All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/16] Simplify how to stage directories in the sysroot
@ 2016-05-11 17:27 Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 01/16] staging.bbclass: Make it easier to define which dirs to stage Peter Kjellerstedt
                   ` (16 more replies)
  0 siblings, 17 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

The first commit in this set makes it possible to specify the
directories that will be staged in the sysroot via variables rather
than hardcoding it in sysroot_stage_dirs(). This should make it a lot
easier to add/remove directories to stage.

The rest of the commits just change recipes to take advantage of the
new variables.

Because of the following if statement in sysroot_stage_dirs():

	if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then

I have split the list of directories into SYSROOT_DIRS and
SYSROOT_DIRS_NATIVE, where the latter is included if that if statement
is true. I am not sure when that statement is true (my understanding
is that it should be true for native builds, but I am not sure if it
is also true for other builds like cross, nativesdk, etc). If it is
only true for native builds then that if statement could be removed,
and the SYSROOT_DIRS_NATIVE variable could be replaced by
SYSROOT_DIRS_append_class-native...

//Peter

The following changes since commit 28433319ad8299aa23b1fcfdddbe100b29e86517:

  bitbake: toaster: tests browser Add test for creating a project (2016-05-11 11:32:58 +0100)

are available in the git repository at:

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

Peter Kjellerstedt (16):
  staging.bbclass: Make it easier to define which dirs to stage
  u-boot-fw-utils: Use SYSROOT_DIRS to add dirs to stage in sysroot
  libtool-cross: Use SYSROOT_DIRS to add dirs to stage in sysroot
  qemuwrapper-cross: Use SYSROOT_DIRS to add dirs to stage in sysroot
  tcl: Use SYSROOT_DIRS to add dirs to stage in sysroot
  shadow-sysroot: Use SYSROOT_DIRS to add dirs to stage in sysroot
  depmodwrapper-cross: Use SYSROOT_DIRS to add dirs to stage in sysroot
  base-files: Use SYSROOT_DIRS to add dirs to stage in sysroot
  signing-keys: Use SYSROOT_DIRS to add dirs to stage in sysroot
  vala.inc: Use SYSROOT_DIRS to add dirs to stage in sysroot
  gobject-introspection: Use SYSROOT_DIRS to add dirs to stage in
    sysroot
  grub2.inc: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from the sysroot
  gettext: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from the sysroot
  gcc-target.inc: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from
    sysroot
  libtool: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from the sysroot
  font-util: Remove ${datadir}/fonts from SYSROOT_DIRS_BLACKLIST

 meta/classes/staging.bbclass                       | 69 ++++++++++++----------
 meta/recipes-bsp/grub/grub2.inc                    |  5 +-
 meta/recipes-bsp/u-boot/u-boot-fw-utils_2016.03.bb |  5 +-
 meta/recipes-core/base-files/base-files_3.0.14.bb  |  5 +-
 meta/recipes-core/gettext/gettext_0.16.1.bb        |  7 +--
 meta/recipes-core/meta/signing-keys.bb             |  6 +-
 meta/recipes-devtools/gcc/gcc-target.inc           |  4 +-
 .../libtool/libtool-cross_2.4.6.bb                 |  7 +--
 meta/recipes-devtools/libtool/libtool_2.4.6.bb     | 13 ++--
 .../recipes-devtools/qemu/qemuwrapper-cross_1.0.bb |  6 +-
 meta/recipes-devtools/tcltk/tcl_8.6.4.bb           |  5 +-
 meta/recipes-devtools/vala/vala.inc                | 13 ++--
 .../shadow/shadow-sysroot_4.2.1.bb                 |  6 +-
 .../gobject-introspection_1.46.0.bb                |  9 ++-
 meta/recipes-graphics/xorg-font/font-util_1.3.1.bb |  5 +-
 .../recipes-kernel/kmod/depmodwrapper-cross_1.0.bb |  6 +-
 16 files changed, 67 insertions(+), 104 deletions(-)

-- 
2.1.0



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

* [PATCH 01/16] staging.bbclass: Make it easier to define which dirs to stage
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 02/16] u-boot-fw-utils: Use SYSROOT_DIRS to add dirs to stage in sysroot Peter Kjellerstedt
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

The directories that should be staged in the sysroot are now specified
in the SYSROOT_DIRS variable. Extra directories that should be staged
for native are specified in SYSROOT_DIRS_NATIVE. Finally, directories
that should not be staged are specified in SYSROOT_DIRS_BLACKLIST.

This also removes the sysroot_stage_libdir() function as it is no
longer used (it was just a wrapper for sysroot_stage_dir()).

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 meta/classes/staging.bbclass | 69 ++++++++++++++++++++++++--------------------
 1 file changed, 38 insertions(+), 31 deletions(-)

diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index bc5dfa8..2460d5d 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -1,3 +1,30 @@
+SYSROOT_DIRS = " \
+    ${includedir} \
+    ${libdir} \
+    ${base_libdir} \
+    ${nonarch_base_libdir} \
+    ${datadir} \
+"
+
+SYSROOT_DIRS_NATIVE = " \
+    ${bindir} \
+    ${sbindir} \
+    ${base_bindir} \
+    ${base_sbindir} \
+    ${libexecdir} \
+    ${sysconfdir} \
+    ${localstatedir} \
+"
+
+SYSROOT_DIRS_BLACKLIST = " \
+    ${mandir} \
+    ${docdir} \
+    ${infodir} \
+    ${datadir}/locale \
+    ${datadir}/applications \
+    ${datadir}/fonts \
+    ${datadir}/pixmaps \
+"
 
 sysroot_stage_dir() {
 	src="$1"
@@ -14,43 +41,23 @@ sysroot_stage_dir() {
 	)
 }
 
-sysroot_stage_libdir() {
-	src="$1"
-	dest="$2"
-
-	sysroot_stage_dir $src $dest
-}
-
 sysroot_stage_dirs() {
 	from="$1"
 	to="$2"
 
-	sysroot_stage_dir $from${includedir} $to${includedir}
+	dirs="${SYSROOT_DIRS}"
 	if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
-		sysroot_stage_dir $from${bindir} $to${bindir}
-		sysroot_stage_dir $from${sbindir} $to${sbindir}
-		sysroot_stage_dir $from${base_bindir} $to${base_bindir}
-		sysroot_stage_dir $from${base_sbindir} $to${base_sbindir}
-		sysroot_stage_dir $from${libexecdir} $to${libexecdir}
-		sysroot_stage_dir $from${sysconfdir} $to${sysconfdir}
-		sysroot_stage_dir $from${localstatedir} $to${localstatedir}
+		dirs="$dirs ${SYSROOT_DIRS_NATIVE}"
 	fi
-	if [ -d $from${libdir} ]
-	then
-		sysroot_stage_libdir $from${libdir} $to${libdir}
-	fi
-	if [ -d $from${base_libdir} ]
-	then
-		sysroot_stage_libdir $from${base_libdir} $to${base_libdir}
-	fi
-	if [ -d $from${nonarch_base_libdir} ]
-	then
-		sysroot_stage_libdir $from${nonarch_base_libdir} $to${nonarch_base_libdir}
-	fi
-	sysroot_stage_dir $from${datadir} $to${datadir}
-	# We don't care about docs/info/manpages/locales
-	rm -rf $to${mandir}/ $to${docdir}/ $to${infodir}/ ${to}${datadir}/locale/
-	rm -rf $to${datadir}/applications/ $to${datadir}/fonts/ $to${datadir}/pixmaps/
+
+	for dir in $dirs; do
+		sysroot_stage_dir "$from$dir" "$to$dir"
+	done
+
+	# Remove directories we do not care about
+	for dir in ${SYSROOT_DIRS_BLACKLIST}; do
+		rm -rf "$to$dir"
+	done
 }
 
 sysroot_stage_all() {
-- 
2.1.0



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

* [PATCH 02/16] u-boot-fw-utils: Use SYSROOT_DIRS to add dirs to stage in sysroot
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 01/16] staging.bbclass: Make it easier to define which dirs to stage Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 03/16] libtool-cross: " Peter Kjellerstedt
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

---
 meta/recipes-bsp/u-boot/u-boot-fw-utils_2016.03.bb | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/meta/recipes-bsp/u-boot/u-boot-fw-utils_2016.03.bb b/meta/recipes-bsp/u-boot/u-boot-fw-utils_2016.03.bb
index dfda5c1..79f1548 100644
--- a/meta/recipes-bsp/u-boot/u-boot-fw-utils_2016.03.bb
+++ b/meta/recipes-bsp/u-boot/u-boot-fw-utils_2016.03.bb
@@ -40,10 +40,7 @@ do_install_class-cross () {
 	install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
 }
 
-SYSROOT_PREPROCESS_FUNCS_class-cross = "uboot_fw_utils_cross"
-uboot_fw_utils_cross() {
-	sysroot_stage_dir ${D}${bindir_cross} ${SYSROOT_DESTDIR}${bindir_cross}
-}
+SYSROOT_DIRS_append_class-cross = " ${bindir_cross}"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 BBCLASSEXTEND = "cross"
-- 
2.1.0



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

* [PATCH 03/16] libtool-cross: Use SYSROOT_DIRS to add dirs to stage in sysroot
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 01/16] staging.bbclass: Make it easier to define which dirs to stage Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 02/16] u-boot-fw-utils: Use SYSROOT_DIRS to add dirs to stage in sysroot Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 04/16] qemuwrapper-cross: " Peter Kjellerstedt
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

---
 meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb b/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb
index 0204d34..b268310 100644
--- a/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb
+++ b/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb
@@ -35,11 +35,6 @@ do_install () {
 	install -c -m 0644 ${S}/m4/*.m4 ${D}${target_datadir}/aclocal/
 }
 
-SYSROOT_PREPROCESS_FUNCS += "libtoolcross_sysroot_preprocess"
-
-libtoolcross_sysroot_preprocess () {
-	sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
-	sysroot_stage_dir ${D}${target_datadir} ${SYSROOT_DESTDIR}${target_datadir}
-}
+SYSROOT_DIRS += "${bindir_crossscripts} ${target_datadir}"
 
 SSTATE_SCAN_FILES += "libtoolize *-libtool"
-- 
2.1.0



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

* [PATCH 04/16] qemuwrapper-cross: Use SYSROOT_DIRS to add dirs to stage in sysroot
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
                   ` (2 preceding siblings ...)
  2016-05-11 17:27 ` [PATCH 03/16] libtool-cross: " Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 05/16] tcl: " Peter Kjellerstedt
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

---
 meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb b/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
index 7f4c6d9..53b302d 100644
--- a/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
+++ b/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
@@ -41,10 +41,6 @@ EOF
 	chmod +x ${D}${bindir_crossscripts}/qemuwrapper
 }
 
-SYSROOT_PREPROCESS_FUNCS += "qemuwrapper_sysroot_preprocess"
-
-qemuwrapper_sysroot_preprocess () {
-	sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
-}
+SYSROOT_DIRS += "${bindir_crossscripts}"
 
 INHIBIT_DEFAULT_DEPS = "1"
-- 
2.1.0



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

* [PATCH 05/16] tcl: Use SYSROOT_DIRS to add dirs to stage in sysroot
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
                   ` (3 preceding siblings ...)
  2016-05-11 17:27 ` [PATCH 04/16] qemuwrapper-cross: " Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 06/16] shadow-sysroot: " Peter Kjellerstedt
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

---
 meta/recipes-devtools/tcltk/tcl_8.6.4.bb | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/meta/recipes-devtools/tcltk/tcl_8.6.4.bb b/meta/recipes-devtools/tcltk/tcl_8.6.4.bb
index 8e92b3e..61be81d 100644
--- a/meta/recipes-devtools/tcltk/tcl_8.6.4.bb
+++ b/meta/recipes-devtools/tcltk/tcl_8.6.4.bb
@@ -68,10 +68,7 @@ do_install() {
 	done
 }
 
-SYSROOT_PREPROCESS_FUNCS += "tcl_sysroot_preprocess"
-tcl_sysroot_preprocess () {
-	sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
-}
+SYSROOT_DIRS += "${bindir_crossscripts}"
 
 PACKAGES =+ "tcl-lib"
 FILES_tcl-lib = "${libdir}/libtcl8.6.so.*"
-- 
2.1.0



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

* [PATCH 06/16] shadow-sysroot: Use SYSROOT_DIRS to add dirs to stage in sysroot
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
                   ` (4 preceding siblings ...)
  2016-05-11 17:27 ` [PATCH 05/16] tcl: " Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 07/16] depmodwrapper-cross: " Peter Kjellerstedt
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

---
 meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb b/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb
index 697569c..ef01462 100644
--- a/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb
+++ b/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb
@@ -21,12 +21,10 @@ S = "${WORKDIR}"
 
 do_install() {
 	install -d ${D}${sysconfdir}
-	install -p -m 755 ${S}/login.defs_shadow-sysroot ${D}${sysconfdir}/login.defs
+	install -p -m 644 ${S}/login.defs_shadow-sysroot ${D}${sysconfdir}/login.defs
 }
 
-sysroot_stage_all() {
-	sysroot_stage_dir ${D} ${SYSROOT_DESTDIR}
-}
+SYSROOT_DIRS += "${sysconfdir}"
 
 # don't create any packages
 # otherwise: dbus-dev depends on shadow-sysroot-dev which depends on shadow-sysroot 
-- 
2.1.0



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

* [PATCH 07/16] depmodwrapper-cross: Use SYSROOT_DIRS to add dirs to stage in sysroot
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
                   ` (5 preceding siblings ...)
  2016-05-11 17:27 ` [PATCH 06/16] shadow-sysroot: " Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 08/16] base-files: " Peter Kjellerstedt
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

---
 meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
index c2c2589..5c7dd52 100644
--- a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
+++ b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
@@ -41,10 +41,6 @@ EOF
 	chmod +x ${D}${bindir_crossscripts}/depmodwrapper
 }
 
-SYSROOT_PREPROCESS_FUNCS += "depmodwrapper_sysroot_preprocess"
-
-depmodwrapper_sysroot_preprocess () {
-	sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
-}
+SYSROOT_DIRS += "${bindir_crossscripts}"
 
 inherit nopackages
-- 
2.1.0



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

* [PATCH 08/16] base-files: Use SYSROOT_DIRS to add dirs to stage in sysroot
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
                   ` (6 preceding siblings ...)
  2016-05-11 17:27 ` [PATCH 07/16] depmodwrapper-cross: " Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 09/16] signing-keys: " Peter Kjellerstedt
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

---
 meta/recipes-core/base-files/base-files_3.0.14.bb | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index d391707..5333110 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -165,9 +165,7 @@ do_install_append_linuxstdbase() {
         done
 }
 
-sysroot_stage_all_append () {
-	sysroot_stage_dir ${D}${sysconfdir}/skel ${SYSROOT_DESTDIR}${sysconfdir}/skel
-}
+SYSROOT_DIRS += "${sysconfdir}/skel"
 
 PACKAGES = "${PN}-doc ${PN} ${PN}-dev ${PN}-dbg"
 FILES_${PN} = "/"
@@ -177,4 +175,3 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 CONFFILES_${PN} = "${sysconfdir}/fstab ${@['', '${sysconfdir}/hostname'][(d.getVar('hostname', True) != '')]} ${sysconfdir}/shells"
 CONFFILES_${PN} += "${sysconfdir}/motd ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile"
-
-- 
2.1.0



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

* [PATCH 09/16] signing-keys: Use SYSROOT_DIRS to add dirs to stage in sysroot
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
                   ` (7 preceding siblings ...)
  2016-05-11 17:27 ` [PATCH 08/16] base-files: " Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 10/16] vala.inc: " Peter Kjellerstedt
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

---
 meta/recipes-core/meta/signing-keys.bb | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-core/meta/signing-keys.bb b/meta/recipes-core/meta/signing-keys.bb
index e843301..ea7400b 100644
--- a/meta/recipes-core/meta/signing-keys.bb
+++ b/meta/recipes-core/meta/signing-keys.bb
@@ -12,6 +12,8 @@ inherit allarch deploy
 EXCLUDE_FROM_WORLD = "1"
 INHIBIT_DEFAULT_DEPS = "1"
 
+SYSROOT_DIRS += "${sysconfdir}/pki"
+
 PACKAGES =+ "${PN}-ipk ${PN}-rpm ${PN}-packagefeed"
 
 FILES_${PN}-rpm = "${sysconfdir}/pki/rpm-gpg"
@@ -54,10 +56,6 @@ do_install () {
     fi
 }
 
-sysroot_stage_all_append () {
-    sysroot_stage_dir ${D}${sysconfdir}/pki ${SYSROOT_DESTDIR}${sysconfdir}/pki
-}
-
 do_deploy () {
     if [ -f "${B}/rpm-key" ]; then
         install -D -m 0644 "${B}/rpm-key" "${DEPLOYDIR}/RPM-GPG-KEY-${DISTRO_VERSION}"
-- 
2.1.0



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

* [PATCH 10/16] vala.inc: Use SYSROOT_DIRS to add dirs to stage in sysroot
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
                   ` (8 preceding siblings ...)
  2016-05-11 17:27 ` [PATCH 09/16] signing-keys: " Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 11/16] gobject-introspection: " Peter Kjellerstedt
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

---
 meta/recipes-devtools/vala/vala.inc | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/meta/recipes-devtools/vala/vala.inc b/meta/recipes-devtools/vala/vala.inc
index 2a8875f..37aa38f 100644
--- a/meta/recipes-devtools/vala/vala.inc
+++ b/meta/recipes-devtools/vala/vala.inc
@@ -36,15 +36,14 @@ do_install_append_class-target() {
         install ${B}/vapigen-wrapper ${D}${bindir}/
 }
 
+# Put vapigen wrapper into target sysroot so that it can be used when building
+# vapi files.
+SYSROOT_DIRS_append_class-target = " ${bindir}"
 
-SYSROOT_PREPROCESS_FUNCS_append_class-target += "vapigen_sysroot_preprocess"
-
+SYSROOT_PREPROCESS_FUNCS_append_class-target = " vapigen_sysroot_preprocess"
 vapigen_sysroot_preprocess() {
-        # Put vapigen wrapper into target sysroot so that it can be used when building vapi files.
-        sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir}
-
-        # Also, tweak the vapigen name in vapigen pkgconfig file, so that it picks up our
-        # wrapper.
+        # Tweak the vapigen name in the vapigen pkgconfig file, so that it picks
+        # up our wrapper.
         sed -i \
            -e "s|vapigen=.*|vapigen=${bindir}/vapigen-wrapper|" \
            ${SYSROOT_DESTDIR}${datadir}/pkgconfig/vapigen-${SHRT_VER}.pc
-- 
2.1.0



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

* [PATCH 11/16] gobject-introspection: Use SYSROOT_DIRS to add dirs to stage in sysroot
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
                   ` (9 preceding siblings ...)
  2016-05-11 17:27 ` [PATCH 10/16] vala.inc: " Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 12/16] grub2.inc: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from the sysroot Peter Kjellerstedt
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

---
 .../gobject-introspection/gobject-introspection_1.46.0.bb        | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.46.0.bb b/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.46.0.bb
index 47102ca..861af5f 100644
--- a/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.46.0.bb
+++ b/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.46.0.bb
@@ -151,13 +151,12 @@ FILES_${PN}-staticdev += "${libdir}/gobject-introspection/giscanner/*.a"
 
 # we need target versions of introspection tools in sysroot so that they can be run via qemu
 # when building introspection files in other packages
-SYSROOT_PREPROCESS_FUNCS_append_class-target += "gi_binaries_sysroot_preprocess"
+SYSROOT_DIRS_append_class-target = " ${bindir}"
 
+SYSROOT_PREPROCESS_FUNCS_append_class-target = " gi_binaries_sysroot_preprocess"
 gi_binaries_sysroot_preprocess() {
-        sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir}
-
-        # Also, tweak the binary names in introspection pkgconfig file, so that it picks up our 
-        # wrappers which do the cross-compile and qemu magic.
+        # Tweak the binary names in the introspection pkgconfig file, so that it
+        # picks up our wrappers which do the cross-compile and qemu magic.
         sed -i \
            -e "s|g_ir_scanner=.*|g_ir_scanner=${bindir}/g-ir-scanner-wrapper|" \
            -e "s|g_ir_compiler=.*|g_ir_compiler=${bindir}/g-ir-compiler-wrapper|" \
-- 
2.1.0



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

* [PATCH 12/16] grub2.inc: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from the sysroot
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
                   ` (10 preceding siblings ...)
  2016-05-11 17:27 ` [PATCH 11/16] gobject-introspection: " Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 13/16] gettext: " Peter Kjellerstedt
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

---
 meta/recipes-bsp/grub/grub2.inc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index 146dde6..dd1ffe2 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -63,7 +63,4 @@ do_configure_prepend() {
 
 # grub and grub-efi's sysroot/${datadir}/grub/grub-mkconfig_lib are
 # conflicted, remove it since no one uses it.
-SYSROOT_PREPROCESS_FUNCS_class-target += "remove_sysroot_mkconfig_lib"
-remove_sysroot_mkconfig_lib() {
-    rm -r "${SYSROOT_DESTDIR}${datadir}/grub/grub-mkconfig_lib"
-}
+SYSROOT_DIRS_BLACKLIST += "${datadir}/grub/grub-mkconfig_lib"
-- 
2.1.0



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

* [PATCH 13/16] gettext: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from the sysroot
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
                   ` (11 preceding siblings ...)
  2016-05-11 17:27 ` [PATCH 12/16] grub2.inc: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from the sysroot Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 14/16] gcc-target.inc: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from sysroot Peter Kjellerstedt
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

---
 meta/recipes-core/gettext/gettext_0.16.1.bb | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/meta/recipes-core/gettext/gettext_0.16.1.bb b/meta/recipes-core/gettext/gettext_0.16.1.bb
index cd0b759..6095c83 100644
--- a/meta/recipes-core/gettext/gettext_0.16.1.bb
+++ b/meta/recipes-core/gettext/gettext_0.16.1.bb
@@ -102,11 +102,6 @@ do_install_append() {
 # available, and we don't want to use older macros from the target gettext in
 # a non-gplv3 build, so kill them and let dependent recipes rely on
 # gettext-native.
-
-SYSROOT_PREPROCESS_FUNCS += "remove_sysroot_m4_macros"
-
-remove_sysroot_m4_macros () {
-    rm -r "${SYSROOT_DESTDIR}${datadir}/aclocal"
-}
+SYSROOT_DIRS_BLACKLIST += "${datadir}/aclocal"
 
 BBCLASSEXTEND = "native nativesdk"
-- 
2.1.0



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

* [PATCH 14/16] gcc-target.inc: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from sysroot
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
                   ` (12 preceding siblings ...)
  2016-05-11 17:27 ` [PATCH 13/16] gettext: " Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 15/16] libtool: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from the sysroot Peter Kjellerstedt
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

---
 meta/recipes-devtools/gcc/gcc-target.inc | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc
index b8dabe5..a960ed4 100644
--- a/meta/recipes-devtools/gcc/gcc-target.inc
+++ b/meta/recipes-devtools/gcc/gcc-target.inc
@@ -205,6 +205,4 @@ do_install_append () {
 # and builds track file dependencies (e.g. perl and its makedepends code).
 # For determinism we don't install this ever and rely on the copy from gcc-cross.
 # [YOCTO #7287]
-sysroot_stage_dirs_append () {
-	rm -rf $to${libdir}/gcc
-}
+SYSROOT_DIRS_BLACKLIST += "${libdir}/gcc"
-- 
2.1.0



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

* [PATCH 15/16] libtool: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from the sysroot
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
                   ` (13 preceding siblings ...)
  2016-05-11 17:27 ` [PATCH 14/16] gcc-target.inc: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from sysroot Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 17:27 ` [PATCH 16/16] font-util: Remove ${datadir}/fonts from SYSROOT_DIRS_BLACKLIST Peter Kjellerstedt
  2016-05-11 21:34 ` [PATCH 00/16] Simplify how to stage directories in the sysroot Richard Purdie
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

---
 meta/recipes-devtools/libtool/libtool_2.4.6.bb | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-devtools/libtool/libtool_2.4.6.bb b/meta/recipes-devtools/libtool/libtool_2.4.6.bb
index 3851ec7..8858f6e 100644
--- a/meta/recipes-devtools/libtool/libtool_2.4.6.bb
+++ b/meta/recipes-devtools/libtool/libtool_2.4.6.bb
@@ -5,7 +5,11 @@ RDEPENDS_${PN} += "bash"
 #
 # We want the results of libtool-cross preserved - don't stage anything ourselves.
 #
-SYSROOT_PREPROCESS_FUNCS += "libtool_sysroot_preprocess"
+SYSROOT_DIRS_BLACKLIST += " \
+    ${bindir} \
+    ${datadir}/aclocal \
+    ${datadir}/libtool/build-aux \
+"
 
 do_install_append () {
         sed -e 's@--sysroot=${STAGING_DIR_HOST}@@g' \
@@ -18,10 +22,3 @@ do_install_append () {
             -e 's@^\(postdep_objects="\).*@\1"@' \
             -i ${D}${bindir}/libtool
 }
-
-libtool_sysroot_preprocess () {
-	rm -rf ${SYSROOT_DESTDIR}${bindir}/*
-	rm -rf ${SYSROOT_DESTDIR}${datadir}/aclocal/*
-	rm -rf ${SYSROOT_DESTDIR}${datadir}/libtool/build-aux/*
-}
-
-- 
2.1.0



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

* [PATCH 16/16] font-util: Remove ${datadir}/fonts from SYSROOT_DIRS_BLACKLIST
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
                   ` (14 preceding siblings ...)
  2016-05-11 17:27 ` [PATCH 15/16] libtool: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from the sysroot Peter Kjellerstedt
@ 2016-05-11 17:27 ` Peter Kjellerstedt
  2016-05-11 21:34 ` [PATCH 00/16] Simplify how to stage directories in the sysroot Richard Purdie
  16 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-11 17:27 UTC (permalink / raw)
  To: openembedded-core

---
 meta/recipes-graphics/xorg-font/font-util_1.3.1.bb | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/meta/recipes-graphics/xorg-font/font-util_1.3.1.bb b/meta/recipes-graphics/xorg-font/font-util_1.3.1.bb
index 2285124..34646ff 100644
--- a/meta/recipes-graphics/xorg-font/font-util_1.3.1.bb
+++ b/meta/recipes-graphics/xorg-font/font-util_1.3.1.bb
@@ -19,7 +19,4 @@ BBCLASSEXTEND = "native"
 SRC_URI[md5sum] = "23756dab809f9ec5011bb27fb2c3c7d6"
 SRC_URI[sha256sum] = "aa7ebdb0715106dd255082f2310dbaa2cd7e225957c2a77d719720c7cc92b921"
 
-SYSROOT_PREPROCESS_FUNCS += "fontutil_sysroot_preprocess"
-fontutil_sysroot_preprocess () {
-	sysroot_stage_dir ${D}${datadir}/fonts/ ${SYSROOT_DESTDIR}${datadir}/fonts/
-}
+SYSROOT_DIRS_BLACKLIST_remove = "${datadir}/fonts"
-- 
2.1.0



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

* Re: [PATCH 00/16] Simplify how to stage directories in the sysroot
  2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
                   ` (15 preceding siblings ...)
  2016-05-11 17:27 ` [PATCH 16/16] font-util: Remove ${datadir}/fonts from SYSROOT_DIRS_BLACKLIST Peter Kjellerstedt
@ 2016-05-11 21:34 ` Richard Purdie
  2016-05-12  8:18   ` Peter Kjellerstedt
  16 siblings, 1 reply; 19+ messages in thread
From: Richard Purdie @ 2016-05-11 21:34 UTC (permalink / raw)
  To: Peter Kjellerstedt, openembedded-core

On Wed, 2016-05-11 at 19:27 +0200, Peter Kjellerstedt wrote:
> The first commit in this set makes it possible to specify the
> directories that will be staged in the sysroot via variables rather
> than hardcoding it in sysroot_stage_dirs(). This should make it a lot
> easier to add/remove directories to stage.
> 
> The rest of the commits just change recipes to take advantage of the
> new variables.
> 
> Because of the following if statement in sysroot_stage_dirs():
> 
> 	if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
> 
> I have split the list of directories into SYSROOT_DIRS and
> SYSROOT_DIRS_NATIVE, where the latter is included if that if
> statement
> is true. I am not sure when that statement is true (my understanding
> is that it should be true for native builds, but I am not sure if it
> is also true for other builds like cross, nativesdk, etc). If it is
> only true for native builds then that if statement could be removed,
> and the SYSROOT_DIRS_NATIVE variable could be replaced by
> SYSROOT_DIRS_append_class-native...

It matches binaries that can run on the build system so it needs to
match native and cross. Something like:

SYSROOT_DIRS_append_class-native = "${SYSROOT_DIRS_NATIVE}"
SYSROOT_DIRS_append_class-cross = "${SYSROOT_DIRS_NATIVE}"

I hadn't realised how much duplication there was in that class. Cleanup
I'd never gotten around to doing. I guess most people don't even
remember how we ended up with that code or the horrors of do_stage
functions :)

Cheers,

Richard



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

* Re: [PATCH 00/16] Simplify how to stage directories in the sysroot
  2016-05-11 21:34 ` [PATCH 00/16] Simplify how to stage directories in the sysroot Richard Purdie
