Remove initrd-specific code from linuxrc

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@661 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Andrew Gaffney 17 years ago
parent 80b3557d0b
commit 3bfe8144c0

@ -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

@ -606,49 +606,7 @@ fi
verbose_kmsg
if [ "$0" = '/linuxrc' ] || [ "$0" = 'linuxrc' ]
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
# 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
@ -665,8 +623,8 @@ then
echo -e "${BOLD}.${NORMAL}"
exec switch_root -c "/dev/console" "${CHROOT}" "${REAL_INIT:-/sbin/init}" "${INIT_OPTS}"
fi
# If we get here, something bad has happened
splash 'verbose'
echo 'A fatal error has probably occured since /sbin/init did not'

Loading…
Cancel
Save