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 | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 4 | file://0001-dev-hdc-open-failed-No-medium-found-will-print-out-i.patch \ |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 5 | file://0001-fix-command-bin-findmnt-bin-lsblk-bin-sort-not-found.patch \ |
Brad Bishop | 00ab237 | 2019-10-14 11:06:18 -0400 | [diff] [blame] | 6 | file://0001-udev-remove-unsupported-OPTIONS-event_timeout-rule.patch \ |
Brad Bishop | 6a62e0e | 2019-10-21 08:11:42 -0400 | [diff] [blame] | 7 | file://0001-activation-add-synchronization-point.patch \ |
| 8 | file://0002-activation-extend-handling-of-pending_delete.patch \ |
| 9 | file://0003-snapshot-always-activate.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 10 | " |
| 11 | |
| 12 | DEPENDS += "autoconf-archive-native" |
| 13 | |
| 14 | inherit multilib_script |
| 15 | |
| 16 | MULTILIB_SCRIPTS = "${PN}:${sysconfdir}/lvm/lvm.conf" |
| 17 | |
| 18 | CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe" |
| 19 | |
| 20 | do_install_append() { |
| 21 | # Install machine specific configuration file |
| 22 | install -d ${D}${sysconfdir}/lvm |
| 23 | install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf |
| 24 | sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf |
| 25 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 26 | oe_runmake 'DESTDIR=${D}' install install_systemd_units |
| 27 | sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service |
| 28 | else |
| 29 | oe_runmake 'DESTDIR=${D}' install install_initscripts |
| 30 | mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d |
| 31 | rm -rf ${D}${sysconfdir}/rc.d |
| 32 | fi |
| 33 | } |
| 34 | |
| 35 | PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules" |
| 36 | |
| 37 | SYSTEMD_PACKAGES = "${PN}" |
| 38 | SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \ |
| 39 | blk-availability.service lvm2-pvscan@.service" |
| 40 | SYSTEMD_AUTO_ENABLE = "disable" |
| 41 | |
| 42 | TARGET_CC_ARCH += "${LDFLAGS}" |
| 43 | |
| 44 | EXTRA_OECONF_append_class-nativesdk = " --with-confdir=${sysconfdir}" |
| 45 | |
Brad Bishop | 665fd02 | 2019-08-26 01:32:28 -0400 | [diff] [blame] | 46 | DEPENDS += "util-linux" |
| 47 | LVM2_PACKAGECONFIG_append_class-target = " \ |
| 48 | udev \ |
| 49 | " |
Brad Bishop | 36a3e3e | 2019-10-02 13:29:27 -0400 | [diff] [blame] | 50 | 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] | 51 | |
Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 52 | PACKAGES =+ "libdevmapper" |
| 53 | FILES_libdevmapper = " \ |
| 54 | ${libdir}/libdevmapper.so.* \ |
| 55 | ${sbindir}/dmsetup \ |
| 56 | ${sbindir}/dmstats \ |
| 57 | " |
| 58 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 59 | FILES_${PN} += "${libdir}/device-mapper/*.so" |
| 60 | FILES_${PN}-scripts = " \ |
| 61 | ${sbindir}/blkdeactivate \ |
| 62 | ${sbindir}/fsadm \ |
| 63 | ${sbindir}/lvmconf \ |
| 64 | ${sbindir}/lvmdump \ |
| 65 | " |
| 66 | # Specified explicitly for the udev rules, just in case that it does not get picked |
| 67 | # up automatically: |
| 68 | FILES_${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 69 | RDEPENDS_${PN}-udevrules = "libdevmapper" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 70 | RDEPENDS_${PN}_append_class-target = " libdevmapper" |
| 71 | RDEPENDS_${PN}_append_class-nativesdk = " libdevmapper" |
| 72 | |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 73 | RDEPENDS_${PN}-scripts = "${PN} (= ${EXTENDPKGV}) \ |
| 74 | bash \ |
| 75 | util-linux-lsblk \ |
| 76 | util-linux-findmnt \ |
| 77 | coreutils \ |
| 78 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 79 | RRECOMMENDS_${PN}_class-target = "${PN}-scripts (= ${EXTENDPKGV})" |
| 80 | |
| 81 | CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf" |
| 82 | |
Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 83 | SYSROOT_PREPROCESS_FUNCS_append = " remove_libdevmapper_sysroot_preprocess" |
| 84 | remove_libdevmapper_sysroot_preprocess() { |
| 85 | rm -f ${SYSROOT_DESTDIR}${libdir}/libdevmapper.so* \ |
| 86 | ${SYSROOT_DESTDIR}${sbindir}/dmsetup \ |
| 87 | ${SYSROOT_DESTDIR}${sbindir}/dmstats \ |
| 88 | ${SYSROOT_DESTDIR}${includedir}/libdevmapper.h \ |
| 89 | ${SYSROOT_DESTDIR}${libdir}/pkgconfig/devmapper.pc |
| 90 | } |
| 91 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 92 | BBCLASSEXTEND = "native nativesdk" |