1 pkgname=udev-old-kernel
5 pkgdesc="The userspace dev tools (udev) for kernel older than 2.6.27"
7 url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
10 depends=('glibc' 'coreutils' 'util-linux' 'libusb' 'glib2')
11 makedepends=('kernel26' 'gperf' 'libxslt') #kernel26 needed to build framebuffer blacklist
13 backup=(etc/udev/udev.conf
14 etc/modprobe.d/framebuffer_blacklist.conf)
15 conflicts=('pcmcia-cs' 'hotplug' 'initscripts<2009.07' 'udev')
16 provides=('udev=151-3')
18 # older initscripts versions required start_udev
19 options=(!makeflags !libtool)
20 source=(http://www.kernel.org/pub/linux/utils/kernel/hotplug/$_pkgname-$pkgver.tar.bz2
21 81-arch.rules load-modules.sh resolve-modalias.c cdsymlinks.sh root-link.sh
22 arch-udev-rules.patch ignore-remove.sh cups-hplip-fix.patch)
23 md5sums=('b2a8acefda4fa8a70d45642035abd718'
24 'cc6406e8b67b2b8711942098a66cde6b'
25 'f4951f61438d69894b728212dac7318b'
26 '64a0169dc9d883a63ff9f8f491fdc34a'
27 '2e808ee78d237c478b57af2a68d43769'
28 '2d6dc6842464f107bccc68cd505a6c31'
29 '9be4683c480488926fdf92a34ae5963c'
30 '35fa97500243a79b2370fa4684828e69'
31 '8cd53a3d91d2321a646033dc18f29217')
34 cd $srcdir/$_pkgname-$pkgver
35 # fix raw printers, will be fixed in udev-147
36 patch -Np1 -i ../cups-hplip-fix.patch
37 ./configure --prefix="" --mandir=/usr/share/man \
38 --includedir=/usr/include \
39 --libexecdir=/lib/udev \
40 --datarootdir=/usr/share
42 make DESTDIR=$pkgdir install
44 install -d -m755 $pkgdir/usr/lib
45 mv $pkgdir/lib/pkgconfig $pkgdir/usr/lib
46 install -D -m644 $srcdir/81-arch.rules $pkgdir/lib/udev/rules.d/81-arch.rules
48 mv $pkgdir/lib/ConsoleKit $pkgdir/usr/lib
49 # Install our rule for permissions and symlinks
50 # install our module loading subsystem
51 install -D -m755 $srcdir/load-modules.sh $pkgdir/lib/udev/load-modules.sh
52 install -d -m755 $pkgdir/bin
53 gcc -Wall $CFLAGS -o $pkgdir/bin/resolve-modalias $srcdir/resolve-modalias.c
54 # install cdsymlinks.sh
55 install -D -m755 $srcdir/cdsymlinks.sh $pkgdir/lib/udev/cdsymlinks.sh
56 # install root-link.sh
57 install -D -m755 $srcdir/root-link.sh $pkgdir/lib/udev/root-link.sh
58 # install ignore-remove.sh
59 install -D -m755 $srcdir/ignore-remove.sh $pkgdir/lib/udev/ignore-remove.sh
60 # disable error logging to prevent startup failures printed to vc on boot
61 sed -i -e 's|udev_log="err"|udev_log="0"|g' $pkgdir/etc/udev/udev.conf
62 # install additional standard rules files
63 for rule in $srcdir/$_pkgname-$pkgver/rules/packages/*.rules; do
64 install -D -m 644 $rule $pkgdir/lib/udev/rules.d/
66 # fix standard udev rules to fit to arch
67 cd $pkgdir/lib/udev/rules.d/
68 patch -Np1 -i $srcdir/arch-udev-rules.patch
70 rm -f $pkgdir/lib/udev/rules.d/*.orig
71 # disable persistent cdromsymlinks and network by default
72 # and move it to /etc/udev/rules.d
73 mv $pkgdir/lib/udev/rules.d/75-persistent-net-generator.rules \
74 $pkgdir/etc/udev/rules.d/75-persistent-net-generator.rules.optional
75 mv $pkgdir/lib/udev/rules.d/75-cd-aliases-generator.rules \
76 $pkgdir/etc/udev/rules.d/75-cd-aliases-generator.rules.optional
77 # remove not needed rules
78 rm $pkgdir/lib/udev/rules.d/40-ia64.rules
79 rm $pkgdir/lib/udev/rules.d/40-ppc.rules
80 rm $pkgdir/lib/udev/rules.d/40-s390.rules
81 rm $pkgdir/lib/udev/rules.d/64-device-mapper.rules
82 rm $pkgdir/lib/udev/rules.d/64-md-raid.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
96 mknod -m 0666 ${pkgdir}/lib/udev/devices/null c 1 3
97 mknod -m 0660 ${pkgdir}/lib/udev/devices/zero c 1 5
98 mknod -m 0666 ${pkgdir}/lib/udev/devices/kmsg c 1 11
100 ln -snf /proc/self/fd ${pkgdir}/lib/udev/devices/fd
101 ln -snf /proc/self/fd/0 ${pkgdir}/lib/udev/devices/stdin
102 ln -snf /proc/self/fd/1 ${pkgdir}/lib/udev/devices/stdout
103 ln -snf /proc/self/fd/2 ${pkgdir}/lib/udev/devices/stderr
104 ln -snf /proc/kcore ${pkgdir}/lib/udev/devices/core
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
109 chgrp disk ${pkgdir}/lib/udev/devices/loop0
111 mkdir ${pkgdir}/lib/udev/devices/net
112 mknod -m 0666 ${pkgdir}/lib/udev/devices/net/tun c 10 200
114 mknod -m 0666 ${pkgdir}/lib/udev/devices/fuse c 10 229
116 mknod -m 0600 ${pkgdir}/lib/udev/devices/ppp c 108 0
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
123 cp $pkgdir/lib/udev/firmware.sh $pkgdir/lib/udev/firmware