]> code.ossystems Code Review - openembedded-core.git/commitdiff
update-rc.d.bbclass: adjust order on tweaking postinst
authorKevin Tian <kevin.tian@intel.com>
Sat, 14 Aug 2010 04:14:23 +0000 (12:14 +0800)
committerRichard Purdie <rpurdie@linux.intel.com>
Tue, 17 Aug 2010 21:57:33 +0000 (22:57 +0100)
So far unlike prerm/postrm, update-rc.d has its own postinst method prepended
to pkg_postinst, which may result "System startup links for xxx already exist"
warning in the 1st boot of target image. Some pkg_postinst requires to run on
the target, and thus prepend here makes update-rc.d method executed twice: one
in rootfs creation and the other in the 1st target boot. So adjust the order
to append.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
meta/classes/update-rc.d.bbclass

index 0c648edb4d1a1d7d83eab51e075acb0fd659f682..57137c60b4c84d78be82c3c5711ad0ef12811fcc 100644 (file)
@@ -44,18 +44,23 @@ python populate_packages_prepend () {
                bb.data.setVar("OVERRIDES", "%s:%s" % (pkg, overrides), localdata)
                bb.data.update_data(localdata)
 
-               postinst = '#!/bin/sh\n'
+               """
+               update_rc.d postinst is appended here because pkg_postinst may require to
+               execute on the target. Not doing so may cause update_rc.d postinst invoked
+               twice to cause unwanted warnings.
+               """ 
+               postinst = bb.data.getVar('pkg_postinst', localdata, 1)
+               if not postinst:
+                       postinst = '#!/bin/sh\n'
                postinst += bb.data.getVar('updatercd_postinst', localdata, 1)
-               try:
-                       postinst += bb.data.getVar('pkg_postinst', localdata, 1)
-               except:
-                       pass
                bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
+
                prerm = bb.data.getVar('pkg_prerm', localdata, 1)
                if not prerm:
                        prerm = '#!/bin/sh\n'
                prerm += bb.data.getVar('updatercd_prerm', localdata, 1)
                bb.data.setVar('pkg_prerm_%s' % pkg, prerm, d)
+
                postrm = bb.data.getVar('pkg_postrm', localdata, 1)
                if not postrm:
                        postrm = '#!/bin/sh\n'