blob: 875709cd90d72d59edede4d205962ee0005464ea [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001require lvm2.inc
2
3SRCREV = "913c28917e62577a2ef67152b2e5159237503dda"
4
Brad Bishop0f291cc2019-09-01 15:16:57 -04005SRC_URI += " \
Brad Bishop19323692019-04-05 15:28:33 -04006 file://0001-dev-hdc-open-failed-No-medium-found-will-print-out-i.patch \
Brad Bishopc1d34332019-09-09 14:56:00 -04007 file://0001-fix-command-bin-findmnt-bin-lsblk-bin-sort-not-found.patch \
Brad Bishop00ab2372019-10-14 11:06:18 -04008 file://0001-udev-remove-unsupported-OPTIONS-event_timeout-rule.patch \
Brad Bishop19323692019-04-05 15:28:33 -04009 "
10
11DEPENDS += "autoconf-archive-native"
12
13inherit multilib_script
14
15MULTILIB_SCRIPTS = "${PN}:${sysconfdir}/lvm/lvm.conf"
16
17CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
18
19do_install_append() {
20 # Install machine specific configuration file
21 install -d ${D}${sysconfdir}/lvm
22 install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf
23 sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf
24 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
25 oe_runmake 'DESTDIR=${D}' install install_systemd_units
26 sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service
27 else
28 oe_runmake 'DESTDIR=${D}' install install_initscripts
29 mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
30 rm -rf ${D}${sysconfdir}/rc.d
31 fi
32}
33
34PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules"
35
36SYSTEMD_PACKAGES = "${PN}"
37SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \
38 blk-availability.service lvm2-pvscan@.service"
39SYSTEMD_AUTO_ENABLE = "disable"
40
41TARGET_CC_ARCH += "${LDFLAGS}"
42
43EXTRA_OECONF_append_class-nativesdk = " --with-confdir=${sysconfdir}"
44
Brad Bishop665fd022019-08-26 01:32:28 -040045DEPENDS += "util-linux"
46LVM2_PACKAGECONFIG_append_class-target = " \
47 udev \
48"
Brad Bishop36a3e3e2019-10-02 13:29:27 -040049PACKAGECONFIG[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 -040050
Brad Bishop0f291cc2019-09-01 15:16:57 -040051PACKAGES =+ "libdevmapper"
52FILES_libdevmapper = " \
53 ${libdir}/libdevmapper.so.* \
54 ${sbindir}/dmsetup \
55 ${sbindir}/dmstats \
56"
57
Brad Bishop19323692019-04-05 15:28:33 -040058FILES_${PN} += "${libdir}/device-mapper/*.so"
59FILES_${PN}-scripts = " \
60 ${sbindir}/blkdeactivate \
61 ${sbindir}/fsadm \
62 ${sbindir}/lvmconf \
63 ${sbindir}/lvmdump \
64"
65# Specified explicitly for the udev rules, just in case that it does not get picked
66# up automatically:
67FILES_${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d"
Brad Bishop26bdd442019-08-16 17:08:17 -040068RDEPENDS_${PN}-udevrules = "libdevmapper"
Brad Bishop19323692019-04-05 15:28:33 -040069RDEPENDS_${PN}_append_class-target = " libdevmapper"
70RDEPENDS_${PN}_append_class-nativesdk = " libdevmapper"
71
Brad Bishopc1d34332019-09-09 14:56:00 -040072RDEPENDS_${PN}-scripts = "${PN} (= ${EXTENDPKGV}) \
73 bash \
74 util-linux-lsblk \
75 util-linux-findmnt \
76 coreutils \
77"
Brad Bishop19323692019-04-05 15:28:33 -040078RRECOMMENDS_${PN}_class-target = "${PN}-scripts (= ${EXTENDPKGV})"
79
80CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf"
81
Brad Bishop0f291cc2019-09-01 15:16:57 -040082SYSROOT_PREPROCESS_FUNCS_append = " remove_libdevmapper_sysroot_preprocess"
83remove_libdevmapper_sysroot_preprocess() {
84 rm -f ${SYSROOT_DESTDIR}${libdir}/libdevmapper.so* \
85 ${SYSROOT_DESTDIR}${sbindir}/dmsetup \
86 ${SYSROOT_DESTDIR}${sbindir}/dmstats \
87 ${SYSROOT_DESTDIR}${includedir}/libdevmapper.h \
88 ${SYSROOT_DESTDIR}${libdir}/pkgconfig/devmapper.pc
89}
90
Brad Bishop19323692019-04-05 15:28:33 -040091BBCLASSEXTEND = "native nativesdk"