All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Handle the sysroots-components dir when restoring from the sstate cache
@ 2017-05-03 21:13 Peter Kjellerstedt
  2017-05-03 21:13 ` [PATCH 1/2] bitbake.conf: Add COMPONENTS_DIR for ${STAGING_DIR}-components Peter Kjellerstedt
  2017-05-03 21:13 ` [PATCH 2/2] useradd.bbclass: Handle COMPONENTS_DIR when restoring state Peter Kjellerstedt
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Kjellerstedt @ 2017-05-03 21:13 UTC (permalink / raw)
  To: openembedded-core

Similar to the problem with the hosttools directory and the state
cache that was recently fixed, there is another problem with the
sysroots-components directory. This only affects postinst-useradd
scripts, so in this case the fix can be activated from useradd.bbclass
rather than sstate.bbclass and thus affects a lot less recipes.

//Peter

The following changes since commit 381897c64069ea43d595380a3ae913bcc79cf7e1:

  build-appliance-image: Update to master head revision (2017-05-01 08:56:47 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib pkj/components_dir
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=pkj/components_dir

Peter Kjellerstedt (2):
  bitbake.conf: Add COMPONENTS_DIR for ${STAGING_DIR}-components
  useradd.bbclass: Handle COMPONENTS_DIR when restoring state

 meta/classes/native.bbclass                     | 2 +-
 meta/classes/staging.bbclass                    | 8 ++++----
 meta/classes/useradd.bbclass                    | 5 +++++
 meta/conf/bitbake.conf                          | 3 ++-
 meta/lib/oeqa/selftest/devtool.py               | 2 +-
 meta/recipes-core/glibc/glibc-locale.inc        | 2 +-
 meta/recipes-core/glibc/glibc-mtrace.inc        | 2 +-
 meta/recipes-core/glibc/glibc-package.inc       | 4 ++--
 meta/recipes-core/glibc/glibc-scripts.inc       | 2 +-
 meta/recipes-devtools/gcc/gcc-common.inc        | 2 +-
 meta/recipes-devtools/gcc/gcc-cross-initial.inc | 2 +-
 meta/recipes-devtools/gcc/gcc-cross.inc         | 4 ++--
 meta/recipes-devtools/guile/guile_2.0.14.bb     | 4 ++--
 13 files changed, 24 insertions(+), 18 deletions(-)

-- 
2.12.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] bitbake.conf: Add COMPONENTS_DIR for ${STAGING_DIR}-components
  2017-05-03 21:13 [PATCH 0/2] Handle the sysroots-components dir when restoring from the sstate cache Peter Kjellerstedt
@ 2017-05-03 21:13 ` Peter Kjellerstedt
  2017-05-03 21:13 ` [PATCH 2/2] useradd.bbclass: Handle COMPONENTS_DIR when restoring state Peter Kjellerstedt
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Kjellerstedt @ 2017-05-03 21:13 UTC (permalink / raw)
  To: openembedded-core

The path to where to install and find the sysroot components is used
in many places. This warrants it to get its own variable.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 meta/classes/native.bbclass                     | 2 +-
 meta/classes/staging.bbclass                    | 6 +++---
 meta/conf/bitbake.conf                          | 3 ++-
 meta/lib/oeqa/selftest/devtool.py               | 2 +-
 meta/recipes-core/glibc/glibc-locale.inc        | 2 +-
 meta/recipes-core/glibc/glibc-mtrace.inc        | 2 +-
 meta/recipes-core/glibc/glibc-package.inc       | 4 ++--
 meta/recipes-core/glibc/glibc-scripts.inc       | 2 +-
 meta/recipes-devtools/gcc/gcc-common.inc        | 2 +-
 meta/recipes-devtools/gcc/gcc-cross-initial.inc | 2 +-
 meta/recipes-devtools/gcc/gcc-cross.inc         | 4 ++--
 meta/recipes-devtools/guile/guile_2.0.14.bb     | 4 ++--
 12 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
index aec1087af5..b8f839a8b2 100644
--- a/meta/classes/native.bbclass
+++ b/meta/classes/native.bbclass
@@ -95,7 +95,7 @@ libdir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
 libexecdir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
 
 do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_NATIVE}/"
