You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
genkernel_fork/generic/initrd.scripts

110 lines
1.7 KiB

#!/bin/ash
. /etc/initrd.defaults
backup() {
echo -ne "\033[0G\033[0K"
}
parse_opt() {
case "$1" in
*\=*)
echo "$1" | cut -f2 -d=
;;
esac
}
modules_scan() {
local MODS
[ -d /etc/modules/${1} ] || touch /etc/modules/${1}
MODS=`cat /etc/modules/${1}`
for x in ${MODS}
do
echo -ne "${BOLD} ::${NORMAL} Scanning for ${x}..."
modprobe ${x} -n
backup
echo -ne "${NORMAL}"
done
}
findcdmount() {
if [ "$#" -gt "0" ]
then
for x in $*
do
echo -e "${GOOD}>>${NORMAL} Attempting to mount CD:- ${x}"
mount -r ${x} /newroot/mnt/cdrom > /dev/null 2>&1
if [ "$?" = '0' ]
then
REAL_ROOT="${x}"
break
## FIXME: I need a proper identifier present on all LiveCDs to work across
## all architectures.
# # Check for a LiveCD
# if [ -e /newroot/mnt/cdrom/.gentoo_LiveCD ]
# then
# REAL_ROOT="${x}"
# break
# else
# umount /newroot/mnt/cdrom
# fi
fi
done
if [ "${REAL_ROOT}" != "" ]
then
echo -e "${GOOD}>>${NORMAL} CD medium found on ${x}"
fi
fi
}
kill_devfsd() {
killall devfsd > /dev/null 2>&1
}
runUdev() {
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).
# We also do VC's for keymap support.
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
for x in class/tty
do
export DEVPATH="/${x}"
/sbin/udev class
for y in ${x}/*
do
if [ -f "${y}/dev" ]
then
export DEVPATH="/${y}"
/sbin/udev class
fi
done
done
cd /
unset -v ACTION DEVPATH UDEV_NO_SLEEP
}