blob: 7bd7b09d8f78c5deb17104fff502ff2ee0ea9e0e [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001require lvm2.inc
2
3SRC_URI[md5sum] = "bc26da66e96727babbd288bb0f050339"
4SRC_URI[sha256sum] = "24997e26dfc916151707c9da504d38d0473bec3481a8230b676bc079041bead6"
5
6SRC_URI += "file://0001-explicitly-do-not-install-libdm.patch"
7
8DEPENDS += "autoconf-archive-native"
9
10inherit multilib_script
11
12MULTILIB_SCRIPTS = "${PN}:${sysconfdir}/lvm/lvm.conf"
13
14CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
15
16do_install_append() {
17 # Install machine specific configuration file
18 install -d ${D}${sysconfdir}/lvm
19 install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf
20 sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf
21 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
22 oe_runmake 'DESTDIR=${D}' install install_systemd_units
23 sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service
24 else
25 oe_runmake 'DESTDIR=${D}' install install_initscripts
26 mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
27 rm -rf ${D}${sysconfdir}/rc.d
28 fi
29}
30
31PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules"
32
33SYSTEMD_PACKAGES = "${PN}"
34SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \
35 ${@bb.utils.contains('PACKAGECONFIG', 'lvmetad', 'lvm2-lvmetad.socket lvm2-pvscan@.service', '', d)} \
36 blk-availability.service"
37SYSTEMD_AUTO_ENABLE = "disable"
38
39TARGET_CC_ARCH += "${LDFLAGS}"
40
41EXTRA_OECONF_append_class-nativesdk = " --with-confdir=${sysconfdir}"
42
43FILES_${PN} += "${libdir}/device-mapper/*.so"
44FILES_${PN}-scripts = " \
45 ${sbindir}/blkdeactivate \
46 ${sbindir}/fsadm \
47 ${sbindir}/lvmconf \
48 ${sbindir}/lvmdump \
49"
50# Specified explicitly for the udev rules, just in case that it does not get picked
51# up automatically:
52FILES_${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d"
53RDEPENDS_${PN}-udevrules = "${PN}"
54RDEPENDS_${PN}_append_class-target = " libdevmapper"
55RDEPENDS_${PN}_append_class-nativesdk = " libdevmapper"
56
57RDEPENDS_${PN}-scripts = "${PN} (= ${EXTENDPKGV}) bash"
58RRECOMMENDS_${PN}_class-target = "${PN}-scripts (= ${EXTENDPKGV})"
59
60CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf"
61
62BBCLASSEXTEND = "native nativesdk"