summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/dpkg/dpkg.inc
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-01-24 04:47:37 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-28 00:52:35 +0000
commitb3bb9c770b17be4f7e1e424e0d0ec00ebe5bfb62 (patch)
treef39fa8bcff48a112968daf3d42388bb64337a5ff /meta/recipes-devtools/dpkg/dpkg.inc
parent1ec04bb2154cbaf5ff335c873a666f8bb9c0807e (diff)
downloadpoky-b3bb9c770b17be4f7e1e424e0d0ec00ebe5bfb62.tar.gz
dpkg: use systemd service for first boot configuration
Use a systemd service file for first boot configuration for dpkg based images which has 'package-management' in its IMAGE_FEATURES. [YOCTO #5719] (From OE-Core rev: 56490921d267b784118df43cbd107925c8b94200) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/dpkg/dpkg.inc')
-rw-r--r--meta/recipes-devtools/dpkg/dpkg.inc21
1 files changed, 19 insertions, 2 deletions
diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index 0ccfd74f54..044a8eb5d3 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -14,7 +14,13 @@ S = "${WORKDIR}/${BPN}-${PV}"
14 14
15PARALLEL_MAKE = "" 15PARALLEL_MAKE = ""
16 16
17inherit autotools gettext perlnative pkgconfig 17inherit autotools gettext perlnative pkgconfig systemd
18
19python () {
20 if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
21 pn = d.getVar('PN', True)
22 d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'dpkg-configure.service')
23}
18 24
19export PERL = "${bindir}/perl" 25export PERL = "${bindir}/perl"
20PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl" 26PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
@@ -48,11 +54,22 @@ do_install_append () {
48 mv ${D}${bindir}/update-alternatives ${D}${sbindir} 54 mv ${D}${bindir}/update-alternatives ${D}${sbindir}
49 sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-* 55 sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-*
50 fi 56 fi
57
58 if ${@base_contains('DISTRO_FEATURES','sysvinit','false','true',d)};then
59 install -d ${D}${systemd_unitdir}/system
60 install -m 0644 ${WORKDIR}/dpkg-configure.service ${D}${systemd_unitdir}/system/
61 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
62 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
63 -e 's,@BINDIR@,${bindir},g' \
64 -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
65 ${D}${systemd_unitdir}/system/dpkg-configure.service
66 fi
51} 67}
52 68
53pkg_postinst_${PN} () { 69pkg_postinst_${PN} () {
54#!/bin/sh 70#!/bin/sh
55if [ "x$D" != "x" ] && [ -f $D/var/lib/dpkg/status ]; then 71if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)} && \
72 [ "x$D" != "x" ] && [ -f $D/var/lib/dpkg/status ]; then
56 install -d $D${sysconfdir}/rcS.d 73 install -d $D${sysconfdir}/rcS.d
57 74
58 # this happens at S98 where our good 'ole packages script used to run 75 # this happens at S98 where our good 'ole packages script used to run