blob: b80f1fd4bb087abd3134f903940f63aee63acc07 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001require lvm2.inc
2
Brad Bishop0f291cc2019-09-01 15:16:57 -04003SRC_URI += " \
Brad Bishop19323692019-04-05 15:28:33 -04004 file://0001-dev-hdc-open-failed-No-medium-found-will-print-out-i.patch \
Brad Bishopc1d34332019-09-09 14:56:00 -04005 file://0001-fix-command-bin-findmnt-bin-lsblk-bin-sort-not-found.patch \
Brad Bishop00ab2372019-10-14 11:06:18 -04006 file://0001-udev-remove-unsupported-OPTIONS-event_timeout-rule.patch \
Brad Bishop6a62e0e2019-10-21 08:11:42 -04007 file://0001-activation-add-synchronization-point.patch \
8 file://0002-activation-extend-handling-of-pending_delete.patch \
9 file://0003-snapshot-always-activate.patch \
Brad Bishop19323692019-04-05 15:28:33 -040010 "
11
12DEPENDS += "autoconf-archive-native"
13
14inherit multilib_script
15
16MULTILIB_SCRIPTS = "${PN}:${sysconfdir}/lvm/lvm.conf"
17
18CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
19
20do_install_append() {
21 # Install machine specific configuration file
22 install -d ${D}${sysconfdir}/lvm
23 install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf
24 sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf
25 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
26 oe_runmake 'DESTDIR=${D}' install install_systemd_units
27 sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service
28 else
29 oe_runmake 'DESTDIR=${D}' install install_initscripts
30 mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
31 rm -rf ${D}${sysconfdir}/rc.d
32 fi
33}
34
35PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules"
36
37SYSTEMD_PACKAGES = "${PN}"
38SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \
39 blk-availability.service lvm2-pvscan@.service"
40SYSTEMD_AUTO_ENABLE = "disable"
41
42TARGET_CC_ARCH += "${LDFLAGS}"
43
44EXTRA_OECONF_append_class-nativesdk = " --with-confdir=${sysconfdir}"
45
Brad Bishop665fd022019-08-26 01:32:28 -040046DEPENDS += "util-linux"
47LVM2_PACKAGECONFIG_append_class-target = " \
48 udev \
49"
Brad Bishop36a3e3e2019-10-02 13:29:27 -040050PACKAGECONFIG[udev] = "--enable-udev_sync --enable-udev_rules --with-udevdir=${nonarch_base_libdir}/udev/rules.d,--disable-udev_sync --disable-udev_rules,udev,${PN}-udevrules"
Brad Bishop665fd022019-08-26 01:32:28 -040051
Brad Bishop0f291cc2019-09-01 15:16:57 -040052PACKAGES =+ "libdevmapper"
53FILES_libdevmapper = " \
54 ${libdir}/libdevmapper.so.* \
55 ${sbindir}/dmsetup \
56 ${sbindir}/dmstats \
57"
58
Brad Bishop19323692019-04-05 15:28:33 -040059FILES_${PN} += "${libdir}/device-mapper/*.so"
60FILES_${PN}-scripts = " \
61 ${sbindir}/blkdeactivate \
62 ${sbindir}/fsadm \
63 ${sbindir}/lvmconf \
64 ${sbindir}/lvmdump \
65"
66# Specified explicitly for the udev rules, just in case that it does not get picked
67# up automatically:
68FILES_${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d"
Brad Bishop26bdd442019-08-16 17:08:17 -040069RDEPENDS_${PN}-udevrules = "libdevmapper"
Brad Bishop19323692019-04-05 15:28:33 -040070RDEPENDS_${PN}_append_class-target = " libdevmapper"
71RDEPENDS_${PN}_append_class-nativesdk = " libdevmapper"
72
Brad Bishopc1d34332019-09-09 14:56:00 -040073RDEPENDS_${PN}-scripts = "${PN} (= ${EXTENDPKGV}) \
74 bash \
75 util-linux-lsblk \
76 util-linux-findmnt \
77 coreutils \
78"
Brad Bishop19323692019-04-05 15:28:33 -040079RRECOMMENDS_${PN}_class-target = "${PN}-scripts (= ${EXTENDPKGV})"
80
81CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf"
82
Brad Bishop0f291cc2019-09-01 15:16:57 -040083SYSROOT_PREPROCESS_FUNCS_append = " remove_libdevmapper_sysroot_preprocess"
84remove_libdevmapper_sysroot_preprocess() {
85 rm -f ${SYSROOT_DESTDIR}${libdir}/libdevmapper.so* \
86 ${SYSROOT_DESTDIR}${sbindir}/dmsetup \
87 ${SYSROOT_DESTDIR}${sbindir}/dmstats \
88 ${SYSROOT_DESTDIR}${includedir}/libdevmapper.h \
89 ${SYSROOT_DESTDIR}${libdir}/pkgconfig/devmapper.pc
90}
91
Brad Bishop19323692019-04-05 15:28:33 -040092BBCLASSEXTEND = "native nativesdk"