systemd-systemctl-native: Add additional messages for better debugging
PATCH v2 1/4 systemd-systemctl-native: Add additional messages for better debugging
These messages helped me to fix the breakage of networkmanager/systemd
--- .../systemd/systemd-systemctl-native.bb | 2 +- .../systemd/systemd-systemctl-native/systemctl | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-)
meta-oe/recipes-core/systemd/systemd-systemctl-native.bb +1 -1
@@ -3,7 +3,7 @@ DESCRIPTION = "Wrapper to enable of systemd services" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" -PR = "r2" +PR = "r3" inherit native
meta-oe/recipes-core/systemd/systemd-systemctl-native/systemctl +5 -0
@@ -1,4 +1,5 @@ #!/bin/sh +echo "Started $0 $*" ROOT=
@@ -42,6 +43,7 @@ while [ $# != 0 ]; do done for service in $services; do + echo "Try to find location of $service..." # find service file for p in $ROOT/etc/systemd/system \ $ROOT/lib/systemd/system \
@@ -55,6 +57,7 @@ for service in $services; do echo "'$service' couldn't be found; exiting with error" exit 1 fi + echo "Found $service in $service_file" # create the required symbolic links wanted_by=$(grep WantedBy $ROOT/$service_file \
@@ -63,6 +66,7 @@ for service in $services; do | grep '\.target$') for r in $wanted_by; do + echo "WantedBy=$r found in $service" if [ "$action" = "enable" ]; then mkdir -p $ROOT/etc/systemd/system/$r.wants ln -s $service_file $ROOT/etc/systemd/system/$r.wants
@@ -79,6 +83,7 @@ for service in $services; do | sed 's,Also=,,g' \ | tr ',' '\n') for a in $also; do + echo "Also=$a found in $service" if [ "$action" = "enable" ]; then $0 --root=$ROOT enable $a fi
Signature · 1 line
1.7.4.4
PATCH v2 2/4 systemd.bbclass: remove unused code
--- meta-oe/classes/systemd.bbclass | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
meta-oe/classes/systemd.bbclass +0 -5
@@ -54,11 +54,6 @@ def systemd_after_parse(d): "\n\n%s: %s in SYSTEMD_PACKAGES does not match <existing-package>-systemd or ${PN} (deprecated)" % \ ( bb_filename, pkg_systemd) - # check SYSTEMD_SERVICE - for pkg_systemd in systemd_pkgs.split(): - service_pkg = 'SYSTEMD_SERVICE' + "_" + pkg_systemd - systemd_services = d.getVar(service_pkg, 1) or d.getVar('SYSTEMD_SERVICE', 1) or "" - # prepend systemd-packages not already included def systemd_create_package(pkg_systemd): packages = d.getVar('PACKAGES', 1)
Signature · 1 line
1.7.4.4
PATCH v2 3/4 systemd.bbclass: extract SYSTEMD_SERVICE properly
In reply to Andreas MüllerTo set service files the following syntax is allowed:
SYSTEMD_SERVICE = <service_file>
or
SYSTEMD_SERVICE_{<systemd_package_name>} = <service_file>
A function get_package_var was introduced to handle all use-cases [1] properly.
Build tested / buildhistory checks
[1] http://lists.linuxtogo.org/pipermail/openembedded-devel/2012-May/039870.html
--- meta-oe/classes/systemd.bbclass | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
meta-oe/classes/systemd.bbclass +9 -5
@@ -24,6 +24,12 @@ systemd_postrm() { systemctl disable ${SYSTEMD_SERVICE} } +def get_package_var(d, var, pkg): + val = (d.getVar('%s_%s' % (var, pkg), d, 1) or "").strip() + if val == "": + val = (d.getVar(var, d, 1) or "").strip() + return val + def systemd_after_parse(d): def systemd_check_vars(): if d.getVar('BB_WORKERCONTEXT', True) is not None:
@@ -155,8 +161,7 @@ python populate_packages_prepend () { systemd_packages = d.getVar('SYSTEMD_PACKAGES', 1) has_exactly_one_service = len(systemd_packages.split()) == 1 if has_exactly_one_service: - systemd_services = d.getVar('SYSTEMD_SERVICE' + "_" + systemd_packages, 1) or d.getVar('SYSTEMD_SERVICE', 1) - has_exactly_one_service = len(systemd_services.split()) == 1 + has_exactly_one_service = len(get_package_var(d, 'SYSTEMD_SERVICE', systemd_packages)) == 1 keys = 'Also' # Conflicts?? if has_exactly_one_service:
@@ -164,8 +169,7 @@ python populate_packages_prepend () { keys = 'Also Conflicts' # scan for all in SYSTEMD_SERVICE[] for pkg_systemd in systemd_packages.split(): - systemd_services = d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1) or d.getVar('SYSTEMD_SERVICE', 1) - for service in systemd_services.split(): + for service in get_package_var(d, 'SYSTEMD_SERVICE', pkg_systemd).split(): path_found = '' for path in searchpaths.split(): if os.path.exists('${D}' + path + service):
@@ -196,7 +200,7 @@ python populate_packages_prepend () { # run all modifications once when creating package if os.path.exists('${D}'): for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split(): - if d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1) and d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1).strip(): + if get_package_var(d, 'SYSTEMD_SERVICE', pkg_systemd) != "": systemd_generate_package_scripts(pkg_systemd) systemd_add_rdepends(pkg_systemd) systemd_check_services()
Signature · 1 line
1.7.4.4
Re: [meta-oe, v2 3/4] systemd.bbclass: extract SYSTEMD_SERVICE properly
Quoted 36 lines · Andreas Müller
To set service files the following syntax is allowed:
SYSTEMD_SERVICE= <service_file>
or
SYSTEMD_SERVICE_{<systemd_package_name>} = <service_file>A function
get_package_varwas introduced to handle all use-cases [1] properly.Build tested / buildhistory checks
[1] http://lists.linuxtogo.org/pipermail/openembedded-devel/2012-May/039870.html
Signed-off-by Andreas Müller <[email protected]>--- meta-oe/classes/systemd.bbclass | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)meta-oe/classes/systemd.bbclass +6
-0@@ -24,6 +24,12 @@ systemd_postrm() { systemctl disable ${SYSTEMD_SERVICE} } +def get_package_var(d, var, pkg): + val = (d.getVar('%s_%s' % (var, pkg), d, 1) or "").strip() + if val == "": + val = (d.getVar(var, d, 1) or "").strip() + return val + def systemd_after_parse(d): def systemd_check_vars(): if d.getVar('BB_WORKERCONTEXT', True) is not None:
meta-oe/classes/systemd.bbclass python populate_packages_prepend () { · line 164
Quoted 6 lines
meta-oe/classes/systemd.bbclass +1
-2@@ -155,8 +161,7 @@ python populate_packages_prepend () { systemd_packages = d.getVar('SYSTEMD_PACKAGES', 1) has_exactly_one_service = len(systemd_packages.split()) == 1 if has_exactly_one_service: - systemd_services = d.getVar('SYSTEMD_SERVICE' + "_" + systemd_packages, 1) or d.getVar('SYSTEMD_SERVICE', 1) - has_exactly_one_service = len(systemd_services.split()) == 1 + has_exactly_one_service = len(get_package_var(d, 'SYSTEMD_SERVICE', systemd_packages)) == 1
^ isn't split() still needed here?
Quoted 30 lines
meta-oe/classes/systemd.bbclass +2
-3keys = 'Also' # Conflicts?? if has_exactly_one_service:@@ -164,8 +169,7 @@ python populate_packages_prepend () { keys = 'Also Conflicts' # scan for all in SYSTEMD_SERVICE[] for pkg_systemd in systemd_packages.split(): - systemd_services = d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1) or d.getVar('SYSTEMD_SERVICE', 1) - for service in systemd_services.split(): + for service in get_package_var(d, 'SYSTEMD_SERVICE', pkg_systemd).split(): path_found = '' for path in searchpaths.split(): if os.path.exists('${D}' + path + service):@@ -196,7 +200,7 @@ python populate_packages_prepend () { # run all modifications once when creating package if os.path.exists('${D}'): for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split(): - if d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1) and d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1).strip(): + if get_package_var(d, 'SYSTEMD_SERVICE', pkg_systemd) != "": systemd_generate_package_scripts(pkg_systemd) systemd_add_rdepends(pkg_systemd) systemd_check_services()Signature · 7 lines
1.7.4.4 _______________________________________________ Openembedded-devel mailing list [email protected] http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Re: [meta-oe, v2 3/4] systemd.bbclass: extract SYSTEMD_SERVICE properly
Quoted 4 lines · Martin Jansa
Quoted 2 lines
-
has_exactly_one_service= len(systemd_services.split()) == 1
+has_exactly_one_service=len(get_package_var(d, 'SYSTEMD_SERVICE', systemd_packages))== 1^ isn't
split()still needed here?
Uhh - this would have broken the /dev/null links - thanks. Hope to do better next time. What concerns me is that I did not see that in buildhistory. Will check that first before sending out V3.
Andreas
Re: [meta-oe, v2 3/4] systemd.bbclass: extract SYSTEMD_SERVICE properly
Quoted 9 lines · Andreas Müller
Quoted 4 lines · Martin Jansa
Quoted 2 lines
-
has_exactly_one_service= len(systemd_services.split()) == 1
+has_exactly_one_service=len(get_package_var(d, 'SYSTEMD_SERVICE', systemd_packages))== 1^ isn't
split()still needed here?Uhh - this would have broken the
/dev/nulllinks - thanks. Hope to do better next time. What concerns me is that I did not see that in buildhistory. Will check that first before sending out V3.
Just if anybody is interested (and to prove that my buildhistory tests were OK :) AFAICS the only recipes affected would have been dropbear and openssh. These have the 'Conflicts' tag in the *.socket files. The *.service file are still dragged in since *.socket files add *.service automatically - there was something mentioned in systemd docs. So time to have short test on V3...
Andreas
PATCH v2 4/4 recipes: bump PR to fix -systemd postinsts where SYSTEMD_SERVICE was used without PN* suffix
In reply to Andreas MüllerFrom: Martin Jansa <[email protected]>
--- meta-efl/recipes-efl/efl/elsa_svn.bb | 2 ++ meta-gnome/recipes-gnome/gdm/gdm_2.32.2.bb | 2 +- meta-oe/recipes-bsp/keymaps/keymaps_1.0.bbappend | 2 +- .../cherokee/cherokee_1.2.98.bb | 2 +- .../recipes-connectivity/gateone/gateone_git.bb | 2 +- .../networkmanager/networkmanager_0.9.2.0.bb | 2 +- .../openssh/openssh_6.0p1.bbappend | 2 +- .../systemd/systemd-machine-units_1.0.bb | 2 ++ meta-oe/recipes-extended/rsyslog/rsyslog.inc | 2 +- .../xinput-calibrator/xinput-calibrator_0.7.5.bb | 2 +- meta-oe/recipes-navigation/gpsd/gpsd_3.4.bb | 2 ++ meta-oe/recipes-navigation/gpsd/gpsd_3.5.bb | 2 ++ meta-oe/recipes-navigation/gpsd/gpsd_git.bb | 2 ++ meta-oe/recipes-support/syslog-ng/syslog-ng.inc | 2 +- 14 files changed, 19 insertions(+), 9 deletions(-)
meta-efl/recipes-efl/efl/elsa_svn.bb +2 -0
@@ -4,6 +4,8 @@ LICENSE = "GPLv3+" LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" SECTION = "e/apps" +PR = "r1" + inherit e gettext SRC_URI = "${E_SVN}/trunk/PROTO;module=${SRCNAME};proto=http;scmdata=keep \ file://0001-pam-use-common-auth-instead-of-system-auth.patch \
meta-gnome/recipes-gnome/gdm/gdm_2.32.2.bb +1 -1
@@ -4,7 +4,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" DEPENDS = "xinput gnome-panel tcp-wrappers libcanberra libxklavier grep consolekit libpam gnome-doc-utils gtk+ xrdb" -PR = "r7" +PR = "r8" inherit gnome update-rc.d systemd
meta-oe/recipes-bsp/keymaps/keymaps_1.0.bbappend +1 -1
@@ -1,5 +1,5 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -PRINC := "${@int(PRINC) + 4}" +PRINC := "${@int(PRINC) + 5}" SRC_URI += " file://keymaps.service"
meta-oe/recipes-connectivity/cherokee/cherokee_1.2.98.bb +1 -1
@@ -5,7 +5,7 @@ SECTION = "network" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" -PR = "r3" +PR = "r4" DEPENDS = "libpcre openssl mysql5 ${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
meta-oe/recipes-connectivity/gateone/gateone_git.bb +1 -1
@@ -2,7 +2,7 @@ DESCRIPTION = "HTML5 (plugin-free) web-based terminal emulator and SSH client" LICENSE = "AGPLv3" LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=ee5b168fc7de89a0cadc49e27830aa2c" -PR = "r5" +PR = "r6" PV = "1.1" SRCREV = "bb74e1095adb66b04b51ed6ff10ae0aa96afdd46"
meta-oe/recipes-connectivity/networkmanager/networkmanager_0.9.2.0.bb +1 -1
@@ -4,7 +4,7 @@ SECTION = "net/misc" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=cbbffd568227ada506640fe950a4823b" -PR = "r5" +PR = "r6" DEPENDS = "systemd libnl dbus dbus-glib udev wireless-tools polkit gnutls util-linux ppp" inherit gnome gettext systemd
meta-oe/recipes-connectivity/openssh/openssh_6.0p1.bbappend +1 -1
@@ -1,6 +1,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -PRINC := "${@int(PRINC) + 1}" +PRINC := "${@int(PRINC) + 2}" SYSTEMD_PACKAGES = "openssh-sshd-systemd" SYSTEMD_SERVICE = "sshd.socket"
meta-oe/recipes-core/systemd/systemd-machine-units_1.0.bb +2 -0
@@ -5,6 +5,8 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3 PACKAGE_ARCH = "${MACHINE_ARCH}" +PR = "r1" + inherit systemd SYSTEMD_SERVICE = "" SYSTEMD_PACKAGES = "${PN}"
meta-oe/recipes-extended/rsyslog/rsyslog.inc +1 -1
@@ -4,7 +4,7 @@ HOMEPAGE = "http://www.rsyslog.com/" LICENSE = "GPLv3" LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973" -INC_PR = "r3" +INC_PR = "r4" SRC_URI = "http://www.rsyslog.com/files/download/rsyslog/${PN}-${PV}.tar.gz \ file://rsyslog.conf"
meta-oe/recipes-graphics/xinput-calibrator/xinput-calibrator_0.7.5.bb +1 -1
@@ -4,7 +4,7 @@ LICENSE = "MIT-X" LIC_FILES_CHKSUM = "file://src/calibrator.cpp;endline=22;md5=998e238a7638a7446eaeb02398f691fc" DEPENDS = "virtual/libx11 libxi" -PR = "r6" +PR = "r7" inherit autotools systemd
meta-oe/recipes-navigation/gpsd/gpsd_3.4.bb +2 -0
@@ -5,6 +5,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d217a23f408e91c94359447735bc1800" DEPENDS = "dbus dbus-glib ncurses python libusb1 chrpath-native" PROVIDES = "virtual/gpsd" +PR = "r1" + SRC_URI = "http://download.savannah.gnu.org/releases/${PN}/${P}.tar.gz \ file://0001-SConstruct-fix-DSO-build-for-ntpshm-garmin_monitor.patch \ file://0001-SConstruct-respect-sysroot-setting-when-prepending-L.patch \
meta-oe/recipes-navigation/gpsd/gpsd_3.5.bb +2 -0
@@ -5,6 +5,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d217a23f408e91c94359447735bc1800" DEPENDS = "dbus dbus-glib ncurses python libusb1" PROVIDES = "virtual/gpsd" +PR = "r1" + DEFAULT_PREFERENCE = "-1" SRC_URI = "http://download.savannah.gnu.org/releases/${PN}/${P}.tar.gz \ file://0001-SConstruct-respect-sysroot-setting-when-prepending-L.patch \
meta-oe/recipes-navigation/gpsd/gpsd_git.bb +2 -0
@@ -5,6 +5,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d217a23f408e91c94359447735bc1800" DEPENDS = "dbus dbus-glib ncurses python libusb1" PROVIDES = "virtual/gpsd" +PR = "r1" + SRCREV = "f8744f4af8cef211de698df5d8e6caddfe33f29d" DEFAULT_PREFERENCE = "-1"
meta-oe/recipes-support/syslog-ng/syslog-ng.inc +1 -1
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=7ec1bcc46f28b11f4722e20d9b7dd4d5" # update-rc.d and update-alternatives is important RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}" -INC_PR = "r7" +INC_PR = "r8" inherit autotools systemd
Signature · 1 line
1.7.4.4