Remove initrd-specific code from linuxrc
authorAndrew Gaffney <agaffney@gentoo.org>
Wed, 2 Apr 2008 18:54:09 +0000 (18:54 +0000)
committerAndrew Gaffney <agaffney@gentoo.org>
Wed, 2 Apr 2008 18:54:09 +0000 (18:54 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@661 67a159dc-881f-0410-a524-ba9dfbe2cb84

ChangeLog
generic/linuxrc

index ddcb219e7667967730b852dc01e026bb206d5e46..d266c910bcfa1a1078bcae90c48e2855cb77879a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
 # Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+  02 Apr 2008; Andrew Gaffney <agaffney@gentoo.org> generic/linuxrc:
+  Remove initrd-specific code from linuxrc
+
   30 Mar 2008; Andrew Gaffney <agaffney@gentoo.org> gen_arch.sh:
   Uncomment ppc/ppc64->powerpc code in set_kernel_arch, since it appears to
   actually be necessary as of 2.6.24-gentoo-r4
index 2af1d75c4400fb1c57db8d1caf7f3a42fd200a99..40de1609ac72342a4cc4f2791cd5f724575d7c3d 100644 (file)
@@ -606,67 +606,25 @@ fi
 
 verbose_kmsg
 
-if [ "$0" = '/linuxrc' ] || [ "$0" = 'linuxrc' ]
+# There used to be some initrd/2.4 code here, but it's gone now :
+if [ ! -e "${CHROOT}/dev/console" ] || [ ! -e "${CHROOT}/dev/null" ] \
+|| [ ! -e "${CHROOT}/dev/tty1" ]
 then
-       # XXX: remove me!!!
-       echo "DEBUG: initrd code path"
-       if [ ! -e "${CHROOT}/dev/console" ] || [ ! -e "${CHROOT}/dev/null" ] \
-       || [ ! -e "${CHROOT}/dev/tty1" ]
-       then
-               echo -ne "${BAD}>>${NORMAL}${BOLD} ERROR: /dev is broken!${NORMAL}"
-       else
-               echo -ne "${GOOD}>>${NORMAL}${BOLD} Booting${NORMAL}"
-       fi
-
-       cd "${CHROOT}"
-       mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null
-       pivot_root . tmp/.initrd
-       if [ "${DO_slowusb}" ] || [ "${FORCE_slowusb}" ]
-       then
-               sleep 10
-       fi
-       echo -ne "${BOLD}.${NORMAL}"
-
-       /tmp/.initrd/bin/[ -e /tmp/.initrd/dev/fd ] && rm /tmp/.initrd/dev/fd
-       /tmp/.initrd/bin/[ -e /tmp/.initrd/dev/stdin ] && rm /tmp/.initrd/dev/stdin
-       /tmp/.initrd/bin/[ -e /tmp/.initrd/dev/stdout ] && rm /tmp/.initrd/dev/stdout
-       /tmp/.initrd/bin/[ -e /tmp/.initrd/dev/stderr ] && rm /tmp/.initrd/dev/stderr
-       /tmp/.initrd/bin/[ -e /tmp/.initrd/dev/core ] && rm /tmp/.initrd/dev/core 
-       umount /tmp/.initrd/dev || echo '*: Failed to unmount the initrd /dev!'
-       umount /tmp/.initrd/proc || echo '*: Failed to unmount the initrd /proc!'
-       umount /tmp/.initrd/sys || echo '*: Failed to unmount the initrd /sys!'
-       echo -ne "${BOLD}.${NORMAL}"
-
-       # /usr/src/linux/Documentation/initrd.txt:
-       #       exec chroot . /sbin/init </dev/console >/dev/console 2>&1
-
-       echo -e "${BOLD}.${NORMAL}"
-       exec <dev/console >dev/console 2>&1
-       exec chroot . /bin/sh <<- EOF
-               umount /tmp/.initrd || echo "*: Failed to unmount the initrd!"
-               /sbin/blockdev --flushbufs /dev/ram0 >/dev/null 2>&1
-               exec "${REAL_INIT:-/sbin/init}" "${INIT_OPTS}"
-EOF
-elif [ "$0" = '/init' ]
-then
-       if [ ! -e "${CHROOT}/dev/console" ] || [ ! -e "${CHROOT}/dev/null" ] \
-       || [ ! -e "${CHROOT}/dev/tty1" ]
-       then
-               echo -ne "${BAD}>>${NORMAL}${BOLD} ERROR: /dev is broken!${NORMAL}"
-       else
-               echo -ne "${GOOD}>>${NORMAL}${BOLD} Booting (initramfs)${NORMAL}"
-       fi
+       echo -ne "${BAD}>>${NORMAL}${BOLD} ERROR: /dev is broken!${NORMAL}"
+else
+       echo -ne "${GOOD}>>${NORMAL}${BOLD} Booting (initramfs)${NORMAL}"
+fi
 
-       cd "${CHROOT}"
-       mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null
-       echo -ne "${BOLD}.${NORMAL}"
-               umount /sys || echo '*: Failed to unmount the initrd /sys!'
-               umount /proc || echo '*: Failed to unmount the initrd /proc!'
-       echo -e "${BOLD}.${NORMAL}"
+cd "${CHROOT}"
+mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null
+echo -ne "${BOLD}.${NORMAL}"
+umount /sys || echo '*: Failed to unmount the initrd /sys!'
+umount /proc || echo '*: Failed to unmount the initrd /proc!'
+echo -e "${BOLD}.${NORMAL}"
 
-       exec switch_root -c "/dev/console" "${CHROOT}" "${REAL_INIT:-/sbin/init}" "${INIT_OPTS}"
-fi
+exec switch_root -c "/dev/console" "${CHROOT}" "${REAL_INIT:-/sbin/init}" "${INIT_OPTS}"
 
+# If we get here, something bad has happened
 splash 'verbose'
 
 echo 'A fatal error has probably occured since /sbin/init did not'