umount them all
[util-vserver.git] / distrib / gentoo / initpost
index ee6e692..f1d6229 100755 (executable)
@@ -63,6 +63,11 @@ test -e "$cfgdir"/apps/init/style && initstyle=$(<"$cfgdir"/apps/init/style)
 if test "$initstyle" == "gentoo"; then
        echo ">>> Installing special init-style magic ... "
 
+       # force /lib/rc/sh even if we don't have it in older stages
+       $_CHROOT_SH mkdir /lib 2>/dev/null || :
+       $_CHROOT_SH mkdir /lib/rc 2>/dev/null || :
+       $_CHROOT_SH mkdir /lib/rc/sh 2>/dev/null || :
+
        $_CAT "$__DISTRIBDIR"/gentoo/init-vserver.sh | \
        $_CHROOT_SH truncate   /lib/rc/sh/init-vserver.sh
        $_CHROOT_SH chmod 0755 /lib/rc/sh/init-vserver.sh
@@ -83,17 +88,22 @@ if test "$initstyle" == "gentoo"; then
        echo "!!! Consult the Gentoo Handbook on how to chroot and install"
        echo "!!! packages into the guest environment."
        echo "!!!"
+else
+       # fix gettys in inittab
+       if $_CHROOT_SH testfile /etc/inittab; then
+               echo ">>> Fixing inittab ... "
+               chrootsed /etc/inittab \
+                       -e 's/\(^[^#].*getty.*$\)/#\1/'
+       fi
 fi
 
-
 # unneeded runlevel scripts
-echo ">>> Fixing default runlevel scripts ... "
 if test $have_openrc -ne 1; then
+       echo ">>> Fixing default runlevel scripts ... "
        $_CHROOT_SH rm /etc/runlevels/boot/{clock,consolefont,keymaps,modules,net.lo} 2>/dev/null || :
        $_CHROOT_SH rm /etc/runlevels/default/{hdparm,netmount} 2>/dev/null || :
 fi
 
-
 # setting hostname
 if test -r "$cfgdir"/uts/nodename && $_CHROOT_SH testfile /etc/conf.d/hostname; then
        echo ">>> Setting hostname ... "
@@ -101,24 +111,14 @@ if test -r "$cfgdir"/uts/nodename && $_CHROOT_SH testfile /etc/conf.d/hostname;
                -e "s:\(HOSTNAME\)=\"\(.*\)\":\1=\"$(< "$cfgdir"/uts/nodename)\":i"
 fi
 
-
 # fix syslog-ng.conf
 if $_CHROOT_SH testfile /etc/syslog-ng/syslog-ng.conf; then
        echo ">>> Fixing syslog-ng.conf ... "
        chrootsed /etc/syslog-ng/syslog-ng.conf \
-               -e 's:pipe("/proc/kmsg"); ::' \
+               -e '/proc\/kmsg/d' \
                -e 's:\(.*console_all.*\):#\1:g'
 fi
 
-
-# fix gettys in inittab
-if $_CHROOT_SH testfile /etc/inittab; then
-       echo ">>> Fixing inittab ... "
-       chrootsed /etc/inittab \
-               -e 's/\(^[^#].*getty.*$\)/#\1/'
-fi
-
-
 # fix fstab for checkfs/localmount in baselayout-2
 # (does not affect any previous versions)
 if test $have_openrc -ne 1; then