|
|
then | then |
[ -n "${DEBUG}" ] && echo -ne "${BOLD} ::${NORMAL} Checking for ${x}..." | [ -n "${DEBUG}" ] && echo -ne "${BOLD} ::${NORMAL} Checking for ${x}..." |
# find -name does not work since the return status is always zero | # find -name does not work since the return status is always zero |
if find /lib/modules | grep /"${x}${KSUFF}" >/dev/null 2>&1 |
if find /lib/modules/${KV} | grep /"${x}${KSUFF}" >/dev/null 2>&1 |
then | then |
echo -ne "${BOLD} ::${NORMAL} Scanning for ${x}..." | echo -ne "${BOLD} ::${NORMAL} Scanning for ${x}..." |
modprobe ${x} -n | modprobe ${x} -n |
|
|
# else | # else |
# mount -r -t auto ${x} ${mntdir} &>/dev/null | # mount -r -t auto ${x} ${mntdir} &>/dev/null |
# fi | # fi |
mount -r -t ${CDROOT_TYPE} ${x} ${mntdir} &>/dev/null |
mount -r -t ${CDROOT_TYPE} ${x} ${mntdir} >/dev/null 2>&1 |
if [ "$?" = '0' ] | if [ "$?" = '0' ] |
then | then |
# Check for the media | # Check for the media |
|
|
else | else |
bad_msg "NFS Mounting failed. Is the path correct ?" | bad_msg "NFS Mounting failed. Is the path correct ?" |
fi | fi |
# FIXME: Need to start portmap and the other rpc daemons in order to |
# FIXME: Need to start portmap and the other rpc daemons in |
# FIXME: remount rw. |
# order to remount rw. |
fi | fi |
| |
fi | fi |
|
|
/bin/ash | /bin/ash |
} | } |
| |
runUdev() { |
|
mount -t tmpfs -o size=100k udev /dev |
|
mkdir /dev/pts |
|
mkdir /dev/shm |
|
echo > /proc/sys/kernel/hotplug |
|
/sbin/udevd --daemon |
|
mkdir -p /dev/.udev/queue |
|
/sbin/udevtrigger |
|
|
|
good_msg 'Letting udev process events' |
|
loop=0 |
|
while test -d /dev/.udev/queue; do |
|
sleep 1; |
|
test "$loop" -gt 30 && break |
|
loop=$(($loop + 1)) |
|
done |
|
good_msg "Udev finished proccsing after $loop iterations" |
|
|
|
killall udevd > /dev/null 2>&1 |
|
ln -snf /proc/self/fd /dev/fd |
|
ln -snf /proc/self/fd/0 /dev/stdin |
|
ln -snf /proc/self/fd/1 /dev/stdout |
|
ln -snf /proc/self/fd/2 /dev/stderr |
|
ln -snf /proc/kcore /dev/core |
|
} |
|
|
|
runmdev() { | runmdev() { |
# busybox udev replacement | # busybox udev replacement |
mdev -s | mdev -s |
|
|
# catch udev hotplug events |
|
echo /sbin/mdev > /proc/sys/kernel/hotplug |
|
} | } |
| |
test_success() { | test_success() { |
|
|
} | } |
| |
whereis(){ | whereis(){ |
# $1 = variable whose value is the path (examples: "REAL_ROOT", "LUKS_KEYDEV") |
# $1 = variable whose value is the path (examples: "REAL_ROOT", |
|
# "LUKS_KEYDEV") |
# $2 = label | # $2 = label |
# $3 = optional explanations for failure | # $3 = optional explanations for failure |
| |
|
|
mount -o bind ${NEW_ROOT}/dev /dev | mount -o bind ${NEW_ROOT}/dev /dev |
} | } |
| |
|
setup_hotplug() { |
|
# Check udev is available... |
|
if [ "${KV_2_6_OR_GREATER}" -a "${USE_UDEV_NORMAL}" != '0' ] |
|
then |
|
USE_UDEV_NORMAL=1 |
|
else |
|
USE_UDEV_NORMAL=0 |
|
fi |
|
|
|
if [ "${USE_UDEV_NORMAL}" = '1' ] |
|
then |
|
# catch udev hotplug events |
|
echo /sbin/mdev > /proc/sys/kernel/hotplug |
|
fi |
|
} |
|
|
start_dev_mgr() { | start_dev_mgr() { |
# Check udev is available... | # Check udev is available... |
if [ "${KV_2_6_OR_GREATER}" -a "${USE_UDEV_NORMAL}" != '0' ] | if [ "${KV_2_6_OR_GREATER}" -a "${USE_UDEV_NORMAL}" != '0' ] |
|
|
[ "${DO_slowusb}" ] && sleep 10 | [ "${DO_slowusb}" ] && sleep 10 |
kill_devfsd | kill_devfsd |
good_msg 'Activating mdev' | good_msg 'Activating mdev' |
# runUdev |
|
runmdev | runmdev |
[ "${DO_slowusb}" ] && sleep 20 | [ "${DO_slowusb}" ] && sleep 20 |
cd / | cd / |
|
|
} | } |
| |
load_modules() { | load_modules() { |
# Load modules listed in MY_HWOPTS if /lib/modules exists |
# Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel |
| |
if [ -d '/lib/modules' ] |
if [ -d "/lib/modules/${KV}" ] |
then | then |
good_msg 'Loading modules' | good_msg 'Loading modules' |
# Load appropriate kernel modules | # Load appropriate kernel modules |