
Hi, While peeking over how you do things in crux it, I've found some things that could potentially be adjusted. Short overview: - NAME= is ignored since v154 (excluding renaming network interfaces) - ignore_device no longer exists since v148 (and ignore_remove since v152) - additional 20090523 rules are in large part invalid in context of the above points (and looking at standard udev rules, somewhat superfluous) - trigger's default is 'change' since v152 - for coldplug, 'add' should be specified explicitly. - devtmpfs - if compiled in kernel, should likely be preferred over tmpfs for /dev - is "fixing" libudev.so placement really necessary ? It forces you to keep track of libudev version and it sometimes get out of sync - pkg-config also scans (under default configuration) /usr/share/pkgconfig, so /usr/lib/pkgconfig is potentially not necessary - udevd at one point uses /proc/kmsg, so it could be added to static nodes Also since v155, udevd automatically copies static nodes from /lib/udev/devices and creates symbolic links. I think that Pkgfile could be made a bit more simple, and start_udev a bit more universal (taking into account that some people will use kernels with devtmpfs, boot with a custom initramfs, etc.) Anyway, a few possible tirival changes for your consideration: diff --git a/udev/Pkgfile b/udev/Pkgfile index e0d8b04..e4b7014 100644 --- a/udev/Pkgfile +++ b/udev/Pkgfile @@ -6,7 +6,6 @@ name=udev version=163 release=1 source=(ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/$name-$version.tar.bz2 \ - http://crux.nu/files/distfiles/udev-config-20090523.tar.bz2 \ start_udev) build() { @@ -21,29 +20,16 @@ build() { pkgconfigdir=/usr/lib/pkgconfig mkdir -p $PKG/lib/{firmware,udev/devices/{pts,shm}} - mkdir -p $PKG/usr/lib - - # Fix location of devel lib - rm $PKG/lib/libudev.so - ln -sf ../../lib/libudev.so.0.9.1 $PKG/usr/lib/libudev.so # Populate nodes mknod -m 600 $PKG/lib/udev/devices/console c 5 1 + mknod -m 600 $PKG/lib/udev/devices/kmsg c 1 11 mknod -m 666 $PKG/lib/udev/devices/null c 1 3 mknod -m 666 $PKG/lib/udev/devices/zero c 1 5 - ln -s /proc/self/fd $PKG/lib/udev/devices/fd - ln -s /proc/self/fd/0 $PKG/lib/udev/devices/stdin - ln -s /proc/self/fd/1 $PKG/lib/udev/devices/stdout - ln -s /proc/self/fd/2 $PKG/lib/udev/devices/stderr - ln -s /proc/kcore $PKG/lib/udev/devices/core - # Add CRUX items + LFS rules + # Add CRUX items install -m 0755 $SRC/start_udev $PKG/sbin - pushd $SRC/udev-config-20090523 - make DESTDIR=$PKG RULES_DIR=/lib/udev/rules.d install - popd - # Keep udevinfo for legacy support mkdir -p $PKG/usr/bin ln -s /sbin/udevadm $PKG/usr/bin/udevinfo diff --git a/udev/start_udev b/udev/start_udev index 1be7ce9..35cdb2b 100644 --- a/udev/start_udev +++ b/udev/start_udev @@ -1,17 +1,32 @@ #!/bin/sh -# mount /dev as a tmpfs; note: some video drivers require exec access in /dev -/bin/mount -n -t tmpfs udev /dev -o exec,nosuid,mode=0755 +# mount /dev as a devtmpfs or tmpfs, depending on current kernel capability +# mount only, if it's not already mounted (e.g. after handover from initramfs) +# note: some video drivers require exec access in /dev +if /bin/grep -Fvq ' / /dev/ ' /proc/self/mountinfo ; then + if /bin/grep -Fq devtmpfs /proc/filesystems ; then + UDEVFS=devtmpfs + else + UDEVFS=tmpfs + fi + /bin/mount -n -t $UDEVFS udev /dev -o exec,nosuid,mode=0755,size=8M +fi -# unset hotplugger +# make sure hotplugger is not set echo > /proc/sys/kernel/hotplug -# populate /dev with static nodes and directories -/bin/cp -a /lib/udev/devices/* /dev/ +# since v155, udevd automatically copies /lib/udev/devices +# and creates /proc/{kcore,self/fd/{0,1,2}} symlinks # launch udev daemon /sbin/udevd --daemon # coldplug devices and wait for the queue to be processed -/sbin/udevadm trigger +/sbin/udevadm trigger --type=subsystems --action=add +/sbin/udevadm settle +/sbin/udevadm trigger --type=devices --action=add +/sbin/udevadm settle + +# retry any failures +/sbin/udevadm trigger --type=failed --action=add /sbin/udevadm settle