Skip to contentSkip to conversation

sstate.bbclass: sstate_hardcode_path(): fix for multilib

PATCH New Robert Yang 1 participant 3 messages Oct 23, 2017

lore
Share & tools
lore
#0 lore raw

cover sstate.bbclass: sstate_hardcode_path(): fix for multilib

The following changes since commit 3b413a80578caacd9a7f405f3c51a3921d78a60d:

README.qemu: qemuppc64 is not supported (2017-10-16 23:54:27 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/2ssfixes
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/2ssfixes

Robert Yang (2):
useradd.bbclass: print a warn when useradd not found sstate.bbclass: sstate_hardcode_path(): fix for multilib

 meta/classes/sstate.bbclass  | 6 +++---
 meta/classes/useradd.bbclass | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 useradd.bbclass: print a warn when useradd not found

Exit quietly makes it very hard for debugging when user is not added as expected, print a warning helps a lot.

---
 meta/classes/useradd.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes/useradd.bbclass +1 -0
index c9103cb..124becd 100644
@@ -118,6 +118,7 @@ useradd_sysroot () {
 	# useradd/groupadd tools are unavailable. If there is no dependency, we assume we don't want to
 	# create users in the sysroot
 	if ! command -v useradd; then
+		bbwarn "command useradd not found!"
 		exit 0
 	fi
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 sstate.bbclass: sstate_hardcode_path(): fix for multilib

In reply to Robert Yang

It only substituted staging_target for target recipe which didn't work for multilib, for example, postinst-useradd-lib32-polkit:

* No multilib:
PATH=/path/to/tmp-glibc/work/core2-64-wrs-linux/polkit/0.113-r0/recipe-sysroot-native/bin It would be substituted to:
FIXMESTAGINGDIRTARGET-native/bin
Not the funny "-native/bin", this works well.

* When multilib:
PATH=/path/to/tmp-glibc/work/core2-32-wrsmllib32-linux/lib32-polkit/0.113-r0/recipe-sysroot-native/bin Now staging_target endswith "/lib32-recipe-sysroot", so it can't
replace '/recipe-sysroot-native', there would be build errors when
building multilib + rm_work, for example:
chown: invalid user: ‘polkitd:root’

Substitute staging_host for target recipe can fix the problem, now all of native, cross and target need substitute staging_host, so we can simply the code a little.

---
 meta/classes/sstate.bbclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta/classes/sstate.bbclass +3 -3
index e30fbe1..314a14d 100644
@@ -538,15 +538,15 @@ python sstate_hardcode_path () {
     staging_host = d.getVar('RECIPE_SYSROOT_NATIVE')
     sstate_builddir = d.getVar('SSTATE_BUILDDIR')
 
+    sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRHOST:g'" % staging_host
     if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross-canadian', d):
         sstate_grep_cmd = "grep -l -e '%s'" % (staging_host)
-        sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRHOST:g'" % (staging_host)
     elif bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d):
         sstate_grep_cmd = "grep -l -e '%s' -e '%s'" % (staging_target, staging_host)
-        sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRTARGET:g; s:%s:FIXMESTAGINGDIRHOST:g'" % (staging_target, staging_host)
+        sstate_sed_cmd += " -e 's:%s:FIXMESTAGINGDIRTARGET:g'" % staging_target
     else:
         sstate_grep_cmd = "grep -l -e '%s'" % (staging_target)
-        sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRTARGET:g'" % (staging_target)
+        sstate_sed_cmd += " -e 's:%s:FIXMESTAGINGDIRTARGET:g'" % staging_target
 
     extra_staging_fixmes = d.getVar('EXTRA_STAGING_FIXMES') or ''
     for fixmevar in extra_staging_fixmes.split():
Signature · 1 line
2.7.4