blob: e2b551bbc60dd02021abc5adec1193ae082b639e [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 Bishop19323692019-04-05 15:28:33 -04006 "
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 blk-availability.service lvm2-pvscan@.service"
36SYSTEMD_AUTO_ENABLE = "disable"
37
38TARGET_CC_ARCH += "${LDFLAGS}"
39
40EXTRA_OECONF_append_class-nativesdk = " --with-confdir=${sysconfdir}"
41
Brad Bishop665fd022019-08-26 01:32:28 -040042DEPENDS += "util-linux"
43LVM2_PACKAGECONFIG_append_class-target = " \
44 udev \
45"
Brad Bishop36a3e3e2019-10-02 13:29:27 -040046PACKAGECONFIG[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 -040047
Brad Bishop0f291cc2019-09-01 15:16:57 -040048PACKAGES =+ "libdevmapper"
49FILES_libdevmapper = " \
50 ${libdir}/libdevmapper.so.* \
51 ${sbindir}/dmsetup \
52 ${sbindir}/dmstats \
53"
54
Brad Bishop19323692019-04-05 15:28:33 -040055FILES_${PN} += "${libdir}/device-mapper/*.so"
56FILES_${PN}-scripts = " \
57 ${sbindir}/blkdeactivate \
58 ${sbindir}/fsadm \
59 ${sbindir}/lvmconf \
60 ${sbindir}/lvmdump \
61"
62# Specified explicitly for the udev rules, just in case that it does not get picked
63# up automatically:
64FILES_${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d"
Brad Bishop26bdd442019-08-16 17:08:17 -040065RDEPENDS_${PN}-udevrules = "libdevmapper"
Brad Bishop19323692019-04-05 15:28:33 -040066RDEPENDS_${PN}_append_class-target = " libdevmapper"
67RDEPENDS_${PN}_append_class-nativesdk = " libdevmapper"
68
Brad Bishopc1d34332019-09-09 14:56:00 -040069RDEPENDS_${PN}-scripts = "${PN} (= ${EXTENDPKGV}) \
70 bash \
71 util-linux-lsblk \
72 util-linux-findmnt \
73 coreutils \
74"
Brad Bishop19323692019-04-05 15:28:33 -040075RRECOMMENDS_${PN}_class-target = "${PN}-scripts (= ${EXTENDPKGV})"
76
77CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf"
78
Brad Bishop0f291cc2019-09-01 15:16:57 -040079SYSROOT_PREPROCESS_FUNCS_append = " remove_libdevmapper_sysroot_preprocess"
80remove_libdevmapper_sysroot_preprocess() {
81 rm -f ${SYSROOT_DESTDIR}${libdir}/libdevmapper.so* \
82 ${SYSROOT_DESTDIR}${sbindir}/dmsetup \
83 ${SYSROOT_DESTDIR}${sbindir}/dmstats \
84 ${SYSROOT_DESTDIR}${includedir}/libdevmapper.h \
85 ${SYSROOT_DESTDIR}${libdir}/pkgconfig/devmapper.pc
86}
87
Brad Bishop19323692019-04-05 15:28:33 -040088BBCLASSEXTEND = "native nativesdk"