appliance: Change comment about unreadable binaries.
[libguestfs.git] / appliance / make.sh.in
index e98c325..56b882a 100755 (executable)
@@ -21,6 +21,7 @@
 unset CDPATH
 
 set -e
+set -x
 
 if [ "@DIST@" = "REDHAT" ]; then
   cd @top_builddir@
@@ -40,17 +41,27 @@ if [ "@DIST@" = "REDHAT" ]; then
 
   @FEBOOTSTRAP@ $packages -u @UPDATES@ @REPO@ initramfs @MIRROR@
 
+  # Create modules.dep.  This is only used in the normal appliance
+  # (not supermin).
+  kversion=$(basename initramfs/lib/modules/*)
+  @FEBOOTSTRAP_RUN@ initramfs -- /sbin/depmod -a $kversion
+
   # /sysroot is where the guest root filesystem will be mounted.
   @FEBOOTSTRAP_RUN@ initramfs -- mkdir -p --mode=0777 /sysroot
 
   # Create /tmp if it is missing.
   @FEBOOTSTRAP_RUN@ initramfs -- mkdir -p --mode=0777 /tmp
 
+  # Create /selinux if it is missing.
+  @FEBOOTSTRAP_RUN@ initramfs -- mkdir -p --mode=0755 /selinux
+
   # Nuke some stuff.  The kernel pulls mkinitrd and plymouth which pulls in
   # all of Python.  Sheez.
+  (cd initramfs && find -name '*python*' -print0) |
+    xargs -0 @FEBOOTSTRAP_RUN@ initramfs -- rm -rf
   (cd initramfs && find -name '*plymouth*' -print0) |
     xargs -0 @FEBOOTSTRAP_RUN@ initramfs -- rm -rf
-  (cd initramfs && find -name '*python*' -print0) |
+  (cd initramfs && find -name 'libply-*' -print0) |
     xargs -0 @FEBOOTSTRAP_RUN@ initramfs -- rm -rf
 
   # In Fedora >= 11, it pulls in all of Perl from somewhere.  Nuke from orbit.
@@ -65,8 +76,8 @@ if [ "@DIST@" = "REDHAT" ]; then
   # Don't need any keyboard maps.
   @FEBOOTSTRAP_RUN@ initramfs -- rm -rf /lib/kbd
 
-  # Remove anything in home directory.  Because this is potentially
-  # liable to monstrous fuck-ups, we don't put a slash before 'home'.
+  # Remove anything in home directory.  Because of the potential for disaster
+  # we don't put a slash before 'home'.
   (cd initramfs && echo home/*) |
     xargs @FEBOOTSTRAP_RUN@ initramfs -- rm -rf
 
@@ -75,9 +86,10 @@ if [ "@DIST@" = "REDHAT" ]; then
 
   # Remove some unreadable binaries which are incompatible with
   # the supermin appliance.  Since these binaries can't be read
-  # from the host filesystem, they generate warnings like:
-  #   cpio: ./usr/bin/chfn: Cannot open: Permission denied
-  # These binaries are not needed for operation of the appliance.
+  # 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 \
@@ -91,6 +103,27 @@ if [ "@DIST@" = "REDHAT" ]; then
     /usr/sbin/groupmod \
     /usr/sbin/groupmems \
     /sbin/unix_update \
+    /usr/sbin/tcpd \
+    /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.*)
 
   # Kernel modules take up nearly half of the image.  Only include ones
@@ -132,13 +165,6 @@ __EOF__
   @FEBOOTSTRAP_INSTALL@ initramfs resolv.conf.new /etc/resolv.conf 0644 root.root
   rm resolv.conf.new
 
-  # Create the init script.
-  @FEBOOTSTRAP_INSTALL@ initramfs appliance/init /init 0755 root.root
-
-  # Just in case the kernel isn't looking for /init, make /sbin/init
-  # be our script, not the real init.
-  #@FEBOOTSTRAP_RUN@ initramfs -- ln -f /init /sbin/init
-
   ls -lh $koutput
 
   # Now directly run the update script to copy/update the daemon in the
@@ -148,5 +174,6 @@ __EOF__
 elif [ "@DIST@" = "DEBIAN" ]; then
   cd @top_builddir@/appliance
   debirf make -n debian
+  mkdir -p @top_builddir@/initramfs
+  touch @top_builddir@/initramfs/fakeroot.log
 fi
-