blob: 7f3f000e0a28cff868696da2fd5a874cba84169d [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001require lvm2.inc
2
Brad Bishop0f291cc2019-09-01 15:16:57 -04003SRC_URI += " \
Brad Bishopc1d34332019-09-09 14:56:00 -04004 file://0001-fix-command-bin-findmnt-bin-lsblk-bin-sort-not-found.patch \
Brad Bishop19323692019-04-05 15:28:33 -04005 "
6
7DEPENDS += "autoconf-archive-native"
8
9inherit multilib_script
10
11MULTILIB_SCRIPTS = "${PN}:${sysconfdir}/lvm/lvm.conf"
12
13CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
14
15do_install_append() {
16 # Install machine specific configuration file
17 install -d ${D}${sysconfdir}/lvm
18 install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf
19 sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf
20 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
21 oe_runmake 'DESTDIR=${D}' install install_systemd_units
22 sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service
23 else
24 oe_runmake 'DESTDIR=${D}' install install_initscripts
25 mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
26 rm -rf ${D}${sysconfdir}/rc.d
27 fi
28}
29
30PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules"
31
32SYSTEMD_PACKAGES = "${PN}"
33SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \
Andrew Geissler89770b02020-06-13 10:40:47 -050034 blk-availability.service"
Brad Bishop19323692019-04-05 15:28:33 -040035SYSTEMD_AUTO_ENABLE = "disable"
36
37TARGET_CC_ARCH += "${LDFLAGS}"
38
39EXTRA_OECONF_append_class-nativesdk = " --with-confdir=${sysconfdir}"
40
Brad Bishop665fd022019-08-26 01:32:28 -040041DEPENDS += "util-linux"
42LVM2_PACKAGECONFIG_append_class-target = " \
43 udev \
44"
Brad Bishop36a3e3e2019-10-02 13:29:27 -040045PACKAGECONFIG[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 -040046
Brad Bishop0f291cc2019-09-01 15:16:57 -040047PACKAGES =+ "libdevmapper"
48FILES_libdevmapper = " \
49 ${libdir}/libdevmapper.so.* \
50 ${sbindir}/dmsetup \
51 ${sbindir}/dmstats \
52"
53
Andrew Geissler89770b02020-06-13 10:40:47 -050054FILES_${PN} += " \
55 ${libdir}/device-mapper/*.so \
56 ${systemd_system_unitdir}/lvm2-pvscan@.service \
57"
58
Brad Bishop19323692019-04-05 15:28:33 -040059FILES_${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"