]> code.ossystems Code Review - openembedded-core.git/commitdiff
update-alternatives.bbclass: refuse to manage SysV init scripts
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Mon, 5 Dec 2016 11:35:16 +0000 (13:35 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 2 Dec 2017 11:24:36 +0000 (11:24 +0000)
Sanity check for future packages.

[YOCTO #10944]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
meta/classes/update-alternatives.bbclass

index 65cae7002ffa5dfe5526be6e35a0d7bcc8172f53..aa01058cf99dec86d5503d66a8dfb09c1a560844 100644 (file)
@@ -143,6 +143,10 @@ python perform_packagecopy_append () {
             if not alt_link:
                 alt_link = "%s/%s" % (d.getVar('bindir'), alt_name)
                 d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link)
+            if alt_link.startswith(os.path.join(d.getVar('sysconfdir', True), 'init.d')):
+                # Managing init scripts does not work (bug #10433), foremost
+                # because of a race with update-rc.d
+                bb.fatal("Using update-alternatives for managing SysV init scripts is not supported")
 
             alt_target   = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name)
             alt_target   = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or d.getVar('ALTERNATIVE_TARGET') or alt_link