-do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR}-components/${PACKAGE_ARCH}/${PN}"
+do_populate_sysroot[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/${PN}"
 
 # Since we actually install these into situ there is no staging prefix
 STAGING_DIR_HOST = ""
diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index 4015dd754c..31cd625640 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -201,8 +201,8 @@ do_populate_sysroot[depends] += "${POPULATESYSROOTDEPS}"
 SSTATETASKS += "do_populate_sysroot"
 do_populate_sysroot[cleandirs] = "${SYSROOT_DESTDIR}"
 do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}"
-do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR}-components/${PACKAGE_ARCH}/${PN}"
-do_populate_sysroot[sstate-fixmedir] = "${STAGING_DIR}-components/${PACKAGE_ARCH}/${PN}"
+do_populate_sysroot[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/${PN}"
+do_populate_sysroot[sstate-fixmedir] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/${PN}"
 
 python do_populate_sysroot_setscene () {
     sstate_setscene(d)
@@ -442,7 +442,7 @@ python extend_recipe_sysroot() {
     bb.note("\n".join(msgbuf))
 
     stagingdir = d.getVar("STAGING_DIR")
-    sharedmanifests = stagingdir + "-components/manifests"
+    sharedmanifests = d.getVar("COMPONENTS_DIR") + "/manifests"
     recipesysroot = d.getVar("RECIPE_SYSROOT")
     recipesysrootnative = d.getVar("RECIPE_SYSROOT_NATIVE")
     current_variant = d.getVar("BBEXTENDVARIANT")
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index a24be0551d..2dd2bb1640 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -351,6 +351,7 @@ S = "${WORKDIR}/${BP}"
 B = "${S}"
 
 STAGING_DIR = "${TMPDIR}/sysroots"
+COMPONENTS_DIR = "${STAGING_DIR}-components"
 RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot"
 RECIPE_SYSROOT_NATIVE = "${WORKDIR}/recipe-sysroot-native"
 
@@ -655,7 +656,7 @@ SRC_URI = ""
 # Use pseudo as the fakeroot implementation
 PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
 PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}:${PSEUDO_SYSROOT}"
-PSEUDO_SYSROOT = "${STAGING_DIR}-components/${BUILD_ARCH}/pseudo-native"
+PSEUDO_SYSROOT = "${COMPONENTS_DIR}/${BUILD_ARCH}/pseudo-native"
 export PSEUDO_DISABLED = "1"
 #export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
 #export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index 8e7642c32b..57048665c0 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -294,7 +294,7 @@ class DevtoolTests(DevtoolBase):
             f.write('\nFILES_${PN}-dev += "${datadir}/cmake/Modules"\n')
             # We don't have the ability to pick up this dependency automatically yet...
             f.write('\nDEPENDS += "libusb1"\n')
-            f.write('\nTESTLIBOUTPUT = "${STAGING_DIR}-components/${TUNE_PKGARCH}/${PN}/${libdir}"\n')
+            f.write('\nTESTLIBOUTPUT = "${COMPONENTS_DIR}/${TUNE_PKGARCH}/${PN}/${libdir}"\n')
         # Test devtool build
         result = runCmd('devtool build libftdi')
         bb_vars = get_bb_vars(['TESTLIBOUTPUT', 'STAMP'], 'libftdi')
diff --git a/meta/recipes-core/glibc/glibc-locale.inc b/meta/recipes-core/glibc/glibc-locale.inc
index 9c99741920..70e2b3a16b 100644
--- a/meta/recipes-core/glibc/glibc-locale.inc
+++ b/meta/recipes-core/glibc/glibc-locale.inc
@@ -66,7 +66,7 @@ DESCRIPTION_localedef = "glibc: compile locale definition files"
 FILES_${MLPREFIX}glibc-gconv = "${libdir}/gconv/*"
 FILES_localedef = "${bindir}/localedef"
 
-LOCALETREESRC = "${STAGING_DIR}-components/${PACKAGE_ARCH}/glibc-stash-locale"
+LOCALETREESRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale"
 
 do_install () {
 	mkdir -p ${D}${bindir} ${D}${datadir} ${D}${libdir}
diff --git a/meta/recipes-core/glibc/glibc-mtrace.inc b/meta/recipes-core/glibc/glibc-mtrace.inc
index d3641b39b6..d703c14bdc 100644
--- a/meta/recipes-core/glibc/glibc-mtrace.inc
+++ b/meta/recipes-core/glibc/glibc-mtrace.inc
@@ -5,7 +5,7 @@ DESCRIPTION = "mtrace utility provided by glibc"
 RDEPENDS_${PN} = "perl"
 RPROVIDES_${PN} = "libc-mtrace"
 
-SRC = "${STAGING_DIR}-components/${PACKAGE_ARCH}/glibc-stash-locale/scripts"
+SRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale/scripts"
 
 do_install() {
 	install -d -m 0755 ${D}${bindir}
diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc
index 2ca56662d5..9f7fa62a37 100644
--- a/meta/recipes-core/glibc/glibc-package.inc
+++ b/meta/recipes-core/glibc/glibc-package.inc
@@ -198,8 +198,8 @@ do_stash_locale[dirs] = "${B}"
 do_stash_locale[cleandirs] = "${LOCALESTASH}"
 SSTATETASKS += "do_stash_locale"
 do_stash_locale[sstate-inputdirs] = "${LOCALESTASH}"
-do_stash_locale[sstate-outputdirs] = "${STAGING_DIR}-components/${PACKAGE_ARCH}/glibc-stash-locale"
-do_stash_locale[sstate-fixmedir] = "${STAGING_DIR}-components/${PACKAGE_ARCH}/glibc-stash-locale"
+do_stash_locale[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale"
+do_stash_locale[sstate-fixmedir] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale"
 
 python do_stash_locale_setscene () {
     sstate_setscene(d)
diff --git a/meta/recipes-core/glibc/glibc-scripts.inc b/meta/recipes-core/glibc/glibc-scripts.inc
index 42616f0760..2a2b41507e 100644
--- a/meta/recipes-core/glibc/glibc-scripts.inc
+++ b/meta/recipes-core/glibc/glibc-scripts.inc
@@ -4,7 +4,7 @@ SUMMARY = "utility scripts provided by glibc"
 DESCRIPTION = "utility scripts provided by glibc"
 RDEPENDS_${PN} = "bash glibc-mtrace"
 
-SRC = "${STAGING_DIR}-components/${PACKAGE_ARCH}/glibc-stash-locale/scripts"
+SRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale/scripts"
 
 bashscripts = "sotruss xtrace"
 
diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
index 74578d94ff..18dc3a6ca6 100644
--- a/meta/recipes-devtools/gcc/gcc-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-common.inc
@@ -13,7 +13,7 @@ COMPILERDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}gcc${COMPILERINITIAL}:do_gcc_s
 COMPILERDEP_class-nativesdk = "virtual/${TARGET_PREFIX}gcc${COMPILERINITIAL}-crosssdk:do_gcc_stash_builddir"
 
 python extract_stashed_builddir () {
-    src = d.expand("${STAGING_DIR}-components/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}")
+    src = d.expand("${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}")
     dest = d.getVar("B")
     oe.path.copyhardlinktree(src, dest)
     staging_processfixme([src + "/fixmepath"], dest, dest, dest, d)
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial.inc b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
index d440d88e53..9502c2b1ab 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-initial.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
@@ -77,7 +77,7 @@ sysroot_stage_all() {
 }
 
 do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_HOST}/"
-do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR}-components/${PACKAGE_ARCH}/${PN}"
+do_populate_sysroot[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/${PN}"
 
 inherit nopackages
 
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index c5c1645f69..45985c3847 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -206,8 +206,8 @@ do_gcc_stash_builddir () {
 addtask do_gcc_stash_builddir after do_compile before do_install
 SSTATETASKS += "do_gcc_stash_builddir"
 do_gcc_stash_builddir[sstate-inputdirs] = "${BUILDDIRSTASH}"
-do_gcc_stash_builddir[sstate-outputdirs] = "${STAGING_DIR}-components/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}"
-do_gcc_stash_builddir[sstate-fixmedir] = "${STAGING_DIR}-components/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}"
+do_gcc_stash_builddir[sstate-outputdirs] = "${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}"
+do_gcc_stash_builddir[sstate-fixmedir] = "${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}"
 
 python do_gcc_stash_builddir_setscene () {
     sstate_setscene(d)
diff --git a/meta/recipes-devtools/guile/guile_2.0.14.bb b/meta/recipes-devtools/guile/guile_2.0.14.bb
index 7a36ba0c3b..7a01d0ffc9 100644
--- a/meta/recipes-devtools/guile/guile_2.0.14.bb
+++ b/meta/recipes-devtools/guile/guile_2.0.14.bb
@@ -111,8 +111,8 @@ guile_cross_config() {
 # auto-compile into the prefix even if it can write there, so touch them here as
 # sysroot is managed.
 SSTATEPOSTINSTFUNCS += "guile_sstate_postinst"
-GUILESSTATEDIR = "${STAGING_DIR}-components/${TUNE_PKGARCH}/${PN}/${libdir}/guile/2.0/ccache"
-GUILESSTATEDIR_class-native = "${STAGING_DIR}-components/${BUILD_ARCH}/${PN}/${libdir_native}/guile/2.0/ccache"
+GUILESSTATEDIR = "${COMPONENTS_DIR}/${TUNE_PKGARCH}/${PN}/${libdir}/guile/2.0/ccache"
+GUILESSTATEDIR_class-native = "${COMPONENTS_DIR}/${BUILD_ARCH}/${PN}/${libdir_native}/guile/2.0/ccache"
 guile_sstate_postinst() {
 	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
 	then
-- 
2.12.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] useradd.bbclass: Handle COMPONENTS_DIR when restoring state
  2017-05-03 21:13 [PATCH 0/2] Handle the sysroots-components dir when restoring from the sstate cache Peter Kjellerstedt
  2017-05-03 21:13 ` [PATCH 1/2] bitbake.conf: Add COMPONENTS_DIR for ${STAGING_DIR}-components Peter Kjellerstedt
@ 2017-05-03 21:13 ` Peter Kjellerstedt
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Kjellerstedt @ 2017-05-03 21:13 UTC (permalink / raw)
  To: openembedded-core

The export of PSEUDO in useradd_sysroot() contains references to
${COMPONENTS_DIR}. These need to be handled when restoring
postinst-useradd-${PN} from the sstate cache.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 meta/classes/staging.bbclass | 2 +-
 meta/classes/useradd.bbclass | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index 31cd625640..565638f48d 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -249,7 +249,7 @@ def staging_processfixme(fixme, target, recipesysroot, recipesysrootnative, d):
     if not fixme:
         return
     cmd = "sed -e 's:^[^/]*/:%s/:g' %s | xargs sed -i -e 's:FIXMESTAGINGDIRTARGET:%s:g; s:FIXMESTAGINGDIRHOST:%s:g'" % (target, " ".join(fixme), recipesysroot, recipesysrootnative)
-    for fixmevar in ['HOSTTOOLS_DIR', 'PKGDATA_DIR']:
+    for fixmevar in ['COMPONENTS_DIR', 'HOSTTOOLS_DIR', 'PKGDATA_DIR']:
         fixme_path = d.getVar(fixmevar)
         cmd += " -e 's:FIXME_%s:%s:g'" % (fixmevar, fixme_path)
     bb.note(cmd)
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 4373677bd6..92e45ff9bc 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -132,6 +132,11 @@ useradd_sysroot () {
 	useradd_preinst
 }
 
+# The export of PSEUDO in useradd_sysroot() above contains references to
+# ${COMPONENTS_DIR}. These need to be handled when restoring
+# postinst-useradd-${PN} from the sstate cache.
+EXTRA_STAGING_FIXMES += "COMPONENTS_DIR"
+
 python useradd_sysroot_sstate () {
     task = d.getVar("BB_CURRENTTASK")
     if task == "package_setscene":
-- 
2.12.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-03 21:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-03 21:13 [PATCH 0/2] Handle the sysroots-components dir when restoring from the sstate cache Peter Kjellerstedt
2017-05-03 21:13 ` [PATCH 1/2] bitbake.conf: Add COMPONENTS_DIR for ${STAGING_DIR}-components Peter Kjellerstedt
2017-05-03 21:13 ` [PATCH 2/2] useradd.bbclass: Handle COMPONENTS_DIR when restoring state Peter Kjellerstedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.