diff options
| author | Andreas Oberritter <obi@opendreambox.org> | 2012-05-16 16:56:01 +0000 |
|---|---|---|
| committer | Koen Kooi <koen@dominion.thruhere.net> | 2012-05-17 09:37:57 +0200 |
| commit | 637cb7e3d2cfdc74d239a4257e6f3477aa17da4e (patch) | |
| tree | 0b4ee59e6920fccf2ecec9bc068f44131e1abf81 /meta-oe/classes | |
| parent | 08dbadf9541f0e2e4ca5c8def8b9dfc9dacb5960 (diff) | |
| download | meta-openembedded-637cb7e3d2cfdc74d239a4257e6f3477aa17da4e.tar.gz | |
systemd.bbclass: drop postrm, use prerm instead
* Calling "systemctl disable" from postrm is too late and
causes the following error:
| Failed to issue method call: No such file or directory
* Messing with $D is not needed in *rm scripts.
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/classes')
| -rw-r--r-- | meta-oe/classes/systemd.bbclass | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass index db35717f63..1edd1e4079 100644 --- a/meta-oe/classes/systemd.bbclass +++ b/meta-oe/classes/systemd.bbclass | |||
| @@ -15,12 +15,7 @@ fi | |||
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | systemd_prerm() { | 17 | systemd_prerm() { |
| 18 | if [ -z "$D" ]; then | 18 | systemctl stop ${SYSTEMD_SERVICE} |
| 19 | systemctl stop ${SYSTEMD_SERVICE} | ||
| 20 | fi | ||
| 21 | } | ||
| 22 | |||
| 23 | systemd_postrm() { | ||
| 24 | systemctl disable ${SYSTEMD_SERVICE} | 19 | systemctl disable ${SYSTEMD_SERVICE} |
| 25 | } | 20 | } |
| 26 | 21 | ||
| @@ -93,7 +88,7 @@ do_install_append() { | |||
| 93 | 88 | ||
| 94 | python populate_packages_prepend () { | 89 | python populate_packages_prepend () { |
| 95 | def systemd_generate_package_scripts(pkg): | 90 | def systemd_generate_package_scripts(pkg): |
| 96 | bb.debug(1, 'adding systemd calls to postinst/postrm for %s' % pkg) | 91 | bb.debug(1, 'adding systemd calls to postinst/prerm for %s' % pkg) |
| 97 | localdata = bb.data.createCopy(d) | 92 | localdata = bb.data.createCopy(d) |
| 98 | overrides = bb.data.getVar("OVERRIDES", localdata, 1) | 93 | overrides = bb.data.getVar("OVERRIDES", localdata, 1) |
| 99 | bb.data.setVar("OVERRIDES", "%s:%s" % (pkg, overrides), localdata) | 94 | bb.data.setVar("OVERRIDES", "%s:%s" % (pkg, overrides), localdata) |
| @@ -116,12 +111,6 @@ python populate_packages_prepend () { | |||
| 116 | prerm += bb.data.getVar('systemd_prerm', localdata, 1) | 111 | prerm += bb.data.getVar('systemd_prerm', localdata, 1) |
| 117 | bb.data.setVar('pkg_prerm_%s' % pkg, prerm, d) | 112 | bb.data.setVar('pkg_prerm_%s' % pkg, prerm, d) |
| 118 | 113 | ||
| 119 | postrm = bb.data.getVar('pkg_postrm', localdata, 1) | ||
| 120 | if not postrm: | ||
| 121 | postrm = '#!/bin/sh\n' | ||
| 122 | postrm += bb.data.getVar('systemd_postrm', localdata, 1) | ||
| 123 | bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d) | ||
| 124 | |||
| 125 | # add files to FILES_*-systemd if existent and not already done | 114 | # add files to FILES_*-systemd if existent and not already done |
| 126 | def systemd_append_file(pkg_systemd, file_append): | 115 | def systemd_append_file(pkg_systemd, file_append): |
| 127 | appended = False | 116 | appended = False |
