Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | require lvm2.inc |
| 2 | |
Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 3 | SRC_URI += " \ |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 4 | file://0001-fix-command-bin-findmnt-bin-lsblk-bin-sort-not-found.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 5 | " |
| 6 | |
| 7 | DEPENDS += "autoconf-archive-native" |
| 8 | |
| 9 | inherit multilib_script |
| 10 | |
| 11 | MULTILIB_SCRIPTS = "${PN}:${sysconfdir}/lvm/lvm.conf" |
| 12 | |
| 13 | CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe" |
| 14 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 15 | do_install:append() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 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 | |
| 30 | PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules" |
| 31 | |
| 32 | SYSTEMD_PACKAGES = "${PN}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 33 | SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \ |
Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 34 | blk-availability.service" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 35 | SYSTEMD_AUTO_ENABLE = "disable" |
| 36 | |
| 37 | TARGET_CC_ARCH += "${LDFLAGS}" |
| 38 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 39 | EXTRA_OECONF:append:class-nativesdk = " --with-confdir=${sysconfdir}" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 40 | |
Brad Bishop | 665fd02 | 2019-08-26 01:32:28 -0400 | [diff] [blame] | 41 | DEPENDS += "util-linux" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 42 | LVM2_PACKAGECONFIG:append:class-target = " \ |
Brad Bishop | 665fd02 | 2019-08-26 01:32:28 -0400 | [diff] [blame] | 43 | udev \ |
| 44 | " |
Brad Bishop | 36a3e3e | 2019-10-02 13:29:27 -0400 | [diff] [blame] | 45 | PACKAGECONFIG[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 Bishop | 665fd02 | 2019-08-26 01:32:28 -0400 | [diff] [blame] | 46 | |
Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 47 | PACKAGES =+ "libdevmapper" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 48 | FILES:libdevmapper = " \ |
Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 49 | ${libdir}/libdevmapper.so.* \ |
| 50 | ${sbindir}/dmsetup \ |
| 51 | ${sbindir}/dmstats \ |
| 52 | " |
| 53 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 54 | FILES:${PN} += " \ |
Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 55 | ${libdir}/device-mapper/*.so \ |
| 56 | ${systemd_system_unitdir}/lvm2-pvscan@.service \ |
| 57 | " |
| 58 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 59 | FILES:${PN}-scripts = " \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 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: |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 67 | FILES:${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d" |
| 68 | RDEPENDS:${PN}-udevrules = "libdevmapper" |
| 69 | RDEPENDS:${PN}:append:class-target = " libdevmapper" |
| 70 | RDEPENDS:${PN}:append:class-nativesdk = " libdevmapper" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 71 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 72 | RDEPENDS:${PN}-scripts = "${PN} (= ${EXTENDPKGV}) \ |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 73 | bash \ |
| 74 | util-linux-lsblk \ |
| 75 | util-linux-findmnt \ |
| 76 | coreutils \ |
| 77 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 78 | RRECOMMENDS:${PN}:class-target = "${PN}-scripts (= ${EXTENDPKGV})" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 79 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 80 | CONFFILES:${PN} += "${sysconfdir}/lvm/lvm.conf" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 81 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 82 | SYSROOT_PREPROCESS_FUNCS:append = " remove_libdevmapper_sysroot_preprocess" |
Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 83 | remove_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 Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 91 | BBCLASSEXTEND = "native nativesdk" |