Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | require lvm2.inc |
| 2 | |
| 3 | SRCREV = "913c28917e62577a2ef67152b2e5159237503dda" |
| 4 | |
Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 5 | SRC_URI += " \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 6 | 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] | 7 | 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^] | 8 | file://0001-udev-remove-unsupported-OPTIONS-event_timeout-rule.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 9 | " |
| 10 | |
| 11 | DEPENDS += "autoconf-archive-native" |
| 12 | |
| 13 | inherit multilib_script |
| 14 | |
| 15 | MULTILIB_SCRIPTS = "${PN}:${sysconfdir}/lvm/lvm.conf" |
| 16 | |
| 17 | CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe" |
| 18 | |
| 19 | do_install_append() { |
| 20 | # Install machine specific configuration file |
| 21 | install -d ${D}${sysconfdir}/lvm |
| 22 | install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf |
| 23 | sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf |
| 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 |
| 32 | } |
| 33 | |
| 34 | PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules" |
| 35 | |
| 36 | SYSTEMD_PACKAGES = "${PN}" |
| 37 | SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \ |
| 38 | blk-availability.service lvm2-pvscan@.service" |
| 39 | SYSTEMD_AUTO_ENABLE = "disable" |
| 40 | |
| 41 | TARGET_CC_ARCH += "${LDFLAGS}" |
| 42 | |
| 43 | EXTRA_OECONF_append_class-nativesdk = " --with-confdir=${sysconfdir}" |
| 44 | |
Brad Bishop | 665fd02 | 2019-08-26 01:32:28 -0400 | [diff] [blame] | 45 | DEPENDS += "util-linux" |
| 46 | LVM2_PACKAGECONFIG_append_class-target = " \ |
| 47 | udev \ |
| 48 | " |
Brad Bishop | 36a3e3e | 2019-10-02 13:29:27 -0400 | [diff] [blame] | 49 | 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] | 50 | |
Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 51 | PACKAGES =+ "libdevmapper" |
| 52 | FILES_libdevmapper = " \ |
| 53 | ${libdir}/libdevmapper.so.* \ |
| 54 | ${sbindir}/dmsetup \ |
| 55 | ${sbindir}/dmstats \ |
| 56 | " |
| 57 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 58 | FILES_${PN} += "${libdir}/device-mapper/*.so" |
| 59 | FILES_${PN}-scripts = " \ |
| 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: |
| 67 | FILES_${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 68 | RDEPENDS_${PN}-udevrules = "libdevmapper" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 69 | RDEPENDS_${PN}_append_class-target = " libdevmapper" |
| 70 | RDEPENDS_${PN}_append_class-nativesdk = " libdevmapper" |
| 71 | |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 72 | RDEPENDS_${PN}-scripts = "${PN} (= ${EXTENDPKGV}) \ |
| 73 | bash \ |
| 74 | util-linux-lsblk \ |
| 75 | util-linux-findmnt \ |
| 76 | coreutils \ |
| 77 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 78 | RRECOMMENDS_${PN}_class-target = "${PN}-scripts (= ${EXTENDPKGV})" |
| 79 | |
| 80 | CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf" |
| 81 | |
Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame] | 82 | SYSROOT_PREPROCESS_FUNCS_append = " remove_libdevmapper_sysroot_preprocess" |
| 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" |