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