From 85708340eb932104ce1ef2dd0af2cfc24d8f015b Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Mon, 18 Feb 2019 16:52:49 -0800 Subject: [PATCH] Remove exclusions from lorax-composer templates If a package is excluded in the template and later added by a blueprint or dependency, anaconda will fail to finish the installation. So remove the -dracut-config-rescue exclusion and instead remove the rescue artifacts in %post (cherry picked from commit 822bc7ac68e0af83cc35bc6d389c73d84a0cb8ca) --- share/composer/ami.ks | 4 +++- share/composer/ext4-filesystem.ks | 3 +++ share/composer/openstack.ks | 4 +++- share/composer/partitioned-disk.ks | 4 +++- share/composer/qcow2.ks | 4 +++- share/composer/tar.ks | 3 +++ share/composer/vhd.ks | 4 +++- share/composer/vmdk.ks | 4 +++- 8 files changed, 24 insertions(+), 6 deletions(-) diff --git a/share/composer/ami.ks b/share/composer/ami.ks index d0926afb..9cbb5472 100644 --- a/share/composer/ami.ks +++ b/share/composer/ami.ks @@ -36,11 +36,13 @@ touch /etc/machine-id # tell cloud-init to create the ec2-user account sed -i 's/cloud-user/ec2-user/' /etc/cloud/cloud.cfg + +# Remove the rescue kernel and image to save space +rm -f /boot/*-rescue* %end %packages kernel --dracut-config-rescue selinux-policy-targeted chrony diff --git a/share/composer/ext4-filesystem.ks b/share/composer/ext4-filesystem.ks index e2616b30..1f3166cb 100644 --- a/share/composer/ext4-filesystem.ks +++ b/share/composer/ext4-filesystem.ks @@ -28,6 +28,9 @@ rm /var/lib/systemd/random-seed # Clear /etc/machine-id rm /etc/machine-id touch /etc/machine-id + +# Remove the rescue kernel and image to save space +rm -f /boot/*-rescue* %end # NOTE Do NOT add any other sections after %packages diff --git a/share/composer/openstack.ks b/share/composer/openstack.ks index 2068e936..11226b71 100644 --- a/share/composer/openstack.ks +++ b/share/composer/openstack.ks @@ -33,11 +33,13 @@ rm /var/lib/systemd/random-seed # Clear /etc/machine-id rm /etc/machine-id touch /etc/machine-id + +# Remove the rescue kernel and image to save space +rm -f /boot/*-rescue* %end %packages kernel --dracut-config-rescue selinux-policy-targeted # Make sure virt guest agents are installed diff --git a/share/composer/partitioned-disk.ks b/share/composer/partitioned-disk.ks index a032c484..33b54dba 100644 --- a/share/composer/partitioned-disk.ks +++ b/share/composer/partitioned-disk.ks @@ -30,11 +30,13 @@ rm /var/lib/systemd/random-seed # Clear /etc/machine-id rm /etc/machine-id touch /etc/machine-id + +# Remove the rescue kernel and image to save space +rm -f /boot/*-rescue* %end %packages kernel --dracut-config-rescue selinux-policy-targeted # NOTE lorax-composer will add the blueprint packages below here, including the final %end diff --git a/share/composer/qcow2.ks b/share/composer/qcow2.ks index d8187dd6..d953b23f 100644 --- a/share/composer/qcow2.ks +++ b/share/composer/qcow2.ks @@ -30,11 +30,13 @@ rm /var/lib/systemd/random-seed # Clear /etc/machine-id rm /etc/machine-id touch /etc/machine-id + +# Remove the rescue kernel and image to save space +rm -f /boot/*-rescue* %end %packages kernel --dracut-config-rescue selinux-policy-targeted # Make sure virt guest agents are installed diff --git a/share/composer/tar.ks b/share/composer/tar.ks index be893f94..f6af8032 100644 --- a/share/composer/tar.ks +++ b/share/composer/tar.ks @@ -28,6 +28,9 @@ rm /var/lib/systemd/random-seed # Clear /etc/machine-id rm /etc/machine-id touch /etc/machine-id + +# Remove the rescue kernel and image to save space +rm -f /boot/*-rescue* %end # NOTE Do NOT add any other sections after %packages diff --git a/share/composer/vhd.ks b/share/composer/vhd.ks index da82ae11..84bd457f 100644 --- a/share/composer/vhd.ks +++ b/share/composer/vhd.ks @@ -34,6 +34,9 @@ rm /var/lib/systemd/random-seed rm /etc/machine-id touch /etc/machine-id +# Remove the rescue kernel and image to save space +rm -f /boot/*-rescue* + # This file is required by waagent in RHEL, but compatible with NetworkManager cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF DEVICE=eth0 @@ -59,7 +62,6 @@ dracut -f -v --persistent-policy by-uuid %packages kernel --dracut-config-rescue selinux-policy-targeted chrony diff --git a/share/composer/vmdk.ks b/share/composer/vmdk.ks index e0a57f91..ecfba176 100644 --- a/share/composer/vmdk.ks +++ b/share/composer/vmdk.ks @@ -33,11 +33,13 @@ rm /var/lib/systemd/random-seed # Clear /etc/machine-id rm /etc/machine-id touch /etc/machine-id + +# Remove the rescue kernel and image to save space +rm -f /boot/*-rescue* %end %packages kernel --dracut-config-rescue selinux-policy-targeted chrony