[ "${UDEV}" -eq '1' ] && { tar -jxpf "${UDEV_BINCACHE}" -C "${TEMP}/initrd-temp" ||
gen_die "Could not extract udev binary cache!"; }
+ ln -sf "./udev" "${TEMP}/initrd-temp/bin/udevstart" ||
+ gen_die 'Could not symlink udev -> udevstart!'
# We make our own devfsd.conf these days, the default one doesn't work with the stripped
# down devfsd we use with dietlibc
}
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).
+ mount -t tmpfs -o size=100k udev /dev
+ mkdir /dev/pts
+ mkdir /dev/shm
+ /sbin/udevstart
+ 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
- # 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
}
then
cd /sys
kill_devfsd
+ echo -e "${GOOD}>>${NORMAL}${BOLD} Activating udev...${NORMAL}"
runUdev
mv /dev/* /newroot/dev
else
then
USE_DEVFS_NORMAL=0
cd /sys
+ echo -e "${GOOD}>>${NORMAL}${BOLD} Activating udev...${NORMAL}"
runUdev
elif [ "${CDROOT}" -eq '0' -a "${USE_DEVFS_NORMAL}" -eq '1' ]
then
rm /tmp/.initrd/dev -rf || '*: Failed to remove the initrd /dev!'
elif [ "${USE_UDEV_NORMAL}" -eq '1' ]
then
+ rm /tmp/.initrd/dev/fd || echo '*: Failed to rm the initrd fd!'
+ rm /tmp/.initrd/dev/stdin || echo '*: Failed to rm the initrd stdin!'
+ rm /tmp/.initrd/dev/stdout || echo '*: Failed to rm the initrd stdout!'
+ rm /tmp/.initrd/dev/stderr || echo '*: Failed to rm the initrd stderr!'
+ rm /tmp/.initrd/dev/core || echo '*: Failed to rm the initrd 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!'
elif [ "${CDROOT}" -eq '1' ]