- # Remove /var/lib/yum stuff.
- @FEBOOTSTRAP_RUN@ initramfs -- rm -rf /var/lib/yum
-
- # Remove some unreadable binaries which are incompatible with
- # the supermin appliance. Since these binaries can't be read
- # from the host filesystem, they cannot be added to the supermin
- # appliance at run time. XXX Need a better fix for this.
- # Probably we should change febootstrap-supermin-helper to just
- # ignore such files.
- @FEBOOTSTRAP_RUN@ initramfs -- rm -f \
- /usr/bin/chfn \
- /usr/bin/chsh \
- /usr/libexec/pt_chown \
- /usr/libexec/utempter/utempter \
- /usr/sbin/groupdel \
- /usr/sbin/groupadd \
- /usr/sbin/useradd \
- /usr/sbin/tzdata-update \
- /usr/sbin/userdel \
- /usr/sbin/usermod \
- /usr/sbin/groupmod \
- /usr/sbin/groupmems \
- /sbin/unix_update \
- /usr/sbin/tcpd \
- /usr/share/dbus-1/services/org.selinux.Restorecond.service \
- /lib/dbus-1/dbus-daemon-launch-helper \
- /lib64/dbus-1/dbus-daemon-launch-helper \
- /etc/passwd- \
- /etc/group- \
- /etc/gshadow \
- /etc/gshadow- \
- /etc/shadow \
- /etc/shadow- \
- /etc/securetty \
- /etc/sysconfig/iptables-config \
- /etc/default/useradd \
- /etc/security/opasswd \
- /etc/libaudit.conf \
- /var/log/tallylog \
- /var/log/maillog \
- /var/log/secure \
- /var/log/spooler \
- /var/log/messages \
- /var/log/btmp \
- /var/log/yum.log \
- $(cd initramfs && echo usr/sbin/glibc_post_upgrade.*)
-
- # Remove all .*.hmac files (RHBZ#654638). These are not used unless
- # you are using FIPS, and they cause hard dependencies on files
- # which change whenever a library version is bumped.
- @FEBOOTSTRAP_RUN@ initramfs -- rm -f $(cd initramfs && find -name '.*.hmac')
-
- # Kernel modules take up nearly half of the image. Only include ones
- # which are on the whitelist.
- exec 5<appliance/kmod.whitelist
- whitelist=
- while read kmod 0<&5; do
- whitelist="$whitelist -a -not -name $kmod"
- done
- exec 5<&-
-
- (cd initramfs && \
- find lib/modules/*/kernel -name '*.ko' $whitelist -a -print0 ) |
- xargs -0 febootstrap-run initramfs -- rm
-
- # Pull the kernel out into the current directory. We don't want it in
- # the initramfs image.
- cp initramfs/boot/vmlinuz* $koutput
- @FEBOOTSTRAP_RUN@ initramfs -- rm -rf boot
-
- # Minimize the image.
- @FEBOOTSTRAP_MINIMIZE@ initramfs
-
- # Add some missing configuration files.
- if [ ! -f initramfs/etc/hosts ]; then
- cat > hosts.new <<'__EOF__'
- 127.0.0.1 guestfs localhost.localdomain localhost
- ::1 localhost6.localdomain6 localhost6
-__EOF__
- @FEBOOTSTRAP_INSTALL@ initramfs hosts.new /etc/hosts 0644 root.root
- rm hosts.new
- fi
-
- if [ ! -f initramfs/etc/fstab ]; then
- @FEBOOTSTRAP_RUN@ initramfs -- touch /etc/fstab
- fi
-
- echo nameserver 169.254.2.3 > resolv.conf.new
- @FEBOOTSTRAP_INSTALL@ initramfs resolv.conf.new /etc/resolv.conf 0644 root.root
- rm resolv.conf.new