@ 2016-05-12  8:18   ` Peter Kjellerstedt
  0 siblings, 0 replies; 19+ messages in thread
From: Peter Kjellerstedt @ 2016-05-12  8:18 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of Richard Purdie
> Sent: den 11 maj 2016 23:35
> To: Peter Kjellerstedt; openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH 00/16] Simplify how to stage directories in the sysroot
> 
> On Wed, 2016-05-11 at 19:27 +0200, Peter Kjellerstedt wrote:
> > The first commit in this set makes it possible to specify the
> > directories that will be staged in the sysroot via variables rather
> > than hardcoding it in sysroot_stage_dirs(). This should make it a lot
> > easier to add/remove directories to stage.
> >
> > The rest of the commits just change recipes to take advantage of the
> > new variables.
> >
> > Because of the following if statement in sysroot_stage_dirs():
> >
> > 	if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
> >
> > I have split the list of directories into SYSROOT_DIRS and
> > SYSROOT_DIRS_NATIVE, where the latter is included if that if statement
> > is true. I am not sure when that statement is true (my understanding
> > is that it should be true for native builds, but I am not sure if it
> > is also true for other builds like cross, nativesdk, etc). If it is
> > only true for native builds then that if statement could be removed,
> > and the SYSROOT_DIRS_NATIVE variable could be replaced by
> > SYSROOT_DIRS_append_class-native...
> 
> It matches binaries that can run on the build system so it needs to
> match native and cross. Something like:
> 
> SYSROOT_DIRS_append_class-native = "${SYSROOT_DIRS_NATIVE}"
> SYSROOT_DIRS_append_class-cross = "${SYSROOT_DIRS_NATIVE}"

Apparently it is true for crossssdk as well (I ran recipes from each of 
the five classes through bitbake -e to verify). I will send an updated 
patch that uses the _append solution instead.

> I hadn't realised how much duplication there was in that class. Cleanup
> I'd never gotten around to doing. I guess most people don't even
> remember how we ended up with that code or the horrors of do_stage
> functions :)

I looked at some of the horrors in the git log while investigating how 
it works. I am glad you got rid of them. ;)

> Cheers,
> 
> Richard

//Peter



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

end of thread, other threads:[~2016-05-12  8:18 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-11 17:27 [PATCH 00/16] Simplify how to stage directories in the sysroot Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 01/16] staging.bbclass: Make it easier to define which dirs to stage Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 02/16] u-boot-fw-utils: Use SYSROOT_DIRS to add dirs to stage in sysroot Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 03/16] libtool-cross: " Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 04/16] qemuwrapper-cross: " Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 05/16] tcl: " Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 06/16] shadow-sysroot: " Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 07/16] depmodwrapper-cross: " Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 08/16] base-files: " Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 09/16] signing-keys: " Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 10/16] vala.inc: " Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 11/16] gobject-introspection: " Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 12/16] grub2.inc: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from the sysroot Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 13/16] gettext: " Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 14/16] gcc-target.inc: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from sysroot Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 15/16] libtool: Use SYSROOT_DIRS_BLACKLIST to exclude dirs from the sysroot Peter Kjellerstedt
2016-05-11 17:27 ` [PATCH 16/16] font-util: Remove ${datadir}/fonts from SYSROOT_DIRS_BLACKLIST Peter Kjellerstedt
2016-05-11 21:34 ` [PATCH 00/16] Simplify how to stage directories in the sysroot Richard Purdie
2016-05-12  8:18   ` 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.