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