summaryrefslogtreecommitdiff
path: root/testing/udev/PKGBUILD
blob: 171a03bc5e26edad92bea281f686ab79987e9156 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# $Id: PKGBUILD 146792 2012-01-18 11:05:48Z tomegun $
# Maintainer: Tom Gundersen <teg@jklm.no>
# Contributor: Aaron Griffin <aaron@archlinux.org>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Thomas Bächler <thomas@archlinux.org>

pkgbase="udev"
pkgname=('udev' 'udev-compat')
pkgver=177
pkgrel=3
arch=(i686 x86_64)
url="http://git.kernel.org/?p=linux/hotplug/udev.git;a=summary"
license=('GPL')
groups=('base')
options=(!makeflags !libtool)
makedepends=('gobject-introspection' 'gperf' 'libxslt' 'usbutils' 'kmod')
source=(ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/$pkgbase-$pkgver.tar.xz
	0001-udevd-kill-hanging-event-processes-after-30-seconds.patch)

build() {
  cd $srcdir/$pkgbase-$pkgver

  # deal with broken drivers waiting for firmware to be loaded
  patch -p1 -i ../0001-udevd-kill-hanging-event-processes-after-30-seconds.patch

  ./configure --prefix=/usr \
              --with-rootprefix= \
              --sysconfdir=/etc \
              --bindir=/sbin \
              --libdir=/usr/lib \
              --with-rootlibdir=/lib \
              --libexecdir=/lib \
              --with-systemdsystemunitdir=/lib/systemd/system \
              --enable-udev_acl

  make
}
  
package_udev() {
  pkgdesc="The userspace dev tools (udev)"
  depends=('util-linux' 'libusb-compat' 'glib2' 'kmod' 'pciutils' 'usbutils' 'pciutils')
  install=udev.install
  backup=(etc/udev/udev.conf)

  cd $srcdir/$pkgbase-$pkgver
  make DESTDIR=${pkgdir} install

  # create framebuffer blacklist
  install -d -m755 ${pkgdir}/lib/modprobe.d/
  for mod in $(find /lib/modules/*/kernel/drivers/video -name '*fb.ko.gz' -exec basename {} .ko.gz \;); do 
  	echo "blacklist $mod" 
  done | sort -u > $pkgdir/lib/modprobe.d/framebuffer_blacklist.conf

  # /dev/loop0 is created for convenience, to autoload the module if necessary
  # this is no longer needed when util-linux-2.21 is released as /dev/loop-control
  # will be used instead. In that case move this to udev-compat
  install -d -m755 ${pkgdir}/lib/udev/devices/
  mknod ${pkgdir}/lib/udev/devices/loop0 b 7 0
  chgrp disk ${pkgdir}/lib/udev/devices/loop0
 
  # udevd moved, symlink to make life easy for restarting udevd manually
  ln -s /lib/udev/udevd ${pkgdir}/sbin/udevd

  # Replace dialout/tape/cdrom group in rules with uucp/storage/optical group
  for i in $pkgdir/lib/udev/rules.d/*.rules; do
    sed -i -e 's#GROUP="dialout"#GROUP="uucp"#g;
               s#GROUP="tape"#GROUP="storage"#g;
               s#GROUP="cdrom"#GROUP="optical"#g' $i
  done
}

package_udev-compat() {
  pkgdesc="The userspace dev tools (udev) - additional rules for older kernels"
  depends=('udev')
  groups=('')
  install -d -m755 ${pkgdir}/lib/udev/rules.d
  install -D -m644 ${srcdir}/${pkgbase}-${pkgver}/rules/misc/30-kernel-compat.rules ${pkgdir}/lib/udev/rules.d/30-kernel-compat.rules

  # create static nodes to be compatible with on-demand module
  # loading in the most recent kernel
  #
  # the list of nodes is generated from /lib/modules/`most recent kernel`/modprobe.devname
  # excluding any devices not included in the LTS kernel and any entries in the
  # modprobe.devname file of the LTS kernel (if it exists).

  install -d -m755 ${pkgdir}/lib/udev/devices
  cd ${pkgdir}/lib/udev/devices

  install -d -m755 net
  mknod net/tun c 10 200
  mknod ppp c 108 0
#  mknod loop-control c 10 237 -- does not exist in old kernels
  mknod uinput c 10 223
  install -d -m755 mapper
  mknod mapper/control c 10 236
  install -d -m755 snd
  mknod snd/timer c 116 33
  mknod snd/seq c 116 1
  mknod btrfs-control c 10 234
  mknod autofs c 10 235
  mknod fuse c 10 229
  install -d -m755 cpu
  mknod cpu/microcode c 10 184
  
}
md5sums=('b4e00faf8153fd7202a7ef609284b0c3'
         '3e40dca1c4f8194b4633e3befb4da4d4')