mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-05-09 17:59:26 +00:00
lvm2: install initscript or systemd unit service conditionally
Issue: LIN8-854 install systemd unit files and modify them only when DISTRO_FEATURE systemd is enabled, otherwise do_install failed due to no blk-availability.service file sed: can't read tmp/work/armv5e-wrs-linux-gnueabi/lvm2/2.02.125-r0/image/lib/systemd/system/blk-availability.service: No such file or directory install the initscript when init is not systemd Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
@@ -39,8 +39,14 @@ do_install_append() {
|
||||
# Install machine specific configuration file
|
||||
install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf
|
||||
sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf
|
||||
oe_runmake 'DESTDIR=${D}' install install_systemd_units
|
||||
sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_unitdir}/system/blk-availability.service
|
||||
if ${@base_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_unitdir}/system/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
|
||||
}
|
||||
|
||||
SYSTEMD_PACKAGES = "${PN}"
|
||||
|
||||
Reference in New Issue
Block a user