1 # Contributor: Gianfranco Micoli <gianfrix.mg@gmail.com>
2 # Contributor: Alessio Biancalana <dottorblaster@gmail.com>
7 pkgdesc="The userspace dev tools (udev) - Ubuntu 9.10 (Karmic) version to fix udev high CPU usage"
9 url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
12 depends=('glibc' 'coreutils' 'util-linux' 'libusb' 'glib2')
13 makedepends=('kernel26' 'gperf' 'libxslt' 'docbook-xsl') #kernel26 needed to build framebuffer blacklist
15 backup=(etc/udev/udev.conf
16 etc/modprobe.d/framebuffer_blacklist.conf)
17 provides=('udev=147.0')
18 conflicts=('pcmcia-cs' 'hotplug' 'initscripts<2009.07' 'udev')
20 # older initscripts versions required start_udev
21 options=(!makeflags !libtool)
22 source=(http://archive.ubuntu.com/ubuntu/pool/main/u/udev/udev_147~-6.tar.gz
23 81-arch.rules load-modules.sh resolve-modalias.c cdsymlinks.sh root-link.sh
24 arch-udev-rules.patch ignore-remove.sh cups-hplip-fix.patch)
25 md5sums=('1bc82f9f6d2bb6e215e2e801a53da580'
26 'cc6406e8b67b2b8711942098a66cde6b'
27 'f4951f61438d69894b728212dac7318b'
28 '64a0169dc9d883a63ff9f8f491fdc34a'
29 '2e808ee78d237c478b57af2a68d43769'
30 '2d6dc6842464f107bccc68cd505a6c31'
31 '9be4683c480488926fdf92a34ae5963c'
32 '35fa97500243a79b2370fa4684828e69'
33 '8cd53a3d91d2321a646033dc18f29217')
37 # fix raw printers, will be fixed in udev-147
38 #patch -Np1 -i ../cups-hplip-fix.patch || return 1 #It's fixed, so we don't need to patch xD
39 ./configure --prefix="" --mandir=/usr/share/man\
40 --includedir=/usr/include\
41 --libexecdir=/lib/udev\
42 --datarootdir=/usr/share
44 make DESTDIR=$startdir/pkg install
46 install -d -m755 $pkgdir/usr/lib
47 mv $pkgdir/lib/pkgconfig $pkgdir/usr/lib
49 # Non-stock rules still go in /etc
50 install -D -m644 $srcdir/81-arch.rules $pkgdir/lib/udev/rules.d/81-arch.rules
52 # install our module loading subsystem
53 install -D -m755 $srcdir/load-modules.sh $pkgdir/lib/udev/load-modules.sh
54 install -d -m755 $pkgdir/bin
55 gcc -Wall $CFLAGS -o $pkgdir/bin/resolve-modalias $srcdir/resolve-modalias.c || return 1
56 # install cdsymlinks.sh
57 install -D -m755 $srcdir/cdsymlinks.sh $pkgdir/lib/udev/cdsymlinks.sh
58 # install root-link.sh
59 install -D -m755 $srcdir/root-link.sh $pkgdir/lib/udev/root-link.sh
60 # install ignore-remove.sh
61 install -D -m755 $srcdir/ignore-remove.sh $pkgdir/lib/udev/ignore-remove.sh
62 # disable error logging to prevent startup failures printed to vc on boot
63 sed -i -e 's|udev_log="err"|udev_log="0"|g' $pkgdir/etc/udev/udev.conf
64 # install additional standard rules files
65 for rule in $srcdir/udev/rules/packages/*.rules; do
66 install -D -m 644 $rule $pkgdir/lib/udev/rules.d/
68 # fix standard udev rules to fit to arch
69 #cd $pkgdir/lib/udev/rules.d/
70 #patch -Np1 -i $srcdir/arch-udev-rules.patch || return 1
72 #rm -f $pkgdir/lib/udev/rules.d/*.orig
73 # disable persistent cdromsymlinks and network by default
74 # and move it to /etc/udev/rules.d
75 mv $pkgdir/lib/udev/rules.d/75-persistent-net-generator.rules \
76 $pkgdir/etc/udev/rules.d/75-persistent-net-generator.rules.optional
77 mv $pkgdir/lib/udev/rules.d/75-cd-aliases-generator.rules \
78 $pkgdir/etc/udev/rules.d/75-cd-aliases-generator.rules.optional
79 # remove not needed rules
80 rm $pkgdir/lib/udev/rules.d/40-ia64.rules
81 rm $pkgdir/lib/udev/rules.d/40-ppc.rules
82 rm $pkgdir/lib/udev/rules.d/40-s390.rules
84 # create framebuffer blacklist
85 mkdir -p $pkgdir/etc/modprobe.d/
86 for mod in $(find /lib/modules/*/kernel/drivers/video -name '*fb.ko' -exec basename {} .ko \;); do
87 echo "blacklist $mod" >> $pkgdir/etc/modprobe.d/framebuffer_blacklist.conf
90 # create static devices in /lib/udev/devices/
91 mkdir ${pkgdir}/lib/udev/devices
92 mkdir ${pkgdir}/lib/udev/devices/pts
93 mkdir ${pkgdir}/lib/udev/devices/shm
95 mknod -m 0600 ${pkgdir}/lib/udev/devices/console c 5 1 || return 1
96 mknod -m 0666 ${pkgdir}/lib/udev/devices/null c 1 3 || return 1
97 mknod -m 0660 ${pkgdir}/lib/udev/devices/zero c 1 5 || return 1
98 mknod -m 0666 ${pkgdir}/lib/udev/devices/kmsg c 1 11 || return 1
100 ln -snf /proc/self/fd ${pkgdir}/lib/udev/devices/fd || return 1
101 ln -snf /proc/self/fd/0 ${pkgdir}/lib/udev/devices/stdin || return 1
102 ln -snf /proc/self/fd/1 ${pkgdir}/lib/udev/devices/stdout || return 1
103 ln -snf /proc/self/fd/2 ${pkgdir}/lib/udev/devices/stderr || return 1
104 ln -snf /proc/kcore ${pkgdir}/lib/udev/devices/core || return 1
106 # these static devices are created for convenience, to autoload the modules if necessary
108 mknod -m 0660 ${pkgdir}/lib/udev/devices/loop0 b 7 0 || return 1
109 chgrp disk ${pkgdir}/lib/udev/devices/loop0 || return 1
111 mkdir ${pkgdir}/lib/udev/devices/net
112 mknod -m 0666 ${pkgdir}/lib/udev/devices/net/tun c 10 200 || return 1
114 mknod -m 0666 ${pkgdir}/lib/udev/devices/fuse c 10 229 || return 1
116 mknod -m 0600 ${pkgdir}/lib/udev/devices/ppp c 108 0 || return 1
118 # Replace dialout group in rules with uucp group
119 for i in $pkgdir/lib/udev/rules.d/*.rules; do
120 sed -i -e 's#GROUP="dialout"#GROUP="uucp"#g' $i