|
|
|
@ -106,94 +106,80 @@ chooseKeymap() {
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if [ "${DO_keymap}" ]
|
|
|
|
|
then
|
|
|
|
|
chooseKeymap
|
|
|
|
|
fi
|
|
|
|
|
[ "${DO_keymap}" ] && chooseKeymap
|
|
|
|
|
echo -e "${GOOD}>>${NORMAL}${BOLD} Mounting filesystems${NORMAL}"
|
|
|
|
|
|
|
|
|
|
echo -e "${GOOD}>>${NORMAL}${BOLD} Mounting filesystems...${NORMAL}"
|
|
|
|
|
# Check udev is on...
|
|
|
|
|
[ "${KMAJOR}" -ge 2 ] && USE_UDEV_SUPPORT=1
|
|
|
|
|
[ "${KMAJOR}" -eq 2 -a "${KMINOR}" -ge '6' ] && USE_UDEV_SUPPORT=1
|
|
|
|
|
[ "${USE_UDEV_SUPPORT}" -eq '1' -a -f /sbin/udev -a "${USE_UDEV_NORMAL}" -ne 0 ] && USE_UDEV_NORMAL=1
|
|
|
|
|
|
|
|
|
|
# Disable udev support if /dev is already mounted as devfs
|
|
|
|
|
[ -e /dev/.devfsd ] && USE_UDEV_NORMAL=0
|
|
|
|
|
|
|
|
|
|
# If using 2.4 and udev; back off...
|
|
|
|
|
[ "${KMAJOR}" -eq 2 -a "${KMINOR}" -lt '6' -a "${USE_UDEV_NORMAL}" -eq 1 ] &&
|
|
|
|
|
USE_UDEV_NORMAL=0
|
|
|
|
|
|
|
|
|
|
mkdir /newroot
|
|
|
|
|
if [ "${CDROOT}" -eq '1' ]
|
|
|
|
|
then
|
|
|
|
|
mount -t tmpfs tmpfs /newroot
|
|
|
|
|
mkdir /newroot/dev /newroot/mnt /newroot/mnt/cdrom /newroot/mnt/livecd /newroot/tmp /newroot/tmp/.initrd /newroot/mnt/gentoo
|
|
|
|
|
[ ! -e /newroot/dev/.devfsd ] && mount -t devfs devfs /newroot/dev
|
|
|
|
|
devfsd /newroot/dev -np
|
|
|
|
|
sleep 1
|
|
|
|
|
mkdir /newroot/dev /newroot/mnt /newroot/mnt/cdrom /newroot/mnt/livecd /newroot/tmp /newroot/tmp/.initrd /newroot/mnt/gentoo /newroot/sys
|
|
|
|
|
if [ "${USE_UDEV_NORMAL}" -eq '1' ]
|
|
|
|
|
then
|
|
|
|
|
# Udev is semi-broken on non /sys sysfs mount points.
|
|
|
|
|
mount -t sysfs sys /sys 2> /dev/null
|
|
|
|
|
mount -t sysfs sys /newroot/sys 2> /dev/null
|
|
|
|
|
[ "$?" -eq '0' ] || USE_UDEV_NORMAL=0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
findcdmount /newroot/dev/cdroms/*
|
|
|
|
|
# not in /dev/cdroms try /dev/ide/cd
|
|
|
|
|
if [ "${REAL_ROOT}" = '' ]
|
|
|
|
|
if [ "${USE_UDEV_NORMAL}" -eq '1' ]
|
|
|
|
|
then
|
|
|
|
|
findcdmount /newroot/dev/ide/cd/*
|
|
|
|
|
cd /sys
|
|
|
|
|
runUdev
|
|
|
|
|
mv /dev/* /newroot/dev
|
|
|
|
|
else
|
|
|
|
|
if [ ! -e /newroot/dev/.devfsd ]
|
|
|
|
|
then
|
|
|
|
|
mount -t devfs devfs /newroot/dev
|
|
|
|
|
devfsd /newroot/dev -np
|
|
|
|
|
sleep 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
findcdmount /newroot/dev/cdroms/*
|
|
|
|
|
|
|
|
|
|
# Not in /dev/cdroms: try /dev/ide/cd
|
|
|
|
|
[ "${REAL_ROOT}" = '' ] && findcdmount /newroot/dev/ide/cd/*
|
|
|
|
|
if [ "${REAL_ROOT}" = '' ]
|
|
|
|
|
then
|
|
|
|
|
exec /bin/ash
|
|
|
|
|
|
|
|
|
|
# Undo stuff
|
|
|
|
|
# kill_devfsd # We run devfsd with -np now
|
|
|
|
|
sleep 1
|
|
|
|
|
umount /newroot/dev/
|
|
|
|
|
sleep 1
|
|
|
|
|
umount /newroot/dev 2>/dev/null
|
|
|
|
|
umount /newroot/sys 2>/dev/null
|
|
|
|
|
umount /sys 2>/dev/null
|
|
|
|
|
|
|
|
|
|
umount /newroot
|
|
|
|
|
# shouldn't be anything in here b/c it was on tmpfs
|
|
|
|
|
rm -rf /newroot/*
|
|
|
|
|
|
|
|
|
|
echo 'Could not find CD to boot, something else needed!'
|
|
|
|
|
CDROOT=0
|
|
|
|
|
echo "Could not find CD to boot, gonna need something else"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Check udev is on...
|
|
|
|
|
[ "${KMAJOR}" -ge 2 ] && USE_UDEV_SUPPORT=1
|
|
|
|
|
[ "${KMAJOR}" -eq 2 -a "${KMINOR}" -ge '6' ] && USE_UDEV_SUPPORT=1
|
|
|
|
|
[ "${USE_UDEV_SUPPORT}" -eq '1' -a -f /sbin/udev -a "${USE_UDEV_NORMAL}" -ne 0 ] && USE_UDEV_NORMAL=1
|
|
|
|
|
|
|
|
|
|
# Disable udev support if /dev is already mounted as devfs
|
|
|
|
|
[ -e /dev/.devfsd ] && USE_UDEV_NORMAL=0
|
|
|
|
|
|
|
|
|
|
# If using 2.4 and udev; back off...
|
|
|
|
|
[ "${KMAJOR}" -eq 2 -a "${KMINOR}" -lt '6' -a "${USE_UDEV_NORMAL}" -eq 1 ] &&
|
|
|
|
|
USE_UDEV_NORMAL=0
|
|
|
|
|
|
|
|
|
|
# Try to mount sysfs, and if it fails, do not use udev
|
|
|
|
|
if [ "${USE_UDEV_NORMAL}" -eq '1' -a "${CDROOT}" -eq '0' ]
|
|
|
|
|
then
|
|
|
|
|
mount -t sysfs sys /sys 2> /dev/null
|
|
|
|
|
[ "$?" -eq "0" ] || USE_UDEV_NORMAL=0
|
|
|
|
|
[ "$?" -eq '0' ] || USE_UDEV_NORMAL=0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Don't do else b/c we set CDROOT=0 if it fails to detect
|
|
|
|
|
# Don't merge these two blocks; ^^ USE_UDEV_NORMAL=0...
|
|
|
|
|
if [ "${USE_UDEV_NORMAL}" -eq '1' -a "${CDROOT}" -eq '0' ]
|
|
|
|
|
then
|
|
|
|
|
USE_DEVFS_NORMAL=0
|
|
|
|
|
export ACTION=add
|
|
|
|
|
export UDEV_NO_SLEEP=1
|
|
|
|
|
|
|
|
|
|
# Add block devices and their partitions to /dev,
|
|
|
|
|
# using information from /sys, and only those
|
|
|
|
|
# devices (since other are not needed for boot).
|
|
|
|
|
|
|
|
|
|
cd /sys
|
|
|
|
|
for x in block/*
|
|
|
|
|
do
|
|
|
|
|
export DEVPATH="/${x}"
|
|
|
|
|
/sbin/udev block
|
|
|
|
|
|
|
|
|
|
for y in ${x}/*
|
|
|
|
|
do
|
|
|
|
|
if [ -f "${y}/dev" ]
|
|
|
|
|
then
|
|
|
|
|
export DEVPATH="/${y}"
|
|
|
|
|
/sbin/udev block
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
done
|
|
|
|
|
cd /
|
|
|
|
|
|
|
|
|
|
unset -v ACTION DEVPATH UDEV_NO_SLEEP
|
|
|
|
|
runUdev
|
|
|
|
|
elif [ "${CDROOT}" -eq '0' -a "${USE_DEVFS_NORMAL}" -eq '1' ]
|
|
|
|
|
then
|
|
|
|
|
[ ! -e /dev/.devfsd ] && mount -t devfs devfs /dev
|
|
|
|
@ -247,8 +233,8 @@ do
|
|
|
|
|
break
|
|
|
|
|
else
|
|
|
|
|
echo -e "${GOOD}>>${NORMAL}${BOLD} Mounting root...${NORMAL}"
|
|
|
|
|
|
|
|
|
|
mount -o rw ${REAL_ROOT} /newroot
|
|
|
|
|
|
|
|
|
|
if [ "$?" = '0' ]
|
|
|
|
|
then
|
|
|
|
|
break
|
|
|
|
@ -387,20 +373,16 @@ then
|
|
|
|
|
umount /tmp/.initrd/proc || echo '*: Failed to unmount the initrd /proc!'
|
|
|
|
|
mount -n --move /tmp/.initrd/dev dev || echo '*: Failed to move over the /dev tree!'
|
|
|
|
|
rm /tmp/.initrd/dev -rf || '*: Failed to remove the initrd /dev!'
|
|
|
|
|
elif [ "${USE_UDEV_NORMAL}" -eq '1' -a "${CDROOT}" -eq '0' ]
|
|
|
|
|
elif [ "${USE_UDEV_NORMAL}" -eq '1' ]
|
|
|
|
|
then
|
|
|
|
|
umount /tmp/.initrd/proc || echo '*: Failed to unmount the initrd /proc!'
|
|
|
|
|
umount /tmp/.initrd/sys || echo '*: Failed to unmount the initrd /sys!'
|
|
|
|
|
elif [ "${CDROOT}" -eq '1' ]
|
|
|
|
|
then
|
|
|
|
|
# If automount at boot was on with devfs, we'll want to umount it
|
|
|
|
|
# also umount proc
|
|
|
|
|
mount -t proc proc /proc
|
|
|
|
|
umount /tmp/.initrd/proc > /dev/null 2>&1 || echo "*: Failed to unmount /tmp/.initrd/proc!"
|
|
|
|
|
umount /tmp/.initrd/proc || echo "*: Failed to unmount the initrd /proc!"
|
|
|
|
|
umount /dev > /dev/null 2>&1
|
|
|
|
|
mount -n --move /tmp/.initrd/dev dev || echo '*: Failed to move over the /dev tree!'
|
|
|
|
|
rm /tmp/.initrd/dev -rf || '*: Failed to remove the initrd /dev!'
|
|
|
|
|
umount /proc > /dev/null 2>&1
|
|
|
|
|
fi
|
|
|
|
|
echo -n '.'
|
|
|
|
|
|
|
|
|
|