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 |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 20 | # We don't want init scripts/systemd units for native SDK utilities |
| 21 | if [ "${PN}" != "nativesdk-lvm2" ]; then |
| 22 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 23 | oe_runmake 'DESTDIR=${D}' install install_systemd_units |
| 24 | sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service |
| 25 | else |
| 26 | oe_runmake 'DESTDIR=${D}' install install_initscripts |
| 27 | mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d |
| 28 | rm -rf ${D}${sysconfdir}/rc.d |
| 29 | fi |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 30 | fi |
| 31 | } |
| 32 | |
| 33 | PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules" |
| 34 | |
| 35 | SYSTEMD_PACKAGES = "${PN}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 36 | 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] | 37 | blk-availability.service" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 38 | SYSTEMD_AUTO_ENABLE = "disable" |
| 39 | |
| 40 | TARGET_CC_ARCH += "${LDFLAGS}" |
| 41 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 42 | EXTRA_OECONF:append:class-nativesdk = " --with-confdir=${sysconfdir}" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 43 | |
Brad Bishop | 665fd02 | 2019-08-26 01:32:28 -0400 | [diff] [blame] | 44 | DEPENDS += "util-linux" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 45 | LVM2_PACKAGECONFIG:append:class-target = " \ |
Brad Bishop | 665fd02 | 2019-08-26 01:32:28 -0400 | [diff] [blame] | 46 | udev \ |
| 47 | " |
Brad Bishop | 36a3e3e | 2019-10-02 13:29:27 -0400 | [diff] [blame] | 48 | 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] | 49 | |
Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 50 | PACKAGES =+ "libdevmapper" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 51 | FILES:libdevmapper = " \ |
Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 52 | ${libdir}/libdevmapper.so.* \ |
| 53 | ${sbindir}/dmsetup \ |
| 54 | ${sbindir}/dmstats \ |
| 55 | " |
| 56 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 57 | FILES:${PN} += " \ |
Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 58 | ${libdir}/device-mapper/*.so \ |
| 59 | ${systemd_system_unitdir}/lvm2-pvscan@.service \ |
| 60 | " |
| 61 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 62 | FILES:${PN}-scripts = " \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 63 | ${sbindir}/blkdeactivate \ |
| 64 | ${sbindir}/fsadm \ |
| 65 | ${sbindir}/lvmconf \ |
| 66 | ${sbindir}/lvmdump \ |
| 67 | " |
| 68 | # Specified explicitly for the udev rules, just in case that it does not get picked |
| 69 | # up automatically: |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 70 | FILES:${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d" |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 71 | RDEPENDS:${PN} = "bash" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 72 | RDEPENDS:${PN}-udevrules = "libdevmapper" |
| 73 | RDEPENDS:${PN}:append:class-target = " libdevmapper" |
| 74 | RDEPENDS:${PN}:append:class-nativesdk = " libdevmapper" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 75 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 76 | RDEPENDS:${PN}-scripts = "${PN} (= ${EXTENDPKGV}) \ |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 77 | bash \ |
| 78 | util-linux-lsblk \ |
| 79 | util-linux-findmnt \ |
| 80 | coreutils \ |
| 81 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 82 | RRECOMMENDS:${PN}:class-target = "${PN}-scripts (= ${EXTENDPKGV})" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 83 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 84 | CONFFILES:${PN} += "${sysconfdir}/lvm/lvm.conf" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 85 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 86 | SYSROOT_PREPROCESS_FUNCS:append = " remove_libdevmapper_sysroot_preprocess" |
Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 87 | remove_libdevmapper_sysroot_preprocess() { |
| 88 | rm -f ${SYSROOT_DESTDIR}${libdir}/libdevmapper.so* \ |
| 89 | ${SYSROOT_DESTDIR}${sbindir}/dmsetup \ |
| 90 | ${SYSROOT_DESTDIR}${sbindir}/dmstats \ |
| 91 | ${SYSROOT_DESTDIR}${includedir}/libdevmapper.h \ |
| 92 | ${SYSROOT_DESTDIR}${libdir}/pkgconfig/devmapper.pc |
| 93 | } |
| 94 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 95 | BBCLASSEXTEND = "native nativesdk" |