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 \ |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 5 | file://tweak-for-lvmdbusd.patch \ |
| 6 | file://0001-lvmdbusd-create-dirs-for-lock-file.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 7 | " |
| 8 | |
| 9 | DEPENDS += "autoconf-archive-native" |
| 10 | |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 11 | inherit multilib_script python3native |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 12 | |
| 13 | MULTILIB_SCRIPTS = "${PN}:${sysconfdir}/lvm/lvm.conf" |
| 14 | |
| 15 | CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe" |
| 16 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 17 | do_install:append() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 18 | # Install machine specific configuration file |
| 19 | install -d ${D}${sysconfdir}/lvm |
| 20 | install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf |
| 21 | sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 22 | # We don't want init scripts/systemd units for native SDK utilities |
| 23 | if [ "${PN}" != "nativesdk-lvm2" ]; then |
| 24 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 25 | oe_runmake 'DESTDIR=${D}' install install_systemd_units |
| 26 | sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service |
| 27 | else |
| 28 | oe_runmake 'DESTDIR=${D}' install install_initscripts |
| 29 | mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d |
| 30 | rm -rf ${D}${sysconfdir}/rc.d |
| 31 | fi |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 32 | fi |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 33 | |
| 34 | # following files only exist when package config `dbus` enabled |
| 35 | sed -i -e '1s,#!.*python.*,#!${USRBINPATH}/env python3,' \ |
| 36 | ${D}${sbindir}/lvmdbusd \ |
| 37 | ${D}${PYTHON_SITEPACKAGES_DIR}/lvmdbusd/lvmdb.py \ |
| 38 | ${D}${PYTHON_SITEPACKAGES_DIR}/lvmdbusd/lvm_shell_proxy.py \ |
| 39 | || true |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules" |
| 43 | |
| 44 | SYSTEMD_PACKAGES = "${PN}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 45 | SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \ |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 46 | ${@bb.utils.contains('PACKAGECONFIG', 'dbus', 'lvm2-lvmdbusd.service', '', d)} \ |
| 47 | blk-availability.service \ |
| 48 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 49 | SYSTEMD_AUTO_ENABLE = "disable" |
| 50 | |
| 51 | TARGET_CC_ARCH += "${LDFLAGS}" |
| 52 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 53 | EXTRA_OECONF:append:class-nativesdk = " --with-confdir=${sysconfdir}" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 54 | |
Brad Bishop | 665fd02 | 2019-08-26 01:32:28 -0400 | [diff] [blame] | 55 | DEPENDS += "util-linux" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 56 | LVM2_PACKAGECONFIG:append:class-target = " \ |
Brad Bishop | 665fd02 | 2019-08-26 01:32:28 -0400 | [diff] [blame] | 57 | udev \ |
| 58 | " |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 59 | |
| 60 | PACKAGECONFIG[dbus] = "--enable-dbus-service,--disable-dbus-service,,python3-dbus python3-pyudev" |
Brad Bishop | 36a3e3e | 2019-10-02 13:29:27 -0400 | [diff] [blame] | 61 | 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] | 62 | |
Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 63 | PACKAGES =+ "libdevmapper" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 64 | FILES:libdevmapper = " \ |
Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 65 | ${libdir}/libdevmapper.so.* \ |
| 66 | ${sbindir}/dmsetup \ |
| 67 | ${sbindir}/dmstats \ |
| 68 | " |
| 69 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 70 | FILES:${PN} += " \ |
Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 71 | ${libdir}/device-mapper/*.so \ |
| 72 | ${systemd_system_unitdir}/lvm2-pvscan@.service \ |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 73 | ${PYTHON_SITEPACKAGES_DIR}/lvmdbusd \ |
| 74 | ${datadir}/dbus-1/system-services/com.redhat.lvmdbus1.service \ |
Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 75 | " |
| 76 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 77 | FILES:${PN}-scripts = " \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 78 | ${sbindir}/blkdeactivate \ |
| 79 | ${sbindir}/fsadm \ |
| 80 | ${sbindir}/lvmconf \ |
| 81 | ${sbindir}/lvmdump \ |
| 82 | " |
| 83 | # Specified explicitly for the udev rules, just in case that it does not get picked |
| 84 | # up automatically: |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 85 | FILES:${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d" |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 86 | RDEPENDS:${PN} = "bash" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 87 | RDEPENDS:${PN}-udevrules = "libdevmapper" |
| 88 | RDEPENDS:${PN}:append:class-target = " libdevmapper" |
| 89 | RDEPENDS:${PN}:append:class-nativesdk = " libdevmapper" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 90 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 91 | RDEPENDS:${PN}-scripts = "${PN} (= ${EXTENDPKGV}) \ |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 92 | bash \ |
| 93 | util-linux-lsblk \ |
| 94 | util-linux-findmnt \ |
| 95 | coreutils \ |
| 96 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 97 | RRECOMMENDS:${PN}:class-target = "${PN}-scripts (= ${EXTENDPKGV})" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 98 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 99 | CONFFILES:${PN} += "${sysconfdir}/lvm/lvm.conf" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 100 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 101 | SYSROOT_PREPROCESS_FUNCS:append = " remove_libdevmapper_sysroot_preprocess" |
Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 102 | remove_libdevmapper_sysroot_preprocess() { |
| 103 | rm -f ${SYSROOT_DESTDIR}${libdir}/libdevmapper.so* \ |
| 104 | ${SYSROOT_DESTDIR}${sbindir}/dmsetup \ |
| 105 | ${SYSROOT_DESTDIR}${sbindir}/dmstats \ |
| 106 | ${SYSROOT_DESTDIR}${includedir}/libdevmapper.h \ |
| 107 | ${SYSROOT_DESTDIR}${libdir}/pkgconfig/devmapper.pc |
| 108 | } |
| 109 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 110 | BBCLASSEXTEND = "native nativesdk" |