--- udev.install.orig 2009-02-11 02:16:03.000000000 -0200 +++ udev.install 2009-02-11 12:50:43.000000000 -0200 @@ -1,5 +1,23 @@ # arg 1: the new package version # arg 2: the old package version + +_make_udev_devices() { + [ -c /lib/udev/devices/console ] || mknod -m 0600 /lib/udev/devices/console c 5 1 + [ -c /lib/udev/devices/null ] || mknod -m 0666 /lib/udev/devices/null c 1 3 + [ -c /lib/udev/devices/zero ] || mknod -m 0666 /lib/udev/devices/zero c 1 5 + + [ -L /lib/udev/devices/fd ] || ln -snf /proc/self/fd /lib/udev/devices/fd + + [ -L /lib/udev/devices/fd/stdin ] || ln -snf /proc/self/fd/0 /lib/udev/devices/stdin + [ -L /lib/udev/devices/fd/stdout ] || ln -snf /proc/self/fd/1 /lib/udev/devices/stdout + [ -L /lib/udev/devices/fd/stderr ] || ln -snf /proc/self/fd/2 /lib/udev/devices/stderr + + [ -L /lib/udev/devices/core ] || ln -snf /proc/kcore /lib/udev/devices/core + + [ -d /lib/udev/devices/pts ] || mkdir /lib/udev/devices/pts + [ -d /lib/udev/devices/shm ] || mkdir /lib/udev/devices/shm +} + post_upgrade() { if [ "$(vercmp $2 100)" -lt 0 ]; then echo "ATTENTION UDEV:" @@ -10,6 +28,9 @@ echo "They are located in /etc/udev/readme-udev-arch.txt" echo "----------" fi +if [ "$(vercmp $2 135-2)" -lt 0 ]; then + _make_udev_devices +fi } post_install() { @@ -25,6 +46,12 @@ umount ${ROOTDIR} rmdir ${ROOTDIR} fi + _make_udev_devices +} + +pre_remove() { + rm /lib/udev/devices/{console,null,zero,fd,stdin,stdout,stderr,core} &> /dev/null + rmdir /lib/udev/devices/{pts,shm} &> /dev/null } op=$1