gh-77: Refresh initramfs when dracut module, don't fail on growpart

Closes #77
pull/17/merge
Vlastimil Holer 8 years ago
parent 151092557c
commit 75f121352c
No known key found for this signature in database
GPG Key ID: EB549BADEFD07C53

@ -35,6 +35,15 @@ if [ -f /etc/init.d/one-context ]; then
if [ -d /etc/sysconfig/network-scripts ] || [ -d /etc/sysconfig/network ]; then
chkconfig --add one-context-local
chkconfig --add one-context
# EL6: refresh initramfs via dracut for growroot module
if [ -f /usr/share/dracut/modules.d/50growroot/install ]; then
for I in $(find /boot -name 'initramfs-*.img'); do
KERNEL_VERS=$(echo "${I}" | sed -e 's/.*initramfs-\(.*\)\.img/\1/')
dracut -f "${I}" "${KERNEL_VERS}" || :
done
fi
elif [ -d /etc/network ]; then
for S in one-context-local one-context; do
update-rc.d ${S} enable >/dev/null 2>&1
@ -88,4 +97,3 @@ if [ -d /etc/sysconfig/network ]; then
sed -i '/^NETCONFIG_DNS_STATIC_SERVERS=/ s/=.*$/=""/' /etc/sysconfig/network/config
sed -i '/^NETCONFIG_DNS_STATIC_SEARCHLIST=/ s/=.*$/=""/' /etc/sysconfig/network/config
fi

@ -44,14 +44,16 @@ if [ -n "$DEBUG" ]; then
echo PARTITION: ${PARTITION}
fi
for PART in ${PARTITION}; do
${GROWPART} ${DISK} ${PART}
done
(
for PART in ${PARTITION}; do
${GROWPART} ${DISK} ${PART}
done
if [ "${LVM}" != "no" ]; then
${PVRESIZE} ${PV}
${LVEXTEND} -l +100%FREE ${LV}
fi
if [ "${LVM}" != "no" ]; then
${PVRESIZE} ${PV}
${LVEXTEND} -l +100%FREE ${LV}
fi
) || : # don't fail, partition can be already extended by dracut
case "${FSTYPE}" in
ext2|ext3|ext4)

@ -4,7 +4,7 @@ case "${TARGET}" in
RELSUFFIX=${RELSUFFIX:-.el6}
TYPE=${TYPE:-rpm}
TAGS=${TAGS:-rpm sysv one}
DEPENDS=${DEPENDS:-util-linux-ng bind-utils cloud-utils-growpart ruby rubygem-json}
DEPENDS=${DEPENDS:-util-linux-ng bind-utils cloud-utils-growpart dracut-modules-growroot ruby rubygem-json}
REPLACES=${REPLACES:-cloud-init}
POSTIN=${POSTINST:-postinstall.one}
PREUN=${PREUN:-preuninstall.one}
@ -16,7 +16,7 @@ case "${TARGET}" in
RELSUFFIX=${RELSUFFIX:-.el6}
TYPE=${TYPE:-rpm}
TAGS=${TAGS:-rpm sysv ec2}
DEPENDS=${DEPENDS:-util-linux-ng bind-utils cloud-utils-growpart ruby rubygem-json}
DEPENDS=${DEPENDS:-util-linux-ng bind-utils cloud-utils-growpart dracut-modules-growroot ruby rubygem-json}
REPLACES=${REPLACES:-cloud-init}
POSTIN=${POSTINST:-postinstall.ec2}
PREUN=${PREUN:-preuninstall.ec2}

Loading…
Cancel
Save