Udev speedups; thanks to Eric Edgar for the patch - bug #72253.

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@150 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Tim Yamin 20 years ago
parent 13b71f516d
commit ef897fb548

@ -82,6 +82,8 @@ create_base_initrd_sys() {
[ "${UDEV}" -eq '1' ] && { tar -jxpf "${UDEV_BINCACHE}" -C "${TEMP}/initrd-temp" || [ "${UDEV}" -eq '1' ] && { tar -jxpf "${UDEV_BINCACHE}" -C "${TEMP}/initrd-temp" ||
gen_die "Could not extract udev binary cache!"; } 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 # We make our own devfsd.conf these days, the default one doesn't work with the stripped
# down devfsd we use with dietlibc # down devfsd we use with dietlibc

@ -65,45 +65,15 @@ kill_devfsd() {
} }
runUdev() { runUdev() {
export ACTION=add
export UDEV_NO_SLEEP=1
# Add block devices and their partitions to /dev, mount -t tmpfs -o size=100k udev /dev
# using information from /sys, and only those mkdir /dev/pts
# devices (since other are not needed for boot). 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
} }

@ -147,6 +147,7 @@ then
then then
cd /sys cd /sys
kill_devfsd kill_devfsd
echo -e "${GOOD}>>${NORMAL}${BOLD} Activating udev...${NORMAL}"
runUdev runUdev
mv /dev/* /newroot/dev mv /dev/* /newroot/dev
else else
@ -214,6 +215,7 @@ if [ "${USE_UDEV_NORMAL}" -eq '1' -a "${CDROOT}" -eq '0' ]
then then
USE_DEVFS_NORMAL=0 USE_DEVFS_NORMAL=0
cd /sys cd /sys
echo -e "${GOOD}>>${NORMAL}${BOLD} Activating udev...${NORMAL}"
runUdev runUdev
elif [ "${CDROOT}" -eq '0' -a "${USE_DEVFS_NORMAL}" -eq '1' ] elif [ "${CDROOT}" -eq '0' -a "${USE_DEVFS_NORMAL}" -eq '1' ]
then then
@ -419,6 +421,12 @@ then
rm /tmp/.initrd/dev -rf || '*: Failed to remove the initrd /dev!' rm /tmp/.initrd/dev -rf || '*: Failed to remove the initrd /dev!'
elif [ "${USE_UDEV_NORMAL}" -eq '1' ] elif [ "${USE_UDEV_NORMAL}" -eq '1' ]
then 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/proc || echo '*: Failed to unmount the initrd /proc!'
umount /tmp/.initrd/sys || echo '*: Failed to unmount the initrd /sys!' umount /tmp/.initrd/sys || echo '*: Failed to unmount the initrd /sys!'
elif [ "${CDROOT}" -eq '1' ] elif [ "${CDROOT}" -eq '1' ]

Loading…
Cancel
Save