initscripts: umount networking filesystems before shutting of the network also for...
[opendreambox.git] / meta-opendreambox / recipes-core / udev / udev_124.inc
1 DESCRIPTION ?= "udev is a program which dynamically creates and removes device nodes from \
2 /dev/. It responds to /sbin/hotplug device events and requires a 2.6 kernel."
3
4 LICENSE = "GPLv2+"
5 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
6
7 SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
8            file://udev.rules \
9            file://devfs-udev.rules \
10            file://links.conf \
11            file://permissions.rules \
12            file://mount.sh \
13            file://network.sh \
14            file://local.rules \
15            file://init \
16            file://udev-compat-wrapper-patch"
17
18 INC_PR = "r30"
19
20 inherit update-rc.d autotools pkgconfig
21
22 PARALLEL_MAKE = ""
23 UDEV_DEVFS_RULES ?= "0"
24 PKG_libvolume-id-dev = "libvolume-id-dev"
25
26 RDEPENDS_${PN} += "module-init-tools-depmod udev-utils"
27
28 INITSCRIPT_NAME = "udev"
29 INITSCRIPT_PARAMS = "start 03 S ."
30
31 export CROSS = "${TARGET_PREFIX}"
32 export HOSTCC = "${BUILD_CC}"
33 export udevdir ?= "/dev"
34 # Put stuff in /lib and /sbin
35 export bindir := "${base_bindir}"
36 export sbindir := "${base_sbindir}"
37 export usrbindir := "${bindir}"
38 export usrsbindir := "${sbindir}"
39 export etcdir := "${sysconfdir}"
40
41 TARGET_CC_ARCH += "${LDFLAGS}"
42 UDEV_EXTRAS = "<override me>"
43 EXTRA_OEMAKE = "-e \
44                 'EXTRAS=${UDEV_EXTRAS}' \
45                 'STRIP=echo'"
46
47 RPROVIDES_udev_append = " udev-compat-wrapper"
48 RDEPENDS_udev_spitz += "udev-compat"
49 do_unpack_append_spitz() {
50         bb.build.exec_func('do_apply_compat_wrapper', d)
51 }
52 RDEPENDS_udev_akita += "udev-compat"
53 do_unpack_append_akita() {
54         bb.build.exec_func('do_apply_compat_wrapper', d)
55 }
56 RDEPENDS_udev_c7x0 += "udev-compat"
57 do_unpack_append_c7x0() {
58         bb.build.exec_func('do_apply_compat_wrapper', d)
59 }
60 RDEPENDS_udev_poodle += "udev-compat"
61 do_unpack_append_poodle() {
62         bb.build.exec_func('do_apply_compat_wrapper', d)
63 }
64
65 # Modify init script on platforms that need to boot old kernels:
66 do_apply_compat_wrapper() {
67         cd ${WORKDIR}
68         sed -i "s:/sbin/udevd:\$UDEVD:g;s:/sbin/udevadm:\$UDEVADM:g" init
69         patch <udev-compat-wrapper-patch
70         cd -
71 }
72
73 do_install () {
74         install -d ${D}${usrsbindir} \
75                    ${D}${sbindir}
76         oe_runmake 'DESTDIR=${D}' INSTALL=install install
77         install -d ${D}${sysconfdir}/init.d
78         install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
79
80         install -d ${D}${sysconfdir}/udev/rules.d/
81
82         install -m 0644 ${WORKDIR}/local.rules         ${D}${sysconfdir}/udev/rules.d/local.rules
83         install -m 0644 ${WORKDIR}/permissions.rules   ${D}${sysconfdir}/udev/rules.d/permissions.rules
84         install -m 0644 ${WORKDIR}/udev.rules          ${D}${sysconfdir}/udev/rules.d/udev.rules
85         if [ "${UDEV_DEVFS_RULES}" = "1" ]; then
86                 install -m 0644 ${WORKDIR}/devfs-udev.rules ${D}${sysconfdir}/udev/rules.d/devfs-udev.rules
87         fi
88
89         install -d ${D}${sysconfdir}/udev/scripts/
90
91         install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh
92         install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts
93         install -m 0644 ${S}/extras/volume_id/lib/libvolume_id.h ${D}${includedir}
94         oe_libinstall -C extras/volume_id/lib libvolume_id ${D}${libdir}
95 }
96
97 PACKAGES =+ "udev-utils libvolume-id libvolume-id-dev"
98 FILES_libvolume-id-dev = "${includedir}/libvolume_id.h ${libdir}/libvolume_id.a ${libdir}/libvolume_id.so ${libdir}/pkgconfig/libvolume_id.pc"
99 FILES_udev-utils = "${usrbindir}/udevinfo ${usrbindir}/udevtest ${sbindir}/udevadm"
100 FILES_libvolume-id = "${base_libdir}/libvolume_id.so.*"
101 FILES_${PN} += "${usrbindir}/* ${usrsbindir}/udevd"
102 FILES_${PN}-dbg += "${usrbindir}/.debug ${usrsbindir}/.debug"