From: Andrew Gaffney Date: Wed, 2 Apr 2008 18:54:09 +0000 (+0000) Subject: Remove initrd-specific code from linuxrc X-Git-Tag: v3.4.10.902~91 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3bfe8144c07bc8686ae5a33ac3caa276be6f7c4a;p=genkernel.git Remove initrd-specific code from linuxrc git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@661 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- diff --git a/ChangeLog b/ChangeLog index ddcb219..d266c91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ # Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 02 Apr 2008; Andrew Gaffney generic/linuxrc: + Remove initrd-specific code from linuxrc + 30 Mar 2008; Andrew Gaffney 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 diff --git a/generic/linuxrc b/generic/linuxrc index 2af1d75..40de160 100644 --- a/generic/linuxrc +++ b/generic/linuxrc @@ -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 2>&1 - - echo -e "${BOLD}.${NORMAL}" - exec 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'