Merge branch 'org.openembedded.dev' of git@git.openembedded.org:openembedded into...
[openembedded.git] / recipes / udev / udev_118.bb
1 DESCRIPTION = "udev is a daemon which dynamically creates and removes device nodes from \
2 /dev/, handles hotplug events and loads drivers at boot time. It replaces \
3 the hotplug package and requires a kernel not older than 2.6.12."
4 RPROVIDES_${PN} = "hotplug"
5
6 PR = "r5"
7
8 DEFAULT_PREFERENCE = "-118"
9
10 SRC_URI = "\
11  http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
12  file://flags.patch;patch=1 \
13  file://vol_id_ld.patch;patch=1 \
14  file://udevtrigger_add_devname_filtering.patch;patch=1 \
15  file://mount.blacklist \
16 "
17
18 require udev.inc
19
20 INITSCRIPT_PARAMS = "start 03 S ."
21
22 FILES_${PN} += "${base_libdir}/udev/*"
23 FILES_${PN}-dbg += "${base_libdir}/udev/.debug"
24 UDEV_EXTRAS = "extras/firmware/ extras/scsi_id/ extras/volume_id/"
25 EXTRA_OEMAKE += "libudevdir=/lib/udev libdir=${base_libdir} prefix="
26
27 do_compile_prepend() {
28         sed -i s,asmlinkage,, *.c
29 }
30
31 do_install () {
32         install -d ${D}${usrsbindir} \
33                    ${D}${sysconfdir} \
34                    ${D}${sbindir}
35         oe_runmake 'DESTDIR=${D}' INSTALL=install install
36         install -d ${D}${sysconfdir}/init.d
37         install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
38
39         install -d ${D}${sysconfdir}/udev/rules.d/
40
41         install -m 0644 ${WORKDIR}/mount.blacklist     ${D}${sysconfdir}/udev/
42         install -m 0644 ${WORKDIR}/local.rules         ${D}${sysconfdir}/udev/rules.d/local.rules
43         install -m 0644 ${WORKDIR}/permissions.rules   ${D}${sysconfdir}/udev/rules.d/permissions.rules
44         install -m 0644 ${WORKDIR}/udev.rules          ${D}${sysconfdir}/udev/rules.d/udev.rules
45         install -m 0644 ${WORKDIR}/links.conf          ${D}${sysconfdir}/udev/links.conf
46         if [ "${UDEV_DEVFS_RULES}" = "1" ]; then
47                 install -m 0644 ${WORKDIR}/devfs-udev.rules ${D}${sysconfdir}/udev/rules.d/devfs-udev.rules
48         fi
49
50         install -d ${D}${sysconfdir}/udev/scripts/
51
52         install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh
53         install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts
54
55         install -d ${D}${base_libdir}/udev/
56 }
57
58 pkg_postinst_append() {
59
60        # Add the root partition to mount.blacklist to avoid a bug in the auto-mounter,
61        # causing confusion with fsck on boot
62
63         while read dev mp fs junk
64         do
65                 if test "$mp" = "/"
66                 then
67                         root_partition="$dev"
68                         echo "$root_partition" >> $D${sysconfdir}/udev/mount.blacklist
69                 fi
70         done < $D${sysconfdir}/fstab
71 }
72