blob: f42bd8ed28ced665b43a63ae2ecd7e44584a7fe8 [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 Bishop19323692019-04-05 15:28:33 -04008 "
9
10DEPENDS += "autoconf-archive-native"
11
12inherit multilib_script
13
14MULTILIB_SCRIPTS = "${PN}:${sysconfdir}/lvm/lvm.conf"
15
16CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
17
18do_install_append() {
19 # Install machine specific configuration file
20 install -d ${D}${sysconfdir}/lvm
21 install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf
22 sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf
23 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
24 oe_runmake 'DESTDIR=${D}' install install_systemd_units
25 sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service
26 else
27 oe_runmake 'DESTDIR=${D}' install install_initscripts
28 mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
29 rm -rf ${D}${sysconfdir}/rc.d
30 fi
31}
32
33PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules"
34
35SYSTEMD_PACKAGES = "${PN}"
36SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \
37 blk-availability.service lvm2-pvscan@.service"
38SYSTEMD_AUTO_ENABLE = "disable"
39
40TARGET_CC_ARCH += "${LDFLAGS}"
41
42EXTRA_OECONF_append_class-nativesdk = " --with-confdir=${sysconfdir}"
43
Brad Bishop665fd022019-08-26 01:32:28 -040044DEPENDS += "util-linux"
45LVM2_PACKAGECONFIG_append_class-target = " \
46 udev \
47"
48PACKAGECONFIG[udev] = "--enable-udev_sync --enable-udev_rules --with-udevdir=${nonarch_base_libdir}/udev/rules.d,--disable-udev_sync --disable-udev_rules,udev"
49
Brad Bishop0f291cc2019-09-01 15:16:57 -040050PACKAGES =+ "libdevmapper"
51FILES_libdevmapper = " \
52 ${libdir}/libdevmapper.so.* \
53 ${sbindir}/dmsetup \
54 ${sbindir}/dmstats \
55"
56
Brad Bishop19323692019-04-05 15:28:33 -040057FILES_${PN} += "${libdir}/device-mapper/*.so"
58FILES_${PN}-scripts = " \
59 ${sbindir}/blkdeactivate \
60 ${sbindir}/fsadm \
61 ${sbindir}/lvmconf \
62 ${sbindir}/lvmdump \
63"
64# Specified explicitly for the udev rules, just in case that it does not get picked
65# up automatically:
66FILES_${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d"
Brad Bishop26bdd442019-08-16 17:08:17 -040067RDEPENDS_${PN}-udevrules = "libdevmapper"
Brad Bishop19323692019-04-05 15:28:33 -040068RDEPENDS_${PN}_append_class-target = " libdevmapper"
69RDEPENDS_${PN}_append_class-nativesdk = " libdevmapper"
70
Brad Bishopc1d34332019-09-09 14:56:00 -040071RDEPENDS_${PN}-scripts = "${PN} (= ${EXTENDPKGV}) \
72 bash \
73 util-linux-lsblk \
74 util-linux-findmnt \
75 coreutils \
76"
Brad Bishop19323692019-04-05 15:28:33 -040077RRECOMMENDS_${PN}_class-target = "${PN}-scripts (= ${EXTENDPKGV})"
78
79CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf"
80
Brad Bishop0f291cc2019-09-01 15:16:57 -040081SYSROOT_PREPROCESS_FUNCS_append = " remove_libdevmapper_sysroot_preprocess"
82remove_libdevmapper_sysroot_preprocess() {
83 rm -f ${SYSROOT_DESTDIR}${libdir}/libdevmapper.so* \
84 ${SYSROOT_DESTDIR}${sbindir}/dmsetup \
85 ${SYSROOT_DESTDIR}${sbindir}/dmstats \
86 ${SYSROOT_DESTDIR}${includedir}/libdevmapper.h \
87 ${SYSROOT_DESTDIR}${libdir}/pkgconfig/devmapper.pc
88}
89
Brad Bishop19323692019-04-05 15:28:33 -040090BBCLASSEXTEND = "native nativesdk"