blob: e2ce95c815b80a27b01dca02cc4eaa6a1d9ae761 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001require lvm2.inc
2
3SRCREV = "913c28917e62577a2ef67152b2e5159237503dda"
4
5SRC_URI += "file://0001-explicitly-do-not-install-libdm.patch \
6 file://0001-dev-hdc-open-failed-No-medium-found-will-print-out-i.patch \
7 "
8
9DEPENDS += "autoconf-archive-native"
10
11inherit multilib_script
12
13MULTILIB_SCRIPTS = "${PN}:${sysconfdir}/lvm/lvm.conf"
14
15CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
16
17do_install_append() {
18 # Install machine specific configuration file
19 install -d ${D}${sysconfdir}/lvm
20 install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf
21 sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf
22 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
23 oe_runmake 'DESTDIR=${D}' install install_systemd_units
24 sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service
25 else
26 oe_runmake 'DESTDIR=${D}' install install_initscripts
27 mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
28 rm -rf ${D}${sysconfdir}/rc.d
29 fi
30}
31
32PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules"
33
34SYSTEMD_PACKAGES = "${PN}"
35SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \
36 blk-availability.service lvm2-pvscan@.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"