2018-01-18 23:19:47 +00:00
|
|
|
require lvm2.inc
|
|
|
|
|
2020-11-02 16:01:58 +00:00
|
|
|
SRC_URI += " \
|
|
|
|
file://0001-fix-command-bin-findmnt-bin-lsblk-bin-sort-not-found.patch \
|
2019-01-15 17:34:27 +00:00
|
|
|
"
|
2018-01-18 23:19:47 +00:00
|
|
|
|
|
|
|
DEPENDS += "autoconf-archive-native"
|
|
|
|
|
2019-01-15 17:34:27 +00:00
|
|
|
inherit multilib_script
|
|
|
|
|
|
|
|
MULTILIB_SCRIPTS = "${PN}:${sysconfdir}/lvm/lvm.conf"
|
|
|
|
|
2018-01-18 23:19:47 +00:00
|
|
|
CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
|
|
|
|
|
2022-05-28 15:20:07 +00:00
|
|
|
do_install:append() {
|
2018-01-18 23:19:47 +00:00
|
|
|
# Install machine specific configuration file
|
|
|
|
install -d ${D}${sysconfdir}/lvm
|
|
|
|
install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf
|
|
|
|
sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf
|
|
|
|
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
|
|
|
|
oe_runmake 'DESTDIR=${D}' install install_systemd_units
|
|
|
|
sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service
|
|
|
|
else
|
|
|
|
oe_runmake 'DESTDIR=${D}' install install_initscripts
|
|
|
|
mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
|
|
|
|
rm -rf ${D}${sysconfdir}/rc.d
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules"
|
|
|
|
|
|
|
|
SYSTEMD_PACKAGES = "${PN}"
|
2022-05-28 15:20:07 +00:00
|
|
|
SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \
|
2018-01-18 23:19:47 +00:00
|
|
|
blk-availability.service"
|
|
|
|
SYSTEMD_AUTO_ENABLE = "disable"
|
|
|
|
|
|
|
|
TARGET_CC_ARCH += "${LDFLAGS}"
|
|
|
|
|
2022-05-28 15:20:07 +00:00
|
|
|
EXTRA_OECONF:append:class-nativesdk = " --with-confdir=${sysconfdir}"
|
2019-01-15 17:34:27 +00:00
|
|
|
|
2020-11-02 16:01:58 +00:00
|
|
|
DEPENDS += "util-linux"
|
2022-05-28 15:20:07 +00:00
|
|
|
LVM2_PACKAGECONFIG:append:class-target = " \
|
2020-11-02 16:01:58 +00:00
|
|
|
udev \
|
|
|
|
"
|
|
|
|
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"
|
|
|
|
|
|
|
|
PACKAGES =+ "libdevmapper"
|
2022-05-28 15:20:07 +00:00
|
|
|
FILES:libdevmapper = " \
|
2020-11-02 16:01:58 +00:00
|
|
|
${libdir}/libdevmapper.so.* \
|
|
|
|
${sbindir}/dmsetup \
|
|
|
|
${sbindir}/dmstats \
|
|
|
|
"
|
|
|
|
|
2022-05-28 15:20:07 +00:00
|
|
|
FILES:${PN} += " \
|
2020-11-02 16:01:58 +00:00
|
|
|
${libdir}/device-mapper/*.so \
|
|
|
|
${systemd_system_unitdir}/lvm2-pvscan@.service \
|
|
|
|
"
|
|
|
|
|
2022-05-28 15:20:07 +00:00
|
|
|
FILES:${PN}-scripts = " \
|
2018-01-18 23:19:47 +00:00
|
|
|
${sbindir}/blkdeactivate \
|
|
|
|
${sbindir}/fsadm \
|
|
|
|
${sbindir}/lvmconf \
|
|
|
|
${sbindir}/lvmdump \
|
|
|
|
"
|
|
|
|
# Specified explicitly for the udev rules, just in case that it does not get picked
|
|
|
|
# up automatically:
|
2022-05-28 15:20:07 +00:00
|
|
|
FILES:${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d"
|
|
|
|
RDEPENDS:${PN}-udevrules = "libdevmapper"
|
|
|
|
RDEPENDS:${PN}:append:class-target = " libdevmapper"
|
|
|
|
RDEPENDS:${PN}:append:class-nativesdk = " libdevmapper"
|
2018-01-18 23:19:47 +00:00
|
|
|
|
2022-05-28 15:20:07 +00:00
|
|
|
RDEPENDS:${PN}-scripts = "${PN} (= ${EXTENDPKGV}) \
|
2020-11-02 16:01:58 +00:00
|
|
|
bash \
|
|
|
|
util-linux-lsblk \
|
|
|
|
util-linux-findmnt \
|
|
|
|
coreutils \
|
|
|
|
"
|
2022-05-28 15:20:07 +00:00
|
|
|
RRECOMMENDS:${PN}:class-target = "${PN}-scripts (= ${EXTENDPKGV})"
|
2018-01-18 23:19:47 +00:00
|
|
|
|
2022-05-28 15:20:07 +00:00
|
|
|
CONFFILES:${PN} += "${sysconfdir}/lvm/lvm.conf"
|
2018-01-18 23:19:47 +00:00
|
|
|
|
2022-05-28 15:20:07 +00:00
|
|
|
SYSROOT_PREPROCESS_FUNCS:append = " remove_libdevmapper_sysroot_preprocess"
|
2020-11-02 16:01:58 +00:00
|
|
|
remove_libdevmapper_sysroot_preprocess() {
|
|
|
|
rm -f ${SYSROOT_DESTDIR}${libdir}/libdevmapper.so* \
|
|
|
|
${SYSROOT_DESTDIR}${sbindir}/dmsetup \
|
|
|
|
${SYSROOT_DESTDIR}${sbindir}/dmstats \
|
|
|
|
${SYSROOT_DESTDIR}${includedir}/libdevmapper.h \
|
|
|
|
${SYSROOT_DESTDIR}${libdir}/pkgconfig/devmapper.pc
|
|
|
|
}
|
|
|
|
|
2018-01-18 23:19:47 +00:00
|
|
|
BBCLASSEXTEND = "native nativesdk"
|