All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/23] Fix for #7040 - Support for /usr merge
@ 2017-02-10 13:42 Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 01/23] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                   ` (48 more replies)
  0 siblings, 49 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

This set of patches implements the long-standing feature - merging of /bin,
/sbin, /libs to their /usr counterparts.

It introduces a 'usrmerge' DISTRO_FEATURE, when it's enabled:
  - other than native all base paths(base_{bin,sbin,lib}dir) points to ${exec_prefix}/{bin,sbin,lib}
  - base-files package adds the needed root links(/bin, /sbin, /lib{32,64}) points to /usr counterparts
  - As most of shell scripts refer "#!/bin/{sh,bash}" inside script, so makes sure that get added to RPROVIDES_ list by those packages to satisfy the build dependencies.

The assumption is that no recipe uses hard coded paths in recipes where pre-defined bitbake configuration variables are available. I have fixed quite many recipes that i found which violates this assumption.

I have tested this change on core-minimal, sato, windriver cube-desktop and intel-iot-refkit image builds. And i would prefer to run autobuilder tests prior to merging.

Amarnath Valluri (19):
  bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE
  cross.bbclass: merged /usr support
  systemd: chagnes to support merged /usr
  bash: changes to support merged /usr
  busybox: changes to support merged /usr
  sed: changes to support merged /usr
  package_deb.bbclass: Ignore file paths in RPROVIDES
  musl: Fix issues in relative symlink creation
  attr/acl: Do not create broken static library link when not needed
  systemd: Do not add libnss_* to systemd package
  util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package.
  util-linux,shadow: Make 'nologin' alternative command
  libarchive: Backport upstream fixes.
  kernel: use ${nonarch_base_libdir} for kernel modules installation.
  firmware: use ${nonarch_base_libdir} for firmware installation.
  mdadm: Avoid using hardocded udev, sbin paths
  mktemp: Move installed files only when needed
  net-tools: Place package content as per bitbake environment.
  lsb: Make use of appropriate bitbake variables.

Joshua Lock (2):
  bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
  base-files: support merged /usr

Jussi Kukkonen (2):
  glibc: Ensure ldconfig is packaged into glibc
  util-linux: Fix packaging with "usrmerge"

 meta/classes/cross.bbclass                         |   2 +-
 meta/classes/kernel-module-split.bbclass           |   2 +-
 meta/classes/kernel.bbclass                        |  14 +-
 meta/classes/module.bbclass                        |   2 +-
 meta/classes/package_deb.bbclass                   |   4 +
 meta/conf/bitbake.conf                             |  20 +-
 meta/recipes-core/base-files/base-files_3.0.14.bb  |  23 +-
 meta/recipes-core/busybox/busybox.inc              |   2 +
 meta/recipes-core/glibc/glibc-package.inc          |   2 +-
 ...dynamic-linker-a-relative-symlink-to-libc.patch |  58 ++++-
 meta/recipes-core/musl/musl_git.bb                 |   2 +-
 meta/recipes-core/systemd/systemd_232.bb           |   7 +-
 meta/recipes-core/util-linux/util-linux.inc        |  15 +-
 meta/recipes-extended/bash/bash.inc                |   2 +
 ...te_disk_posix.c-make-_fsobj-functions-mor.patch | 242 +++++++++++++++++++++
 ...02-Fix-extracting-hardlinks-over-symlinks.patch | 116 ++++++++++
 .../libarchive/libarchive_3.2.2.bb                 |   2 +
 meta/recipes-extended/lsb/lsb_4.1.bb               |  40 ++--
 meta/recipes-extended/mdadm/mdadm_4.0.bb           |   6 +-
 meta/recipes-extended/mktemp/mktemp_1.7.bb         |   8 +-
 .../net-tools/net-tools_1.60-26.bb                 |  11 +
 meta/recipes-extended/sed/sed_4.2.2.bb             |   1 +
 meta/recipes-extended/shadow/shadow.inc            |   3 +-
 .../linux-firmware/linux-firmware_git.bb           | 168 +++++++-------
 meta/recipes-support/attr/ea-acl.inc               |   2 +
 ...gure-option-to-enable-disable-static-libr.patch |  70 ++++++
 26 files changed, 668 insertions(+), 156 deletions(-)
 create mode 100644 meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch
 create mode 100644 meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch
 create mode 100644 meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch

-- 
2.7.4



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

* [PATCH 01/23] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 16:29   ` Christopher Larson
  2017-02-10 13:42 ` [PATCH 02/23] bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE Amarnath Valluri
                   ` (47 subsequent siblings)
  48 siblings, 1 reply; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core; +Cc: Joshua Lock

From: Joshua Lock <joshua.g.lock@intel.com>

Modify bindir, libdir and sbindir to be exec_prefix/$d, rather than
base_prefix/$d, when the usrmerge DISTRO_FEATURE is enabled.

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
---
 meta/conf/bitbake.conf | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index e421650..c5beb77 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -18,10 +18,14 @@ export prefix = "/usr"
 export exec_prefix = "${prefix}"
 
 # Base paths
-export base_bindir = "${base_prefix}/bin"
-export base_sbindir = "${base_prefix}/sbin"
-export base_libdir = "${base_prefix}/${baselib}"
-export nonarch_base_libdir = "${base_prefix}/lib"
+bin = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}/bin', '${base_prefix}/bin', d)}"
+sbin = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}/sbin', '${base_prefix}/sbin', d)}"
+lib = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}/${baselib}', '${base_prefix}/${baselib}', d)}"
+nonarch_lib = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}/lib', '${base_prefix}/lib', d)}"
+export base_bindir = "${bin}"
+export base_sbindir = "${sbin}"
+export base_libdir = "${lib}"
+export nonarch_base_libdir = "${nonarch_lib}"
 
 # Architecture independent paths
 export sysconfdir = "${base_prefix}/etc"
-- 
2.7.4



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

* [PATCH 02/23] bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 01/23] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 03/23] cross.bbclass: merged /usr support Amarnath Valluri
                   ` (46 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

Modify base bin, sbin, and lib nativesdk variables to be ${prefix_nativesdk}/$d,
when the usrmerge DISTRO_FEATURE is enabled.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/conf/bitbake.conf | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index c5beb77..ecff034 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -67,11 +67,11 @@ bindir_crossscripts = "${bindir}/crossscripts"
 prefix_nativesdk = "/usr"
 bindir_nativesdk = "${prefix_nativesdk}/bin"
 sbindir_nativesdk = "${prefix_nativesdk}/sbin"
-base_bindir_nativesdk = "/bin"
-base_sbindir_nativesdk = "/sbin"
-includedir_nativesdk = "${prefix_nativesdk}/include"
 libdir_nativesdk = "${prefix_nativesdk}/lib"
-base_libdir_nativesdk = "/lib"
+base_bindir_nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${bindir_nativesdk}', '/bin', d)}"
+base_sbindir_nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${sbindir_nativesdk}', '/sbin', d)}"
+base_libdir_nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${libdir_nativesdk}', '/lib', d)}"
+includedir_nativesdk = "${prefix_nativesdk}/include"
 localstatedir_nativesdk = "/var"
 
 #
-- 
2.7.4



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

* [PATCH 03/23] cross.bbclass: merged /usr support
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 01/23] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 02/23] bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 04/23] base-files: support merged /usr Amarnath Valluri
                   ` (45 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

When 'usrmerge' distro feature enabled match target_base_libdir to ${target_libdir}.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/classes/cross.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/cross.bbclass b/meta/classes/cross.bbclass
index 2602153..c8ef3a5 100644
--- a/meta/classes/cross.bbclass
+++ b/meta/classes/cross.bbclass
@@ -48,8 +48,8 @@ SSTATE_SCAN_CMD ?= "${SSTATE_SCAN_CMD_NATIVE}"
 target_base_prefix := "${base_prefix}"
 target_prefix := "${prefix}"
 target_exec_prefix := "${exec_prefix}"
-target_base_libdir = "${target_base_prefix}/${baselib}"
 target_libdir = "${target_exec_prefix}/${baselib}"
+target_base_libdir = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${target_libdir}', '${target_base_prefix}/${baselib}', d)}"
 target_includedir := "${includedir}"
 
 # Overrides for paths
-- 
2.7.4



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

* [PATCH 04/23] base-files: support merged /usr
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (2 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 03/23] cross.bbclass: merged /usr support Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 05/23] systemd: chagnes to " Amarnath Valluri
                   ` (44 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core; +Cc: Joshua Lock

From: Joshua Lock <joshua.g.lock@intel.com>

When the usrmerge DISTRO_FEATURE is enabled don't create /bin, /lib{32,64}
and /sbin. Instead, link them to the equivalent directories in /usr

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/base-files/base-files_3.0.14.bb | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 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 d138005..9e2c0b7 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
@@ -32,8 +32,8 @@ INHIBIT_DEFAULT_DEPS = "1"
 docdir_append = "/${P}"
 dirs1777 = "/tmp ${localstatedir}/volatile/tmp"
 dirs2775 = ""
-dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
-           ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \
+dirs755 = "/boot /dev ${sysconfdir} ${sysconfdir}/default \
+           ${sysconfdir}/skel /mnt /proc ${ROOT_HOME} /run \
            ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
            ${libdir} ${sbindir} ${datadir} \
            ${datadir}/common-licenses ${datadir}/dict ${infodir} \
@@ -42,8 +42,8 @@ dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
            /sys ${localstatedir}/lib/misc ${localstatedir}/spool \
            ${localstatedir}/volatile \
            ${localstatedir}/volatile/log \
-           /home ${prefix}/src ${localstatedir}/local \
-           /media"
+           /home ${prefix}/src ${localstatedir}/local /media \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '', '/bin /lib /sbin', d)}"
 
 dirs755-lsb = "/srv  \
                ${prefix}/local ${prefix}/local/bin ${prefix}/local/games \
@@ -105,6 +105,21 @@ do_install () {
 		ln -sf volatile/$d ${D}${localstatedir}/$d
 	done
 
+	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '1', '0', d)}" = "1" ] ; then
+		lnr ${D}${base_bindir} ${D}/bin
+		lnr ${D}${base_sbindir} ${D}/sbin
+		lnr ${D}${base_libdir} ${D}/${baselib}
+		if [ "${baselib}" != "lib" ]; then
+			lnr ${D}${nonarch_base_libdir} ${D}/lib
+		fi
+                # create base links for multilibs
+		multi_libdirs="${@d.getVar('MULTILIB_VARIANTS')}"
+		for d in $multi_libdirs; do
+			install -m 0755 -d ${D}/${exec_prefix}/$d
+			lnr ${D}/${exec_prefix}/$d ${D}/$d
+		done
+	fi
+
 	ln -snf ../run ${D}${localstatedir}/run
 	ln -snf ../run/lock ${D}${localstatedir}/lock
 
-- 
2.7.4



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

* [PATCH 05/23] systemd: chagnes to support merged /usr
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (3 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 04/23] base-files: support merged /usr Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 06/23] bash: changes " Amarnath Valluri
                   ` (43 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

When the usrmerge DISTRO_FEATURE is selected disable the split-usr
support and modify rootprefix to be exec_prefix, rather than base_prefix.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/systemd/systemd_232.bb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd_232.bb b/meta/recipes-core/systemd/systemd_232.bb
index cc8781e..bf0fadc 100644
--- a/meta/recipes-core/systemd/systemd_232.bb
+++ b/meta/recipes-core/systemd/systemd_232.bb
@@ -131,7 +131,7 @@ CACHED_CONFIGUREVARS += "ac_cv_path_SULOGIN=${base_sbindir}/sulogin"
 
 # Helper variables to clarify locations.  This mirrors the logic in systemd's
 # build system.
-rootprefix ?= "${base_prefix}"
+rootprefix ?= "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}', '${base_prefix}', d)}"
 rootlibdir ?= "${base_libdir}"
 rootlibexecdir = "${rootprefix}/lib"
 
@@ -149,10 +149,10 @@ CACHED_CONFIGUREVARS_class-target = "\
 EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
                  --with-rootlibdir=${rootlibdir} \
                  --with-roothomedir=${ROOT_HOME} \
-                 --enable-split-usr \
+                 ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '--disable-split-usr', '--enable-split-usr', d)} \
                  --without-python \
                  --with-sysvrcnd-path=${sysconfdir} \
-                 --with-firmware-path=/lib/firmware \
+                 --with-firmware-path=${nonarch_base_libdir}/firmware \
                  --with-testdir=${PTEST_PATH} \
                "
 # per the systemd README, define VALGRIND=1 to run under valgrind
-- 
2.7.4



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

* [PATCH 06/23] bash: changes to support merged /usr
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (4 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 05/23] systemd: chagnes to " Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 07/23] busybox: " Amarnath Valluri
                   ` (42 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

Most of shell scripts refer to '#!/bin/{sh,bash}' inside the script. But when
'usrmege' feature is enbaled this path will be /usr/bin/{sh, bash}.

so to satisify build dependency add '/bin/{sh,bash}' to its providers list.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/bash/bash.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-extended/bash/bash.inc b/meta/recipes-extended/bash/bash.inc
index 1d08526..6525d64 100644
--- a/meta/recipes-extended/bash/bash.inc
+++ b/meta/recipes-extended/bash/bash.inc
@@ -63,3 +63,5 @@ pkg_postinst_${PN} () {
 pkg_postrm_${PN} () {
 	printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
 }
+
+RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh /bin/bash', '', d)}"
-- 
2.7.4



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

* [PATCH 07/23] busybox: changes to support merged /usr
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (5 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 06/23] bash: changes " Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 08/23] sed: " Amarnath Valluri
                   ` (41 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

Most of the shell scripts refer to /bin/sh inside the script. When 'usrmege'
feature is enabled, this path would be /usr/bin/sh. Hence, to satisfy build
dependency add '/bin/sh' to it's providers list.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/busybox/busybox.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 34f4e25..61d17e4 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -431,3 +431,5 @@ pkg_prerm_${PN}-syslog () {
 		fi
 	fi
 }
+
+RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh', '', d)}"
-- 
2.7.4



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

* [PATCH 08/23] sed: changes to support merged /usr
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (6 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 07/23] busybox: " Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 09/23] package_deb.bbclass: Ignore file paths in RPROVIDES Amarnath Valluri
                   ` (40 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

Few of the perl scripts referring '#!/bin/sed' inside the script. But when
'usrmerge' feature is enabled this path would be /usr/bin/sed. So to satisfy
build dependency add '/bin/sed' to it's providers list.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/sed/sed_4.2.2.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-extended/sed/sed_4.2.2.bb b/meta/recipes-extended/sed/sed_4.2.2.bb
index 5aa7d8a..e31bec2 100644
--- a/meta/recipes-extended/sed/sed_4.2.2.bb
+++ b/meta/recipes-extended/sed/sed_4.2.2.bb
@@ -44,3 +44,4 @@ do_install_ptest() {
 	oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR}
 }
 
+RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sed', '', d)}"
-- 
2.7.4



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

* [PATCH 09/23] package_deb.bbclass: Ignore file paths in RPROVIDES
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (7 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 08/23] sed: " Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-13 12:57   ` Alexander Kanavin
  2017-02-10 13:42 ` [PATCH 10/23] musl: Fix issues in relative symlink creation Amarnath Valluri
                   ` (39 subsequent siblings)
  48 siblings, 1 reply; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

Unlike rpm, debian packaging does not allow file paths in 'Provides:' field.
When 'usrmerge' distro feature enabled bash/busybox packages adds '/bin/sh' to
it's RPROVIDES to satisfy build dependencies, this entry should be filtered out.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/classes/package_deb.bbclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index eb549ca..e1bc078 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -237,6 +237,10 @@ python do_package_deb () {
         debian_cmp_remap(rsuggests)
         # Deliberately drop version information here, not wanted/supported by deb
         rprovides = dict.fromkeys(bb.utils.explode_dep_versions2(localdata.getVar("RPROVIDES") or ""), [])
+        # Remove file paths if any from rprovides, debian does not support custom providers
+        for key in list(rprovides.keys()):
+            if key.startswith('/'):
+                del rprovides[key]
         rprovides = collections.OrderedDict(sorted(rprovides.items(), key=lambda x: x[0]))
         debian_cmp_remap(rprovides)
         rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES") or "")
-- 
2.7.4



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

* [PATCH 10/23] musl: Fix issues in relative symlink creation
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (8 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 09/23] package_deb.bbclass: Ignore file paths in RPROVIDES Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 11/23] glibc: Ensure ldconfig is packaged into glibc Amarnath Valluri
                   ` (38 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

Make use of lnr/ln -r while creating relative symlinks than guessing the
relalive path.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 ...dynamic-linker-a-relative-symlink-to-libc.patch | 58 ++++++++++++++++++----
 meta/recipes-core/musl/musl_git.bb                 |  2 +-
 2 files changed, 49 insertions(+), 11 deletions(-)

diff --git a/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch b/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
index 5490b1c..5161c09 100644
--- a/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
+++ b/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
@@ -1,6 +1,6 @@
-From 94c0b97b62125d8bbc92dce0694e387d5b2ad181 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 10 Jan 2016 12:14:02 -0800
+From 0ec74744a4cba7c5fdfaa2685995119a4fca0260 Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Wed, 18 Jan 2017 16:14:37 +0200
 Subject: [PATCH] Make dynamic linker a relative symlink to libc
 
 absolute symlink into $(libdir) fails to load in a cross build
@@ -10,25 +10,63 @@ can be computed during cross builds, qemu in usermode often comes to aid
 in such situations to feed into cross builds.
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
 ---
 Upstream-Status: Pending
-
- Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+---
+ Makefile         | 2 +-
+ tools/install.sh | 8 +++++---
+ 2 files changed, 6 insertions(+), 4 deletions(-)
 
 diff --git a/Makefile b/Makefile
-index b2226fa..0d71f7f 100644
+index 8246b78..d1dbe39 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -189,7 +189,7 @@ $(DESTDIR)$(includedir)/%: include/%
+@@ -215,7 +215,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/include/%
  	$(INSTALL) -D -m 644 $< $@
  
  $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
 -	$(INSTALL) -D -l $(libdir)/libc.so $@ || true
-+	$(INSTALL) -D -l ..$(libdir)/libc.so $@ || true
++	$(INSTALL) -D -r $(DESTDIR)$(libdir)/libc.so $@ || true
  
  install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)
  
+diff --git a/tools/install.sh b/tools/install.sh
+index d913b60..b6a7f79 100755
+--- a/tools/install.sh
++++ b/tools/install.sh
+@@ -6,18 +6,20 @@
+ #
+ 
+ usage() {
+-printf "usage: %s [-D] [-l] [-m mode] src dest\n" "$0" 1>&2
++printf "usage: %s [-D] [-l] [-r] [-m mode] src dest\n" "$0" 1>&2
+ exit 1
+ }
+ 
+ mkdirp=
+ symlink=
++symlinkflags="-s"
+ mode=755
+ 
+-while getopts Dlm: name ; do
++while getopts Dlrm: name ; do
+ case "$name" in
+ D) mkdirp=yes ;;
+ l) symlink=yes ;;
++r) symlink=yes; symlinkflags="$symlinkflags -r" ;;
+ m) mode=$OPTARG ;;
+ ?) usage ;;
+ esac
+@@ -48,7 +50,7 @@ trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP
+ umask 077
+ 
+ if test "$symlink" ; then
+-ln -s "$1" "$tmp"
++ln $symlinkflags "$1" "$tmp"
+ else
+ cat < "$1" > "$tmp"
+ chmod "$mode" "$tmp"
 -- 
-2.7.0
+2.7.4
 
diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb
index e9b9fef..5775184 100644
--- a/meta/recipes-core/musl/musl_git.bb
+++ b/meta/recipes-core/musl/musl_git.bb
@@ -49,7 +49,7 @@ do_install() {
 	oe_runmake install DESTDIR='${D}'
 
 	install -d ${D}${bindir}
-	ln -s ../../${libdir}/libc.so ${D}${bindir}/ldd
+	lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd
 	for l in crypt dl m pthread resolv rt util xnet
 	do
 		ln -s libc.so ${D}${libdir}/lib$l.so
-- 
2.7.4



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

* [PATCH 11/23] glibc: Ensure ldconfig is packaged into glibc
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (9 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 10/23] musl: Fix issues in relative symlink creation Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 12/23] util-linux: Fix packaging with "usrmerge" Amarnath Valluri
                   ` (37 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

From: Jussi Kukkonen <jussi.kukkonen@intel.com>

If "usrmerge" feature is used, /usr/sbin/ldconfig gets packaged into
glibc-utils instead of glibc: Switch PACKAGES order to prevent this.

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
 meta/recipes-core/glibc/glibc-package.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc
index 481a00e..d9b9f52 100644
--- a/meta/recipes-core/glibc/glibc-package.inc
+++ b/meta/recipes-core/glibc/glibc-package.inc
@@ -19,7 +19,7 @@ USE_LDCONFIG ?= "1"
 
 INHIBIT_SYSROOT_STRIP = "1"
 
-PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode ${PN}-utils glibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
+PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode glibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} ${PN}-utils glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
 
 # The ld.so in this glibc supports the GNU_HASH
 RPROVIDES_${PN} = "eglibc rtld(GNU_HASH)"
-- 
2.7.4



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

* [PATCH 12/23] util-linux: Fix packaging with "usrmerge"
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (10 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 11/23] glibc: Ensure ldconfig is packaged into glibc Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 13/23] attr/acl: Do not create broken static library link when not needed Amarnath Valluri
                   ` (36 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

From: Jussi Kukkonen <jussi.kukkonen@intel.com>

Make sure fsck.cramfs is packaged before fsck so the latter
does not steal the fsck.cramfs binary when building with usrmerge
DISTRO_FEATURE.

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
 meta/recipes-core/util-linux/util-linux.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index 7d948bf..ae60b0a 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -29,9 +29,9 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin
 PACKAGES =+ "util-linux-agetty util-linux-fdisk util-linux-cfdisk util-linux-sfdisk \
              util-linux-swaponoff util-linux-losetup util-linux-umount \
              util-linux-mount util-linux-readprofile util-linux-uuidd \
-             util-linux-uuidgen util-linux-lscpu util-linux-fsck util-linux-blkid \
-             util-linux-mkfs util-linux-mcookie util-linux-reset util-linux-lsblk \
-             util-linux-mkfs.cramfs util-linux-fsck.cramfs util-linux-fstrim \
+             util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs util-linux-fsck \
+             util-linux-blkid util-linux-mkfs util-linux-mcookie util-linux-reset \
+             util-linux-lsblk util-linux-mkfs.cramfs util-linux-fstrim \
              util-linux-partx util-linux-hwclock util-linux-mountpoint \
              util-linux-findfs util-linux-getopt util-linux-sulogin util-linux-prlimit"
 PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}"
-- 
2.7.4



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

* [PATCH 13/23] attr/acl: Do not create broken static library link when not needed
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (11 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 12/23] util-linux: Fix packaging with "usrmerge" Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 14/23] systemd: Do not add libnss_* to systemd package Amarnath Valluri
                   ` (35 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

Stop creating the static library archieve(liba(ttr|cl).a) when --disable-static
configure option used.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-support/attr/ea-acl.inc               |  2 +
 ...gure-option-to-enable-disable-static-libr.patch | 70 ++++++++++++++++++++++
 2 files changed, 72 insertions(+)
 create mode 100644 meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch

diff --git a/meta/recipes-support/attr/ea-acl.inc b/meta/recipes-support/attr/ea-acl.inc
index a88ce90..c587b3c 100644
--- a/meta/recipes-support/attr/ea-acl.inc
+++ b/meta/recipes-support/attr/ea-acl.inc
@@ -2,6 +2,8 @@
 
 SRC_URI += "file://relative-libdir.patch;striplevel=0 \
            "
+# This patch should be applied after '(attr\|acl)-Missing-configure.ac.patch' 
+SRC_URI_append = " file://0001-Added-configure-option-to-enable-disable-static-libr.patch"
 
 inherit autotools-brokensep gettext
 
diff --git a/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch b/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch
new file mode 100644
index 0000000..b7f4f19
--- /dev/null
+++ b/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch
@@ -0,0 +1,70 @@
+From 01256c61ba126449c46dd4ab5d5e145488b981fa Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Mon, 23 Jan 2017 13:25:13 +0200
+Subject: [PATCH] Added configure option to enable/disable static library
+
+Create static library archieve only in case of --enable-static.
+
+Upstream-Status: Pending
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ configure.ac         | 6 ++++++
+ include/builddefs.in | 1 +
+ include/buildmacros  | 3 +++
+ 3 files changed, 10 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index b966d0e..e48268b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -26,6 +26,12 @@ AC_ARG_ENABLE(shared,
+ 	enable_shared=yes)
+ AC_SUBST(enable_shared)
+ 
++AC_ARG_ENABLE(static,
++[ --enable-static=[yes/no] Enable use of static libraries [default=yes]],,
++	enable_static=yes)
++AC_SUBST(enable_static)
++
++
+ AC_ARG_ENABLE(gettext,
+ [ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
+ 	enable_gettext=yes)
+diff --git a/include/builddefs.in b/include/builddefs.in
+index d9931db..3b3dbd2 100644
+--- a/include/builddefs.in
++++ b/include/builddefs.in
+@@ -71,6 +71,7 @@ RPMBUILD	= @rpmbuild@
+ RPM_VERSION	= @rpm_version@
+ 
+ ENABLE_SHARED	= @enable_shared@
++ENABLE_STATIC 	= @enable_static@
+ ENABLE_GETTEXT	= @enable_gettext@
+ 
+ HAVE_ZIPPED_MANPAGES = @have_zipped_manpages@
+diff --git a/include/buildmacros b/include/buildmacros
+index 39fa7e2..b0f25c5 100644
+--- a/include/buildmacros
++++ b/include/buildmacros
+@@ -80,6 +80,7 @@ endif
+ # /usr/lib.
+ ifeq ($(ENABLE_SHARED),yes)
+ INSTALL_LTLIB_DEV = \
++	set -x; \
+ 	cd $(TOPDIR)/$(LIBNAME)/.libs; \
+ 	../$(INSTALL) -m 755 -d $(PKG_DEVLIB_DIR); \
+ 	../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_DEVLIB_DIR); \
+@@ -88,7 +89,9 @@ INSTALL_LTLIB_DEV = \
+ 	../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_LIB_DIR); \
+ 	if test "x$(PKG_DEVLIB_DIR)" != "x$(PKG_LIB_DIR)" ; then \
+ 	rel_lib_prefix=$$(echo $(PKG_LIB_DIR) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
++	if test "$(ENABLE_STATIC)" = "yes" ; then \
+ 	../$(INSTALL) -S $$rel_lib_prefix$(PKG_DEVLIB_DIR)/$(LIBNAME).a $(PKG_LIB_DIR)/$(LIBNAME).a; \
++	fi ;\
+ 	../$(INSTALL) -S $$rel_lib_prefix$(PKG_DEVLIB_DIR)/$(LIBNAME).la $(PKG_LIB_DIR)/$(LIBNAME).la; \
+ 	rel_devlib_prefix=$$(echo $(PKG_DEVLIB_DIR) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
+ 	../$(INSTALL) -S $$rel_devlib_prefix$(PKG_LIB_DIR)/$(LIBNAME).so $(PKG_DEVLIB_DIR)/$(LIBNAME).so; \
+-- 
+2.7.4
+
-- 
2.7.4



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

* [PATCH 14/23] systemd: Do not add libnss_* to systemd package
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (12 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 13/23] attr/acl: Do not create broken static library link when not needed Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 15/23] util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package Amarnath Valluri
                   ` (34 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

libnss_* files should be part of corresponding sub-packages, the split happens
by do_package_split(). By adding ${libdir}/libnss_* to FILES_${PN}, those files
endup in systemd package when ${libdir} == ${base_libdir}.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/systemd/systemd_232.bb | 1 -
 1 file changed, 1 deletion(-)

diff --git a/meta/recipes-core/systemd/systemd_232.bb b/meta/recipes-core/systemd/systemd_232.bb
index bf0fadc..a18907a 100644
--- a/meta/recipes-core/systemd/systemd_232.bb
+++ b/meta/recipes-core/systemd/systemd_232.bb
@@ -451,7 +451,6 @@ FILES_${PN} = " ${base_bindir}/* \
                 ${rootlibexecdir}/systemd/* \
                 ${systemd_unitdir}/* \
                 ${base_libdir}/security/*.so \
-                ${libdir}/libnss_* \
                 /cgroup \
                 ${bindir}/systemd* \
                 ${bindir}/busctl \
-- 
2.7.4



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

* [PATCH 15/23] util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package.
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (13 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 14/23] systemd: Do not add libnss_* to systemd package Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 16/23] util-linux, shadow: Make 'nologin' alternative command Amarnath Valluri
                   ` (33 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

update-alternative.bbclass might rename the 'reset' binary when LINK_NAME ==
TARGET, This is true(${base_bindir} == ${bindir}) when 'usrmerge' distro feature
is enabled.  Hence, suffix with * to properly package the renamed binary.

Took the opportunity to make 'reset' alternative available only for target.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/util-linux/util-linux.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index ae60b0a..691b4e6 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -84,7 +84,7 @@ FILES_util-linux-umount = "${base_bindir}/umount.${BPN}"
 FILES_util-linux-readprofile = "${sbindir}/readprofile.${BPN}"
 FILES_util-linux-uuidgen = "${bindir}/uuidgen"
 FILES_util-linux-uuidd = "${sbindir}/uuidd"
-FILES_util-linux-reset = "${base_bindir}/reset"
+FILES_util-linux-reset = "${base_bindir}/reset*"
 FILES_util-linux-partx = "${sbindir}/partx"
 FILES_util-linux-hwclock = "${base_sbindir}/hwclock.${BPN}"
 FILES_util-linux-findfs = "${sbindir}/findfs"
@@ -255,7 +255,7 @@ ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck"
 ALTERNATIVE_util-linux-blkid = "blkid"
 ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid"
 
-ALTERNATIVE_util-linux-reset = "reset"
+ALTERNATIVE_util-linux-reset_class-target = "reset"
 ALTERNATIVE_LINK_NAME[reset] = "${bindir}/reset"
 ALTERNATIVE_TARGET[reset] = "${base_bindir}/reset"
 
-- 
2.7.4



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

* [PATCH 16/23] util-linux, shadow: Make 'nologin' alternative command
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (14 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 15/23] util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 17/23] libarchive: Backport upstream fixes Amarnath Valluri
                   ` (32 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

Both shadow and util-linux packages provides 'nologin' binary in ${base_sbindir}
and ${sbindir} respectively, this leads to conflict when 'usrmerge' feature is
enabled, where ${sbindir} == ${base_sbindir}. Hance, handle this to alternative
system to resolve the conflict.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/util-linux/util-linux.inc | 5 +++--
 meta/recipes-extended/shadow/shadow.inc     | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index 691b4e6..bd59b5a 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -187,14 +187,14 @@ do_install () {
 # reset and nologin causes a conflict with ncurses-native and shadow-native
 do_install_append_class-native () {
 	rm -f ${D}${base_bindir}/reset
-	rm -f ${D}${base_sbindir}/nologin
+	rm -f ${D}${sbindir}/nologin
 }
 
 ALTERNATIVE_PRIORITY = "80"
 
 ALTERNATIVE_${PN}  = "dmesg kill more mkswap blockdev pivot_root switch_root"
 ALTERNATIVE_${PN} += "hexdump last lastb logger mesg renice wall"
-ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject"
+ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject nologin"
 
 ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
 ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill"
@@ -204,6 +204,7 @@ ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev"
 ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
 ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
 ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
+ALTERNATIVE_LINK_NAME[nologin] = "${sbindir}/nologin"
 
 ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 nologin.8 sulogin.8 utmpdump.1 reset.1 kill.1 libblkid.3 blkid.8 findfs.8 fsck.8 uuid.3"
 
diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc
index 4c4db00..91b6f46 100644
--- a/meta/recipes-extended/shadow/shadow.inc
+++ b/meta/recipes-extended/shadow/shadow.inc
@@ -170,10 +170,11 @@ inherit update-alternatives
 
 ALTERNATIVE_PRIORITY = "200"
 
-ALTERNATIVE_${PN} = "passwd chfn chsh chpasswd vipw vigr"
+ALTERNATIVE_${PN} = "passwd chfn chsh chpasswd vipw vigr nologin"
 ALTERNATIVE_LINK_NAME[chpasswd] = "${sbindir}/chpasswd"
 ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
 ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
+ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
 
 ALTERNATIVE_${PN}-base = "newgrp groups login su"
 ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"
-- 
2.7.4



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

* [PATCH 17/23] libarchive: Backport upstream fixes.
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (15 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 16/23] util-linux, shadow: Make 'nologin' alternative command Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 18/23] kernel: use ${nonarch_base_libdir} for kernel modules installation Amarnath Valluri
                   ` (31 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

These set of patches backported from upstream, which fixes the issues in
extracting hardlinks over softlinks while etracting packages by opkg.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 ...te_disk_posix.c-make-_fsobj-functions-mor.patch | 242 +++++++++++++++++++++
 ...02-Fix-extracting-hardlinks-over-symlinks.patch | 116 ++++++++++
 .../libarchive/libarchive_3.2.2.bb                 |   2 +
 3 files changed, 360 insertions(+)
 create mode 100644 meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch
 create mode 100644 meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch

diff --git a/meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch b/meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch
new file mode 100644
index 0000000..6e2fd7b
--- /dev/null
+++ b/meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch
@@ -0,0 +1,242 @@
+From 90881d24d3f6d5fb207e97df3b91bbea8598e84e Mon Sep 17 00:00:00 2001
+From: Martin Matuska <martin@matuska.org>
+Date: Tue, 29 Nov 2016 16:47:37 +0100
+Subject: [PATCH 1/2] archive_write_disk_posix.c: make *_fsobj functions more
+ readable
+
+---
+ libarchive/archive_write_disk_posix.c | 121 +++++++++++++++++-----------------
+ 1 file changed, 61 insertions(+), 60 deletions(-)
+
+diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
+index 17c23b0..d786bc2 100644
+--- a/libarchive/archive_write_disk_posix.c
++++ b/libarchive/archive_write_disk_posix.c
+@@ -336,6 +336,8 @@ struct archive_write_disk {
+ 
+ #define HFS_BLOCKS(s)	((s) >> 12)
+ 
++static void	fsobj_error(int *, struct archive_string *, int, const char *,
++		    const char *);
+ static int	check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags);
+ static int	check_symlinks(struct archive_write_disk *);
+ static int	create_filesystem_object(struct archive_write_disk *);
+@@ -2005,8 +2007,9 @@ restore_entry(struct archive_write_disk *a)
+ 
+ 	if (en) {
+ 		/* Everything failed; give up here. */
+-		archive_set_error(&a->archive, en, "Can't create '%s'",
+-		    a->name);
++		if ((&a->archive)->error == NULL)
++			archive_set_error(&a->archive, en, "Can't create '%s'",
++			    a->name);
+ 		return (ARCHIVE_FAILED);
+ 	}
+ 
+@@ -2388,6 +2391,17 @@ current_fixup(struct archive_write_disk *a, const char *pathname)
+ 	return (a->current_fixup);
+ }
+ 
++/* Error helper for new *_fsobj functions */
++static void
++fsobj_error(int *a_eno, struct archive_string *a_estr,
++    int err, const char *errstr, const char *path)
++{
++	if (a_eno)
++		*a_eno = err;
++	if (a_estr)
++		archive_string_sprintf(a_estr, errstr, path);
++}
++
+ /*
+  * TODO: Someday, integrate this with the deep dir support; they both
+  * scan the path and both can be optimized by comparing against other
+@@ -2400,7 +2414,7 @@ current_fixup(struct archive_write_disk *a, const char *pathname)
+  * ARCHIVE_OK if there are none, otherwise puts an error in errmsg.
+  */
+ static int
+-check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags)
++check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr, int flags)
+ {
+ #if !defined(HAVE_LSTAT)
+ 	/* Platform doesn't have lstat, so we can't look for symlinks. */
+@@ -2474,19 +2488,20 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 			if (errno == ENOENT) {
+ 				break;
+ 			} else {
+-				/* Treat any other error as fatal - best to be paranoid here
+-				 * Note: This effectively disables deep directory
+-				 * support when security checks are enabled.
+-				 * Otherwise, very long pathnames that trigger
+-				 * an error here could evade the sandbox.
+-				 * TODO: We could do better, but it would probably
+-				 * require merging the symlink checks with the
+-				 * deep-directory editing. */
+-				if (error_number) *error_number = errno;
+-				if (error_string)
+-					archive_string_sprintf(error_string,
+-							"Could not stat %s",
+-							path);
++				/*
++				 * Treat any other error as fatal - best to be
++				 * paranoid here.
++				 * Note: This effectively disables deep
++				 * directory support when security checks are
++				 * enabled. Otherwise, very long pathnames that
++				 * trigger an error here could evade the
++				 * sandbox.
++				 * TODO: We could do better, but it would
++				 * probably require merging the symlink checks
++				 * with the deep-directory editing.
++				 */
++				fsobj_error(a_eno, a_estr, errno,
++				    "Could not stat %s", path);
+ 				res = ARCHIVE_FAILED;
+ 				break;
+ 			}
+@@ -2494,11 +2509,8 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 			if (!last) {
+ 				if (chdir(head) != 0) {
+ 					tail[0] = c;
+-					if (error_number) *error_number = errno;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Could not chdir %s",
+-								path);
++					fsobj_error(a_eno, a_estr, errno,
++					    "Could not chdir %s", path);
+ 					res = (ARCHIVE_FATAL);
+ 					break;
+ 				}
+@@ -2514,11 +2526,9 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 				 */
+ 				if (unlink(head)) {
+ 					tail[0] = c;
+-					if (error_number) *error_number = errno;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Could not remove symlink %s",
+-								path);
++					fsobj_error(a_eno, a_estr, errno,
++					    "Could not remove symlink %s",
++					    path);
+ 					res = ARCHIVE_FAILED;
+ 					break;
+ 				}
+@@ -2529,13 +2539,14 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 				 * symlink with another symlink.
+ 				 */
+ 				tail[0] = c;
+-				/* FIXME:  not sure how important this is to restore
++				/*
++				 * FIXME:  not sure how important this is to
++				 * restore
++				 */
++				/*
+ 				if (!S_ISLNK(path)) {
+-					if (error_number) *error_number = 0;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Removing symlink %s",
+-								path);
++					fsobj_error(a_eno, a_estr, 0,
++					    "Removing symlink %s", path);
+ 				}
+ 				*/
+ 				/* Symlink gone.  No more problem! */
+@@ -2545,22 +2556,17 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 				/* User asked us to remove problems. */
+ 				if (unlink(head) != 0) {
+ 					tail[0] = c;
+-					if (error_number) *error_number = 0;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Cannot remove intervening symlink %s",
+-								path);
++					fsobj_error(a_eno, a_estr, 0,
++					    "Cannot remove intervening "
++					    "symlink %s", path);
+ 					res = ARCHIVE_FAILED;
+ 					break;
+ 				}
+ 				tail[0] = c;
+ 			} else {
+ 				tail[0] = c;
+-				if (error_number) *error_number = 0;
+-				if (error_string)
+-					archive_string_sprintf(error_string,
+-							"Cannot extract through symlink %s",
+-							path);
++				fsobj_error(a_eno, a_estr, 0,
++				    "Cannot extract through symlink %s", path);
+ 				res = ARCHIVE_FAILED;
+ 				break;
+ 			}
+@@ -2577,10 +2583,8 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 	if (restore_pwd >= 0) {
+ 		r = fchdir(restore_pwd);
+ 		if (r != 0) {
+-			if(error_number) *error_number = errno;
+-			if(error_string)
+-				archive_string_sprintf(error_string,
+-						"chdir() failure");
++			fsobj_error(a_eno, a_estr, errno,
++			    "chdir() failure", "");
+ 		}
+ 		close(restore_pwd);
+ 		restore_pwd = -1;
+@@ -2688,17 +2692,16 @@ cleanup_pathname_win(struct archive_write_disk *a)
+  * is set) if the path is absolute.
+  */
+ static int
+-cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags)
++cleanup_pathname_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
++    int flags)
+ {
+ 	char *dest, *src;
+ 	char separator = '\0';
+ 
+ 	dest = src = path;
+ 	if (*src == '\0') {
+-		if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
+-		if (error_string)
+-		    archive_string_sprintf(error_string,
+-			    "Invalid empty pathname");
++		fsobj_error(a_eno, a_estr, ARCHIVE_ERRNO_MISC,
++		    "Invalid empty ", "pathname");
+ 		return (ARCHIVE_FAILED);
+ 	}
+ 
+@@ -2708,10 +2711,8 @@ cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *err
+ 	/* Skip leading '/'. */
+ 	if (*src == '/') {
+ 		if (flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) {
+-			if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
+-			if (error_string)
+-			    archive_string_sprintf(error_string,
+-				    "Path is absolute");
++			fsobj_error(a_eno, a_estr, ARCHIVE_ERRNO_MISC,
++			    "Path is ", "absolute");
+ 			return (ARCHIVE_FAILED);
+ 		}
+ 
+@@ -2738,11 +2739,11 @@ cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *err
+ 			} else if (src[1] == '.') {
+ 				if (src[2] == '/' || src[2] == '\0') {
+ 					/* Conditionally warn about '..' */
+-					if (flags & ARCHIVE_EXTRACT_SECURE_NODOTDOT) {
+-						if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
+-						if (error_string)
+-						    archive_string_sprintf(error_string,
+-							    "Path contains '..'");
++					if (flags
++					    & ARCHIVE_EXTRACT_SECURE_NODOTDOT) {
++						fsobj_error(a_eno, a_estr,
++						    ARCHIVE_ERRNO_MISC,
++						    "Path contains ", "'..'");
+ 						return (ARCHIVE_FAILED);
+ 					}
+ 				}
+-- 
+2.7.4
+
diff --git a/meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch b/meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch
new file mode 100644
index 0000000..d4a2d28
--- /dev/null
+++ b/meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch
@@ -0,0 +1,116 @@
+From ece28103885a079a129a23c5001252a1648517af Mon Sep 17 00:00:00 2001
+From: Martin Matuska <martin@matuska.org>
+Date: Tue, 29 Nov 2016 16:55:41 +0100
+Subject: [PATCH 2/2] Fix extracting hardlinks over symlinks
+
+Closes #821
+---
+ libarchive/archive_write_disk_posix.c | 43 +++++++++++++++++++++++++++++++++++
+ tar/test/test_symlink_dir.c           | 18 ++++++++++++++-
+ 2 files changed, 60 insertions(+), 1 deletion(-)
+
+diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
+index d786bc2..80b03cd 100644
+--- a/libarchive/archive_write_disk_posix.c
++++ b/libarchive/archive_write_disk_posix.c
+@@ -2563,6 +2563,49 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr, int
+ 					break;
+ 				}
+ 				tail[0] = c;
++			} else if ((flags &
++			    ARCHIVE_EXTRACT_SECURE_SYMLINKS) == 0) {
++				/*
++				 * We are not the last element and we want to
++				 * follow symlinks if they are a directory.
++				 * 
++				 * This is needed to extract hardlinks over
++				 * symlinks.
++				 */
++				r = stat(head, &st);
++				if (r != 0) {
++					tail[0] = c;
++					if (errno == ENOENT) {
++						break;
++					} else {
++						fsobj_error(a_eno, a_estr,
++						    errno,
++						    "Could not stat %s", path);
++						res = (ARCHIVE_FAILED);
++						break;
++					}
++				} else if (S_ISDIR(st.st_mode)) {
++					if (chdir(head) != 0) {
++						tail[0] = c;
++						fsobj_error(a_eno, a_estr,
++						    errno,
++						    "Could not chdir %s", path);
++						res = (ARCHIVE_FATAL);
++						break;
++					}
++					/*
++					 * Our view is now from inside
++					 * this dir:
++					 */
++					head = tail + 1;
++				} else {
++					tail[0] = c;
++					fsobj_error(a_eno, a_estr, 0,
++					    "Cannot extract through "
++					    "symlink %s", path);
++					res = ARCHIVE_FAILED;
++					break;
++				}
+ 			} else {
+ 				tail[0] = c;
+ 				fsobj_error(a_eno, a_estr, 0,
+diff --git a/tar/test/test_symlink_dir.c b/tar/test/test_symlink_dir.c
+index 25bd8b1..852e00b 100644
+--- a/tar/test/test_symlink_dir.c
++++ b/tar/test/test_symlink_dir.c
+@@ -47,11 +47,18 @@ DEFINE_TEST(test_symlink_dir)
+ 	assertMakeDir("source/dir3", 0755);
+ 	assertMakeDir("source/dir3/d3", 0755);
+ 	assertMakeFile("source/dir3/f3", 0755, "abcde");
++	assertMakeDir("source/dir4", 0755);
++	assertMakeFile("source/dir4/file3", 0755, "abcdef");
++	assertMakeHardlink("source/dir4/file4", "source/dir4/file3");
+ 
+ 	assertEqualInt(0,
+ 	    systemf("%s -cf test.tar -C source dir dir2 dir3 file file2",
+ 		testprog));
+ 
++	/* Second archive with hardlinks */
++	assertEqualInt(0,
++	    systemf("%s -cf test2.tar -C source dir4", testprog));
++
+ 	/*
+ 	 * Extract with -x and without -P.
+ 	 */
+@@ -118,9 +125,15 @@ DEFINE_TEST(test_symlink_dir)
+ 		assertMakeSymlink("dest2/file2", "real_file2");
+ 	assertEqualInt(0, systemf("%s -xPf test.tar -C dest2", testprog));
+ 
+-	/* dest2/dir symlink should be followed */
++	/* "dir4" is a symlink to existing "real_dir" */
++	if (canSymlink())
++		assertMakeSymlink("dest2/dir4", "real_dir");
++	assertEqualInt(0, systemf("%s -xPf test2.tar -C dest2", testprog));
++
++	/* dest2/dir and dest2/dir4 symlinks should be followed */
+ 	if (canSymlink()) {
+ 		assertIsSymlink("dest2/dir", "real_dir");
++		assertIsSymlink("dest2/dir4", "real_dir");
+ 		assertIsDir("dest2/real_dir", -1);
+ 	}
+ 
+@@ -141,4 +154,7 @@ DEFINE_TEST(test_symlink_dir)
+ 	/* dest2/file2 symlink should be removed */
+ 	failure("Symlink to non-existing file should be removed");
+ 	assertIsReg("dest2/file2", -1);
++
++	/* dest2/dir4/file3 and dest2/dir4/file4 should be hard links */
++	assertIsHardlink("dest2/dir4/file3", "dest2/dir4/file4");
+ }
+-- 
+2.7.4
+
diff --git a/meta/recipes-extended/libarchive/libarchive_3.2.2.bb b/meta/recipes-extended/libarchive/libarchive_3.2.2.bb
index 8ad62ad..387fa9b 100644
--- a/meta/recipes-extended/libarchive/libarchive_3.2.2.bb
+++ b/meta/recipes-extended/libarchive/libarchive_3.2.2.bb
@@ -33,6 +33,8 @@ PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4,"
 
 SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
            file://non-recursive-extract-and-list.patch \
+	   file://0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch \
+	   file://0002-Fix-extracting-hardlinks-over-symlinks.patch \
            "
 
 SRC_URI[md5sum] = "1ec00b7dcaf969dd2a5712f85f23c764"
-- 
2.7.4



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

* [PATCH 18/23] kernel: use ${nonarch_base_libdir} for kernel modules installation.
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (16 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 17/23] libarchive: Backport upstream fixes Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 19/23] firmware: use ${nonarch_base_libdir} for firmware installation Amarnath Valluri
                   ` (30 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

Replace hardcoded '/lib' in kernel modules installation path with
${nonarch_base_libdir}, which is ment exactly for this.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/classes/kernel-module-split.bbclass |  2 +-
 meta/classes/kernel.bbclass              | 14 +++++++-------
 meta/classes/module.bbclass              |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/meta/classes/kernel-module-split.bbclass b/meta/classes/kernel-module-split.bbclass
index db332e5..858d3ec 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -136,7 +136,7 @@ python split_kernel_module_packages () {
     postinst = d.getVar('pkg_postinst_modules')
     postrm = d.getVar('pkg_postrm_modules')
 
-    modules = do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='kernel-%s' % (d.getVar("KERNEL_VERSION")))
+    modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='kernel-%s' % (d.getVar("KERNEL_VERSION")))
     if modules:
         metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
         d.appendVar('RDEPENDS_' + metapkg, ' '+' '.join(modules))
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index f462b2f..447e9f3 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -297,11 +297,11 @@ kernel_do_install() {
 	#
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
 	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
-		oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
-		rm "${D}/lib/modules/${KERNEL_VERSION}/build"
-		rm "${D}/lib/modules/${KERNEL_VERSION}/source"
+		oe_runmake DEPMOD=echo MODLIB=${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION} INSTALL_FW_PATH=${D}${nonarch_base_libdir}/firmware modules_install
+		rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
+		rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source"
 		# If the kernel/ directory is empty remove it to prevent QA issues
-		rmdir --ignore-fail-on-non-empty "${D}/lib/modules/${KERNEL_VERSION}/kernel"
+		rmdir --ignore-fail-on-non-empty "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel"
 	else
 		bbnote "no modules to install"
 	fi
@@ -479,9 +479,9 @@ EXPORT_FUNCTIONS do_compile do_install do_configure
 # kernel-image becomes kernel-image-${KERNEL_VERSION}
 PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-modules"
 FILES_${PN} = ""
-FILES_kernel-base = "/lib/modules/${KERNEL_VERSION}/modules.order /lib/modules/${KERNEL_VERSION}/modules.builtin"
+FILES_kernel-base = "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.order ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin"
 FILES_kernel-image = ""
-FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} /lib/modules/${KERNEL_VERSION}/build"
+FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
 FILES_kernel-vmlinux = "/boot/vmlinux-${KERNEL_VERSION_NAME}"
 FILES_kernel-modules = ""
 RDEPENDS_kernel = "kernel-base"
@@ -512,7 +512,7 @@ pkg_postinst_kernel-base () {
 PACKAGESPLITFUNCS_prepend = "split_kernel_packages "
 
 python split_kernel_packages () {
-    do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.(bin|fw|cis|csp|dsp)$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
+    do_split_packages(d, root='${nonarch_base_libdir}/firmware', file_regex='^(.*)\.(bin|fw|cis|csp|dsp)$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
 }
 
 # Many scripts want to look in arch/$arch/boot for the bootable
diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
index a588873..a0491af 100644
--- a/meta/classes/module.bbclass
+++ b/meta/classes/module.bbclass
@@ -31,7 +31,7 @@ module_do_compile() {
 
 module_do_install() {
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
-	oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" \
+	oe_runmake DEPMOD=echo MODLIB="${D}${kernel_libdir}/modules/${KERNEL_VERSION}" \
 	           CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
 	           O=${STAGING_KERNEL_BUILDDIR} \
 	           ${MODULES_INSTALL_TARGET}
-- 
2.7.4



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

* [PATCH 19/23] firmware: use ${nonarch_base_libdir} for firmware installation.
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (17 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 18/23] kernel: use ${nonarch_base_libdir} for kernel modules installation Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 20/23] mdadm: Avoid using hardocded udev, sbin paths Amarnath Valluri
                   ` (29 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

Replace hardcoded '/lib' in kernel firmware installation path with
${nonarch_base_libdir}.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 .../linux-firmware/linux-firmware_git.bb           | 168 ++++++++++-----------
 1 file changed, 84 insertions(+), 84 deletions(-)

diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
index 0aba740..5a74a57 100644
--- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
+++ b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
@@ -195,27 +195,27 @@ do_compile() {
 }
 
 do_install() {
-	install -d  ${D}/lib/firmware/
-	cp -r * ${D}/lib/firmware/
+	install -d  ${D}${nonarch_base_libdir}/firmware/
+	cp -r * ${D}${nonarch_base_libdir}/firmware/
 
 	# Avoid Makefile to be deployed
-	rm ${D}/lib/firmware/Makefile
+	rm ${D}${nonarch_base_libdir}/firmware/Makefile
 
 	# Remove unbuild firmware which needs cmake and bash
-	rm ${D}/lib/firmware/carl9170fw -rf
+	rm ${D}${nonarch_base_libdir}/firmware/carl9170fw -rf
 
 	# Remove pointless bash script
-	rm ${D}/lib/firmware/configure
+	rm ${D}${nonarch_base_libdir}/firmware/configure
 
 	# Libertas sd8686
-	ln -sf libertas/sd8686_v9.bin ${D}/lib/firmware/sd8686.bin
-	ln -sf libertas/sd8686_v9_helper.bin ${D}/lib/firmware/sd8686_helper.bin
+	ln -sf libertas/sd8686_v9.bin ${D}${nonarch_base_libdir}/firmware/sd8686.bin
+	ln -sf libertas/sd8686_v9_helper.bin ${D}${nonarch_base_libdir}/firmware/sd8686_helper.bin
 
 	# fixup wl12xx location, after 2.6.37 the kernel searches a different location for it
-	( cd ${D}/lib/firmware ; ln -sf ti-connectivity/* . )
+	( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/* . )
 
         # Copy the iwlwifi ucode
-        cp ${WORKDIR}/iwlwifi-8000C-19.ucode ${D}/lib/firmware/
+        cp ${WORKDIR}/iwlwifi-8000C-19.ucode ${D}${nonarch_base_libdir}/firmware/
 }
 
 
@@ -252,23 +252,23 @@ LICENSE_${PN}-ath6k = "Firmware-atheros_firmware"
 LICENSE_${PN}-ath9k = "Firmware-atheros_firmware"
 LICENSE_${PN}-atheros-license = "Firmware-atheros_firmware"
 
-FILES_${PN}-atheros-license = "/lib/firmware/LICENCE.atheros_firmware"
+FILES_${PN}-atheros-license = "${nonarch_base_libdir}/firmware/LICENCE.atheros_firmware"
 FILES_${PN}-ar9170 = " \
-  /lib/firmware/ar9170*.fw \
+  ${nonarch_base_libdir}/firmware/ar9170*.fw \
 "
 FILES_${PN}-carl9170 = " \
-  /lib/firmware/carl9170*.fw \
+  ${nonarch_base_libdir}/firmware/carl9170*.fw \
 "
 FILES_${PN}-ath6k = " \
-  /lib/firmware/ath6k \
+  ${nonarch_base_libdir}/firmware/ath6k \
 "
 FILES_${PN}-ath9k = " \
-  /lib/firmware/ar9271.fw \
-  /lib/firmware/ar7010*.fw \
-  /lib/firmware/htc_9271.fw \
-  /lib/firmware/htc_7010.fw \
-  /lib/firmware/ath9k_htc/htc_7010-1.4.0.fw \
-  /lib/firmware/ath9k_htc/htc_9271-1.4.0.fw \
+  ${nonarch_base_libdir}/firmware/ar9271.fw \
+  ${nonarch_base_libdir}/firmware/ar7010*.fw \
+  ${nonarch_base_libdir}/firmware/htc_9271.fw \
+  ${nonarch_base_libdir}/firmware/htc_7010.fw \
+  ${nonarch_base_libdir}/firmware/ath9k_htc/htc_7010-1.4.0.fw \
+  ${nonarch_base_libdir}/firmware/ath9k_htc/htc_9271-1.4.0.fw \
 "
 
 RDEPENDS_${PN}-ar9170 += "${PN}-atheros-license"
@@ -282,14 +282,14 @@ LICENSE_${PN}-ar3k-license = "Firmware-qualcommAthos_ar3k"
 LICENSE_${PN}-ath10k = "Firmware-qualcommAthos_ath10k"
 LICENSE_${PN}-ath10k-license = "Firmware-qualcommAthos_ath10k"
 
-FILES_${PN}-ar3k-license = "/lib/firmware/LICENSE.QualcommAtheros_ar3k"
+FILES_${PN}-ar3k-license = "${nonarch_base_libdir}/firmware/LICENSE.QualcommAtheros_ar3k"
 FILES_${PN}-ar3k = " \
-  /lib/firmware/ar3k \
+  ${nonarch_base_libdir}/firmware/ar3k \
 "
 
-FILES_${PN}-ath10k-license = "/lib/firmware/LICENSE.QualcommAtheros_ath10k"
+FILES_${PN}-ath10k-license = "${nonarch_base_libdir}/firmware/LICENSE.QualcommAtheros_ath10k"
 FILES_${PN}-ath10k = " \
-  /lib/firmware/ath10k \
+  ${nonarch_base_libdir}/firmware/ath10k \
 "
 
 RDEPENDS_${PN}-ar3k += "${PN}-ar3k-license"
@@ -299,9 +299,9 @@ RDEPENDS_${PN}-ath10k += "${PN}-ath10k-license"
 LICENSE_${PN}-ralink = "Firmware-ralink-firmware"
 LICENSE_${PN}-ralink-license = "Firmware-ralink-firmware"
 
-FILES_${PN}-ralink-license = "/lib/firmware/LICENCE.ralink-firmware.txt"
+FILES_${PN}-ralink-license = "${nonarch_base_libdir}/firmware/LICENCE.ralink-firmware.txt"
 FILES_${PN}-ralink = " \
-  /lib/firmware/rt*.bin \
+  ${nonarch_base_libdir}/firmware/rt*.bin \
 "
 
 RDEPENDS_${PN}-ralink += "${PN}-ralink-license"
@@ -310,9 +310,9 @@ RDEPENDS_${PN}-ralink += "${PN}-ralink-license"
 LICENSE_${PN}-radeon = "Firmware-radeon"
 LICENSE_${PN}-radeon-license = "Firmware-radeon"
 
-FILES_${PN}-radeon-license = "/lib/firmware/LICENSE.radeon"
+FILES_${PN}-radeon-license = "${nonarch_base_libdir}/firmware/LICENSE.radeon"
 FILES_${PN}-radeon = " \
-  /lib/firmware/radeon \
+  ${nonarch_base_libdir}/firmware/radeon \
 "
 
 RDEPENDS_${PN}-radeon += "${PN}-radeon-license"
@@ -324,20 +324,20 @@ LICENSE_${PN}-sd8787 = "Firmware-Marvell"
 LICENSE_${PN}-sd8797 = "Firmware-Marvell"
 LICENSE_${PN}-marvell-license = "Firmware-Marvell"
 
-FILES_${PN}-marvell-license = "/lib/firmware/LICENCE.Marvell"
+FILES_${PN}-marvell-license = "${nonarch_base_libdir}/firmware/LICENCE.Marvell"
 FILES_${PN}-sd8686 = " \
-  /lib/firmware/libertas/sd8686_v9* \
-  /lib/firmware/sd8686* \
+  ${nonarch_base_libdir}/firmware/libertas/sd8686_v9* \
+  ${nonarch_base_libdir}/firmware/sd8686* \
 "
 FILES_${PN}-sd8688 = " \
-  /lib/firmware/libertas/sd8688* \
-  /lib/firmware/mrvl/sd8688* \
+  ${nonarch_base_libdir}/firmware/libertas/sd8688* \
+  ${nonarch_base_libdir}/firmware/mrvl/sd8688* \
 "
 FILES_${PN}-sd8787 = " \
-  /lib/firmware/mrvl/sd8787_uapsta.bin \
+  ${nonarch_base_libdir}/firmware/mrvl/sd8787_uapsta.bin \
 "
 FILES_${PN}-sd8797 = " \
-  /lib/firmware/mrvl/sd8797_uapsta.bin \
+  ${nonarch_base_libdir}/firmware/mrvl/sd8797_uapsta.bin \
 "
 
 RDEPENDS_${PN}-sd8686 += "${PN}-marvell-license"
@@ -355,25 +355,25 @@ LICENSE_${PN}-rtl8821 = "Firmware-rtlwifi_firmware"
 LICENSE_${PN}-rtl-license = "Firmware-rtlwifi_firmware"
 
 FILES_${PN}-rtl-license = " \
-  /lib/firmware/LICENCE.rtlwifi_firmware.txt \
+  ${nonarch_base_libdir}/firmware/LICENCE.rtlwifi_firmware.txt \
 "
 FILES_${PN}-rtl8188 = " \
-  /lib/firmware/rtlwifi/rtl8188*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8188*.bin \
 "
 FILES_${PN}-rtl8192cu = " \
-  /lib/firmware/rtlwifi/rtl8192cufw*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8192cufw*.bin \
 "
 FILES_${PN}-rtl8192ce = " \
-  /lib/firmware/rtlwifi/rtl8192cfw*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8192cfw*.bin \
 "
 FILES_${PN}-rtl8192su = " \
-  /lib/firmware/rtlwifi/rtl8712u.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8712u.bin \
 "
 FILES_${PN}-rtl8723 = " \
-  /lib/firmware/rtlwifi/rtl8723*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8723*.bin \
 "
 FILES_${PN}-rtl8821 = " \
-  /lib/firmware/rtlwifi/rtl8821*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8821*.bin \
 "
 
 RDEPENDS_${PN}-rtl8188 += "${PN}-rtl-license"
@@ -388,16 +388,16 @@ LICENSE_${PN}-wl12xx = "Firmware-ti-connectivity"
 LICENSE_${PN}-wl18xx = "Firmware-ti-connectivity"
 LICENSE_${PN}-ti-connectivity-license = "Firmware-ti-connectivity"
 
-FILES_${PN}-ti-connectivity-license = "/lib/firmware/LICENCE.ti-connectivity"
+FILES_${PN}-ti-connectivity-license = "${nonarch_base_libdir}/firmware/LICENCE.ti-connectivity"
 FILES_${PN}-wl12xx = " \
-  /lib/firmware/wl12* \
-  /lib/firmware/TI* \
-  /lib/firmware/ti-connectivity \
+  ${nonarch_base_libdir}/firmware/wl12* \
+  ${nonarch_base_libdir}/firmware/TI* \
+  ${nonarch_base_libdir}/firmware/ti-connectivity \
 "
 FILES_${PN}-wl18xx = " \
-  /lib/firmware/wl18* \
-  /lib/firmware/TI* \
-  /lib/firmware/ti-connectivity \
+  ${nonarch_base_libdir}/firmware/wl18* \
+  ${nonarch_base_libdir}/firmware/TI* \
+  ${nonarch_base_libdir}/firmware/ti-connectivity \
 "
 
 RDEPENDS_${PN}-wl12xx = "${PN}-ti-connectivity-license"
@@ -407,9 +407,9 @@ RDEPENDS_${PN}-wl18xx = "${PN}-ti-connectivity-license"
 LICENSE_${PN}-vt6656 = "Firmware-via_vt6656"
 LICENSE_${PN}-vt6656-license = "Firmware-via_vt6656"
 
-FILES_${PN}-vt6656-license = "/lib/firmware/LICENCE.via_vt6656"
+FILES_${PN}-vt6656-license = "${nonarch_base_libdir}/firmware/LICENCE.via_vt6656"
 FILES_${PN}-vt6656 = " \
-  /lib/firmware/vntwusb.fw \
+  ${nonarch_base_libdir}/firmware/vntwusb.fw \
 "
 
 RDEPENDS_${PN}-vt6656 = "${PN}-vt6656-license"
@@ -426,28 +426,28 @@ LICENSE_${PN}-bcm4354 = "Firmware-broadcom_bcm43xx"
 LICENSE_${PN}-broadcom-license = "Firmware-broadcom_bcm43xx"
 
 FILES_${PN}-broadcom-license = " \
-  /lib/firmware/LICENCE.broadcom_bcm43xx \
+  ${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx \
 "
 FILES_${PN}-bcm4329 = " \
-  /lib/firmware/brcm/brcmfmac4329-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4329-sdio.bin \
 "
 FILES_${PN}-bcm4330 = " \
-  /lib/firmware/brcm/brcmfmac4330-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4330-sdio.bin \
 "
 FILES_${PN}-bcm4334 = " \
-  /lib/firmware/brcm/brcmfmac4334-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4334-sdio.bin \
 "
 FILES_${PN}-bcm43340 = " \
-  /lib/firmware/brcm/brcmfmac43340-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac43340-sdio.bin \
 "
 FILES_${PN}-bcm4339 = " \
-  /lib/firmware/brcm/brcmfmac4339-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4339-sdio.bin \
 "
 FILES_${PN}-bcm43430 = " \
-  /lib/firmware/brcm/brcmfmac43430-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.bin \
 "
 FILES_${PN}-bcm4354 = " \
-  /lib/firmware/brcm/brcmfmac4354-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4354-sdio.bin \
 "
 
 RDEPENDS_${PN}-bcm4329 += "${PN}-broadcom-license"
@@ -466,8 +466,8 @@ RDEPENDS_${PN}-bcm4354 += "${PN}-broadcom-license"
 LICENSE_${PN}-bnx2-mips = "WHENCE"
 LICENSE_${PN}-whence-license = "WHENCE"
 
-FILES_${PN}-bnx2-mips = "/lib/firmware/bnx2/bnx2-mips-09-6.2.1b.fw"
-FILES_${PN}-whence-license = "/lib/firmware/WHENCE"
+FILES_${PN}-bnx2-mips = "${nonarch_base_libdir}/firmware/bnx2/bnx2-mips-09-6.2.1b.fw"
+FILES_${PN}-whence-license = "${nonarch_base_libdir}/firmware/WHENCE"
 
 RDEPENDS_${PN}-bnx2-mips += "${PN}-whence-license"
 
@@ -493,24 +493,24 @@ LICENSE_${PN}-iwlwifi-misc      = "Firmware-iwlwifi_firmware"
 LICENSE_${PN}-iwlwifi-license   = "Firmware-iwlwifi_firmware"
 
 
-FILES_${PN}-iwlwifi-license = "/lib/firmware/LICENCE.iwlwifi_firmware"
-FILES_${PN}-iwlwifi-135-6 = "/lib/firmware/iwlwifi-135-6.ucode"
-FILES_${PN}-iwlwifi-3160-7 = "/lib/firmware/iwlwifi-3160-7.ucode"
-FILES_${PN}-iwlwifi-3160-8 = "/lib/firmware/iwlwifi-3160-8.ucode"
-FILES_${PN}-iwlwifi-3160-9 = "/lib/firmware/iwlwifi-3160-9.ucode"
-FILES_${PN}-iwlwifi-6000-4 = "/lib/firmware/iwlwifi-6000-4.ucode"
-FILES_${PN}-iwlwifi-6000g2a-5 = "/lib/firmware/iwlwifi-6000g2a-5.ucode"
-FILES_${PN}-iwlwifi-6000g2a-6 = "/lib/firmware/iwlwifi-6000g2a-6.ucode"
-FILES_${PN}-iwlwifi-6000g2b-5 = "/lib/firmware/iwlwifi-6000g2b-5.ucode"
-FILES_${PN}-iwlwifi-6000g2b-6 = "/lib/firmware/iwlwifi-6000g2b-6.ucode"
-FILES_${PN}-iwlwifi-6050-4 = "/lib/firmware/iwlwifi-6050-4.ucode"
-FILES_${PN}-iwlwifi-6050-5 = "/lib/firmware/iwlwifi-6050-5.ucode"
-FILES_${PN}-iwlwifi-7260   = "/lib/firmware/iwlwifi-7260-*.ucode"
-FILES_${PN}-iwlwifi-7265   = "/lib/firmware/iwlwifi-7265-*.ucode"
-FILES_${PN}-iwlwifi-7265d   = "/lib/firmware/iwlwifi-7265D-*.ucode"
-FILES_${PN}-iwlwifi-8000c   = "/lib/firmware/iwlwifi-8000C-*.ucode"
-FILES_${PN}-iwlwifi-8265   = "/lib/firmware/iwlwifi-8265-*.ucode"
-FILES_${PN}-iwlwifi-misc   = "/lib/firmware/iwlwifi-*.ucode"
+FILES_${PN}-iwlwifi-license = "${nonarch_base_libdir}/firmware/LICENCE.iwlwifi_firmware"
+FILES_${PN}-iwlwifi-135-6 = "${nonarch_base_libdir}/firmware/iwlwifi-135-6.ucode"
+FILES_${PN}-iwlwifi-3160-7 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-7.ucode"
+FILES_${PN}-iwlwifi-3160-8 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-8.ucode"
+FILES_${PN}-iwlwifi-3160-9 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-9.ucode"
+FILES_${PN}-iwlwifi-6000-4 = "${nonarch_base_libdir}/firmware/iwlwifi-6000-4.ucode"
+FILES_${PN}-iwlwifi-6000g2a-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2a-5.ucode"
+FILES_${PN}-iwlwifi-6000g2a-6 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2a-6.ucode"
+FILES_${PN}-iwlwifi-6000g2b-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2b-5.ucode"
+FILES_${PN}-iwlwifi-6000g2b-6 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2b-6.ucode"
+FILES_${PN}-iwlwifi-6050-4 = "${nonarch_base_libdir}/firmware/iwlwifi-6050-4.ucode"
+FILES_${PN}-iwlwifi-6050-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6050-5.ucode"
+FILES_${PN}-iwlwifi-7260   = "${nonarch_base_libdir}/firmware/iwlwifi-7260-*.ucode"
+FILES_${PN}-iwlwifi-7265   = "${nonarch_base_libdir}/firmware/iwlwifi-7265-*.ucode"
+FILES_${PN}-iwlwifi-7265d   = "${nonarch_base_libdir}/firmware/iwlwifi-7265D-*.ucode"
+FILES_${PN}-iwlwifi-8000c   = "${nonarch_base_libdir}/firmware/iwlwifi-8000C-*.ucode"
+FILES_${PN}-iwlwifi-8265   = "${nonarch_base_libdir}/firmware/iwlwifi-8265-*.ucode"
+FILES_${PN}-iwlwifi-misc   = "${nonarch_base_libdir}/firmware/iwlwifi-*.ucode"
 
 RDEPENDS_${PN}-iwlwifi-135-6     = "${PN}-iwlwifi-license"
 RDEPENDS_${PN}-iwlwifi-3160-7    = "${PN}-iwlwifi-license"
@@ -549,14 +549,14 @@ RCONFLICTS_${PN}-iwlwifi-7260 = "${PN}-iwlwifi-7260-7 ${PN}-iwlwifi-7260-8 ${PN}
 
 LICENSE_${PN}-i915       = "Firmware-i915"
 LICENSE_${PN}-i915-license = "Firmware-i915"
-FILES_${PN}-i915-license = "/lib/firmware/LICENSE.i915"
-FILES_${PN}-i915         = "/lib/firmware/i915"
+FILES_${PN}-i915-license = "${nonarch_base_libdir}/firmware/LICENSE.i915"
+FILES_${PN}-i915         = "${nonarch_base_libdir}/firmware/i915"
 RDEPENDS_${PN}-i915      = "${PN}-i915-license"
 
-FILES_${PN}-adsp-sst-license      = "/lib/firmware/LICENCE.adsp_sst"
+FILES_${PN}-adsp-sst-license      = "${nonarch_base_libdir}/firmware/LICENCE.adsp_sst"
 LICENSE_${PN}-adsp-sst            = "Firmware-adsp_sst"
 LICENSE_${PN}-adsp-sst-license    = "Firmware-adsp_sst"
-FILES_${PN}-adsp-sst              = "/lib/firmware/intel/dsp_fw*"
+FILES_${PN}-adsp-sst              = "${nonarch_base_libdir}/firmware/intel/dsp_fw*"
 RDEPENDS_${PN}-adsp-sst           = "${PN}-adsp-sst-license"
 
 # For other firmwares
@@ -608,8 +608,8 @@ LICENSE_${PN} = "\
     & WHENCE \
 "
 
-FILES_${PN}-license += "/lib/firmware/LICEN*"
-FILES_${PN} += "/lib/firmware/*"
+FILES_${PN}-license += "${nonarch_base_libdir}/firmware/LICEN*"
+FILES_${PN} += "${nonarch_base_libdir}/firmware/*"
 RDEPENDS_${PN} += "${PN}-license"
 RDEPENDS_${PN} += "${PN}-whence-license"
 
-- 
2.7.4



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

* [PATCH 20/23] mdadm: Avoid using hardocded udev, sbin paths
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (18 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 19/23] firmware: use ${nonarch_base_libdir} for firmware installation Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 21/23] mktemp: Move installed files only when needed Amarnath Valluri
                   ` (28 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

Use appropriate bitbake variables inplace of below hardcoded locations:
  /sbin -> ${base_sbindir}
  /lib/udev -> ${nonarch_base_libdir}/udev

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/mdadm/mdadm_4.0.bb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-extended/mdadm/mdadm_4.0.bb b/meta/recipes-extended/mdadm/mdadm_4.0.bb
index c228899..8a77204 100644
--- a/meta/recipes-extended/mdadm/mdadm_4.0.bb
+++ b/meta/recipes-extended/mdadm/mdadm_4.0.bb
@@ -33,7 +33,9 @@ CFLAGS_append_mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__'
 CFLAGS_append_mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__'
 
 do_compile() {
-	oe_runmake SYSROOT="${STAGING_DIR_TARGET}"
+	# Point to right sbindir
+	sed -i -e 's;BINDIR  = /sbin;BINDIR = $base_sbindir;' ${S}/Makefile
+	oe_runmake SYSROOT="${STAGING_DIR_TARGET}" UDEVDIR="${nonarch_libdir}/udev"
 }
 
 do_install() {
@@ -51,7 +53,7 @@ do_install_ptest() {
 	cp -a ${S}/tests ${D}${PTEST_PATH}/tests
 	cp ${S}/test ${D}${PTEST_PATH}
 	sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test
-	ln -s /sbin/mdadm ${D}${PTEST_PATH}/mdadm
+	ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm
 	for prg in test_stripe swap_super raid6check
 	do
 		install -D -m 755 $prg ${D}${PTEST_PATH}/
-- 
2.7.4



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

* [PATCH 21/23] mktemp: Move installed files only when needed
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (19 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 20/23] mdadm: Avoid using hardocded udev, sbin paths Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 22/23] net-tools: Place package content as per bitbake environment Amarnath Valluri
                   ` (27 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

Move binary(ies) only when ${base_bindir} != ${bindir}.

When usrmerge distro feature is enabled they both might point to same location.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/mktemp/mktemp_1.7.bb | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-extended/mktemp/mktemp_1.7.bb b/meta/recipes-extended/mktemp/mktemp_1.7.bb
index 9accc6e..e8ae5c6 100644
--- a/meta/recipes-extended/mktemp/mktemp_1.7.bb
+++ b/meta/recipes-extended/mktemp/mktemp_1.7.bb
@@ -20,9 +20,11 @@ inherit autotools update-alternatives
 EXTRA_OECONF = "--with-libc"
 
 do_install_append () {
-	install -d ${D}${base_bindir}
-	mv ${D}${bindir}/mktemp ${D}${base_bindir}/mktemp
-	rmdir ${D}${bindir}
+	if [ "${base_bindir}" != "${bindir}" ] ; then
+		install -d ${D}${base_bindir}
+		mv ${D}${bindir}/mktemp ${D}${base_bindir}/mktemp
+		rmdir ${D}${bindir}
+	fi
 }
 
 ALTERNATIVE_${PN} = "mktemp"
-- 
2.7.4



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

* [PATCH 22/23] net-tools: Place package content as per bitbake environment.
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (20 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 21/23] mktemp: Move installed files only when needed Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:42 ` [PATCH 23/23] lsb: Make use of appropriate bitbake variables Amarnath Valluri
                   ` (26 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

net-tools Makefile was hardcoded sbin, bin installation paths to /bin and /sbin
respectively.  This change moves the installed files to appropriate location as
per configured bitbake environment.

This might be solved much better way by patching Makefile, but that causing
build issues, as net-tools recipe is using pre-generated config.{h/status}.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/net-tools/net-tools_1.60-26.bb | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meta/recipes-extended/net-tools/net-tools_1.60-26.bb b/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
index 49a65f8..c4af7ef 100644
--- a/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
+++ b/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
@@ -93,6 +93,17 @@ do_install() {
 	unset CFLAGS
 	unset LDFLAGS
 	oe_runmake 'BASEDIR=${D}' install
+
+	if [ "${base_bindir}" != "/bin" ]; then
+		mkdir -p ${D}/${base_bindir}
+		mv ${D}/bin/* ${D}/${base_bindir}/
+		rmdir ${D}/bin
+	fi
+	if [ "${base_sbindir}" != "/sbin" ]; then
+		mkdir ${D}/${base_sbindir}
+		mv ${D}/sbin/* ${D}/${base_sbindir}/
+		rmdir ${D}/sbin
+	fi
 }
 
 inherit update-alternatives
-- 
2.7.4



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

* [PATCH 23/23] lsb: Make use of appropriate bitbake variables.
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (21 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 22/23] net-tools: Place package content as per bitbake environment Amarnath Valluri
@ 2017-02-10 13:42 ` Amarnath Valluri
  2017-02-10 13:59 ` ✗ patchtest: failure for Fix for #7040 - Support for /usr merge Patchwork
                   ` (25 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-10 13:42 UTC (permalink / raw)
  To: openembedded-core

Using of bitbake environment variables in-place of hardcoded strings makes this
recipe portable to all environments.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/lsb/lsb_4.1.bb | 40 +++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/meta/recipes-extended/lsb/lsb_4.1.bb b/meta/recipes-extended/lsb/lsb_4.1.bb
index ece0eab..77ea365 100644
--- a/meta/recipes-extended/lsb/lsb_4.1.bb
+++ b/meta/recipes-extended/lsb/lsb_4.1.bb
@@ -33,14 +33,14 @@ S = "${WORKDIR}/lsb-release-1.4"
 CLEANBROKEN = "1"
 
 do_install(){
-	oe_runmake install prefix=${D}  mandir=${D}/${datadir}/man/ DESTDIR=${D}
+	oe_runmake install prefix=${D}/${prefix}  mandir=${D}/${datadir}/man/ DESTDIR=${D}
 
 	# this 2 dirs are needed by package lsb-dist-checker
 	mkdir -p ${D}${sysconfdir}/opt
 	mkdir -p ${D}${localstatedir}/opt
 
 	mkdir -p ${D}${base_bindir}
-	mkdir -p ${D}/${baselib}
+	mkdir -p ${D}${base_libdir}
 	mkdir -p ${D}${sysconfdir}/lsb-release.d
 	printf "LSB_VERSION=\"core-4.1-noarch:" > ${D}${sysconfdir}/lsb-release
 
@@ -86,47 +86,45 @@ do_install_append(){
            install -m 0755 ${WORKDIR}/${i} ${D}${sysconfdir}/core-lsb
        done
 
-       install -d ${D}/lib/lsb
-       install -m 0755 ${WORKDIR}/init-functions ${D}/lib/lsb
+       install -d ${D}/${nonarch_base_libdir}/lsb
+       install -m 0755 ${WORKDIR}/init-functions ${D}/${nonarch_base_libdir}/lsb
 
        # creat links for LSB test
-       install -d ${D}/usr/lib/lsb
-       ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/install_initd
-       ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/remove_initd
+       if [ "${nonarch_base_libdir}" != "${nonarch_libdir}" ; then
+               install -d ${D}/${nonarch_libdir}/lsb
+       fi
+       ln -sf ${sbindir}/chkconfig ${D}/${nonarch_libdir}/lsb/install_initd
+       ln -sf ${sbindir}/chkconfig ${D}/${nonarch_libdir}/lsb/remove_initd
 
        if [ "${TARGET_ARCH}" = "x86_64" ];then
-	       cd ${D}
                if [ "${baselib}" != "lib64" ]; then
-                   ln -sf ${baselib} lib64
+                   lnr ${D}${base_libdir} ${D}/lib64
                fi
-	       cd ${D}/${baselib}
+	       cd ${D}/${base_libdir}
                ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.2
                ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3
        fi
        if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
-	       cd ${D}/${baselib}
+	       cd ${D}/${base_libdir}
                ln -sf ld-linux.so.2 ld-lsb.so.2
                ln -sf ld-linux.so.2 ld-lsb.so.3
        fi
 
        if [ "${TARGET_ARCH}" = "powerpc64" ];then
-               cd ${D}
                if [ "${baselib}" != "lib64" ]; then
-                   ln -sf ${baselib} lib64
+                   lnr  ${D}${base_libdir} ${D}/lib64
                fi
-               cd ${D}/${baselib}
+               cd ${D}/${base_libdir}
                ln -sf ld64.so.1 ld-lsb-ppc64.so.2
                ln -sf ld64.so.1 ld-lsb-ppc64.so.3
        fi
        if [ "${TARGET_ARCH}" = "powerpc" ];then
-	       cd ${D}/${baselib}
+	       cd ${D}/${base_libdir}
                ln -sf ld.so.1 ld-lsb-ppc32.so.2
                ln -sf ld.so.1 ld-lsb-ppc32.so.3
        fi
 }
-FILES_${PN} += "/lib64 \
-                ${base_libdir} \
-                /usr/lib/lsb \
-                ${base_libdir}/lsb/* \
-                /lib/lsb/* \
-               "
+FILES_${PN} += "${base_libdir} \
+                ${nonarch_base_libdir}/lsb \
+                ${nonarch_libdir}/lsb/* \
+                ${@'/lib64' if d.getVar('TARGET_ARCH')  == ('x86_64' or 'powerpc64') and '${baselib}' != 'lib64' else ''}"
-- 
2.7.4



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

* ✗ patchtest: failure for Fix for #7040 - Support for /usr merge
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (22 preceding siblings ...)
  2017-02-10 13:42 ` [PATCH 23/23] lsb: Make use of appropriate bitbake variables Amarnath Valluri
@ 2017-02-10 13:59 ` Patchwork
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                   ` (24 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Patchwork @ 2017-02-10 13:59 UTC (permalink / raw)
  To: Amarnath Valluri; +Cc: openembedded-core

== Series Details ==

Series: Fix for #7040 - Support for /usr merge
Revision: 1
URL   : https://patchwork.openembedded.org/series/5259/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Added patch file is missing Upstream-Status in the header [test_upstream_status_presence] 
  Suggested fix    Add Upstream-Status: <status> to the header of meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch (possible values: Pending, Submitted, Accepted, Backport, Denied, Inappropriate)

* Issue             A patch file has been added, but does not have a Signed-off-by tag [test_signed_off_by_presence] 
  Suggested fix    Sign off the added patch file (meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



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

* Re: [PATCH 01/23] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
  2017-02-10 13:42 ` [PATCH 01/23] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
@ 2017-02-10 16:29   ` Christopher Larson
  0 siblings, 0 replies; 88+ messages in thread
From: Christopher Larson @ 2017-02-10 16:29 UTC (permalink / raw)
  To: Amarnath Valluri
  Cc: Joshua Lock, Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

On Fri, Feb 10, 2017 at 6:42 AM, Amarnath Valluri <
amarnath.valluri@intel.com> wrote:

> From: Joshua Lock <joshua.g.lock@intel.com>
>
> Modify bindir, libdir and sbindir to be exec_prefix/$d, rather than
> base_prefix/$d, when the usrmerge DISTRO_FEATURE is enabled.
>
> Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
>

This looks interesting, but worth noting that this will invalidate all
sstates everywhere, as sstate uses unexpanded variables. So even if the
feature is gone, it’ll change the checksums anyway. That’s probably okay,
just something to keep in mind.
-- 
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 1325 bytes --]

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

* Re: [PATCH 09/23] package_deb.bbclass: Ignore file paths in RPROVIDES
  2017-02-10 13:42 ` [PATCH 09/23] package_deb.bbclass: Ignore file paths in RPROVIDES Amarnath Valluri
@ 2017-02-13 12:57   ` Alexander Kanavin
  0 siblings, 0 replies; 88+ messages in thread
From: Alexander Kanavin @ 2017-02-13 12:57 UTC (permalink / raw)
  To: openembedded-core

On 02/10/2017 03:42 PM, Amarnath Valluri wrote:
> Unlike rpm, debian packaging does not allow file paths in 'Provides:' field.
> When 'usrmerge' distro feature enabled bash/busybox packages adds '/bin/sh' to
> it's RPROVIDES to satisfy build dependencies, this entry should be filtered out.

Thanks for this patch, it's also necessary in the when using dnf :) I 
cherry-picked it to my branch.

Alex



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

* [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (23 preceding siblings ...)
  2017-02-10 13:59 ` ✗ patchtest: failure for Fix for #7040 - Support for /usr merge Patchwork
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26   ` [PATCH v2 00/25] Fix for #7040 - Support for /usr merge Amarnath Valluri
                     ` (26 more replies)
  2017-02-22  8:26 ` [PATCH v2 02/25] bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE Amarnath Valluri
                   ` (23 subsequent siblings)
  48 siblings, 27 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core; +Cc: Joshua Lock

From: Joshua Lock <joshua.g.lock@intel.com>

Modify bindir, libdir and sbindir to be exec_prefix/$d, rather than
base_prefix/$d, when the usrmerge DISTRO_FEATURE is enabled.

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
---
 meta/conf/bitbake.conf | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index e421650..c5beb77 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -18,10 +18,14 @@ export prefix = "/usr"
 export exec_prefix = "${prefix}"
 
 # Base paths
-export base_bindir = "${base_prefix}/bin"
-export base_sbindir = "${base_prefix}/sbin"
-export base_libdir = "${base_prefix}/${baselib}"
-export nonarch_base_libdir = "${base_prefix}/lib"
+bin = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}/bin', '${base_prefix}/bin', d)}"
+sbin = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}/sbin', '${base_prefix}/sbin', d)}"
+lib = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}/${baselib}', '${base_prefix}/${baselib}', d)}"
+nonarch_lib = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}/lib', '${base_prefix}/lib', d)}"
+export base_bindir = "${bin}"
+export base_sbindir = "${sbin}"
+export base_libdir = "${lib}"
+export nonarch_base_libdir = "${nonarch_lib}"
 
 # Architecture independent paths
 export sysconfdir = "${base_prefix}/etc"
-- 
2.7.4



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

* [PATCH v2 02/25] bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (24 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 03/25] cross.bbclass: merged /usr support Amarnath Valluri
                   ` (22 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

Modify base bin, sbin, and lib nativesdk variables to be ${prefix_nativesdk}/$d,
when the usrmerge DISTRO_FEATURE is enabled.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/conf/bitbake.conf | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index c5beb77..ecff034 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -67,11 +67,11 @@ bindir_crossscripts = "${bindir}/crossscripts"
 prefix_nativesdk = "/usr"
 bindir_nativesdk = "${prefix_nativesdk}/bin"
 sbindir_nativesdk = "${prefix_nativesdk}/sbin"
-base_bindir_nativesdk = "/bin"
-base_sbindir_nativesdk = "/sbin"
-includedir_nativesdk = "${prefix_nativesdk}/include"
 libdir_nativesdk = "${prefix_nativesdk}/lib"
-base_libdir_nativesdk = "/lib"
+base_bindir_nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${bindir_nativesdk}', '/bin', d)}"
+base_sbindir_nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${sbindir_nativesdk}', '/sbin', d)}"
+base_libdir_nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${libdir_nativesdk}', '/lib', d)}"
+includedir_nativesdk = "${prefix_nativesdk}/include"
 localstatedir_nativesdk = "/var"
 
 #
-- 
2.7.4



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

* [PATCH v2 03/25] cross.bbclass: merged /usr support
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (25 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 02/25] bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 04/25] base-files: Replace hardcoded root paths with appropriate bitbake variables Amarnath Valluri
                   ` (21 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

When 'usrmerge' distro feature enabled match target_base_libdir to ${target_libdir}.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/classes/cross.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/cross.bbclass b/meta/classes/cross.bbclass
index 2602153..c8ef3a5 100644
--- a/meta/classes/cross.bbclass
+++ b/meta/classes/cross.bbclass
@@ -48,8 +48,8 @@ SSTATE_SCAN_CMD ?= "${SSTATE_SCAN_CMD_NATIVE}"
 target_base_prefix := "${base_prefix}"
 target_prefix := "${prefix}"
 target_exec_prefix := "${exec_prefix}"
-target_base_libdir = "${target_base_prefix}/${baselib}"
 target_libdir = "${target_exec_prefix}/${baselib}"
+target_base_libdir = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${target_libdir}', '${target_base_prefix}/${baselib}', d)}"
 target_includedir := "${includedir}"
 
 # Overrides for paths
-- 
2.7.4



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

* [PATCH v2 04/25] base-files: Replace hardcoded root paths with appropriate bitbake variables
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (26 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 03/25] cross.bbclass: merged /usr support Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 05/25] systemd: chagnes to support merged /usr Amarnath Valluri
                   ` (20 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

/bin, /sbin, /lib are replaced with ${base_bindir}, ${base_sbindir} and
${base_libdir}.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/base-files/base-files_3.0.14.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 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 d138005..35744f4 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
@@ -32,8 +32,9 @@ INHIBIT_DEFAULT_DEPS = "1"
 docdir_append = "/${P}"
 dirs1777 = "/tmp ${localstatedir}/volatile/tmp"
 dirs2775 = ""
-dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
-           ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \
+dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \
+           ${sysconfdir} ${sysconfdir}/default \
+           ${sysconfdir}/skel ${nonarch_base_libdir} /mnt /proc ${ROOT_HOME} /run \
            ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
            ${libdir} ${sbindir} ${datadir} \
            ${datadir}/common-licenses ${datadir}/dict ${infodir} \
-- 
2.7.4



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

* [PATCH v2 05/25] systemd: chagnes to support merged /usr
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (27 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 04/25] base-files: Replace hardcoded root paths with appropriate bitbake variables Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 06/25] bash: changes " Amarnath Valluri
                   ` (19 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

When the usrmerge DISTRO_FEATURE is selected disable the split-usr
support and modify rootprefix to be exec_prefix, rather than base_prefix.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/systemd/systemd_232.bb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd_232.bb b/meta/recipes-core/systemd/systemd_232.bb
index cc8781e..bf0fadc 100644
--- a/meta/recipes-core/systemd/systemd_232.bb
+++ b/meta/recipes-core/systemd/systemd_232.bb
@@ -131,7 +131,7 @@ CACHED_CONFIGUREVARS += "ac_cv_path_SULOGIN=${base_sbindir}/sulogin"
 
 # Helper variables to clarify locations.  This mirrors the logic in systemd's
 # build system.
-rootprefix ?= "${base_prefix}"
+rootprefix ?= "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}', '${base_prefix}', d)}"
 rootlibdir ?= "${base_libdir}"
 rootlibexecdir = "${rootprefix}/lib"
 
@@ -149,10 +149,10 @@ CACHED_CONFIGUREVARS_class-target = "\
 EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
                  --with-rootlibdir=${rootlibdir} \
                  --with-roothomedir=${ROOT_HOME} \
-                 --enable-split-usr \
+                 ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '--disable-split-usr', '--enable-split-usr', d)} \
                  --without-python \
                  --with-sysvrcnd-path=${sysconfdir} \
-                 --with-firmware-path=/lib/firmware \
+                 --with-firmware-path=${nonarch_base_libdir}/firmware \
                  --with-testdir=${PTEST_PATH} \
                "
 # per the systemd README, define VALGRIND=1 to run under valgrind
-- 
2.7.4



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

* [PATCH v2 06/25] bash: changes to support merged /usr
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (28 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 05/25] systemd: chagnes to support merged /usr Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 07/25] busybox: " Amarnath Valluri
                   ` (18 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

Most of shell scripts refer to '#!/bin/{sh,bash}' inside the script. But when
'usrmege' feature is enabled this path will be /usr/bin/{sh, bash}.

so to satisify build dependency add '/bin/{sh,bash}' to its providers list.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/bash/bash.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-extended/bash/bash.inc b/meta/recipes-extended/bash/bash.inc
index a05b987..0f0d679 100644
--- a/meta/recipes-extended/bash/bash.inc
+++ b/meta/recipes-extended/bash/bash.inc
@@ -65,3 +65,5 @@ pkg_postinst_${PN} () {
 pkg_postrm_${PN} () {
 	printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
 }
+
+RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh /bin/bash', '', d)}"
-- 
2.7.4



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

* [PATCH v2 07/25] busybox: changes to support merged /usr
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (29 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 06/25] bash: changes " Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 08/25] sed: " Amarnath Valluri
                   ` (17 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

Most of the shell scripts refer to /bin/sh inside the script. When 'usrmege'
feature is enabled, this path would be /usr/bin/sh. Hence, to satisfy build
dependency add '/bin/sh' to it's providers list.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/busybox/busybox.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 34f4e25..61d17e4 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -431,3 +431,5 @@ pkg_prerm_${PN}-syslog () {
 		fi
 	fi
 }
+
+RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh', '', d)}"
-- 
2.7.4



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

* [PATCH v2 08/25] sed: changes to support merged /usr
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (30 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 07/25] busybox: " Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 09/25] musl: Fix issues in relative symlink creation Amarnath Valluri
                   ` (16 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

Few of the perl scripts referring '#!/bin/sed' inside the script. But when
'usrmerge' feature is enabled this path would be /usr/bin/sed. So to satisfy
build dependency add '/bin/sed' to it's providers list.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/sed/sed_4.2.2.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-extended/sed/sed_4.2.2.bb b/meta/recipes-extended/sed/sed_4.2.2.bb
index 5aa7d8a..e31bec2 100644
--- a/meta/recipes-extended/sed/sed_4.2.2.bb
+++ b/meta/recipes-extended/sed/sed_4.2.2.bb
@@ -44,3 +44,4 @@ do_install_ptest() {
 	oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR}
 }
 
+RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sed', '', d)}"
-- 
2.7.4



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

* [PATCH v2 09/25] musl: Fix issues in relative symlink creation
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (31 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 08/25] sed: " Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 10/25] glibc: Ensure ldconfig is packaged into glibc Amarnath Valluri
                   ` (15 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

Make use of lnr/ln -r while creating relative symlinks than guessing the
relalive path.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 ...dynamic-linker-a-relative-symlink-to-libc.patch | 62 ++++++++++++++++++----
 meta/recipes-core/musl/musl_git.bb                 |  2 +-
 2 files changed, 53 insertions(+), 11 deletions(-)

diff --git a/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch b/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
index 5490b1c..462d338 100644
--- a/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
+++ b/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
@@ -1,6 +1,6 @@
-From 94c0b97b62125d8bbc92dce0694e387d5b2ad181 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 10 Jan 2016 12:14:02 -0800
+From 0ec74744a4cba7c5fdfaa2685995119a4fca0260 Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Wed, 18 Jan 2017 16:14:37 +0200
 Subject: [PATCH] Make dynamic linker a relative symlink to libc
 
 absolute symlink into $(libdir) fails to load in a cross build
@@ -9,26 +9,68 @@ applications, which cross build systems often do, since not everything
 can be computed during cross builds, qemu in usermode often comes to aid
 in such situations to feed into cross builds.
 
+V2:
+ Make use of 'ln -r' to create relative symlinks, as most fo the distros
+ shipping coreutils 8.16+
+
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
 ---
 Upstream-Status: Pending
-
- Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+---
+ Makefile         | 2 +-
+ tools/install.sh | 8 +++++---
+ 2 files changed, 6 insertions(+), 4 deletions(-)
 
 diff --git a/Makefile b/Makefile
-index b2226fa..0d71f7f 100644
+index 8246b78..d1dbe39 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -189,7 +189,7 @@ $(DESTDIR)$(includedir)/%: include/%
+@@ -215,7 +215,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/include/%
  	$(INSTALL) -D -m 644 $< $@
  
  $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
 -	$(INSTALL) -D -l $(libdir)/libc.so $@ || true
-+	$(INSTALL) -D -l ..$(libdir)/libc.so $@ || true
++	$(INSTALL) -D -r $(DESTDIR)$(libdir)/libc.so $@ || true
  
  install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)
  
+diff --git a/tools/install.sh b/tools/install.sh
+index d913b60..b6a7f79 100755
+--- a/tools/install.sh
++++ b/tools/install.sh
+@@ -6,18 +6,20 @@
+ #
+ 
+ usage() {
+-printf "usage: %s [-D] [-l] [-m mode] src dest\n" "$0" 1>&2
++printf "usage: %s [-D] [-l] [-r] [-m mode] src dest\n" "$0" 1>&2
+ exit 1
+ }
+ 
+ mkdirp=
+ symlink=
++symlinkflags="-s"
+ mode=755
+ 
+-while getopts Dlm: name ; do
++while getopts Dlrm: name ; do
+ case "$name" in
+ D) mkdirp=yes ;;
+ l) symlink=yes ;;
++r) symlink=yes; symlinkflags="$symlinkflags -r" ;;
+ m) mode=$OPTARG ;;
+ ?) usage ;;
+ esac
+@@ -48,7 +50,7 @@ trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP
+ umask 077
+ 
+ if test "$symlink" ; then
+-ln -s "$1" "$tmp"
++ln $symlinkflags "$1" "$tmp"
+ else
+ cat < "$1" > "$tmp"
+ chmod "$mode" "$tmp"
 -- 
-2.7.0
+2.7.4
 
diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb
index e9b9fef..5775184 100644
--- a/meta/recipes-core/musl/musl_git.bb
+++ b/meta/recipes-core/musl/musl_git.bb
@@ -49,7 +49,7 @@ do_install() {
 	oe_runmake install DESTDIR='${D}'
 
 	install -d ${D}${bindir}
-	ln -s ../../${libdir}/libc.so ${D}${bindir}/ldd
+	lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd
 	for l in crypt dl m pthread resolv rt util xnet
 	do
 		ln -s libc.so ${D}${libdir}/lib$l.so
-- 
2.7.4



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

* [PATCH v2 10/25] glibc: Ensure ldconfig is packaged into glibc
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (32 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 09/25] musl: Fix issues in relative symlink creation Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 11/25] util-linux: Fix packaging with "usrmerge" Amarnath Valluri
                   ` (14 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

From: Jussi Kukkonen <jussi.kukkonen@intel.com>

If "usrmerge" feature is used, /usr/sbin/ldconfig gets packaged into
glibc-utils instead of glibc: Switch PACKAGES order to prevent this.

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
 meta/recipes-core/glibc/glibc-package.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc
index f0fc9c1..6aca2db 100644
--- a/meta/recipes-core/glibc/glibc-package.inc
+++ b/meta/recipes-core/glibc/glibc-package.inc
@@ -19,7 +19,7 @@ USE_LDCONFIG ?= "1"
 
 INHIBIT_SYSROOT_STRIP = "1"
 
-PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode ${PN}-utils glibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
+PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode glibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} ${PN}-utils glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
 
 # The ld.so in this glibc supports the GNU_HASH
 RPROVIDES_${PN} = "eglibc rtld(GNU_HASH)"
-- 
2.7.4



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

* [PATCH v2 11/25] util-linux: Fix packaging with "usrmerge"
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (33 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 10/25] glibc: Ensure ldconfig is packaged into glibc Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 12/25] attr/acl: Do not create broken static library link when not needed Amarnath Valluri
                   ` (13 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

From: Jussi Kukkonen <jussi.kukkonen@intel.com>

Make sure fsck.cramfs is packaged before fsck so the latter
does not steal the fsck.cramfs binary when building with usrmerge
DISTRO_FEATURE.

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
 meta/recipes-core/util-linux/util-linux.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index 7d948bf..ae60b0a 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -29,9 +29,9 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin
 PACKAGES =+ "util-linux-agetty util-linux-fdisk util-linux-cfdisk util-linux-sfdisk \
              util-linux-swaponoff util-linux-losetup util-linux-umount \
              util-linux-mount util-linux-readprofile util-linux-uuidd \
-             util-linux-uuidgen util-linux-lscpu util-linux-fsck util-linux-blkid \
-             util-linux-mkfs util-linux-mcookie util-linux-reset util-linux-lsblk \
-             util-linux-mkfs.cramfs util-linux-fsck.cramfs util-linux-fstrim \
+             util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs util-linux-fsck \
+             util-linux-blkid util-linux-mkfs util-linux-mcookie util-linux-reset \
+             util-linux-lsblk util-linux-mkfs.cramfs util-linux-fstrim \
              util-linux-partx util-linux-hwclock util-linux-mountpoint \
              util-linux-findfs util-linux-getopt util-linux-sulogin util-linux-prlimit"
 PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}"
-- 
2.7.4



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

* [PATCH v2 12/25] attr/acl: Do not create broken static library link when not needed
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (34 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 11/25] util-linux: Fix packaging with "usrmerge" Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 13/25] systemd: Do not add libnss_* to systemd package Amarnath Valluri
                   ` (12 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

Stop creating the static library archieve(liba(ttr|cl).a) when --disable-static
configure option used.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-support/attr/ea-acl.inc               |  2 +
 ...gure-option-to-enable-disable-static-libr.patch | 70 ++++++++++++++++++++++
 2 files changed, 72 insertions(+)
 create mode 100644 meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch

diff --git a/meta/recipes-support/attr/ea-acl.inc b/meta/recipes-support/attr/ea-acl.inc
index a88ce90..c587b3c 100644
--- a/meta/recipes-support/attr/ea-acl.inc
+++ b/meta/recipes-support/attr/ea-acl.inc
@@ -2,6 +2,8 @@
 
 SRC_URI += "file://relative-libdir.patch;striplevel=0 \
            "
+# This patch should be applied after '(attr\|acl)-Missing-configure.ac.patch' 
+SRC_URI_append = " file://0001-Added-configure-option-to-enable-disable-static-libr.patch"
 
 inherit autotools-brokensep gettext
 
diff --git a/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch b/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch
new file mode 100644
index 0000000..1c1159f
--- /dev/null
+++ b/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch
@@ -0,0 +1,70 @@
+From 01256c61ba126449c46dd4ab5d5e145488b981fa Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Mon, 23 Jan 2017 13:25:13 +0200
+Subject: [PATCH] Added configure option to enable/disable static library
+
+Create static library archive only in case of --enable-static.
+
+Upstream-Status: Pending
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ configure.ac         | 6 ++++++
+ include/builddefs.in | 1 +
+ include/buildmacros  | 3 +++
+ 3 files changed, 10 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index b966d0e..e48268b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -26,6 +26,12 @@ AC_ARG_ENABLE(shared,
+ 	enable_shared=yes)
+ AC_SUBST(enable_shared)
+ 
++AC_ARG_ENABLE(static,
++[ --enable-static=[yes/no] Enable use of static libraries [default=yes]],,
++	enable_static=yes)
++AC_SUBST(enable_static)
++
++
+ AC_ARG_ENABLE(gettext,
+ [ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
+ 	enable_gettext=yes)
+diff --git a/include/builddefs.in b/include/builddefs.in
+index d9931db..3b3dbd2 100644
+--- a/include/builddefs.in
++++ b/include/builddefs.in
+@@ -71,6 +71,7 @@ RPMBUILD	= @rpmbuild@
+ RPM_VERSION	= @rpm_version@
+ 
+ ENABLE_SHARED	= @enable_shared@
++ENABLE_STATIC 	= @enable_static@
+ ENABLE_GETTEXT	= @enable_gettext@
+ 
+ HAVE_ZIPPED_MANPAGES = @have_zipped_manpages@
+diff --git a/include/buildmacros b/include/buildmacros
+index 39fa7e2..b0f25c5 100644
+--- a/include/buildmacros
++++ b/include/buildmacros
+@@ -80,6 +80,7 @@ endif
+ # /usr/lib.
+ ifeq ($(ENABLE_SHARED),yes)
+ INSTALL_LTLIB_DEV = \
++	set -x; \
+ 	cd $(TOPDIR)/$(LIBNAME)/.libs; \
+ 	../$(INSTALL) -m 755 -d $(PKG_DEVLIB_DIR); \
+ 	../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_DEVLIB_DIR); \
+@@ -88,7 +89,9 @@ INSTALL_LTLIB_DEV = \
+ 	../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_LIB_DIR); \
+ 	if test "x$(PKG_DEVLIB_DIR)" != "x$(PKG_LIB_DIR)" ; then \
+ 	rel_lib_prefix=$$(echo $(PKG_LIB_DIR) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
++	if test "$(ENABLE_STATIC)" = "yes" ; then \
+ 	../$(INSTALL) -S $$rel_lib_prefix$(PKG_DEVLIB_DIR)/$(LIBNAME).a $(PKG_LIB_DIR)/$(LIBNAME).a; \
++	fi ;\
+ 	../$(INSTALL) -S $$rel_lib_prefix$(PKG_DEVLIB_DIR)/$(LIBNAME).la $(PKG_LIB_DIR)/$(LIBNAME).la; \
+ 	rel_devlib_prefix=$$(echo $(PKG_DEVLIB_DIR) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
+ 	../$(INSTALL) -S $$rel_devlib_prefix$(PKG_LIB_DIR)/$(LIBNAME).so $(PKG_DEVLIB_DIR)/$(LIBNAME).so; \
+-- 
+2.7.4
+
-- 
2.7.4



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

* [PATCH v2 13/25] systemd: Do not add libnss_* to systemd package
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (35 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 12/25] attr/acl: Do not create broken static library link when not needed Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 14/25] util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package Amarnath Valluri
                   ` (11 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

libnss_* files should be part of corresponding sub-packages, the split happens
by do_package_split(). By adding ${libdir}/libnss_* to FILES_${PN}, those files
endup in systemd package when ${libdir} == ${base_libdir}.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/systemd/systemd_232.bb | 1 -
 1 file changed, 1 deletion(-)

diff --git a/meta/recipes-core/systemd/systemd_232.bb b/meta/recipes-core/systemd/systemd_232.bb
index bf0fadc..a18907a 100644
--- a/meta/recipes-core/systemd/systemd_232.bb
+++ b/meta/recipes-core/systemd/systemd_232.bb
@@ -451,7 +451,6 @@ FILES_${PN} = " ${base_bindir}/* \
                 ${rootlibexecdir}/systemd/* \
                 ${systemd_unitdir}/* \
                 ${base_libdir}/security/*.so \
-                ${libdir}/libnss_* \
                 /cgroup \
                 ${bindir}/systemd* \
                 ${bindir}/busctl \
-- 
2.7.4



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

* [PATCH v2 14/25] util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package.
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (36 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 13/25] systemd: Do not add libnss_* to systemd package Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 15/25] util-linux, shadow: Make 'nologin' alternative command Amarnath Valluri
                   ` (10 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

update-alternative.bbclass might rename the 'reset' binary when LINK_NAME ==
TARGET, This is true(${base_bindir} == ${bindir}) when 'usrmerge' distro feature
is enabled.  Hence, suffix with * to properly package the renamed binary.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>

util-linux
---
 meta/recipes-core/util-linux/util-linux.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index ae60b0a..5934fb5 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -84,7 +84,7 @@ FILES_util-linux-umount = "${base_bindir}/umount.${BPN}"
 FILES_util-linux-readprofile = "${sbindir}/readprofile.${BPN}"
 FILES_util-linux-uuidgen = "${bindir}/uuidgen"
 FILES_util-linux-uuidd = "${sbindir}/uuidd"
-FILES_util-linux-reset = "${base_bindir}/reset"
+FILES_util-linux-reset = "${base_bindir}/reset*"
 FILES_util-linux-partx = "${sbindir}/partx"
 FILES_util-linux-hwclock = "${base_sbindir}/hwclock.${BPN}"
 FILES_util-linux-findfs = "${sbindir}/findfs"
-- 
2.7.4



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

* [PATCH v2 15/25] util-linux, shadow: Make 'nologin' alternative command
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (37 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 14/25] util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 16/25] libarchive: Backport upstream fixes Amarnath Valluri
                   ` (9 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

Both shadow and util-linux packages provides 'nologin' binary in ${base_sbindir}
and ${sbindir} respectively, this leads to conflict when 'usrmerge' feature is
enabled, where ${sbindir} == ${base_sbindir}. Hance, handle this to alternative
system to resolve the conflict.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/util-linux/util-linux.inc | 5 +++--
 meta/recipes-extended/shadow/shadow.inc     | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index 5934fb5..afc3c73 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -151,7 +151,7 @@ do_install () {
 	mkdir -p ${D}${base_bindir}
 
         sbinprogs="agetty ctrlaltdel cfdisk vipw vigr"
-        sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root"
+        sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root nologin"
         binprogs_a="dmesg getopt kill more umount mount login reset su mountpoint"
 
         if [ "${base_sbindir}" != "${sbindir}" ]; then
@@ -194,7 +194,7 @@ ALTERNATIVE_PRIORITY = "80"
 
 ALTERNATIVE_${PN}  = "dmesg kill more mkswap blockdev pivot_root switch_root"
 ALTERNATIVE_${PN} += "hexdump last lastb logger mesg renice wall"
-ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject"
+ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject nologin"
 
 ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
 ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill"
@@ -204,6 +204,7 @@ ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev"
 ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
 ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
 ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
+ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
 
 ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 nologin.8 sulogin.8 utmpdump.1 reset.1 kill.1 libblkid.3 blkid.8 findfs.8 fsck.8 uuid.3"
 
diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc
index 4c4db00..91b6f46 100644
--- a/meta/recipes-extended/shadow/shadow.inc
+++ b/meta/recipes-extended/shadow/shadow.inc
@@ -170,10 +170,11 @@ inherit update-alternatives
 
 ALTERNATIVE_PRIORITY = "200"
 
-ALTERNATIVE_${PN} = "passwd chfn chsh chpasswd vipw vigr"
+ALTERNATIVE_${PN} = "passwd chfn chsh chpasswd vipw vigr nologin"
 ALTERNATIVE_LINK_NAME[chpasswd] = "${sbindir}/chpasswd"
 ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
 ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
+ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
 
 ALTERNATIVE_${PN}-base = "newgrp groups login su"
 ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"
-- 
2.7.4



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

* [PATCH v2 16/25] libarchive: Backport upstream fixes.
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (38 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 15/25] util-linux, shadow: Make 'nologin' alternative command Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 17/25] kernel: use ${nonarch_base_libdir} for kernel modules installation Amarnath Valluri
                   ` (8 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

These set of patches backported from upstream, which fixes the issues in
extracting hardlinks over softlinks while etracting packages by opkg.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 ...te_disk_posix.c-make-_fsobj-functions-mor.patch | 245 +++++++++++++++++++++
 ...02-Fix-extracting-hardlinks-over-symlinks.patch | 120 ++++++++++
 .../libarchive/libarchive_3.2.2.bb                 |   2 +
 3 files changed, 367 insertions(+)
 create mode 100644 meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch
 create mode 100644 meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch

diff --git a/meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch b/meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch
new file mode 100644
index 0000000..7d93142
--- /dev/null
+++ b/meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch
@@ -0,0 +1,245 @@
+From 90881d24d3f6d5fb207e97df3b91bbea8598e84e Mon Sep 17 00:00:00 2001
+From: Martin Matuska <martin@matuska.org>
+Date: Tue, 29 Nov 2016 16:47:37 +0100
+Subject: [PATCH 1/2] archive_write_disk_posix.c: make *_fsobj functions more
+ readable
+
+Upstream-Status: Backport
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ libarchive/archive_write_disk_posix.c | 121 +++++++++++++++++-----------------
+ 1 file changed, 61 insertions(+), 60 deletions(-)
+
+diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
+index 17c23b0..d786bc2 100644
+--- a/libarchive/archive_write_disk_posix.c
++++ b/libarchive/archive_write_disk_posix.c
+@@ -336,6 +336,8 @@ struct archive_write_disk {
+ 
+ #define HFS_BLOCKS(s)	((s) >> 12)
+ 
++static void	fsobj_error(int *, struct archive_string *, int, const char *,
++		    const char *);
+ static int	check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags);
+ static int	check_symlinks(struct archive_write_disk *);
+ static int	create_filesystem_object(struct archive_write_disk *);
+@@ -2005,8 +2007,9 @@ restore_entry(struct archive_write_disk *a)
+ 
+ 	if (en) {
+ 		/* Everything failed; give up here. */
+-		archive_set_error(&a->archive, en, "Can't create '%s'",
+-		    a->name);
++		if ((&a->archive)->error == NULL)
++			archive_set_error(&a->archive, en, "Can't create '%s'",
++			    a->name);
+ 		return (ARCHIVE_FAILED);
+ 	}
+ 
+@@ -2388,6 +2391,17 @@ current_fixup(struct archive_write_disk *a, const char *pathname)
+ 	return (a->current_fixup);
+ }
+ 
++/* Error helper for new *_fsobj functions */
++static void
++fsobj_error(int *a_eno, struct archive_string *a_estr,
++    int err, const char *errstr, const char *path)
++{
++	if (a_eno)
++		*a_eno = err;
++	if (a_estr)
++		archive_string_sprintf(a_estr, errstr, path);
++}
++
+ /*
+  * TODO: Someday, integrate this with the deep dir support; they both
+  * scan the path and both can be optimized by comparing against other
+@@ -2400,7 +2414,7 @@ current_fixup(struct archive_write_disk *a, const char *pathname)
+  * ARCHIVE_OK if there are none, otherwise puts an error in errmsg.
+  */
+ static int
+-check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags)
++check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr, int flags)
+ {
+ #if !defined(HAVE_LSTAT)
+ 	/* Platform doesn't have lstat, so we can't look for symlinks. */
+@@ -2474,19 +2488,20 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 			if (errno == ENOENT) {
+ 				break;
+ 			} else {
+-				/* Treat any other error as fatal - best to be paranoid here
+-				 * Note: This effectively disables deep directory
+-				 * support when security checks are enabled.
+-				 * Otherwise, very long pathnames that trigger
+-				 * an error here could evade the sandbox.
+-				 * TODO: We could do better, but it would probably
+-				 * require merging the symlink checks with the
+-				 * deep-directory editing. */
+-				if (error_number) *error_number = errno;
+-				if (error_string)
+-					archive_string_sprintf(error_string,
+-							"Could not stat %s",
+-							path);
++				/*
++				 * Treat any other error as fatal - best to be
++				 * paranoid here.
++				 * Note: This effectively disables deep
++				 * directory support when security checks are
++				 * enabled. Otherwise, very long pathnames that
++				 * trigger an error here could evade the
++				 * sandbox.
++				 * TODO: We could do better, but it would
++				 * probably require merging the symlink checks
++				 * with the deep-directory editing.
++				 */
++				fsobj_error(a_eno, a_estr, errno,
++				    "Could not stat %s", path);
+ 				res = ARCHIVE_FAILED;
+ 				break;
+ 			}
+@@ -2494,11 +2509,8 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 			if (!last) {
+ 				if (chdir(head) != 0) {
+ 					tail[0] = c;
+-					if (error_number) *error_number = errno;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Could not chdir %s",
+-								path);
++					fsobj_error(a_eno, a_estr, errno,
++					    "Could not chdir %s", path);
+ 					res = (ARCHIVE_FATAL);
+ 					break;
+ 				}
+@@ -2514,11 +2526,9 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 				 */
+ 				if (unlink(head)) {
+ 					tail[0] = c;
+-					if (error_number) *error_number = errno;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Could not remove symlink %s",
+-								path);
++					fsobj_error(a_eno, a_estr, errno,
++					    "Could not remove symlink %s",
++					    path);
+ 					res = ARCHIVE_FAILED;
+ 					break;
+ 				}
+@@ -2529,13 +2539,14 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 				 * symlink with another symlink.
+ 				 */
+ 				tail[0] = c;
+-				/* FIXME:  not sure how important this is to restore
++				/*
++				 * FIXME:  not sure how important this is to
++				 * restore
++				 */
++				/*
+ 				if (!S_ISLNK(path)) {
+-					if (error_number) *error_number = 0;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Removing symlink %s",
+-								path);
++					fsobj_error(a_eno, a_estr, 0,
++					    "Removing symlink %s", path);
+ 				}
+ 				*/
+ 				/* Symlink gone.  No more problem! */
+@@ -2545,22 +2556,17 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 				/* User asked us to remove problems. */
+ 				if (unlink(head) != 0) {
+ 					tail[0] = c;
+-					if (error_number) *error_number = 0;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Cannot remove intervening symlink %s",
+-								path);
++					fsobj_error(a_eno, a_estr, 0,
++					    "Cannot remove intervening "
++					    "symlink %s", path);
+ 					res = ARCHIVE_FAILED;
+ 					break;
+ 				}
+ 				tail[0] = c;
+ 			} else {
+ 				tail[0] = c;
+-				if (error_number) *error_number = 0;
+-				if (error_string)
+-					archive_string_sprintf(error_string,
+-							"Cannot extract through symlink %s",
+-							path);
++				fsobj_error(a_eno, a_estr, 0,
++				    "Cannot extract through symlink %s", path);
+ 				res = ARCHIVE_FAILED;
+ 				break;
+ 			}
+@@ -2577,10 +2583,8 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 	if (restore_pwd >= 0) {
+ 		r = fchdir(restore_pwd);
+ 		if (r != 0) {
+-			if(error_number) *error_number = errno;
+-			if(error_string)
+-				archive_string_sprintf(error_string,
+-						"chdir() failure");
++			fsobj_error(a_eno, a_estr, errno,
++			    "chdir() failure", "");
+ 		}
+ 		close(restore_pwd);
+ 		restore_pwd = -1;
+@@ -2688,17 +2692,16 @@ cleanup_pathname_win(struct archive_write_disk *a)
+  * is set) if the path is absolute.
+  */
+ static int
+-cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags)
++cleanup_pathname_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
++    int flags)
+ {
+ 	char *dest, *src;
+ 	char separator = '\0';
+ 
+ 	dest = src = path;
+ 	if (*src == '\0') {
+-		if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
+-		if (error_string)
+-		    archive_string_sprintf(error_string,
+-			    "Invalid empty pathname");
++		fsobj_error(a_eno, a_estr, ARCHIVE_ERRNO_MISC,
++		    "Invalid empty ", "pathname");
+ 		return (ARCHIVE_FAILED);
+ 	}
+ 
+@@ -2708,10 +2711,8 @@ cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *err
+ 	/* Skip leading '/'. */
+ 	if (*src == '/') {
+ 		if (flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) {
+-			if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
+-			if (error_string)
+-			    archive_string_sprintf(error_string,
+-				    "Path is absolute");
++			fsobj_error(a_eno, a_estr, ARCHIVE_ERRNO_MISC,
++			    "Path is ", "absolute");
+ 			return (ARCHIVE_FAILED);
+ 		}
+ 
+@@ -2738,11 +2739,11 @@ cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *err
+ 			} else if (src[1] == '.') {
+ 				if (src[2] == '/' || src[2] == '\0') {
+ 					/* Conditionally warn about '..' */
+-					if (flags & ARCHIVE_EXTRACT_SECURE_NODOTDOT) {
+-						if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
+-						if (error_string)
+-						    archive_string_sprintf(error_string,
+-							    "Path contains '..'");
++					if (flags
++					    & ARCHIVE_EXTRACT_SECURE_NODOTDOT) {
++						fsobj_error(a_eno, a_estr,
++						    ARCHIVE_ERRNO_MISC,
++						    "Path contains ", "'..'");
+ 						return (ARCHIVE_FAILED);
+ 					}
+ 				}
+-- 
+2.7.4
+
diff --git a/meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch b/meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch
new file mode 100644
index 0000000..a885409
--- /dev/null
+++ b/meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch
@@ -0,0 +1,120 @@
+From ece28103885a079a129a23c5001252a1648517af Mon Sep 17 00:00:00 2001
+From: Martin Matuska <martin@matuska.org>
+Date: Tue, 29 Nov 2016 16:55:41 +0100
+Subject: [PATCH 2/2] Fix extracting hardlinks over symlinks
+
+Closes #821
+
+Upstream-Status: Backport
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ libarchive/archive_write_disk_posix.c | 43 +++++++++++++++++++++++++++++++++++
+ tar/test/test_symlink_dir.c           | 18 ++++++++++++++-
+ 2 files changed, 60 insertions(+), 1 deletion(-)
+
+diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
+index d786bc2..80b03cd 100644
+--- a/libarchive/archive_write_disk_posix.c
++++ b/libarchive/archive_write_disk_posix.c
+@@ -2563,6 +2563,49 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr, int
+ 					break;
+ 				}
+ 				tail[0] = c;
++			} else if ((flags &
++			    ARCHIVE_EXTRACT_SECURE_SYMLINKS) == 0) {
++				/*
++				 * We are not the last element and we want to
++				 * follow symlinks if they are a directory.
++				 * 
++				 * This is needed to extract hardlinks over
++				 * symlinks.
++				 */
++				r = stat(head, &st);
++				if (r != 0) {
++					tail[0] = c;
++					if (errno == ENOENT) {
++						break;
++					} else {
++						fsobj_error(a_eno, a_estr,
++						    errno,
++						    "Could not stat %s", path);
++						res = (ARCHIVE_FAILED);
++						break;
++					}
++				} else if (S_ISDIR(st.st_mode)) {
++					if (chdir(head) != 0) {
++						tail[0] = c;
++						fsobj_error(a_eno, a_estr,
++						    errno,
++						    "Could not chdir %s", path);
++						res = (ARCHIVE_FATAL);
++						break;
++					}
++					/*
++					 * Our view is now from inside
++					 * this dir:
++					 */
++					head = tail + 1;
++				} else {
++					tail[0] = c;
++					fsobj_error(a_eno, a_estr, 0,
++					    "Cannot extract through "
++					    "symlink %s", path);
++					res = ARCHIVE_FAILED;
++					break;
++				}
+ 			} else {
+ 				tail[0] = c;
+ 				fsobj_error(a_eno, a_estr, 0,
+diff --git a/tar/test/test_symlink_dir.c b/tar/test/test_symlink_dir.c
+index 25bd8b1..852e00b 100644
+--- a/tar/test/test_symlink_dir.c
++++ b/tar/test/test_symlink_dir.c
+@@ -47,11 +47,18 @@ DEFINE_TEST(test_symlink_dir)
+ 	assertMakeDir("source/dir3", 0755);
+ 	assertMakeDir("source/dir3/d3", 0755);
+ 	assertMakeFile("source/dir3/f3", 0755, "abcde");
++	assertMakeDir("source/dir4", 0755);
++	assertMakeFile("source/dir4/file3", 0755, "abcdef");
++	assertMakeHardlink("source/dir4/file4", "source/dir4/file3");
+ 
+ 	assertEqualInt(0,
+ 	    systemf("%s -cf test.tar -C source dir dir2 dir3 file file2",
+ 		testprog));
+ 
++	/* Second archive with hardlinks */
++	assertEqualInt(0,
++	    systemf("%s -cf test2.tar -C source dir4", testprog));
++
+ 	/*
+ 	 * Extract with -x and without -P.
+ 	 */
+@@ -118,9 +125,15 @@ DEFINE_TEST(test_symlink_dir)
+ 		assertMakeSymlink("dest2/file2", "real_file2");
+ 	assertEqualInt(0, systemf("%s -xPf test.tar -C dest2", testprog));
+ 
+-	/* dest2/dir symlink should be followed */
++	/* "dir4" is a symlink to existing "real_dir" */
++	if (canSymlink())
++		assertMakeSymlink("dest2/dir4", "real_dir");
++	assertEqualInt(0, systemf("%s -xPf test2.tar -C dest2", testprog));
++
++	/* dest2/dir and dest2/dir4 symlinks should be followed */
+ 	if (canSymlink()) {
+ 		assertIsSymlink("dest2/dir", "real_dir");
++		assertIsSymlink("dest2/dir4", "real_dir");
+ 		assertIsDir("dest2/real_dir", -1);
+ 	}
+ 
+@@ -141,4 +154,7 @@ DEFINE_TEST(test_symlink_dir)
+ 	/* dest2/file2 symlink should be removed */
+ 	failure("Symlink to non-existing file should be removed");
+ 	assertIsReg("dest2/file2", -1);
++
++	/* dest2/dir4/file3 and dest2/dir4/file4 should be hard links */
++	assertIsHardlink("dest2/dir4/file3", "dest2/dir4/file4");
+ }
+-- 
+2.7.4
+
diff --git a/meta/recipes-extended/libarchive/libarchive_3.2.2.bb b/meta/recipes-extended/libarchive/libarchive_3.2.2.bb
index 8ad62ad..387fa9b 100644
--- a/meta/recipes-extended/libarchive/libarchive_3.2.2.bb
+++ b/meta/recipes-extended/libarchive/libarchive_3.2.2.bb
@@ -33,6 +33,8 @@ PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4,"
 
 SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
            file://non-recursive-extract-and-list.patch \
+	   file://0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch \
+	   file://0002-Fix-extracting-hardlinks-over-symlinks.patch \
            "
 
 SRC_URI[md5sum] = "1ec00b7dcaf969dd2a5712f85f23c764"
-- 
2.7.4



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

* [PATCH v2 17/25] kernel: use ${nonarch_base_libdir} for kernel modules installation.
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (39 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 16/25] libarchive: Backport upstream fixes Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 18/25] firmware: use ${nonarch_base_libdir} for firmware installation Amarnath Valluri
                   ` (7 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

Replace hardcoded '/lib' in kernel modules installation path with
${nonarch_base_libdir}, which is meant exactly for this.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/classes/kernel-module-split.bbclass |  2 +-
 meta/classes/kernel.bbclass              | 14 +++++++-------
 meta/classes/module.bbclass              |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/meta/classes/kernel-module-split.bbclass b/meta/classes/kernel-module-split.bbclass
index ba9cc15..5e10dcf 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -138,7 +138,7 @@ python split_kernel_module_packages () {
     postinst = d.getVar('pkg_postinst_modules')
     postrm = d.getVar('pkg_postrm_modules')
 
-    modules = do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='kernel-%s' % (d.getVar("KERNEL_VERSION")))
+    modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='kernel-%s' % (d.getVar("KERNEL_VERSION")))
     if modules:
         metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
         d.appendVar('RDEPENDS_' + metapkg, ' '+' '.join(modules))
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 97cba92..bb02ba5 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -297,11 +297,11 @@ kernel_do_install() {
 	#
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
 	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
-		oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
-		rm "${D}/lib/modules/${KERNEL_VERSION}/build"
-		rm "${D}/lib/modules/${KERNEL_VERSION}/source"
+		oe_runmake DEPMOD=echo MODLIB=${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION} INSTALL_FW_PATH=${D}${nonarch_base_libdir}/firmware modules_install
+		rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
+		rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source"
 		# If the kernel/ directory is empty remove it to prevent QA issues
-		rmdir --ignore-fail-on-non-empty "${D}/lib/modules/${KERNEL_VERSION}/kernel"
+		rmdir --ignore-fail-on-non-empty "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel"
 	else
 		bbnote "no modules to install"
 	fi
@@ -479,9 +479,9 @@ EXPORT_FUNCTIONS do_compile do_install do_configure
 # kernel-image becomes kernel-image-${KERNEL_VERSION}
 PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-modules"
 FILES_${PN} = ""
-FILES_kernel-base = "/lib/modules/${KERNEL_VERSION}/modules.order /lib/modules/${KERNEL_VERSION}/modules.builtin"
+FILES_kernel-base = "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.order ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin"
 FILES_kernel-image = ""
-FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} /lib/modules/${KERNEL_VERSION}/build"
+FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
 FILES_kernel-vmlinux = "/boot/vmlinux-${KERNEL_VERSION_NAME}"
 FILES_kernel-modules = ""
 RDEPENDS_kernel = "kernel-base"
@@ -512,7 +512,7 @@ pkg_postinst_kernel-base () {
 PACKAGESPLITFUNCS_prepend = "split_kernel_packages "
 
 python split_kernel_packages () {
-    do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.(bin|fw|cis|csp|dsp)$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
+    do_split_packages(d, root='${nonarch_base_libdir}/firmware', file_regex='^(.*)\.(bin|fw|cis|csp|dsp)$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
 }
 
 # Many scripts want to look in arch/$arch/boot for the bootable
diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
index a588873..e894c89 100644
--- a/meta/classes/module.bbclass
+++ b/meta/classes/module.bbclass
@@ -31,7 +31,7 @@ module_do_compile() {
 
 module_do_install() {
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
-	oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" \
+	oe_runmake DEPMOD=echo MODLIB="${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}" \
 	           CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
 	           O=${STAGING_KERNEL_BUILDDIR} \
 	           ${MODULES_INSTALL_TARGET}
-- 
2.7.4



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

* [PATCH v2 18/25] firmware: use ${nonarch_base_libdir} for firmware installation.
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (40 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 17/25] kernel: use ${nonarch_base_libdir} for kernel modules installation Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 19/25] mdadm: Avoid using hardocded udev, sbin paths Amarnath Valluri
                   ` (6 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

Replace hardcoded '/lib' in kernel firmware installation path with
${nonarch_base_libdir}.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 .../linux-firmware/linux-firmware_git.bb           | 168 ++++++++++-----------
 1 file changed, 84 insertions(+), 84 deletions(-)

diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
index 0aba740..5a74a57 100644
--- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
+++ b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
@@ -195,27 +195,27 @@ do_compile() {
 }
 
 do_install() {
-	install -d  ${D}/lib/firmware/
-	cp -r * ${D}/lib/firmware/
+	install -d  ${D}${nonarch_base_libdir}/firmware/
+	cp -r * ${D}${nonarch_base_libdir}/firmware/
 
 	# Avoid Makefile to be deployed
-	rm ${D}/lib/firmware/Makefile
+	rm ${D}${nonarch_base_libdir}/firmware/Makefile
 
 	# Remove unbuild firmware which needs cmake and bash
-	rm ${D}/lib/firmware/carl9170fw -rf
+	rm ${D}${nonarch_base_libdir}/firmware/carl9170fw -rf
 
 	# Remove pointless bash script
-	rm ${D}/lib/firmware/configure
+	rm ${D}${nonarch_base_libdir}/firmware/configure
 
 	# Libertas sd8686
-	ln -sf libertas/sd8686_v9.bin ${D}/lib/firmware/sd8686.bin
-	ln -sf libertas/sd8686_v9_helper.bin ${D}/lib/firmware/sd8686_helper.bin
+	ln -sf libertas/sd8686_v9.bin ${D}${nonarch_base_libdir}/firmware/sd8686.bin
+	ln -sf libertas/sd8686_v9_helper.bin ${D}${nonarch_base_libdir}/firmware/sd8686_helper.bin
 
 	# fixup wl12xx location, after 2.6.37 the kernel searches a different location for it
-	( cd ${D}/lib/firmware ; ln -sf ti-connectivity/* . )
+	( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/* . )
 
         # Copy the iwlwifi ucode
-        cp ${WORKDIR}/iwlwifi-8000C-19.ucode ${D}/lib/firmware/
+        cp ${WORKDIR}/iwlwifi-8000C-19.ucode ${D}${nonarch_base_libdir}/firmware/
 }
 
 
@@ -252,23 +252,23 @@ LICENSE_${PN}-ath6k = "Firmware-atheros_firmware"
 LICENSE_${PN}-ath9k = "Firmware-atheros_firmware"
 LICENSE_${PN}-atheros-license = "Firmware-atheros_firmware"
 
-FILES_${PN}-atheros-license = "/lib/firmware/LICENCE.atheros_firmware"
+FILES_${PN}-atheros-license = "${nonarch_base_libdir}/firmware/LICENCE.atheros_firmware"
 FILES_${PN}-ar9170 = " \
-  /lib/firmware/ar9170*.fw \
+  ${nonarch_base_libdir}/firmware/ar9170*.fw \
 "
 FILES_${PN}-carl9170 = " \
-  /lib/firmware/carl9170*.fw \
+  ${nonarch_base_libdir}/firmware/carl9170*.fw \
 "
 FILES_${PN}-ath6k = " \
-  /lib/firmware/ath6k \
+  ${nonarch_base_libdir}/firmware/ath6k \
 "
 FILES_${PN}-ath9k = " \
-  /lib/firmware/ar9271.fw \
-  /lib/firmware/ar7010*.fw \
-  /lib/firmware/htc_9271.fw \
-  /lib/firmware/htc_7010.fw \
-  /lib/firmware/ath9k_htc/htc_7010-1.4.0.fw \
-  /lib/firmware/ath9k_htc/htc_9271-1.4.0.fw \
+  ${nonarch_base_libdir}/firmware/ar9271.fw \
+  ${nonarch_base_libdir}/firmware/ar7010*.fw \
+  ${nonarch_base_libdir}/firmware/htc_9271.fw \
+  ${nonarch_base_libdir}/firmware/htc_7010.fw \
+  ${nonarch_base_libdir}/firmware/ath9k_htc/htc_7010-1.4.0.fw \
+  ${nonarch_base_libdir}/firmware/ath9k_htc/htc_9271-1.4.0.fw \
 "
 
 RDEPENDS_${PN}-ar9170 += "${PN}-atheros-license"
@@ -282,14 +282,14 @@ LICENSE_${PN}-ar3k-license = "Firmware-qualcommAthos_ar3k"
 LICENSE_${PN}-ath10k = "Firmware-qualcommAthos_ath10k"
 LICENSE_${PN}-ath10k-license = "Firmware-qualcommAthos_ath10k"
 
-FILES_${PN}-ar3k-license = "/lib/firmware/LICENSE.QualcommAtheros_ar3k"
+FILES_${PN}-ar3k-license = "${nonarch_base_libdir}/firmware/LICENSE.QualcommAtheros_ar3k"
 FILES_${PN}-ar3k = " \
-  /lib/firmware/ar3k \
+  ${nonarch_base_libdir}/firmware/ar3k \
 "
 
-FILES_${PN}-ath10k-license = "/lib/firmware/LICENSE.QualcommAtheros_ath10k"
+FILES_${PN}-ath10k-license = "${nonarch_base_libdir}/firmware/LICENSE.QualcommAtheros_ath10k"
 FILES_${PN}-ath10k = " \
-  /lib/firmware/ath10k \
+  ${nonarch_base_libdir}/firmware/ath10k \
 "
 
 RDEPENDS_${PN}-ar3k += "${PN}-ar3k-license"
@@ -299,9 +299,9 @@ RDEPENDS_${PN}-ath10k += "${PN}-ath10k-license"
 LICENSE_${PN}-ralink = "Firmware-ralink-firmware"
 LICENSE_${PN}-ralink-license = "Firmware-ralink-firmware"
 
-FILES_${PN}-ralink-license = "/lib/firmware/LICENCE.ralink-firmware.txt"
+FILES_${PN}-ralink-license = "${nonarch_base_libdir}/firmware/LICENCE.ralink-firmware.txt"
 FILES_${PN}-ralink = " \
-  /lib/firmware/rt*.bin \
+  ${nonarch_base_libdir}/firmware/rt*.bin \
 "
 
 RDEPENDS_${PN}-ralink += "${PN}-ralink-license"
@@ -310,9 +310,9 @@ RDEPENDS_${PN}-ralink += "${PN}-ralink-license"
 LICENSE_${PN}-radeon = "Firmware-radeon"
 LICENSE_${PN}-radeon-license = "Firmware-radeon"
 
-FILES_${PN}-radeon-license = "/lib/firmware/LICENSE.radeon"
+FILES_${PN}-radeon-license = "${nonarch_base_libdir}/firmware/LICENSE.radeon"
 FILES_${PN}-radeon = " \
-  /lib/firmware/radeon \
+  ${nonarch_base_libdir}/firmware/radeon \
 "
 
 RDEPENDS_${PN}-radeon += "${PN}-radeon-license"
@@ -324,20 +324,20 @@ LICENSE_${PN}-sd8787 = "Firmware-Marvell"
 LICENSE_${PN}-sd8797 = "Firmware-Marvell"
 LICENSE_${PN}-marvell-license = "Firmware-Marvell"
 
-FILES_${PN}-marvell-license = "/lib/firmware/LICENCE.Marvell"
+FILES_${PN}-marvell-license = "${nonarch_base_libdir}/firmware/LICENCE.Marvell"
 FILES_${PN}-sd8686 = " \
-  /lib/firmware/libertas/sd8686_v9* \
-  /lib/firmware/sd8686* \
+  ${nonarch_base_libdir}/firmware/libertas/sd8686_v9* \
+  ${nonarch_base_libdir}/firmware/sd8686* \
 "
 FILES_${PN}-sd8688 = " \
-  /lib/firmware/libertas/sd8688* \
-  /lib/firmware/mrvl/sd8688* \
+  ${nonarch_base_libdir}/firmware/libertas/sd8688* \
+  ${nonarch_base_libdir}/firmware/mrvl/sd8688* \
 "
 FILES_${PN}-sd8787 = " \
-  /lib/firmware/mrvl/sd8787_uapsta.bin \
+  ${nonarch_base_libdir}/firmware/mrvl/sd8787_uapsta.bin \
 "
 FILES_${PN}-sd8797 = " \
-  /lib/firmware/mrvl/sd8797_uapsta.bin \
+  ${nonarch_base_libdir}/firmware/mrvl/sd8797_uapsta.bin \
 "
 
 RDEPENDS_${PN}-sd8686 += "${PN}-marvell-license"
@@ -355,25 +355,25 @@ LICENSE_${PN}-rtl8821 = "Firmware-rtlwifi_firmware"
 LICENSE_${PN}-rtl-license = "Firmware-rtlwifi_firmware"
 
 FILES_${PN}-rtl-license = " \
-  /lib/firmware/LICENCE.rtlwifi_firmware.txt \
+  ${nonarch_base_libdir}/firmware/LICENCE.rtlwifi_firmware.txt \
 "
 FILES_${PN}-rtl8188 = " \
-  /lib/firmware/rtlwifi/rtl8188*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8188*.bin \
 "
 FILES_${PN}-rtl8192cu = " \
-  /lib/firmware/rtlwifi/rtl8192cufw*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8192cufw*.bin \
 "
 FILES_${PN}-rtl8192ce = " \
-  /lib/firmware/rtlwifi/rtl8192cfw*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8192cfw*.bin \
 "
 FILES_${PN}-rtl8192su = " \
-  /lib/firmware/rtlwifi/rtl8712u.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8712u.bin \
 "
 FILES_${PN}-rtl8723 = " \
-  /lib/firmware/rtlwifi/rtl8723*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8723*.bin \
 "
 FILES_${PN}-rtl8821 = " \
-  /lib/firmware/rtlwifi/rtl8821*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8821*.bin \
 "
 
 RDEPENDS_${PN}-rtl8188 += "${PN}-rtl-license"
@@ -388,16 +388,16 @@ LICENSE_${PN}-wl12xx = "Firmware-ti-connectivity"
 LICENSE_${PN}-wl18xx = "Firmware-ti-connectivity"
 LICENSE_${PN}-ti-connectivity-license = "Firmware-ti-connectivity"
 
-FILES_${PN}-ti-connectivity-license = "/lib/firmware/LICENCE.ti-connectivity"
+FILES_${PN}-ti-connectivity-license = "${nonarch_base_libdir}/firmware/LICENCE.ti-connectivity"
 FILES_${PN}-wl12xx = " \
-  /lib/firmware/wl12* \
-  /lib/firmware/TI* \
-  /lib/firmware/ti-connectivity \
+  ${nonarch_base_libdir}/firmware/wl12* \
+  ${nonarch_base_libdir}/firmware/TI* \
+  ${nonarch_base_libdir}/firmware/ti-connectivity \
 "
 FILES_${PN}-wl18xx = " \
-  /lib/firmware/wl18* \
-  /lib/firmware/TI* \
-  /lib/firmware/ti-connectivity \
+  ${nonarch_base_libdir}/firmware/wl18* \
+  ${nonarch_base_libdir}/firmware/TI* \
+  ${nonarch_base_libdir}/firmware/ti-connectivity \
 "
 
 RDEPENDS_${PN}-wl12xx = "${PN}-ti-connectivity-license"
@@ -407,9 +407,9 @@ RDEPENDS_${PN}-wl18xx = "${PN}-ti-connectivity-license"
 LICENSE_${PN}-vt6656 = "Firmware-via_vt6656"
 LICENSE_${PN}-vt6656-license = "Firmware-via_vt6656"
 
-FILES_${PN}-vt6656-license = "/lib/firmware/LICENCE.via_vt6656"
+FILES_${PN}-vt6656-license = "${nonarch_base_libdir}/firmware/LICENCE.via_vt6656"
 FILES_${PN}-vt6656 = " \
-  /lib/firmware/vntwusb.fw \
+  ${nonarch_base_libdir}/firmware/vntwusb.fw \
 "
 
 RDEPENDS_${PN}-vt6656 = "${PN}-vt6656-license"
@@ -426,28 +426,28 @@ LICENSE_${PN}-bcm4354 = "Firmware-broadcom_bcm43xx"
 LICENSE_${PN}-broadcom-license = "Firmware-broadcom_bcm43xx"
 
 FILES_${PN}-broadcom-license = " \
-  /lib/firmware/LICENCE.broadcom_bcm43xx \
+  ${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx \
 "
 FILES_${PN}-bcm4329 = " \
-  /lib/firmware/brcm/brcmfmac4329-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4329-sdio.bin \
 "
 FILES_${PN}-bcm4330 = " \
-  /lib/firmware/brcm/brcmfmac4330-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4330-sdio.bin \
 "
 FILES_${PN}-bcm4334 = " \
-  /lib/firmware/brcm/brcmfmac4334-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4334-sdio.bin \
 "
 FILES_${PN}-bcm43340 = " \
-  /lib/firmware/brcm/brcmfmac43340-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac43340-sdio.bin \
 "
 FILES_${PN}-bcm4339 = " \
-  /lib/firmware/brcm/brcmfmac4339-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4339-sdio.bin \
 "
 FILES_${PN}-bcm43430 = " \
-  /lib/firmware/brcm/brcmfmac43430-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.bin \
 "
 FILES_${PN}-bcm4354 = " \
-  /lib/firmware/brcm/brcmfmac4354-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4354-sdio.bin \
 "
 
 RDEPENDS_${PN}-bcm4329 += "${PN}-broadcom-license"
@@ -466,8 +466,8 @@ RDEPENDS_${PN}-bcm4354 += "${PN}-broadcom-license"
 LICENSE_${PN}-bnx2-mips = "WHENCE"
 LICENSE_${PN}-whence-license = "WHENCE"
 
-FILES_${PN}-bnx2-mips = "/lib/firmware/bnx2/bnx2-mips-09-6.2.1b.fw"
-FILES_${PN}-whence-license = "/lib/firmware/WHENCE"
+FILES_${PN}-bnx2-mips = "${nonarch_base_libdir}/firmware/bnx2/bnx2-mips-09-6.2.1b.fw"
+FILES_${PN}-whence-license = "${nonarch_base_libdir}/firmware/WHENCE"
 
 RDEPENDS_${PN}-bnx2-mips += "${PN}-whence-license"
 
@@ -493,24 +493,24 @@ LICENSE_${PN}-iwlwifi-misc      = "Firmware-iwlwifi_firmware"
 LICENSE_${PN}-iwlwifi-license   = "Firmware-iwlwifi_firmware"
 
 
-FILES_${PN}-iwlwifi-license = "/lib/firmware/LICENCE.iwlwifi_firmware"
-FILES_${PN}-iwlwifi-135-6 = "/lib/firmware/iwlwifi-135-6.ucode"
-FILES_${PN}-iwlwifi-3160-7 = "/lib/firmware/iwlwifi-3160-7.ucode"
-FILES_${PN}-iwlwifi-3160-8 = "/lib/firmware/iwlwifi-3160-8.ucode"
-FILES_${PN}-iwlwifi-3160-9 = "/lib/firmware/iwlwifi-3160-9.ucode"
-FILES_${PN}-iwlwifi-6000-4 = "/lib/firmware/iwlwifi-6000-4.ucode"
-FILES_${PN}-iwlwifi-6000g2a-5 = "/lib/firmware/iwlwifi-6000g2a-5.ucode"
-FILES_${PN}-iwlwifi-6000g2a-6 = "/lib/firmware/iwlwifi-6000g2a-6.ucode"
-FILES_${PN}-iwlwifi-6000g2b-5 = "/lib/firmware/iwlwifi-6000g2b-5.ucode"
-FILES_${PN}-iwlwifi-6000g2b-6 = "/lib/firmware/iwlwifi-6000g2b-6.ucode"
-FILES_${PN}-iwlwifi-6050-4 = "/lib/firmware/iwlwifi-6050-4.ucode"
-FILES_${PN}-iwlwifi-6050-5 = "/lib/firmware/iwlwifi-6050-5.ucode"
-FILES_${PN}-iwlwifi-7260   = "/lib/firmware/iwlwifi-7260-*.ucode"
-FILES_${PN}-iwlwifi-7265   = "/lib/firmware/iwlwifi-7265-*.ucode"
-FILES_${PN}-iwlwifi-7265d   = "/lib/firmware/iwlwifi-7265D-*.ucode"
-FILES_${PN}-iwlwifi-8000c   = "/lib/firmware/iwlwifi-8000C-*.ucode"
-FILES_${PN}-iwlwifi-8265   = "/lib/firmware/iwlwifi-8265-*.ucode"
-FILES_${PN}-iwlwifi-misc   = "/lib/firmware/iwlwifi-*.ucode"
+FILES_${PN}-iwlwifi-license = "${nonarch_base_libdir}/firmware/LICENCE.iwlwifi_firmware"
+FILES_${PN}-iwlwifi-135-6 = "${nonarch_base_libdir}/firmware/iwlwifi-135-6.ucode"
+FILES_${PN}-iwlwifi-3160-7 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-7.ucode"
+FILES_${PN}-iwlwifi-3160-8 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-8.ucode"
+FILES_${PN}-iwlwifi-3160-9 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-9.ucode"
+FILES_${PN}-iwlwifi-6000-4 = "${nonarch_base_libdir}/firmware/iwlwifi-6000-4.ucode"
+FILES_${PN}-iwlwifi-6000g2a-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2a-5.ucode"
+FILES_${PN}-iwlwifi-6000g2a-6 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2a-6.ucode"
+FILES_${PN}-iwlwifi-6000g2b-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2b-5.ucode"
+FILES_${PN}-iwlwifi-6000g2b-6 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2b-6.ucode"
+FILES_${PN}-iwlwifi-6050-4 = "${nonarch_base_libdir}/firmware/iwlwifi-6050-4.ucode"
+FILES_${PN}-iwlwifi-6050-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6050-5.ucode"
+FILES_${PN}-iwlwifi-7260   = "${nonarch_base_libdir}/firmware/iwlwifi-7260-*.ucode"
+FILES_${PN}-iwlwifi-7265   = "${nonarch_base_libdir}/firmware/iwlwifi-7265-*.ucode"
+FILES_${PN}-iwlwifi-7265d   = "${nonarch_base_libdir}/firmware/iwlwifi-7265D-*.ucode"
+FILES_${PN}-iwlwifi-8000c   = "${nonarch_base_libdir}/firmware/iwlwifi-8000C-*.ucode"
+FILES_${PN}-iwlwifi-8265   = "${nonarch_base_libdir}/firmware/iwlwifi-8265-*.ucode"
+FILES_${PN}-iwlwifi-misc   = "${nonarch_base_libdir}/firmware/iwlwifi-*.ucode"
 
 RDEPENDS_${PN}-iwlwifi-135-6     = "${PN}-iwlwifi-license"
 RDEPENDS_${PN}-iwlwifi-3160-7    = "${PN}-iwlwifi-license"
@@ -549,14 +549,14 @@ RCONFLICTS_${PN}-iwlwifi-7260 = "${PN}-iwlwifi-7260-7 ${PN}-iwlwifi-7260-8 ${PN}
 
 LICENSE_${PN}-i915       = "Firmware-i915"
 LICENSE_${PN}-i915-license = "Firmware-i915"
-FILES_${PN}-i915-license = "/lib/firmware/LICENSE.i915"
-FILES_${PN}-i915         = "/lib/firmware/i915"
+FILES_${PN}-i915-license = "${nonarch_base_libdir}/firmware/LICENSE.i915"
+FILES_${PN}-i915         = "${nonarch_base_libdir}/firmware/i915"
 RDEPENDS_${PN}-i915      = "${PN}-i915-license"
 
-FILES_${PN}-adsp-sst-license      = "/lib/firmware/LICENCE.adsp_sst"
+FILES_${PN}-adsp-sst-license      = "${nonarch_base_libdir}/firmware/LICENCE.adsp_sst"
 LICENSE_${PN}-adsp-sst            = "Firmware-adsp_sst"
 LICENSE_${PN}-adsp-sst-license    = "Firmware-adsp_sst"
-FILES_${PN}-adsp-sst              = "/lib/firmware/intel/dsp_fw*"
+FILES_${PN}-adsp-sst              = "${nonarch_base_libdir}/firmware/intel/dsp_fw*"
 RDEPENDS_${PN}-adsp-sst           = "${PN}-adsp-sst-license"
 
 # For other firmwares
@@ -608,8 +608,8 @@ LICENSE_${PN} = "\
     & WHENCE \
 "
 
-FILES_${PN}-license += "/lib/firmware/LICEN*"
-FILES_${PN} += "/lib/firmware/*"
+FILES_${PN}-license += "${nonarch_base_libdir}/firmware/LICEN*"
+FILES_${PN} += "${nonarch_base_libdir}/firmware/*"
 RDEPENDS_${PN} += "${PN}-license"
 RDEPENDS_${PN} += "${PN}-whence-license"
 
-- 
2.7.4



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

* [PATCH v2 19/25] mdadm: Avoid using hardocded udev, sbin paths
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (41 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 18/25] firmware: use ${nonarch_base_libdir} for firmware installation Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 20/25] mktemp: Move installed files only when needed Amarnath Valluri
                   ` (5 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

Use appropriate bitbake variables inplace of below hardcoded locations:
  /sbin -> ${base_sbindir}
  /lib/udev -> ${nonarch_base_libdir}/udev

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/mdadm/mdadm_4.0.bb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-extended/mdadm/mdadm_4.0.bb b/meta/recipes-extended/mdadm/mdadm_4.0.bb
index c228899..8a77204 100644
--- a/meta/recipes-extended/mdadm/mdadm_4.0.bb
+++ b/meta/recipes-extended/mdadm/mdadm_4.0.bb
@@ -33,7 +33,9 @@ CFLAGS_append_mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__'
 CFLAGS_append_mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__'
 
 do_compile() {
-	oe_runmake SYSROOT="${STAGING_DIR_TARGET}"
+	# Point to right sbindir
+	sed -i -e 's;BINDIR  = /sbin;BINDIR = $base_sbindir;' ${S}/Makefile
+	oe_runmake SYSROOT="${STAGING_DIR_TARGET}" UDEVDIR="${nonarch_libdir}/udev"
 }
 
 do_install() {
@@ -51,7 +53,7 @@ do_install_ptest() {
 	cp -a ${S}/tests ${D}${PTEST_PATH}/tests
 	cp ${S}/test ${D}${PTEST_PATH}
 	sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test
-	ln -s /sbin/mdadm ${D}${PTEST_PATH}/mdadm
+	ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm
 	for prg in test_stripe swap_super raid6check
 	do
 		install -D -m 755 $prg ${D}${PTEST_PATH}/
-- 
2.7.4



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

* [PATCH v2 20/25] mktemp: Move installed files only when needed
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (42 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 19/25] mdadm: Avoid using hardocded udev, sbin paths Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 21/25] net-tools: Place package content as per bitbake environment Amarnath Valluri
                   ` (4 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

Move binary(ies) only when ${base_bindir} != ${bindir}.

When usrmerge distro feature is enabled they both might point to same location.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/mktemp/mktemp_1.7.bb | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-extended/mktemp/mktemp_1.7.bb b/meta/recipes-extended/mktemp/mktemp_1.7.bb
index 9accc6e..e8ae5c6 100644
--- a/meta/recipes-extended/mktemp/mktemp_1.7.bb
+++ b/meta/recipes-extended/mktemp/mktemp_1.7.bb
@@ -20,9 +20,11 @@ inherit autotools update-alternatives
 EXTRA_OECONF = "--with-libc"
 
 do_install_append () {
-	install -d ${D}${base_bindir}
-	mv ${D}${bindir}/mktemp ${D}${base_bindir}/mktemp
-	rmdir ${D}${bindir}
+	if [ "${base_bindir}" != "${bindir}" ] ; then
+		install -d ${D}${base_bindir}
+		mv ${D}${bindir}/mktemp ${D}${base_bindir}/mktemp
+		rmdir ${D}${bindir}
+	fi
 }
 
 ALTERNATIVE_${PN} = "mktemp"
-- 
2.7.4



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

* [PATCH v2 21/25] net-tools: Place package content as per bitbake environment.
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (43 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 20/25] mktemp: Move installed files only when needed Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 22/25] lsb: Make use of appropriate bitbake variables Amarnath Valluri
                   ` (3 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

net-tools Makefile was hardcoded sbin, bin installation paths to /bin and /sbin
respectively.  This change moves the installed files to appropriate location as
per configured bitbake environment.

This might be solved much better way by patching Makefile, but that causing
build issues, as net-tools recipe is using pre-generated config.{h/status}.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/net-tools/net-tools_1.60-26.bb | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meta/recipes-extended/net-tools/net-tools_1.60-26.bb b/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
index 49a65f8..c4af7ef 100644
--- a/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
+++ b/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
@@ -93,6 +93,17 @@ do_install() {
 	unset CFLAGS
 	unset LDFLAGS
 	oe_runmake 'BASEDIR=${D}' install
+
+	if [ "${base_bindir}" != "/bin" ]; then
+		mkdir -p ${D}/${base_bindir}
+		mv ${D}/bin/* ${D}/${base_bindir}/
+		rmdir ${D}/bin
+	fi
+	if [ "${base_sbindir}" != "/sbin" ]; then
+		mkdir ${D}/${base_sbindir}
+		mv ${D}/sbin/* ${D}/${base_sbindir}/
+		rmdir ${D}/sbin
+	fi
 }
 
 inherit update-alternatives
-- 
2.7.4



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

* [PATCH v2 22/25] lsb: Make use of appropriate bitbake variables.
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (44 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 21/25] net-tools: Place package content as per bitbake environment Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 23/25] lttng-modules: Replace '/lib' with ${nonarch_base_libdir} Amarnath Valluri
                   ` (2 subsequent siblings)
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

Using of bitbake environment variables in-place of hardcoded strings makes this
recipe portable to all environments.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/lsb/lsb_4.1.bb | 40 +++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/meta/recipes-extended/lsb/lsb_4.1.bb b/meta/recipes-extended/lsb/lsb_4.1.bb
index ece0eab..7194505 100644
--- a/meta/recipes-extended/lsb/lsb_4.1.bb
+++ b/meta/recipes-extended/lsb/lsb_4.1.bb
@@ -33,14 +33,14 @@ S = "${WORKDIR}/lsb-release-1.4"
 CLEANBROKEN = "1"
 
 do_install(){
-	oe_runmake install prefix=${D}  mandir=${D}/${datadir}/man/ DESTDIR=${D}
+	oe_runmake install prefix=${D}/${prefix}  mandir=${D}/${datadir}/man/ DESTDIR=${D}
 
 	# this 2 dirs are needed by package lsb-dist-checker
 	mkdir -p ${D}${sysconfdir}/opt
 	mkdir -p ${D}${localstatedir}/opt
 
 	mkdir -p ${D}${base_bindir}
-	mkdir -p ${D}/${baselib}
+	mkdir -p ${D}${base_libdir}
 	mkdir -p ${D}${sysconfdir}/lsb-release.d
 	printf "LSB_VERSION=\"core-4.1-noarch:" > ${D}${sysconfdir}/lsb-release
 
@@ -86,47 +86,45 @@ do_install_append(){
            install -m 0755 ${WORKDIR}/${i} ${D}${sysconfdir}/core-lsb
        done
 
-       install -d ${D}/lib/lsb
-       install -m 0755 ${WORKDIR}/init-functions ${D}/lib/lsb
+       install -d ${D}/${nonarch_base_libdir}/lsb
+       install -m 0755 ${WORKDIR}/init-functions ${D}/${nonarch_base_libdir}/lsb
 
        # creat links for LSB test
-       install -d ${D}/usr/lib/lsb
-       ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/install_initd
-       ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/remove_initd
+       if [ "${nonarch_base_libdir}" != "${nonarch_libdir}" ; then
+               install -d ${D}/${nonarch_libdir}/lsb
+       fi
+       ln -sf ${sbindir}/chkconfig ${D}/${nonarch_base_libdir}/lsb/install_initd
+       ln -sf ${sbindir}/chkconfig ${D}/${nonarch_base_libdir}/lsb/remove_initd
 
        if [ "${TARGET_ARCH}" = "x86_64" ];then
-	       cd ${D}
                if [ "${baselib}" != "lib64" ]; then
-                   ln -sf ${baselib} lib64
+                   lnr ${D}${base_libdir} ${D}/lib64
                fi
-	       cd ${D}/${baselib}
+	       cd ${D}/${base_libdir}
                ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.2
                ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3
        fi
        if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
-	       cd ${D}/${baselib}
+	       cd ${D}/${base_libdir}
                ln -sf ld-linux.so.2 ld-lsb.so.2
                ln -sf ld-linux.so.2 ld-lsb.so.3
        fi
 
        if [ "${TARGET_ARCH}" = "powerpc64" ];then
-               cd ${D}
                if [ "${baselib}" != "lib64" ]; then
-                   ln -sf ${baselib} lib64
+                   lnr  ${D}${base_libdir} ${D}/lib64
                fi
-               cd ${D}/${baselib}
+               cd ${D}/${base_libdir}
                ln -sf ld64.so.1 ld-lsb-ppc64.so.2
                ln -sf ld64.so.1 ld-lsb-ppc64.so.3
        fi
        if [ "${TARGET_ARCH}" = "powerpc" ];then
-	       cd ${D}/${baselib}
+	       cd ${D}/${base_libdir}
                ln -sf ld.so.1 ld-lsb-ppc32.so.2
                ln -sf ld.so.1 ld-lsb-ppc32.so.3
        fi
 }
-FILES_${PN} += "/lib64 \
-                ${base_libdir} \
-                /usr/lib/lsb \
-                ${base_libdir}/lsb/* \
-                /lib/lsb/* \
-               "
+FILES_${PN} += "${base_bindir} ${base_libdir} \
+                ${nonarch_libdir}/lsb \
+                ${nonarch_base_libdir}/lsb/* \
+                ${@'/lib64' if d.getVar('TARGET_ARCH')  == ('x86_64' or 'powerpc64') and '${baselib}' != 'lib64' else ''}"
-- 
2.7.4



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

* [PATCH v2 23/25] lttng-modules: Replace '/lib' with ${nonarch_base_libdir}
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (45 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 22/25] lsb: Make use of appropriate bitbake variables Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 24/25] image: create symlinks needed for merged /usr Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 25/25] insane.bbclass: Add package QA check " Amarnath Valluri
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

Do not assume '/lib' for kernel modules location, instead use
${nonarch_base_libdir}. Because when 'usrmerge' distro feature is enabled,
kernel modules are not located in /lib/modules, instead /usr/lib/modules.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-kernel/lttng/lttng-modules_2.9.0.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.9.0.bb b/meta/recipes-kernel/lttng/lttng-modules_2.9.0.bb
index e59d6bc..3536f26 100644
--- a/meta/recipes-kernel/lttng/lttng-modules_2.9.0.bb
+++ b/meta/recipes-kernel/lttng/lttng-modules_2.9.0.bb
@@ -22,11 +22,11 @@ EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'"
 
 do_install_append() {
 	# Delete empty directories to avoid QA failures if no modules were built
-	find ${D}/lib -depth -type d -empty -exec rmdir {} \;
+	find ${D}/${nonarch_base_libdir} -depth -type d -empty -exec rmdir {} \;
 }
 
 python do_package_prepend() {
-    if not os.path.exists(os.path.join(d.getVar('D'), 'lib/modules')):
+    if not os.path.exists(os.path.join(d.getVar('D'), d.getVar('nonarch_base_libdir')[1:], 'modules')):
         bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN'))
 }
 
-- 
2.7.4



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

* [PATCH v2 24/25] image: create symlinks needed for merged /usr
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (46 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 23/25] lttng-modules: Replace '/lib' with ${nonarch_base_libdir} Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  2017-02-22  8:26 ` [PATCH v2 25/25] insane.bbclass: Add package QA check " Amarnath Valluri
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

Prepare the symlinks required for merged /usr at the time of rootfs creation.

The links created in rootfs are:
/bin --> /usr/sbin
/sbin --> /usr/sbin
/lib --> /usr/lib
/lib64 --> /usr/lib64

We cannot make these symlinks as part of 'base-files' or some other package.
Because at rootfs creation, installation of the package(say kernel) that depends
on these root folders/links fails, if package manager installs this package
prior to base-files.

These symbolic links in top level folder should present as long as
 - kerenl tools use /lib/{module,firmware}
 - shell scripts uses "#!/bin/sh"

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/classes/image.bbclass | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 127e62d..4a9b40e 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -617,3 +617,26 @@ do_bundle_initramfs () {
 	:
 }
 addtask bundle_initramfs after do_image_complete
+
+# Prepare the root links to point to the /usr counterparts.
+create_merged_usr_symlinks() {
+    install -m 0755 -d ${IMAGE_ROOTFS}/${base_bindir}
+    install -m 0755 -d ${IMAGE_ROOTFS}/${base_sbindir}
+    install -m 0755 -d ${IMAGE_ROOTFS}/${base_libdir}
+    lnr ${IMAGE_ROOTFS}${base_bindir} ${IMAGE_ROOTFS}/bin
+    lnr ${IMAGE_ROOTFS}${base_sbindir} ${IMAGE_ROOTFS}/sbin
+    lnr ${IMAGE_ROOTFS}${base_libdir} ${IMAGE_ROOTFS}/${baselib}
+
+    if [ "${nonarch_base_libdir}" != "${base_libdir}" ]; then
+       install -m 0755 -d ${IMAGE_ROOTFS}/${nonarch_base_libdir}
+       lnr ${IMAGE_ROOTFS}${nonarch_base_libdir} ${IMAGE_ROOTFS}/lib
+    fi
+
+    # create base links for multilibs
+    multi_libdirs="${@d.getVar('MULTILIB_VARIANTS')}"
+    for d in $multi_libdirs; do
+        install -m 0755 -d ${IMAGE_ROOTFS}/${exec_prefix}/$d
+        lnr ${IMAGE_ROOTFS}/${exec_prefix}/$d ${IMAGE_ROOTFS}/$d
+    done
+}
+ROOTFS_PREPROCESS_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'create_merged_usr_symlinks; ', '',d)}"
-- 
2.7.4



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

* [PATCH v2 25/25] insane.bbclass: Add package QA check for merged /usr.
  2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
                   ` (47 preceding siblings ...)
  2017-02-22  8:26 ` [PATCH v2 24/25] image: create symlinks needed for merged /usr Amarnath Valluri
@ 2017-02-22  8:26 ` Amarnath Valluri
  48 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

This check makes sure that, when usrmerge distro feature enabled, no package
installs files to root (/bin, /sbin, /lib, /lib64) folders.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/classes/insane.bbclass | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index e8e54f0..011eb99 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -40,6 +40,9 @@ ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             version-going-backwards expanded-d invalid-chars \
             license-checksum dev-elf \
             "
+# Add usrmerge QA check based on distro feature	    
+ERROR_QA_append = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' usrmerge', '', d)}"
+
 FAKEROOT_QA = "host-user-contaminated"
 FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \
 enabled tests are listed here, the do_package_qa task will run under fakeroot."
@@ -1035,6 +1038,18 @@ def package_qa_check_deps(pkg, pkgdest, skip, d):
     check_valid_deps('RREPLACES')
     check_valid_deps('RCONFLICTS')
 
+QAPKGTEST[usrmerge] = "package_qa_check_usrmerge"
+def package_qa_check_usrmerge(pkg, d, messages):
+    pkgdest = d.getVar('PKGDEST')
+    pkg_dir = pkgdest + os.sep + pkg + os.sep
+    merged_dirs = ['bin', 'sbin', 'lib'] + d.getVar('MULTILIB_VARIANTS').split()
+    for f in merged_dirs:
+        if os.path.exists(pkg_dir + f) and not os.path.islink(pkg_dir + f):
+            msg = "%s package is not obeying usrmerge distro feature. /%s should be relocated to /usr." % (pkg, f)
+            package_qa_add_message(messages, "usrmerge", msg)
+            return False
+    return True
+
 QAPKGTEST[expanded-d] = "package_qa_check_expanded_d"
 def package_qa_check_expanded_d(package, d, messages):
     """
@@ -1108,6 +1123,7 @@ def package_qa_check_host_user(path, name, d, elf, messages):
             return False
     return True
 
+
 # The PACKAGE FUNC to scan each package
 python do_package_qa () {
     import subprocess
-- 
2.7.4



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

* [PATCH v2 00/25] Fix for #7040 - Support for /usr merge
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
@ 2017-02-22  8:26   ` Amarnath Valluri
  2017-02-22  8:26   ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (25 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

This set of patches implements the long-standing feature - merging of /bin,
/sbin, /libs to their /usr counterparts.

It introduces a 'usrmerge' DISTRO_FEATURE, when it's enabled:
     - other than native all base paths(base_{bin,sbin,lib}dir) points to
       ${exec_prefix}/{bin,sbin,lib}
     - base-files package adds the needed root links(/bin, /sbin, /lib{32,64})
       points to /usr counterparts
     - As most of shell scripts refer "#!/bin/{sh,bash}" inside script, so makes
       sure that get added to RPROVIDES_ list by those packages to satisfy the
       build dependencies.

The assumption is that no recipe uses hard coded paths in recipes where
pre-defined bitbake configuration variables are available. I have fixed quite
many recipes that i found which violates this assumption.

I have tested this change on core-minimal, sato, windriver cube-desktop and
intel-iot-refkit image builds. And i would prefer to run autobuilder tests prior
to merging.

Changes in v2:
 - Moved root links creation out from 'base-files' to pre-rootfs.
 - Fixes to lsb, lttng-modules recipes., that are failed in autobuilder tests.
 - Added insane check to usrmerge feature.
 - Fixed typos in commit messages.


Amarnath Valluri (22):
  bitbake.conf: Modify nativesdk variables to support 'usrmerge'
    DISTRO_FEATURE
  cross.bbclass: merged /usr support
  base-files: Replace hardcoded root paths with appropriate bitbake
    variables
  systemd: chagnes to support merged /usr
  bash: changes to support merged /usr
  busybox: changes to support merged /usr
  sed: changes to support merged /usr
  musl: Fix issues in relative symlink creation
  attr/acl: Do not create broken static library link when not needed
  systemd: Do not add libnss_* to systemd package
  util-linux: Make sure '${base_bindir}/reset' is part of
    util-linux-reset package.
  util-linux,shadow: Make 'nologin' alternative command
  libarchive: Backport upstream fixes.
  kernel: use ${nonarch_base_libdir} for kernel modules installation.
  firmware: use ${nonarch_base_libdir} for firmware installation.
  mdadm: Avoid using hardocded udev, sbin paths
  mktemp: Move installed files only when needed
  net-tools: Place package content as per bitbake environment.
  lsb: Make use of appropriate bitbake variables.
  lttng-modules: Replace '/lib' with ${nonarch_base_libdir}
  image: create symlinks needed for merged /usr
  insane.bbclass: Add package QA check for merged /usr.

Joshua Lock (1):
  bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge

Jussi Kukkonen (2):
  glibc: Ensure ldconfig is packaged into glibc
  util-linux: Fix packaging with "usrmerge"

 meta/classes/cross.bbclass                         |   2 +-
 meta/classes/image.bbclass                         |  23 ++
 meta/classes/insane.bbclass                        |  16 ++
 meta/classes/kernel-module-split.bbclass           |   2 +-
 meta/classes/kernel.bbclass                        |  14 +-
 meta/classes/module.bbclass                        |   2 +-
 meta/conf/bitbake.conf                             |  20 +-
 meta/recipes-core/base-files/base-files_3.0.14.bb  |   5 +-
 meta/recipes-core/busybox/busybox.inc              |   2 +
 meta/recipes-core/glibc/glibc-package.inc          |   2 +-
 ...dynamic-linker-a-relative-symlink-to-libc.patch |  62 +++++-
 meta/recipes-core/musl/musl_git.bb                 |   2 +-
 meta/recipes-core/systemd/systemd_232.bb           |   7 +-
 meta/recipes-core/util-linux/util-linux.inc        |  13 +-
 meta/recipes-extended/bash/bash.inc                |   2 +
 ...te_disk_posix.c-make-_fsobj-functions-mor.patch | 245 +++++++++++++++++++++
 ...02-Fix-extracting-hardlinks-over-symlinks.patch | 120 ++++++++++
 .../libarchive/libarchive_3.2.2.bb                 |   2 +
 meta/recipes-extended/lsb/lsb_4.1.bb               |  40 ++--
 meta/recipes-extended/mdadm/mdadm_4.0.bb           |   6 +-
 meta/recipes-extended/mktemp/mktemp_1.7.bb         |   8 +-
 .../net-tools/net-tools_1.60-26.bb                 |  11 +
 meta/recipes-extended/sed/sed_4.2.2.bb             |   1 +
 meta/recipes-extended/shadow/shadow.inc            |   3 +-
 .../linux-firmware/linux-firmware_git.bb           | 168 +++++++-------
 meta/recipes-kernel/lttng/lttng-modules_2.9.0.bb   |   4 +-
 meta/recipes-support/attr/ea-acl.inc               |   2 +
 ...gure-option-to-enable-disable-static-libr.patch |  70 ++++++
 28 files changed, 699 insertions(+), 155 deletions(-)
 create mode 100644 meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch
 create mode 100644 meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch
 create mode 100644 meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch

-- 
2.7.4



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

* [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
  2017-02-22  8:26   ` [PATCH v2 00/25] Fix for #7040 - Support for /usr merge Amarnath Valluri
@ 2017-02-22  8:26   ` Amarnath Valluri
  2017-02-22  8:26   ` [PATCH v2 02/25] bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE Amarnath Valluri
                     ` (24 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core; +Cc: Joshua Lock

From: Joshua Lock <joshua.g.lock@intel.com>

Modify bindir, libdir and sbindir to be exec_prefix/$d, rather than
base_prefix/$d, when the usrmerge DISTRO_FEATURE is enabled.

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
---
 meta/conf/bitbake.conf | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index e421650..c5beb77 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -18,10 +18,14 @@ export prefix = "/usr"
 export exec_prefix = "${prefix}"
 
 # Base paths
-export base_bindir = "${base_prefix}/bin"
-export base_sbindir = "${base_prefix}/sbin"
-export base_libdir = "${base_prefix}/${baselib}"
-export nonarch_base_libdir = "${base_prefix}/lib"
+bin = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}/bin', '${base_prefix}/bin', d)}"
+sbin = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}/sbin', '${base_prefix}/sbin', d)}"
+lib = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}/${baselib}', '${base_prefix}/${baselib}', d)}"
+nonarch_lib = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}/lib', '${base_prefix}/lib', d)}"
+export base_bindir = "${bin}"
+export base_sbindir = "${sbin}"
+export base_libdir = "${lib}"
+export nonarch_base_libdir = "${nonarch_lib}"
 
 # Architecture independent paths
 export sysconfdir = "${base_prefix}/etc"
-- 
2.7.4



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

* [PATCH v2 02/25] bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
  2017-02-22  8:26   ` [PATCH v2 00/25] Fix for #7040 - Support for /usr merge Amarnath Valluri
  2017-02-22  8:26   ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
@ 2017-02-22  8:26   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 03/25] cross.bbclass: merged /usr support Amarnath Valluri
                     ` (23 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:26 UTC (permalink / raw)
  To: openembedded-core

Modify base bin, sbin, and lib nativesdk variables to be ${prefix_nativesdk}/$d,
when the usrmerge DISTRO_FEATURE is enabled.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/conf/bitbake.conf | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index c5beb77..ecff034 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -67,11 +67,11 @@ bindir_crossscripts = "${bindir}/crossscripts"
 prefix_nativesdk = "/usr"
 bindir_nativesdk = "${prefix_nativesdk}/bin"
 sbindir_nativesdk = "${prefix_nativesdk}/sbin"
-base_bindir_nativesdk = "/bin"
-base_sbindir_nativesdk = "/sbin"
-includedir_nativesdk = "${prefix_nativesdk}/include"
 libdir_nativesdk = "${prefix_nativesdk}/lib"
-base_libdir_nativesdk = "/lib"
+base_bindir_nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${bindir_nativesdk}', '/bin', d)}"
+base_sbindir_nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${sbindir_nativesdk}', '/sbin', d)}"
+base_libdir_nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${libdir_nativesdk}', '/lib', d)}"
+includedir_nativesdk = "${prefix_nativesdk}/include"
 localstatedir_nativesdk = "/var"
 
 #
-- 
2.7.4



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

* [PATCH v2 03/25] cross.bbclass: merged /usr support
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (2 preceding siblings ...)
  2017-02-22  8:26   ` [PATCH v2 02/25] bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 04/25] base-files: Replace hardcoded root paths with appropriate bitbake variables Amarnath Valluri
                     ` (22 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

When 'usrmerge' distro feature enabled match target_base_libdir to ${target_libdir}.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/classes/cross.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/cross.bbclass b/meta/classes/cross.bbclass
index 2602153..c8ef3a5 100644
--- a/meta/classes/cross.bbclass
+++ b/meta/classes/cross.bbclass
@@ -48,8 +48,8 @@ SSTATE_SCAN_CMD ?= "${SSTATE_SCAN_CMD_NATIVE}"
 target_base_prefix := "${base_prefix}"
 target_prefix := "${prefix}"
 target_exec_prefix := "${exec_prefix}"
-target_base_libdir = "${target_base_prefix}/${baselib}"
 target_libdir = "${target_exec_prefix}/${baselib}"
+target_base_libdir = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${target_libdir}', '${target_base_prefix}/${baselib}', d)}"
 target_includedir := "${includedir}"
 
 # Overrides for paths
-- 
2.7.4



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

* [PATCH v2 04/25] base-files: Replace hardcoded root paths with appropriate bitbake variables
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (3 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 03/25] cross.bbclass: merged /usr support Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 05/25] systemd: chagnes to support merged /usr Amarnath Valluri
                     ` (21 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

/bin, /sbin, /lib are replaced with ${base_bindir}, ${base_sbindir} and
${base_libdir}.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/base-files/base-files_3.0.14.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 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 d138005..35744f4 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
@@ -32,8 +32,9 @@ INHIBIT_DEFAULT_DEPS = "1"
 docdir_append = "/${P}"
 dirs1777 = "/tmp ${localstatedir}/volatile/tmp"
 dirs2775 = ""
-dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
-           ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \
+dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \
+           ${sysconfdir} ${sysconfdir}/default \
+           ${sysconfdir}/skel ${nonarch_base_libdir} /mnt /proc ${ROOT_HOME} /run \
            ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
            ${libdir} ${sbindir} ${datadir} \
            ${datadir}/common-licenses ${datadir}/dict ${infodir} \
-- 
2.7.4



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

* [PATCH v2 05/25] systemd: chagnes to support merged /usr
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (4 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 04/25] base-files: Replace hardcoded root paths with appropriate bitbake variables Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 06/25] bash: changes " Amarnath Valluri
                     ` (20 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

When the usrmerge DISTRO_FEATURE is selected disable the split-usr
support and modify rootprefix to be exec_prefix, rather than base_prefix.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/systemd/systemd_232.bb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd_232.bb b/meta/recipes-core/systemd/systemd_232.bb
index cc8781e..bf0fadc 100644
--- a/meta/recipes-core/systemd/systemd_232.bb
+++ b/meta/recipes-core/systemd/systemd_232.bb
@@ -131,7 +131,7 @@ CACHED_CONFIGUREVARS += "ac_cv_path_SULOGIN=${base_sbindir}/sulogin"
 
 # Helper variables to clarify locations.  This mirrors the logic in systemd's
 # build system.
-rootprefix ?= "${base_prefix}"
+rootprefix ?= "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}', '${base_prefix}', d)}"
 rootlibdir ?= "${base_libdir}"
 rootlibexecdir = "${rootprefix}/lib"
 
@@ -149,10 +149,10 @@ CACHED_CONFIGUREVARS_class-target = "\
 EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
                  --with-rootlibdir=${rootlibdir} \
                  --with-roothomedir=${ROOT_HOME} \
-                 --enable-split-usr \
+                 ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '--disable-split-usr', '--enable-split-usr', d)} \
                  --without-python \
                  --with-sysvrcnd-path=${sysconfdir} \
-                 --with-firmware-path=/lib/firmware \
+                 --with-firmware-path=${nonarch_base_libdir}/firmware \
                  --with-testdir=${PTEST_PATH} \
                "
 # per the systemd README, define VALGRIND=1 to run under valgrind
-- 
2.7.4



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

* [PATCH v2 06/25] bash: changes to support merged /usr
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (5 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 05/25] systemd: chagnes to support merged /usr Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 07/25] busybox: " Amarnath Valluri
                     ` (19 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

Most of shell scripts refer to '#!/bin/{sh,bash}' inside the script. But when
'usrmege' feature is enabled this path will be /usr/bin/{sh, bash}.

so to satisify build dependency add '/bin/{sh,bash}' to its providers list.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/bash/bash.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-extended/bash/bash.inc b/meta/recipes-extended/bash/bash.inc
index a05b987..0f0d679 100644
--- a/meta/recipes-extended/bash/bash.inc
+++ b/meta/recipes-extended/bash/bash.inc
@@ -65,3 +65,5 @@ pkg_postinst_${PN} () {
 pkg_postrm_${PN} () {
 	printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
 }
+
+RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh /bin/bash', '', d)}"
-- 
2.7.4



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

* [PATCH v2 07/25] busybox: changes to support merged /usr
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (6 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 06/25] bash: changes " Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 08/25] sed: " Amarnath Valluri
                     ` (18 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

Most of the shell scripts refer to /bin/sh inside the script. When 'usrmege'
feature is enabled, this path would be /usr/bin/sh. Hence, to satisfy build
dependency add '/bin/sh' to it's providers list.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/busybox/busybox.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 34f4e25..61d17e4 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -431,3 +431,5 @@ pkg_prerm_${PN}-syslog () {
 		fi
 	fi
 }
+
+RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh', '', d)}"
-- 
2.7.4



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

* [PATCH v2 08/25] sed: changes to support merged /usr
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (7 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 07/25] busybox: " Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 09/25] musl: Fix issues in relative symlink creation Amarnath Valluri
                     ` (17 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

Few of the perl scripts referring '#!/bin/sed' inside the script. But when
'usrmerge' feature is enabled this path would be /usr/bin/sed. So to satisfy
build dependency add '/bin/sed' to it's providers list.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/sed/sed_4.2.2.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-extended/sed/sed_4.2.2.bb b/meta/recipes-extended/sed/sed_4.2.2.bb
index 5aa7d8a..e31bec2 100644
--- a/meta/recipes-extended/sed/sed_4.2.2.bb
+++ b/meta/recipes-extended/sed/sed_4.2.2.bb
@@ -44,3 +44,4 @@ do_install_ptest() {
 	oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR}
 }
 
+RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sed', '', d)}"
-- 
2.7.4



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

* [PATCH v2 09/25] musl: Fix issues in relative symlink creation
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (8 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 08/25] sed: " Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 10/25] glibc: Ensure ldconfig is packaged into glibc Amarnath Valluri
                     ` (16 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

Make use of lnr/ln -r while creating relative symlinks than guessing the
relalive path.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 ...dynamic-linker-a-relative-symlink-to-libc.patch | 62 ++++++++++++++++++----
 meta/recipes-core/musl/musl_git.bb                 |  2 +-
 2 files changed, 53 insertions(+), 11 deletions(-)

diff --git a/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch b/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
index 5490b1c..462d338 100644
--- a/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
+++ b/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
@@ -1,6 +1,6 @@
-From 94c0b97b62125d8bbc92dce0694e387d5b2ad181 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 10 Jan 2016 12:14:02 -0800
+From 0ec74744a4cba7c5fdfaa2685995119a4fca0260 Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Wed, 18 Jan 2017 16:14:37 +0200
 Subject: [PATCH] Make dynamic linker a relative symlink to libc
 
 absolute symlink into $(libdir) fails to load in a cross build
@@ -9,26 +9,68 @@ applications, which cross build systems often do, since not everything
 can be computed during cross builds, qemu in usermode often comes to aid
 in such situations to feed into cross builds.
 
+V2:
+ Make use of 'ln -r' to create relative symlinks, as most fo the distros
+ shipping coreutils 8.16+
+
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
 ---
 Upstream-Status: Pending
-
- Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+---
+ Makefile         | 2 +-
+ tools/install.sh | 8 +++++---
+ 2 files changed, 6 insertions(+), 4 deletions(-)
 
 diff --git a/Makefile b/Makefile
-index b2226fa..0d71f7f 100644
+index 8246b78..d1dbe39 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -189,7 +189,7 @@ $(DESTDIR)$(includedir)/%: include/%
+@@ -215,7 +215,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/include/%
  	$(INSTALL) -D -m 644 $< $@
  
  $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
 -	$(INSTALL) -D -l $(libdir)/libc.so $@ || true
-+	$(INSTALL) -D -l ..$(libdir)/libc.so $@ || true
++	$(INSTALL) -D -r $(DESTDIR)$(libdir)/libc.so $@ || true
  
  install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)
  
+diff --git a/tools/install.sh b/tools/install.sh
+index d913b60..b6a7f79 100755
+--- a/tools/install.sh
++++ b/tools/install.sh
+@@ -6,18 +6,20 @@
+ #
+ 
+ usage() {
+-printf "usage: %s [-D] [-l] [-m mode] src dest\n" "$0" 1>&2
++printf "usage: %s [-D] [-l] [-r] [-m mode] src dest\n" "$0" 1>&2
+ exit 1
+ }
+ 
+ mkdirp=
+ symlink=
++symlinkflags="-s"
+ mode=755
+ 
+-while getopts Dlm: name ; do
++while getopts Dlrm: name ; do
+ case "$name" in
+ D) mkdirp=yes ;;
+ l) symlink=yes ;;
++r) symlink=yes; symlinkflags="$symlinkflags -r" ;;
+ m) mode=$OPTARG ;;
+ ?) usage ;;
+ esac
+@@ -48,7 +50,7 @@ trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP
+ umask 077
+ 
+ if test "$symlink" ; then
+-ln -s "$1" "$tmp"
++ln $symlinkflags "$1" "$tmp"
+ else
+ cat < "$1" > "$tmp"
+ chmod "$mode" "$tmp"
 -- 
-2.7.0
+2.7.4
 
diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb
index e9b9fef..5775184 100644
--- a/meta/recipes-core/musl/musl_git.bb
+++ b/meta/recipes-core/musl/musl_git.bb
@@ -49,7 +49,7 @@ do_install() {
 	oe_runmake install DESTDIR='${D}'
 
 	install -d ${D}${bindir}
-	ln -s ../../${libdir}/libc.so ${D}${bindir}/ldd
+	lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd
 	for l in crypt dl m pthread resolv rt util xnet
 	do
 		ln -s libc.so ${D}${libdir}/lib$l.so
-- 
2.7.4



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

* [PATCH v2 10/25] glibc: Ensure ldconfig is packaged into glibc
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (9 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 09/25] musl: Fix issues in relative symlink creation Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 11/25] util-linux: Fix packaging with "usrmerge" Amarnath Valluri
                     ` (15 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

From: Jussi Kukkonen <jussi.kukkonen@intel.com>

If "usrmerge" feature is used, /usr/sbin/ldconfig gets packaged into
glibc-utils instead of glibc: Switch PACKAGES order to prevent this.

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
 meta/recipes-core/glibc/glibc-package.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc
index f0fc9c1..6aca2db 100644
--- a/meta/recipes-core/glibc/glibc-package.inc
+++ b/meta/recipes-core/glibc/glibc-package.inc
@@ -19,7 +19,7 @@ USE_LDCONFIG ?= "1"
 
 INHIBIT_SYSROOT_STRIP = "1"
 
-PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode ${PN}-utils glibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
+PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode glibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} ${PN}-utils glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
 
 # The ld.so in this glibc supports the GNU_HASH
 RPROVIDES_${PN} = "eglibc rtld(GNU_HASH)"
-- 
2.7.4



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

* [PATCH v2 11/25] util-linux: Fix packaging with "usrmerge"
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (10 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 10/25] glibc: Ensure ldconfig is packaged into glibc Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 12/25] attr/acl: Do not create broken static library link when not needed Amarnath Valluri
                     ` (14 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

From: Jussi Kukkonen <jussi.kukkonen@intel.com>

Make sure fsck.cramfs is packaged before fsck so the latter
does not steal the fsck.cramfs binary when building with usrmerge
DISTRO_FEATURE.

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
 meta/recipes-core/util-linux/util-linux.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index 7d948bf..ae60b0a 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -29,9 +29,9 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin
 PACKAGES =+ "util-linux-agetty util-linux-fdisk util-linux-cfdisk util-linux-sfdisk \
              util-linux-swaponoff util-linux-losetup util-linux-umount \
              util-linux-mount util-linux-readprofile util-linux-uuidd \
-             util-linux-uuidgen util-linux-lscpu util-linux-fsck util-linux-blkid \
-             util-linux-mkfs util-linux-mcookie util-linux-reset util-linux-lsblk \
-             util-linux-mkfs.cramfs util-linux-fsck.cramfs util-linux-fstrim \
+             util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs util-linux-fsck \
+             util-linux-blkid util-linux-mkfs util-linux-mcookie util-linux-reset \
+             util-linux-lsblk util-linux-mkfs.cramfs util-linux-fstrim \
              util-linux-partx util-linux-hwclock util-linux-mountpoint \
              util-linux-findfs util-linux-getopt util-linux-sulogin util-linux-prlimit"
 PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}"
-- 
2.7.4



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

* [PATCH v2 12/25] attr/acl: Do not create broken static library link when not needed
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (11 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 11/25] util-linux: Fix packaging with "usrmerge" Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 13/25] systemd: Do not add libnss_* to systemd package Amarnath Valluri
                     ` (13 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

Stop creating the static library archieve(liba(ttr|cl).a) when --disable-static
configure option used.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-support/attr/ea-acl.inc               |  2 +
 ...gure-option-to-enable-disable-static-libr.patch | 70 ++++++++++++++++++++++
 2 files changed, 72 insertions(+)
 create mode 100644 meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch

diff --git a/meta/recipes-support/attr/ea-acl.inc b/meta/recipes-support/attr/ea-acl.inc
index a88ce90..c587b3c 100644
--- a/meta/recipes-support/attr/ea-acl.inc
+++ b/meta/recipes-support/attr/ea-acl.inc
@@ -2,6 +2,8 @@
 
 SRC_URI += "file://relative-libdir.patch;striplevel=0 \
            "
+# This patch should be applied after '(attr\|acl)-Missing-configure.ac.patch' 
+SRC_URI_append = " file://0001-Added-configure-option-to-enable-disable-static-libr.patch"
 
 inherit autotools-brokensep gettext
 
diff --git a/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch b/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch
new file mode 100644
index 0000000..1c1159f
--- /dev/null
+++ b/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch
@@ -0,0 +1,70 @@
+From 01256c61ba126449c46dd4ab5d5e145488b981fa Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Mon, 23 Jan 2017 13:25:13 +0200
+Subject: [PATCH] Added configure option to enable/disable static library
+
+Create static library archive only in case of --enable-static.
+
+Upstream-Status: Pending
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ configure.ac         | 6 ++++++
+ include/builddefs.in | 1 +
+ include/buildmacros  | 3 +++
+ 3 files changed, 10 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index b966d0e..e48268b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -26,6 +26,12 @@ AC_ARG_ENABLE(shared,
+ 	enable_shared=yes)
+ AC_SUBST(enable_shared)
+ 
++AC_ARG_ENABLE(static,
++[ --enable-static=[yes/no] Enable use of static libraries [default=yes]],,
++	enable_static=yes)
++AC_SUBST(enable_static)
++
++
+ AC_ARG_ENABLE(gettext,
+ [ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
+ 	enable_gettext=yes)
+diff --git a/include/builddefs.in b/include/builddefs.in
+index d9931db..3b3dbd2 100644
+--- a/include/builddefs.in
++++ b/include/builddefs.in
+@@ -71,6 +71,7 @@ RPMBUILD	= @rpmbuild@
+ RPM_VERSION	= @rpm_version@
+ 
+ ENABLE_SHARED	= @enable_shared@
++ENABLE_STATIC 	= @enable_static@
+ ENABLE_GETTEXT	= @enable_gettext@
+ 
+ HAVE_ZIPPED_MANPAGES = @have_zipped_manpages@
+diff --git a/include/buildmacros b/include/buildmacros
+index 39fa7e2..b0f25c5 100644
+--- a/include/buildmacros
++++ b/include/buildmacros
+@@ -80,6 +80,7 @@ endif
+ # /usr/lib.
+ ifeq ($(ENABLE_SHARED),yes)
+ INSTALL_LTLIB_DEV = \
++	set -x; \
+ 	cd $(TOPDIR)/$(LIBNAME)/.libs; \
+ 	../$(INSTALL) -m 755 -d $(PKG_DEVLIB_DIR); \
+ 	../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_DEVLIB_DIR); \
+@@ -88,7 +89,9 @@ INSTALL_LTLIB_DEV = \
+ 	../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_LIB_DIR); \
+ 	if test "x$(PKG_DEVLIB_DIR)" != "x$(PKG_LIB_DIR)" ; then \
+ 	rel_lib_prefix=$$(echo $(PKG_LIB_DIR) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
++	if test "$(ENABLE_STATIC)" = "yes" ; then \
+ 	../$(INSTALL) -S $$rel_lib_prefix$(PKG_DEVLIB_DIR)/$(LIBNAME).a $(PKG_LIB_DIR)/$(LIBNAME).a; \
++	fi ;\
+ 	../$(INSTALL) -S $$rel_lib_prefix$(PKG_DEVLIB_DIR)/$(LIBNAME).la $(PKG_LIB_DIR)/$(LIBNAME).la; \
+ 	rel_devlib_prefix=$$(echo $(PKG_DEVLIB_DIR) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
+ 	../$(INSTALL) -S $$rel_devlib_prefix$(PKG_LIB_DIR)/$(LIBNAME).so $(PKG_DEVLIB_DIR)/$(LIBNAME).so; \
+-- 
+2.7.4
+
-- 
2.7.4



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

* [PATCH v2 13/25] systemd: Do not add libnss_* to systemd package
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (12 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 12/25] attr/acl: Do not create broken static library link when not needed Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 14/25] util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package Amarnath Valluri
                     ` (12 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

libnss_* files should be part of corresponding sub-packages, the split happens
by do_package_split(). By adding ${libdir}/libnss_* to FILES_${PN}, those files
endup in systemd package when ${libdir} == ${base_libdir}.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/systemd/systemd_232.bb | 1 -
 1 file changed, 1 deletion(-)

diff --git a/meta/recipes-core/systemd/systemd_232.bb b/meta/recipes-core/systemd/systemd_232.bb
index bf0fadc..a18907a 100644
--- a/meta/recipes-core/systemd/systemd_232.bb
+++ b/meta/recipes-core/systemd/systemd_232.bb
@@ -451,7 +451,6 @@ FILES_${PN} = " ${base_bindir}/* \
                 ${rootlibexecdir}/systemd/* \
                 ${systemd_unitdir}/* \
                 ${base_libdir}/security/*.so \
-                ${libdir}/libnss_* \
                 /cgroup \
                 ${bindir}/systemd* \
                 ${bindir}/busctl \
-- 
2.7.4



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

* [PATCH v2 14/25] util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package.
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (13 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 13/25] systemd: Do not add libnss_* to systemd package Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 15/25] util-linux, shadow: Make 'nologin' alternative command Amarnath Valluri
                     ` (11 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

update-alternative.bbclass might rename the 'reset' binary when LINK_NAME ==
TARGET, This is true(${base_bindir} == ${bindir}) when 'usrmerge' distro feature
is enabled.  Hence, suffix with * to properly package the renamed binary.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>

util-linux
---
 meta/recipes-core/util-linux/util-linux.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index ae60b0a..5934fb5 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -84,7 +84,7 @@ FILES_util-linux-umount = "${base_bindir}/umount.${BPN}"
 FILES_util-linux-readprofile = "${sbindir}/readprofile.${BPN}"
 FILES_util-linux-uuidgen = "${bindir}/uuidgen"
 FILES_util-linux-uuidd = "${sbindir}/uuidd"
-FILES_util-linux-reset = "${base_bindir}/reset"
+FILES_util-linux-reset = "${base_bindir}/reset*"
 FILES_util-linux-partx = "${sbindir}/partx"
 FILES_util-linux-hwclock = "${base_sbindir}/hwclock.${BPN}"
 FILES_util-linux-findfs = "${sbindir}/findfs"
-- 
2.7.4



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

* [PATCH v2 15/25] util-linux, shadow: Make 'nologin' alternative command
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (14 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 14/25] util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 16/25] libarchive: Backport upstream fixes Amarnath Valluri
                     ` (10 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

Both shadow and util-linux packages provides 'nologin' binary in ${base_sbindir}
and ${sbindir} respectively, this leads to conflict when 'usrmerge' feature is
enabled, where ${sbindir} == ${base_sbindir}. Hance, handle this to alternative
system to resolve the conflict.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-core/util-linux/util-linux.inc | 5 +++--
 meta/recipes-extended/shadow/shadow.inc     | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index 5934fb5..afc3c73 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -151,7 +151,7 @@ do_install () {
 	mkdir -p ${D}${base_bindir}
 
         sbinprogs="agetty ctrlaltdel cfdisk vipw vigr"
-        sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root"
+        sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root nologin"
         binprogs_a="dmesg getopt kill more umount mount login reset su mountpoint"
 
         if [ "${base_sbindir}" != "${sbindir}" ]; then
@@ -194,7 +194,7 @@ ALTERNATIVE_PRIORITY = "80"
 
 ALTERNATIVE_${PN}  = "dmesg kill more mkswap blockdev pivot_root switch_root"
 ALTERNATIVE_${PN} += "hexdump last lastb logger mesg renice wall"
-ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject"
+ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject nologin"
 
 ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
 ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill"
@@ -204,6 +204,7 @@ ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev"
 ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
 ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
 ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
+ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
 
 ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 nologin.8 sulogin.8 utmpdump.1 reset.1 kill.1 libblkid.3 blkid.8 findfs.8 fsck.8 uuid.3"
 
diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc
index 4c4db00..91b6f46 100644
--- a/meta/recipes-extended/shadow/shadow.inc
+++ b/meta/recipes-extended/shadow/shadow.inc
@@ -170,10 +170,11 @@ inherit update-alternatives
 
 ALTERNATIVE_PRIORITY = "200"
 
-ALTERNATIVE_${PN} = "passwd chfn chsh chpasswd vipw vigr"
+ALTERNATIVE_${PN} = "passwd chfn chsh chpasswd vipw vigr nologin"
 ALTERNATIVE_LINK_NAME[chpasswd] = "${sbindir}/chpasswd"
 ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
 ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
+ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
 
 ALTERNATIVE_${PN}-base = "newgrp groups login su"
 ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"
-- 
2.7.4



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

* [PATCH v2 16/25] libarchive: Backport upstream fixes.
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (15 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 15/25] util-linux, shadow: Make 'nologin' alternative command Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 17/25] kernel: use ${nonarch_base_libdir} for kernel modules installation Amarnath Valluri
                     ` (9 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

These set of patches backported from upstream, which fixes the issues in
extracting hardlinks over softlinks while etracting packages by opkg.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 ...te_disk_posix.c-make-_fsobj-functions-mor.patch | 245 +++++++++++++++++++++
 ...02-Fix-extracting-hardlinks-over-symlinks.patch | 120 ++++++++++
 .../libarchive/libarchive_3.2.2.bb                 |   2 +
 3 files changed, 367 insertions(+)
 create mode 100644 meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch
 create mode 100644 meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch

diff --git a/meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch b/meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch
new file mode 100644
index 0000000..7d93142
--- /dev/null
+++ b/meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch
@@ -0,0 +1,245 @@
+From 90881d24d3f6d5fb207e97df3b91bbea8598e84e Mon Sep 17 00:00:00 2001
+From: Martin Matuska <martin@matuska.org>
+Date: Tue, 29 Nov 2016 16:47:37 +0100
+Subject: [PATCH 1/2] archive_write_disk_posix.c: make *_fsobj functions more
+ readable
+
+Upstream-Status: Backport
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ libarchive/archive_write_disk_posix.c | 121 +++++++++++++++++-----------------
+ 1 file changed, 61 insertions(+), 60 deletions(-)
+
+diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
+index 17c23b0..d786bc2 100644
+--- a/libarchive/archive_write_disk_posix.c
++++ b/libarchive/archive_write_disk_posix.c
+@@ -336,6 +336,8 @@ struct archive_write_disk {
+ 
+ #define HFS_BLOCKS(s)	((s) >> 12)
+ 
++static void	fsobj_error(int *, struct archive_string *, int, const char *,
++		    const char *);
+ static int	check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags);
+ static int	check_symlinks(struct archive_write_disk *);
+ static int	create_filesystem_object(struct archive_write_disk *);
+@@ -2005,8 +2007,9 @@ restore_entry(struct archive_write_disk *a)
+ 
+ 	if (en) {
+ 		/* Everything failed; give up here. */
+-		archive_set_error(&a->archive, en, "Can't create '%s'",
+-		    a->name);
++		if ((&a->archive)->error == NULL)
++			archive_set_error(&a->archive, en, "Can't create '%s'",
++			    a->name);
+ 		return (ARCHIVE_FAILED);
+ 	}
+ 
+@@ -2388,6 +2391,17 @@ current_fixup(struct archive_write_disk *a, const char *pathname)
+ 	return (a->current_fixup);
+ }
+ 
++/* Error helper for new *_fsobj functions */
++static void
++fsobj_error(int *a_eno, struct archive_string *a_estr,
++    int err, const char *errstr, const char *path)
++{
++	if (a_eno)
++		*a_eno = err;
++	if (a_estr)
++		archive_string_sprintf(a_estr, errstr, path);
++}
++
+ /*
+  * TODO: Someday, integrate this with the deep dir support; they both
+  * scan the path and both can be optimized by comparing against other
+@@ -2400,7 +2414,7 @@ current_fixup(struct archive_write_disk *a, const char *pathname)
+  * ARCHIVE_OK if there are none, otherwise puts an error in errmsg.
+  */
+ static int
+-check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags)
++check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr, int flags)
+ {
+ #if !defined(HAVE_LSTAT)
+ 	/* Platform doesn't have lstat, so we can't look for symlinks. */
+@@ -2474,19 +2488,20 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 			if (errno == ENOENT) {
+ 				break;
+ 			} else {
+-				/* Treat any other error as fatal - best to be paranoid here
+-				 * Note: This effectively disables deep directory
+-				 * support when security checks are enabled.
+-				 * Otherwise, very long pathnames that trigger
+-				 * an error here could evade the sandbox.
+-				 * TODO: We could do better, but it would probably
+-				 * require merging the symlink checks with the
+-				 * deep-directory editing. */
+-				if (error_number) *error_number = errno;
+-				if (error_string)
+-					archive_string_sprintf(error_string,
+-							"Could not stat %s",
+-							path);
++				/*
++				 * Treat any other error as fatal - best to be
++				 * paranoid here.
++				 * Note: This effectively disables deep
++				 * directory support when security checks are
++				 * enabled. Otherwise, very long pathnames that
++				 * trigger an error here could evade the
++				 * sandbox.
++				 * TODO: We could do better, but it would
++				 * probably require merging the symlink checks
++				 * with the deep-directory editing.
++				 */
++				fsobj_error(a_eno, a_estr, errno,
++				    "Could not stat %s", path);
+ 				res = ARCHIVE_FAILED;
+ 				break;
+ 			}
+@@ -2494,11 +2509,8 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 			if (!last) {
+ 				if (chdir(head) != 0) {
+ 					tail[0] = c;
+-					if (error_number) *error_number = errno;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Could not chdir %s",
+-								path);
++					fsobj_error(a_eno, a_estr, errno,
++					    "Could not chdir %s", path);
+ 					res = (ARCHIVE_FATAL);
+ 					break;
+ 				}
+@@ -2514,11 +2526,9 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 				 */
+ 				if (unlink(head)) {
+ 					tail[0] = c;
+-					if (error_number) *error_number = errno;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Could not remove symlink %s",
+-								path);
++					fsobj_error(a_eno, a_estr, errno,
++					    "Could not remove symlink %s",
++					    path);
+ 					res = ARCHIVE_FAILED;
+ 					break;
+ 				}
+@@ -2529,13 +2539,14 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 				 * symlink with another symlink.
+ 				 */
+ 				tail[0] = c;
+-				/* FIXME:  not sure how important this is to restore
++				/*
++				 * FIXME:  not sure how important this is to
++				 * restore
++				 */
++				/*
+ 				if (!S_ISLNK(path)) {
+-					if (error_number) *error_number = 0;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Removing symlink %s",
+-								path);
++					fsobj_error(a_eno, a_estr, 0,
++					    "Removing symlink %s", path);
+ 				}
+ 				*/
+ 				/* Symlink gone.  No more problem! */
+@@ -2545,22 +2556,17 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 				/* User asked us to remove problems. */
+ 				if (unlink(head) != 0) {
+ 					tail[0] = c;
+-					if (error_number) *error_number = 0;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Cannot remove intervening symlink %s",
+-								path);
++					fsobj_error(a_eno, a_estr, 0,
++					    "Cannot remove intervening "
++					    "symlink %s", path);
+ 					res = ARCHIVE_FAILED;
+ 					break;
+ 				}
+ 				tail[0] = c;
+ 			} else {
+ 				tail[0] = c;
+-				if (error_number) *error_number = 0;
+-				if (error_string)
+-					archive_string_sprintf(error_string,
+-							"Cannot extract through symlink %s",
+-							path);
++				fsobj_error(a_eno, a_estr, 0,
++				    "Cannot extract through symlink %s", path);
+ 				res = ARCHIVE_FAILED;
+ 				break;
+ 			}
+@@ -2577,10 +2583,8 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 	if (restore_pwd >= 0) {
+ 		r = fchdir(restore_pwd);
+ 		if (r != 0) {
+-			if(error_number) *error_number = errno;
+-			if(error_string)
+-				archive_string_sprintf(error_string,
+-						"chdir() failure");
++			fsobj_error(a_eno, a_estr, errno,
++			    "chdir() failure", "");
+ 		}
+ 		close(restore_pwd);
+ 		restore_pwd = -1;
+@@ -2688,17 +2692,16 @@ cleanup_pathname_win(struct archive_write_disk *a)
+  * is set) if the path is absolute.
+  */
+ static int
+-cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags)
++cleanup_pathname_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
++    int flags)
+ {
+ 	char *dest, *src;
+ 	char separator = '\0';
+ 
+ 	dest = src = path;
+ 	if (*src == '\0') {
+-		if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
+-		if (error_string)
+-		    archive_string_sprintf(error_string,
+-			    "Invalid empty pathname");
++		fsobj_error(a_eno, a_estr, ARCHIVE_ERRNO_MISC,
++		    "Invalid empty ", "pathname");
+ 		return (ARCHIVE_FAILED);
+ 	}
+ 
+@@ -2708,10 +2711,8 @@ cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *err
+ 	/* Skip leading '/'. */
+ 	if (*src == '/') {
+ 		if (flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) {
+-			if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
+-			if (error_string)
+-			    archive_string_sprintf(error_string,
+-				    "Path is absolute");
++			fsobj_error(a_eno, a_estr, ARCHIVE_ERRNO_MISC,
++			    "Path is ", "absolute");
+ 			return (ARCHIVE_FAILED);
+ 		}
+ 
+@@ -2738,11 +2739,11 @@ cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *err
+ 			} else if (src[1] == '.') {
+ 				if (src[2] == '/' || src[2] == '\0') {
+ 					/* Conditionally warn about '..' */
+-					if (flags & ARCHIVE_EXTRACT_SECURE_NODOTDOT) {
+-						if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
+-						if (error_string)
+-						    archive_string_sprintf(error_string,
+-							    "Path contains '..'");
++					if (flags
++					    & ARCHIVE_EXTRACT_SECURE_NODOTDOT) {
++						fsobj_error(a_eno, a_estr,
++						    ARCHIVE_ERRNO_MISC,
++						    "Path contains ", "'..'");
+ 						return (ARCHIVE_FAILED);
+ 					}
+ 				}
+-- 
+2.7.4
+
diff --git a/meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch b/meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch
new file mode 100644
index 0000000..a885409
--- /dev/null
+++ b/meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch
@@ -0,0 +1,120 @@
+From ece28103885a079a129a23c5001252a1648517af Mon Sep 17 00:00:00 2001
+From: Martin Matuska <martin@matuska.org>
+Date: Tue, 29 Nov 2016 16:55:41 +0100
+Subject: [PATCH 2/2] Fix extracting hardlinks over symlinks
+
+Closes #821
+
+Upstream-Status: Backport
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ libarchive/archive_write_disk_posix.c | 43 +++++++++++++++++++++++++++++++++++
+ tar/test/test_symlink_dir.c           | 18 ++++++++++++++-
+ 2 files changed, 60 insertions(+), 1 deletion(-)
+
+diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
+index d786bc2..80b03cd 100644
+--- a/libarchive/archive_write_disk_posix.c
++++ b/libarchive/archive_write_disk_posix.c
+@@ -2563,6 +2563,49 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr, int
+ 					break;
+ 				}
+ 				tail[0] = c;
++			} else if ((flags &
++			    ARCHIVE_EXTRACT_SECURE_SYMLINKS) == 0) {
++				/*
++				 * We are not the last element and we want to
++				 * follow symlinks if they are a directory.
++				 * 
++				 * This is needed to extract hardlinks over
++				 * symlinks.
++				 */
++				r = stat(head, &st);
++				if (r != 0) {
++					tail[0] = c;
++					if (errno == ENOENT) {
++						break;
++					} else {
++						fsobj_error(a_eno, a_estr,
++						    errno,
++						    "Could not stat %s", path);
++						res = (ARCHIVE_FAILED);
++						break;
++					}
++				} else if (S_ISDIR(st.st_mode)) {
++					if (chdir(head) != 0) {
++						tail[0] = c;
++						fsobj_error(a_eno, a_estr,
++						    errno,
++						    "Could not chdir %s", path);
++						res = (ARCHIVE_FATAL);
++						break;
++					}
++					/*
++					 * Our view is now from inside
++					 * this dir:
++					 */
++					head = tail + 1;
++				} else {
++					tail[0] = c;
++					fsobj_error(a_eno, a_estr, 0,
++					    "Cannot extract through "
++					    "symlink %s", path);
++					res = ARCHIVE_FAILED;
++					break;
++				}
+ 			} else {
+ 				tail[0] = c;
+ 				fsobj_error(a_eno, a_estr, 0,
+diff --git a/tar/test/test_symlink_dir.c b/tar/test/test_symlink_dir.c
+index 25bd8b1..852e00b 100644
+--- a/tar/test/test_symlink_dir.c
++++ b/tar/test/test_symlink_dir.c
+@@ -47,11 +47,18 @@ DEFINE_TEST(test_symlink_dir)
+ 	assertMakeDir("source/dir3", 0755);
+ 	assertMakeDir("source/dir3/d3", 0755);
+ 	assertMakeFile("source/dir3/f3", 0755, "abcde");
++	assertMakeDir("source/dir4", 0755);
++	assertMakeFile("source/dir4/file3", 0755, "abcdef");
++	assertMakeHardlink("source/dir4/file4", "source/dir4/file3");
+ 
+ 	assertEqualInt(0,
+ 	    systemf("%s -cf test.tar -C source dir dir2 dir3 file file2",
+ 		testprog));
+ 
++	/* Second archive with hardlinks */
++	assertEqualInt(0,
++	    systemf("%s -cf test2.tar -C source dir4", testprog));
++
+ 	/*
+ 	 * Extract with -x and without -P.
+ 	 */
+@@ -118,9 +125,15 @@ DEFINE_TEST(test_symlink_dir)
+ 		assertMakeSymlink("dest2/file2", "real_file2");
+ 	assertEqualInt(0, systemf("%s -xPf test.tar -C dest2", testprog));
+ 
+-	/* dest2/dir symlink should be followed */
++	/* "dir4" is a symlink to existing "real_dir" */
++	if (canSymlink())
++		assertMakeSymlink("dest2/dir4", "real_dir");
++	assertEqualInt(0, systemf("%s -xPf test2.tar -C dest2", testprog));
++
++	/* dest2/dir and dest2/dir4 symlinks should be followed */
+ 	if (canSymlink()) {
+ 		assertIsSymlink("dest2/dir", "real_dir");
++		assertIsSymlink("dest2/dir4", "real_dir");
+ 		assertIsDir("dest2/real_dir", -1);
+ 	}
+ 
+@@ -141,4 +154,7 @@ DEFINE_TEST(test_symlink_dir)
+ 	/* dest2/file2 symlink should be removed */
+ 	failure("Symlink to non-existing file should be removed");
+ 	assertIsReg("dest2/file2", -1);
++
++	/* dest2/dir4/file3 and dest2/dir4/file4 should be hard links */
++	assertIsHardlink("dest2/dir4/file3", "dest2/dir4/file4");
+ }
+-- 
+2.7.4
+
diff --git a/meta/recipes-extended/libarchive/libarchive_3.2.2.bb b/meta/recipes-extended/libarchive/libarchive_3.2.2.bb
index 8ad62ad..387fa9b 100644
--- a/meta/recipes-extended/libarchive/libarchive_3.2.2.bb
+++ b/meta/recipes-extended/libarchive/libarchive_3.2.2.bb
@@ -33,6 +33,8 @@ PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4,"
 
 SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
            file://non-recursive-extract-and-list.patch \
+	   file://0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch \
+	   file://0002-Fix-extracting-hardlinks-over-symlinks.patch \
            "
 
 SRC_URI[md5sum] = "1ec00b7dcaf969dd2a5712f85f23c764"
-- 
2.7.4



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

* [PATCH v2 17/25] kernel: use ${nonarch_base_libdir} for kernel modules installation.
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (16 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 16/25] libarchive: Backport upstream fixes Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 18/25] firmware: use ${nonarch_base_libdir} for firmware installation Amarnath Valluri
                     ` (8 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

Replace hardcoded '/lib' in kernel modules installation path with
${nonarch_base_libdir}, which is meant exactly for this.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/classes/kernel-module-split.bbclass |  2 +-
 meta/classes/kernel.bbclass              | 14 +++++++-------
 meta/classes/module.bbclass              |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/meta/classes/kernel-module-split.bbclass b/meta/classes/kernel-module-split.bbclass
index ba9cc15..5e10dcf 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -138,7 +138,7 @@ python split_kernel_module_packages () {
     postinst = d.getVar('pkg_postinst_modules')
     postrm = d.getVar('pkg_postrm_modules')
 
-    modules = do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='kernel-%s' % (d.getVar("KERNEL_VERSION")))
+    modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='kernel-%s' % (d.getVar("KERNEL_VERSION")))
     if modules:
         metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
         d.appendVar('RDEPENDS_' + metapkg, ' '+' '.join(modules))
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 97cba92..bb02ba5 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -297,11 +297,11 @@ kernel_do_install() {
 	#
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
 	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
-		oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
-		rm "${D}/lib/modules/${KERNEL_VERSION}/build"
-		rm "${D}/lib/modules/${KERNEL_VERSION}/source"
+		oe_runmake DEPMOD=echo MODLIB=${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION} INSTALL_FW_PATH=${D}${nonarch_base_libdir}/firmware modules_install
+		rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
+		rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source"
 		# If the kernel/ directory is empty remove it to prevent QA issues
-		rmdir --ignore-fail-on-non-empty "${D}/lib/modules/${KERNEL_VERSION}/kernel"
+		rmdir --ignore-fail-on-non-empty "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel"
 	else
 		bbnote "no modules to install"
 	fi
@@ -479,9 +479,9 @@ EXPORT_FUNCTIONS do_compile do_install do_configure
 # kernel-image becomes kernel-image-${KERNEL_VERSION}
 PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-modules"
 FILES_${PN} = ""
-FILES_kernel-base = "/lib/modules/${KERNEL_VERSION}/modules.order /lib/modules/${KERNEL_VERSION}/modules.builtin"
+FILES_kernel-base = "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.order ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin"
 FILES_kernel-image = ""
-FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} /lib/modules/${KERNEL_VERSION}/build"
+FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
 FILES_kernel-vmlinux = "/boot/vmlinux-${KERNEL_VERSION_NAME}"
 FILES_kernel-modules = ""
 RDEPENDS_kernel = "kernel-base"
@@ -512,7 +512,7 @@ pkg_postinst_kernel-base () {
 PACKAGESPLITFUNCS_prepend = "split_kernel_packages "
 
 python split_kernel_packages () {
-    do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.(bin|fw|cis|csp|dsp)$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
+    do_split_packages(d, root='${nonarch_base_libdir}/firmware', file_regex='^(.*)\.(bin|fw|cis|csp|dsp)$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
 }
 
 # Many scripts want to look in arch/$arch/boot for the bootable
diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
index a588873..e894c89 100644
--- a/meta/classes/module.bbclass
+++ b/meta/classes/module.bbclass
@@ -31,7 +31,7 @@ module_do_compile() {
 
 module_do_install() {
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
-	oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" \
+	oe_runmake DEPMOD=echo MODLIB="${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}" \
 	           CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
 	           O=${STAGING_KERNEL_BUILDDIR} \
 	           ${MODULES_INSTALL_TARGET}
-- 
2.7.4



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

* [PATCH v2 18/25] firmware: use ${nonarch_base_libdir} for firmware installation.
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (17 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 17/25] kernel: use ${nonarch_base_libdir} for kernel modules installation Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 19/25] mdadm: Avoid using hardocded udev, sbin paths Amarnath Valluri
                     ` (7 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

Replace hardcoded '/lib' in kernel firmware installation path with
${nonarch_base_libdir}.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 .../linux-firmware/linux-firmware_git.bb           | 168 ++++++++++-----------
 1 file changed, 84 insertions(+), 84 deletions(-)

diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
index 0aba740..5a74a57 100644
--- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
+++ b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
@@ -195,27 +195,27 @@ do_compile() {
 }
 
 do_install() {
-	install -d  ${D}/lib/firmware/
-	cp -r * ${D}/lib/firmware/
+	install -d  ${D}${nonarch_base_libdir}/firmware/
+	cp -r * ${D}${nonarch_base_libdir}/firmware/
 
 	# Avoid Makefile to be deployed
-	rm ${D}/lib/firmware/Makefile
+	rm ${D}${nonarch_base_libdir}/firmware/Makefile
 
 	# Remove unbuild firmware which needs cmake and bash
-	rm ${D}/lib/firmware/carl9170fw -rf
+	rm ${D}${nonarch_base_libdir}/firmware/carl9170fw -rf
 
 	# Remove pointless bash script
-	rm ${D}/lib/firmware/configure
+	rm ${D}${nonarch_base_libdir}/firmware/configure
 
 	# Libertas sd8686
-	ln -sf libertas/sd8686_v9.bin ${D}/lib/firmware/sd8686.bin
-	ln -sf libertas/sd8686_v9_helper.bin ${D}/lib/firmware/sd8686_helper.bin
+	ln -sf libertas/sd8686_v9.bin ${D}${nonarch_base_libdir}/firmware/sd8686.bin
+	ln -sf libertas/sd8686_v9_helper.bin ${D}${nonarch_base_libdir}/firmware/sd8686_helper.bin
 
 	# fixup wl12xx location, after 2.6.37 the kernel searches a different location for it
-	( cd ${D}/lib/firmware ; ln -sf ti-connectivity/* . )
+	( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/* . )
 
         # Copy the iwlwifi ucode
-        cp ${WORKDIR}/iwlwifi-8000C-19.ucode ${D}/lib/firmware/
+        cp ${WORKDIR}/iwlwifi-8000C-19.ucode ${D}${nonarch_base_libdir}/firmware/
 }
 
 
@@ -252,23 +252,23 @@ LICENSE_${PN}-ath6k = "Firmware-atheros_firmware"
 LICENSE_${PN}-ath9k = "Firmware-atheros_firmware"
 LICENSE_${PN}-atheros-license = "Firmware-atheros_firmware"
 
-FILES_${PN}-atheros-license = "/lib/firmware/LICENCE.atheros_firmware"
+FILES_${PN}-atheros-license = "${nonarch_base_libdir}/firmware/LICENCE.atheros_firmware"
 FILES_${PN}-ar9170 = " \
-  /lib/firmware/ar9170*.fw \
+  ${nonarch_base_libdir}/firmware/ar9170*.fw \
 "
 FILES_${PN}-carl9170 = " \
-  /lib/firmware/carl9170*.fw \
+  ${nonarch_base_libdir}/firmware/carl9170*.fw \
 "
 FILES_${PN}-ath6k = " \
-  /lib/firmware/ath6k \
+  ${nonarch_base_libdir}/firmware/ath6k \
 "
 FILES_${PN}-ath9k = " \
-  /lib/firmware/ar9271.fw \
-  /lib/firmware/ar7010*.fw \
-  /lib/firmware/htc_9271.fw \
-  /lib/firmware/htc_7010.fw \
-  /lib/firmware/ath9k_htc/htc_7010-1.4.0.fw \
-  /lib/firmware/ath9k_htc/htc_9271-1.4.0.fw \
+  ${nonarch_base_libdir}/firmware/ar9271.fw \
+  ${nonarch_base_libdir}/firmware/ar7010*.fw \
+  ${nonarch_base_libdir}/firmware/htc_9271.fw \
+  ${nonarch_base_libdir}/firmware/htc_7010.fw \
+  ${nonarch_base_libdir}/firmware/ath9k_htc/htc_7010-1.4.0.fw \
+  ${nonarch_base_libdir}/firmware/ath9k_htc/htc_9271-1.4.0.fw \
 "
 
 RDEPENDS_${PN}-ar9170 += "${PN}-atheros-license"
@@ -282,14 +282,14 @@ LICENSE_${PN}-ar3k-license = "Firmware-qualcommAthos_ar3k"
 LICENSE_${PN}-ath10k = "Firmware-qualcommAthos_ath10k"
 LICENSE_${PN}-ath10k-license = "Firmware-qualcommAthos_ath10k"
 
-FILES_${PN}-ar3k-license = "/lib/firmware/LICENSE.QualcommAtheros_ar3k"
+FILES_${PN}-ar3k-license = "${nonarch_base_libdir}/firmware/LICENSE.QualcommAtheros_ar3k"
 FILES_${PN}-ar3k = " \
-  /lib/firmware/ar3k \
+  ${nonarch_base_libdir}/firmware/ar3k \
 "
 
-FILES_${PN}-ath10k-license = "/lib/firmware/LICENSE.QualcommAtheros_ath10k"
+FILES_${PN}-ath10k-license = "${nonarch_base_libdir}/firmware/LICENSE.QualcommAtheros_ath10k"
 FILES_${PN}-ath10k = " \
-  /lib/firmware/ath10k \
+  ${nonarch_base_libdir}/firmware/ath10k \
 "
 
 RDEPENDS_${PN}-ar3k += "${PN}-ar3k-license"
@@ -299,9 +299,9 @@ RDEPENDS_${PN}-ath10k += "${PN}-ath10k-license"
 LICENSE_${PN}-ralink = "Firmware-ralink-firmware"
 LICENSE_${PN}-ralink-license = "Firmware-ralink-firmware"
 
-FILES_${PN}-ralink-license = "/lib/firmware/LICENCE.ralink-firmware.txt"
+FILES_${PN}-ralink-license = "${nonarch_base_libdir}/firmware/LICENCE.ralink-firmware.txt"
 FILES_${PN}-ralink = " \
-  /lib/firmware/rt*.bin \
+  ${nonarch_base_libdir}/firmware/rt*.bin \
 "
 
 RDEPENDS_${PN}-ralink += "${PN}-ralink-license"
@@ -310,9 +310,9 @@ RDEPENDS_${PN}-ralink += "${PN}-ralink-license"
 LICENSE_${PN}-radeon = "Firmware-radeon"
 LICENSE_${PN}-radeon-license = "Firmware-radeon"
 
-FILES_${PN}-radeon-license = "/lib/firmware/LICENSE.radeon"
+FILES_${PN}-radeon-license = "${nonarch_base_libdir}/firmware/LICENSE.radeon"
 FILES_${PN}-radeon = " \
-  /lib/firmware/radeon \
+  ${nonarch_base_libdir}/firmware/radeon \
 "
 
 RDEPENDS_${PN}-radeon += "${PN}-radeon-license"
@@ -324,20 +324,20 @@ LICENSE_${PN}-sd8787 = "Firmware-Marvell"
 LICENSE_${PN}-sd8797 = "Firmware-Marvell"
 LICENSE_${PN}-marvell-license = "Firmware-Marvell"
 
-FILES_${PN}-marvell-license = "/lib/firmware/LICENCE.Marvell"
+FILES_${PN}-marvell-license = "${nonarch_base_libdir}/firmware/LICENCE.Marvell"
 FILES_${PN}-sd8686 = " \
-  /lib/firmware/libertas/sd8686_v9* \
-  /lib/firmware/sd8686* \
+  ${nonarch_base_libdir}/firmware/libertas/sd8686_v9* \
+  ${nonarch_base_libdir}/firmware/sd8686* \
 "
 FILES_${PN}-sd8688 = " \
-  /lib/firmware/libertas/sd8688* \
-  /lib/firmware/mrvl/sd8688* \
+  ${nonarch_base_libdir}/firmware/libertas/sd8688* \
+  ${nonarch_base_libdir}/firmware/mrvl/sd8688* \
 "
 FILES_${PN}-sd8787 = " \
-  /lib/firmware/mrvl/sd8787_uapsta.bin \
+  ${nonarch_base_libdir}/firmware/mrvl/sd8787_uapsta.bin \
 "
 FILES_${PN}-sd8797 = " \
-  /lib/firmware/mrvl/sd8797_uapsta.bin \
+  ${nonarch_base_libdir}/firmware/mrvl/sd8797_uapsta.bin \
 "
 
 RDEPENDS_${PN}-sd8686 += "${PN}-marvell-license"
@@ -355,25 +355,25 @@ LICENSE_${PN}-rtl8821 = "Firmware-rtlwifi_firmware"
 LICENSE_${PN}-rtl-license = "Firmware-rtlwifi_firmware"
 
 FILES_${PN}-rtl-license = " \
-  /lib/firmware/LICENCE.rtlwifi_firmware.txt \
+  ${nonarch_base_libdir}/firmware/LICENCE.rtlwifi_firmware.txt \
 "
 FILES_${PN}-rtl8188 = " \
-  /lib/firmware/rtlwifi/rtl8188*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8188*.bin \
 "
 FILES_${PN}-rtl8192cu = " \
-  /lib/firmware/rtlwifi/rtl8192cufw*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8192cufw*.bin \
 "
 FILES_${PN}-rtl8192ce = " \
-  /lib/firmware/rtlwifi/rtl8192cfw*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8192cfw*.bin \
 "
 FILES_${PN}-rtl8192su = " \
-  /lib/firmware/rtlwifi/rtl8712u.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8712u.bin \
 "
 FILES_${PN}-rtl8723 = " \
-  /lib/firmware/rtlwifi/rtl8723*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8723*.bin \
 "
 FILES_${PN}-rtl8821 = " \
-  /lib/firmware/rtlwifi/rtl8821*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8821*.bin \
 "
 
 RDEPENDS_${PN}-rtl8188 += "${PN}-rtl-license"
@@ -388,16 +388,16 @@ LICENSE_${PN}-wl12xx = "Firmware-ti-connectivity"
 LICENSE_${PN}-wl18xx = "Firmware-ti-connectivity"
 LICENSE_${PN}-ti-connectivity-license = "Firmware-ti-connectivity"
 
-FILES_${PN}-ti-connectivity-license = "/lib/firmware/LICENCE.ti-connectivity"
+FILES_${PN}-ti-connectivity-license = "${nonarch_base_libdir}/firmware/LICENCE.ti-connectivity"
 FILES_${PN}-wl12xx = " \
-  /lib/firmware/wl12* \
-  /lib/firmware/TI* \
-  /lib/firmware/ti-connectivity \
+  ${nonarch_base_libdir}/firmware/wl12* \
+  ${nonarch_base_libdir}/firmware/TI* \
+  ${nonarch_base_libdir}/firmware/ti-connectivity \
 "
 FILES_${PN}-wl18xx = " \
-  /lib/firmware/wl18* \
-  /lib/firmware/TI* \
-  /lib/firmware/ti-connectivity \
+  ${nonarch_base_libdir}/firmware/wl18* \
+  ${nonarch_base_libdir}/firmware/TI* \
+  ${nonarch_base_libdir}/firmware/ti-connectivity \
 "
 
 RDEPENDS_${PN}-wl12xx = "${PN}-ti-connectivity-license"
@@ -407,9 +407,9 @@ RDEPENDS_${PN}-wl18xx = "${PN}-ti-connectivity-license"
 LICENSE_${PN}-vt6656 = "Firmware-via_vt6656"
 LICENSE_${PN}-vt6656-license = "Firmware-via_vt6656"
 
-FILES_${PN}-vt6656-license = "/lib/firmware/LICENCE.via_vt6656"
+FILES_${PN}-vt6656-license = "${nonarch_base_libdir}/firmware/LICENCE.via_vt6656"
 FILES_${PN}-vt6656 = " \
-  /lib/firmware/vntwusb.fw \
+  ${nonarch_base_libdir}/firmware/vntwusb.fw \
 "
 
 RDEPENDS_${PN}-vt6656 = "${PN}-vt6656-license"
@@ -426,28 +426,28 @@ LICENSE_${PN}-bcm4354 = "Firmware-broadcom_bcm43xx"
 LICENSE_${PN}-broadcom-license = "Firmware-broadcom_bcm43xx"
 
 FILES_${PN}-broadcom-license = " \
-  /lib/firmware/LICENCE.broadcom_bcm43xx \
+  ${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx \
 "
 FILES_${PN}-bcm4329 = " \
-  /lib/firmware/brcm/brcmfmac4329-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4329-sdio.bin \
 "
 FILES_${PN}-bcm4330 = " \
-  /lib/firmware/brcm/brcmfmac4330-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4330-sdio.bin \
 "
 FILES_${PN}-bcm4334 = " \
-  /lib/firmware/brcm/brcmfmac4334-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4334-sdio.bin \
 "
 FILES_${PN}-bcm43340 = " \
-  /lib/firmware/brcm/brcmfmac43340-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac43340-sdio.bin \
 "
 FILES_${PN}-bcm4339 = " \
-  /lib/firmware/brcm/brcmfmac4339-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4339-sdio.bin \
 "
 FILES_${PN}-bcm43430 = " \
-  /lib/firmware/brcm/brcmfmac43430-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.bin \
 "
 FILES_${PN}-bcm4354 = " \
-  /lib/firmware/brcm/brcmfmac4354-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4354-sdio.bin \
 "
 
 RDEPENDS_${PN}-bcm4329 += "${PN}-broadcom-license"
@@ -466,8 +466,8 @@ RDEPENDS_${PN}-bcm4354 += "${PN}-broadcom-license"
 LICENSE_${PN}-bnx2-mips = "WHENCE"
 LICENSE_${PN}-whence-license = "WHENCE"
 
-FILES_${PN}-bnx2-mips = "/lib/firmware/bnx2/bnx2-mips-09-6.2.1b.fw"
-FILES_${PN}-whence-license = "/lib/firmware/WHENCE"
+FILES_${PN}-bnx2-mips = "${nonarch_base_libdir}/firmware/bnx2/bnx2-mips-09-6.2.1b.fw"
+FILES_${PN}-whence-license = "${nonarch_base_libdir}/firmware/WHENCE"
 
 RDEPENDS_${PN}-bnx2-mips += "${PN}-whence-license"
 
@@ -493,24 +493,24 @@ LICENSE_${PN}-iwlwifi-misc      = "Firmware-iwlwifi_firmware"
 LICENSE_${PN}-iwlwifi-license   = "Firmware-iwlwifi_firmware"
 
 
-FILES_${PN}-iwlwifi-license = "/lib/firmware/LICENCE.iwlwifi_firmware"
-FILES_${PN}-iwlwifi-135-6 = "/lib/firmware/iwlwifi-135-6.ucode"
-FILES_${PN}-iwlwifi-3160-7 = "/lib/firmware/iwlwifi-3160-7.ucode"
-FILES_${PN}-iwlwifi-3160-8 = "/lib/firmware/iwlwifi-3160-8.ucode"
-FILES_${PN}-iwlwifi-3160-9 = "/lib/firmware/iwlwifi-3160-9.ucode"
-FILES_${PN}-iwlwifi-6000-4 = "/lib/firmware/iwlwifi-6000-4.ucode"
-FILES_${PN}-iwlwifi-6000g2a-5 = "/lib/firmware/iwlwifi-6000g2a-5.ucode"
-FILES_${PN}-iwlwifi-6000g2a-6 = "/lib/firmware/iwlwifi-6000g2a-6.ucode"
-FILES_${PN}-iwlwifi-6000g2b-5 = "/lib/firmware/iwlwifi-6000g2b-5.ucode"
-FILES_${PN}-iwlwifi-6000g2b-6 = "/lib/firmware/iwlwifi-6000g2b-6.ucode"
-FILES_${PN}-iwlwifi-6050-4 = "/lib/firmware/iwlwifi-6050-4.ucode"
-FILES_${PN}-iwlwifi-6050-5 = "/lib/firmware/iwlwifi-6050-5.ucode"
-FILES_${PN}-iwlwifi-7260   = "/lib/firmware/iwlwifi-7260-*.ucode"
-FILES_${PN}-iwlwifi-7265   = "/lib/firmware/iwlwifi-7265-*.ucode"
-FILES_${PN}-iwlwifi-7265d   = "/lib/firmware/iwlwifi-7265D-*.ucode"
-FILES_${PN}-iwlwifi-8000c   = "/lib/firmware/iwlwifi-8000C-*.ucode"
-FILES_${PN}-iwlwifi-8265   = "/lib/firmware/iwlwifi-8265-*.ucode"
-FILES_${PN}-iwlwifi-misc   = "/lib/firmware/iwlwifi-*.ucode"
+FILES_${PN}-iwlwifi-license = "${nonarch_base_libdir}/firmware/LICENCE.iwlwifi_firmware"
+FILES_${PN}-iwlwifi-135-6 = "${nonarch_base_libdir}/firmware/iwlwifi-135-6.ucode"
+FILES_${PN}-iwlwifi-3160-7 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-7.ucode"
+FILES_${PN}-iwlwifi-3160-8 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-8.ucode"
+FILES_${PN}-iwlwifi-3160-9 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-9.ucode"
+FILES_${PN}-iwlwifi-6000-4 = "${nonarch_base_libdir}/firmware/iwlwifi-6000-4.ucode"
+FILES_${PN}-iwlwifi-6000g2a-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2a-5.ucode"
+FILES_${PN}-iwlwifi-6000g2a-6 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2a-6.ucode"
+FILES_${PN}-iwlwifi-6000g2b-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2b-5.ucode"
+FILES_${PN}-iwlwifi-6000g2b-6 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2b-6.ucode"
+FILES_${PN}-iwlwifi-6050-4 = "${nonarch_base_libdir}/firmware/iwlwifi-6050-4.ucode"
+FILES_${PN}-iwlwifi-6050-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6050-5.ucode"
+FILES_${PN}-iwlwifi-7260   = "${nonarch_base_libdir}/firmware/iwlwifi-7260-*.ucode"
+FILES_${PN}-iwlwifi-7265   = "${nonarch_base_libdir}/firmware/iwlwifi-7265-*.ucode"
+FILES_${PN}-iwlwifi-7265d   = "${nonarch_base_libdir}/firmware/iwlwifi-7265D-*.ucode"
+FILES_${PN}-iwlwifi-8000c   = "${nonarch_base_libdir}/firmware/iwlwifi-8000C-*.ucode"
+FILES_${PN}-iwlwifi-8265   = "${nonarch_base_libdir}/firmware/iwlwifi-8265-*.ucode"
+FILES_${PN}-iwlwifi-misc   = "${nonarch_base_libdir}/firmware/iwlwifi-*.ucode"
 
 RDEPENDS_${PN}-iwlwifi-135-6     = "${PN}-iwlwifi-license"
 RDEPENDS_${PN}-iwlwifi-3160-7    = "${PN}-iwlwifi-license"
@@ -549,14 +549,14 @@ RCONFLICTS_${PN}-iwlwifi-7260 = "${PN}-iwlwifi-7260-7 ${PN}-iwlwifi-7260-8 ${PN}
 
 LICENSE_${PN}-i915       = "Firmware-i915"
 LICENSE_${PN}-i915-license = "Firmware-i915"
-FILES_${PN}-i915-license = "/lib/firmware/LICENSE.i915"
-FILES_${PN}-i915         = "/lib/firmware/i915"
+FILES_${PN}-i915-license = "${nonarch_base_libdir}/firmware/LICENSE.i915"
+FILES_${PN}-i915         = "${nonarch_base_libdir}/firmware/i915"
 RDEPENDS_${PN}-i915      = "${PN}-i915-license"
 
-FILES_${PN}-adsp-sst-license      = "/lib/firmware/LICENCE.adsp_sst"
+FILES_${PN}-adsp-sst-license      = "${nonarch_base_libdir}/firmware/LICENCE.adsp_sst"
 LICENSE_${PN}-adsp-sst            = "Firmware-adsp_sst"
 LICENSE_${PN}-adsp-sst-license    = "Firmware-adsp_sst"
-FILES_${PN}-adsp-sst              = "/lib/firmware/intel/dsp_fw*"
+FILES_${PN}-adsp-sst              = "${nonarch_base_libdir}/firmware/intel/dsp_fw*"
 RDEPENDS_${PN}-adsp-sst           = "${PN}-adsp-sst-license"
 
 # For other firmwares
@@ -608,8 +608,8 @@ LICENSE_${PN} = "\
     & WHENCE \
 "
 
-FILES_${PN}-license += "/lib/firmware/LICEN*"
-FILES_${PN} += "/lib/firmware/*"
+FILES_${PN}-license += "${nonarch_base_libdir}/firmware/LICEN*"
+FILES_${PN} += "${nonarch_base_libdir}/firmware/*"
 RDEPENDS_${PN} += "${PN}-license"
 RDEPENDS_${PN} += "${PN}-whence-license"
 
-- 
2.7.4



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

* [PATCH v2 19/25] mdadm: Avoid using hardocded udev, sbin paths
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (18 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 18/25] firmware: use ${nonarch_base_libdir} for firmware installation Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-03-02 20:11     ` Burton, Ross
  2017-02-22  8:27   ` [PATCH v2 20/25] mktemp: Move installed files only when needed Amarnath Valluri
                     ` (6 subsequent siblings)
  26 siblings, 1 reply; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

Use appropriate bitbake variables inplace of below hardcoded locations:
  /sbin -> ${base_sbindir}
  /lib/udev -> ${nonarch_base_libdir}/udev

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/mdadm/mdadm_4.0.bb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-extended/mdadm/mdadm_4.0.bb b/meta/recipes-extended/mdadm/mdadm_4.0.bb
index c228899..8a77204 100644
--- a/meta/recipes-extended/mdadm/mdadm_4.0.bb
+++ b/meta/recipes-extended/mdadm/mdadm_4.0.bb
@@ -33,7 +33,9 @@ CFLAGS_append_mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__'
 CFLAGS_append_mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__'
 
 do_compile() {
-	oe_runmake SYSROOT="${STAGING_DIR_TARGET}"
+	# Point to right sbindir
+	sed -i -e 's;BINDIR  = /sbin;BINDIR = $base_sbindir;' ${S}/Makefile
+	oe_runmake SYSROOT="${STAGING_DIR_TARGET}" UDEVDIR="${nonarch_libdir}/udev"
 }
 
 do_install() {
@@ -51,7 +53,7 @@ do_install_ptest() {
 	cp -a ${S}/tests ${D}${PTEST_PATH}/tests
 	cp ${S}/test ${D}${PTEST_PATH}
 	sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test
-	ln -s /sbin/mdadm ${D}${PTEST_PATH}/mdadm
+	ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm
 	for prg in test_stripe swap_super raid6check
 	do
 		install -D -m 755 $prg ${D}${PTEST_PATH}/
-- 
2.7.4



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

* [PATCH v2 20/25] mktemp: Move installed files only when needed
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (19 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 19/25] mdadm: Avoid using hardocded udev, sbin paths Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 21/25] net-tools: Place package content as per bitbake environment Amarnath Valluri
                     ` (5 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

Move binary(ies) only when ${base_bindir} != ${bindir}.

When usrmerge distro feature is enabled they both might point to same location.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/mktemp/mktemp_1.7.bb | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-extended/mktemp/mktemp_1.7.bb b/meta/recipes-extended/mktemp/mktemp_1.7.bb
index 9accc6e..e8ae5c6 100644
--- a/meta/recipes-extended/mktemp/mktemp_1.7.bb
+++ b/meta/recipes-extended/mktemp/mktemp_1.7.bb
@@ -20,9 +20,11 @@ inherit autotools update-alternatives
 EXTRA_OECONF = "--with-libc"
 
 do_install_append () {
-	install -d ${D}${base_bindir}
-	mv ${D}${bindir}/mktemp ${D}${base_bindir}/mktemp
-	rmdir ${D}${bindir}
+	if [ "${base_bindir}" != "${bindir}" ] ; then
+		install -d ${D}${base_bindir}
+		mv ${D}${bindir}/mktemp ${D}${base_bindir}/mktemp
+		rmdir ${D}${bindir}
+	fi
 }
 
 ALTERNATIVE_${PN} = "mktemp"
-- 
2.7.4



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

* [PATCH v2 21/25] net-tools: Place package content as per bitbake environment.
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (20 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 20/25] mktemp: Move installed files only when needed Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 22/25] lsb: Make use of appropriate bitbake variables Amarnath Valluri
                     ` (4 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

net-tools Makefile was hardcoded sbin, bin installation paths to /bin and /sbin
respectively.  This change moves the installed files to appropriate location as
per configured bitbake environment.

This might be solved much better way by patching Makefile, but that causing
build issues, as net-tools recipe is using pre-generated config.{h/status}.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/net-tools/net-tools_1.60-26.bb | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meta/recipes-extended/net-tools/net-tools_1.60-26.bb b/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
index 49a65f8..c4af7ef 100644
--- a/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
+++ b/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
@@ -93,6 +93,17 @@ do_install() {
 	unset CFLAGS
 	unset LDFLAGS
 	oe_runmake 'BASEDIR=${D}' install
+
+	if [ "${base_bindir}" != "/bin" ]; then
+		mkdir -p ${D}/${base_bindir}
+		mv ${D}/bin/* ${D}/${base_bindir}/
+		rmdir ${D}/bin
+	fi
+	if [ "${base_sbindir}" != "/sbin" ]; then
+		mkdir ${D}/${base_sbindir}
+		mv ${D}/sbin/* ${D}/${base_sbindir}/
+		rmdir ${D}/sbin
+	fi
 }
 
 inherit update-alternatives
-- 
2.7.4



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

* [PATCH v2 22/25] lsb: Make use of appropriate bitbake variables.
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (21 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 21/25] net-tools: Place package content as per bitbake environment Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-03-02 20:13     ` Burton, Ross
  2017-02-22  8:27   ` [PATCH v2 23/25] lttng-modules: Replace '/lib' with ${nonarch_base_libdir} Amarnath Valluri
                     ` (3 subsequent siblings)
  26 siblings, 1 reply; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

Using of bitbake environment variables in-place of hardcoded strings makes this
recipe portable to all environments.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/lsb/lsb_4.1.bb | 40 +++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/meta/recipes-extended/lsb/lsb_4.1.bb b/meta/recipes-extended/lsb/lsb_4.1.bb
index ece0eab..7194505 100644
--- a/meta/recipes-extended/lsb/lsb_4.1.bb
+++ b/meta/recipes-extended/lsb/lsb_4.1.bb
@@ -33,14 +33,14 @@ S = "${WORKDIR}/lsb-release-1.4"
 CLEANBROKEN = "1"
 
 do_install(){
-	oe_runmake install prefix=${D}  mandir=${D}/${datadir}/man/ DESTDIR=${D}
+	oe_runmake install prefix=${D}/${prefix}  mandir=${D}/${datadir}/man/ DESTDIR=${D}
 
 	# this 2 dirs are needed by package lsb-dist-checker
 	mkdir -p ${D}${sysconfdir}/opt
 	mkdir -p ${D}${localstatedir}/opt
 
 	mkdir -p ${D}${base_bindir}
-	mkdir -p ${D}/${baselib}
+	mkdir -p ${D}${base_libdir}
 	mkdir -p ${D}${sysconfdir}/lsb-release.d
 	printf "LSB_VERSION=\"core-4.1-noarch:" > ${D}${sysconfdir}/lsb-release
 
@@ -86,47 +86,45 @@ do_install_append(){
            install -m 0755 ${WORKDIR}/${i} ${D}${sysconfdir}/core-lsb
        done
 
-       install -d ${D}/lib/lsb
-       install -m 0755 ${WORKDIR}/init-functions ${D}/lib/lsb
+       install -d ${D}/${nonarch_base_libdir}/lsb
+       install -m 0755 ${WORKDIR}/init-functions ${D}/${nonarch_base_libdir}/lsb
 
        # creat links for LSB test
-       install -d ${D}/usr/lib/lsb
-       ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/install_initd
-       ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/remove_initd
+       if [ "${nonarch_base_libdir}" != "${nonarch_libdir}" ; then
+               install -d ${D}/${nonarch_libdir}/lsb
+       fi
+       ln -sf ${sbindir}/chkconfig ${D}/${nonarch_base_libdir}/lsb/install_initd
+       ln -sf ${sbindir}/chkconfig ${D}/${nonarch_base_libdir}/lsb/remove_initd
 
        if [ "${TARGET_ARCH}" = "x86_64" ];then
-	       cd ${D}
                if [ "${baselib}" != "lib64" ]; then
-                   ln -sf ${baselib} lib64
+                   lnr ${D}${base_libdir} ${D}/lib64
                fi
-	       cd ${D}/${baselib}
+	       cd ${D}/${base_libdir}
                ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.2
                ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3
        fi
        if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
-	       cd ${D}/${baselib}
+	       cd ${D}/${base_libdir}
                ln -sf ld-linux.so.2 ld-lsb.so.2
                ln -sf ld-linux.so.2 ld-lsb.so.3
        fi
 
        if [ "${TARGET_ARCH}" = "powerpc64" ];then
-               cd ${D}
                if [ "${baselib}" != "lib64" ]; then
-                   ln -sf ${baselib} lib64
+                   lnr  ${D}${base_libdir} ${D}/lib64
                fi
-               cd ${D}/${baselib}
+               cd ${D}/${base_libdir}
                ln -sf ld64.so.1 ld-lsb-ppc64.so.2
                ln -sf ld64.so.1 ld-lsb-ppc64.so.3
        fi
        if [ "${TARGET_ARCH}" = "powerpc" ];then
-	       cd ${D}/${baselib}
+	       cd ${D}/${base_libdir}
                ln -sf ld.so.1 ld-lsb-ppc32.so.2
                ln -sf ld.so.1 ld-lsb-ppc32.so.3
        fi
 }
-FILES_${PN} += "/lib64 \
-                ${base_libdir} \
-                /usr/lib/lsb \
-                ${base_libdir}/lsb/* \
-                /lib/lsb/* \
-               "
+FILES_${PN} += "${base_bindir} ${base_libdir} \
+                ${nonarch_libdir}/lsb \
+                ${nonarch_base_libdir}/lsb/* \
+                ${@'/lib64' if d.getVar('TARGET_ARCH')  == ('x86_64' or 'powerpc64') and '${baselib}' != 'lib64' else ''}"
-- 
2.7.4



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

* [PATCH v2 23/25] lttng-modules: Replace '/lib' with ${nonarch_base_libdir}
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (22 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 22/25] lsb: Make use of appropriate bitbake variables Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 24/25] image: create symlinks needed for merged /usr Amarnath Valluri
                     ` (2 subsequent siblings)
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

Do not assume '/lib' for kernel modules location, instead use
${nonarch_base_libdir}. Because when 'usrmerge' distro feature is enabled,
kernel modules are not located in /lib/modules, instead /usr/lib/modules.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-kernel/lttng/lttng-modules_2.9.0.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.9.0.bb b/meta/recipes-kernel/lttng/lttng-modules_2.9.0.bb
index e59d6bc..3536f26 100644
--- a/meta/recipes-kernel/lttng/lttng-modules_2.9.0.bb
+++ b/meta/recipes-kernel/lttng/lttng-modules_2.9.0.bb
@@ -22,11 +22,11 @@ EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'"
 
 do_install_append() {
 	# Delete empty directories to avoid QA failures if no modules were built
-	find ${D}/lib -depth -type d -empty -exec rmdir {} \;
+	find ${D}/${nonarch_base_libdir} -depth -type d -empty -exec rmdir {} \;
 }
 
 python do_package_prepend() {
-    if not os.path.exists(os.path.join(d.getVar('D'), 'lib/modules')):
+    if not os.path.exists(os.path.join(d.getVar('D'), d.getVar('nonarch_base_libdir')[1:], 'modules')):
         bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN'))
 }
 
-- 
2.7.4



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

* [PATCH v2 24/25] image: create symlinks needed for merged /usr
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (23 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 23/25] lttng-modules: Replace '/lib' with ${nonarch_base_libdir} Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-02-22  8:27   ` [PATCH v2 25/25] insane.bbclass: Add package QA check " Amarnath Valluri
  2017-06-07 11:52   ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Richard Purdie
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

Prepare the symlinks required for merged /usr at the time of rootfs creation.

The links created in rootfs are:
/bin --> /usr/sbin
/sbin --> /usr/sbin
/lib --> /usr/lib
/lib64 --> /usr/lib64

We cannot make these symlinks as part of 'base-files' or some other package.
Because at rootfs creation, installation of the package(say kernel) that depends
on these root folders/links fails, if package manager installs this package
prior to base-files.

These symbolic links in top level folder should present as long as
 - kerenl tools use /lib/{module,firmware}
 - shell scripts uses "#!/bin/sh"

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/classes/image.bbclass | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 127e62d..4a9b40e 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -617,3 +617,26 @@ do_bundle_initramfs () {
 	:
 }
 addtask bundle_initramfs after do_image_complete
+
+# Prepare the root links to point to the /usr counterparts.
+create_merged_usr_symlinks() {
+    install -m 0755 -d ${IMAGE_ROOTFS}/${base_bindir}
+    install -m 0755 -d ${IMAGE_ROOTFS}/${base_sbindir}
+    install -m 0755 -d ${IMAGE_ROOTFS}/${base_libdir}
+    lnr ${IMAGE_ROOTFS}${base_bindir} ${IMAGE_ROOTFS}/bin
+    lnr ${IMAGE_ROOTFS}${base_sbindir} ${IMAGE_ROOTFS}/sbin
+    lnr ${IMAGE_ROOTFS}${base_libdir} ${IMAGE_ROOTFS}/${baselib}
+
+    if [ "${nonarch_base_libdir}" != "${base_libdir}" ]; then
+       install -m 0755 -d ${IMAGE_ROOTFS}/${nonarch_base_libdir}
+       lnr ${IMAGE_ROOTFS}${nonarch_base_libdir} ${IMAGE_ROOTFS}/lib
+    fi
+
+    # create base links for multilibs
+    multi_libdirs="${@d.getVar('MULTILIB_VARIANTS')}"
+    for d in $multi_libdirs; do
+        install -m 0755 -d ${IMAGE_ROOTFS}/${exec_prefix}/$d
+        lnr ${IMAGE_ROOTFS}/${exec_prefix}/$d ${IMAGE_ROOTFS}/$d
+    done
+}
+ROOTFS_PREPROCESS_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'create_merged_usr_symlinks; ', '',d)}"
-- 
2.7.4



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

* [PATCH v2 25/25] insane.bbclass: Add package QA check for merged /usr.
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (24 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 24/25] image: create symlinks needed for merged /usr Amarnath Valluri
@ 2017-02-22  8:27   ` Amarnath Valluri
  2017-06-07 11:52   ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Richard Purdie
  26 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-02-22  8:27 UTC (permalink / raw)
  To: openembedded-core

This check makes sure that, when usrmerge distro feature enabled, no package
installs files to root (/bin, /sbin, /lib, /lib64) folders.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/classes/insane.bbclass | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index e8e54f0..011eb99 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -40,6 +40,9 @@ ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             version-going-backwards expanded-d invalid-chars \
             license-checksum dev-elf \
             "
+# Add usrmerge QA check based on distro feature	    
+ERROR_QA_append = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' usrmerge', '', d)}"
+
 FAKEROOT_QA = "host-user-contaminated"
 FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \
 enabled tests are listed here, the do_package_qa task will run under fakeroot."
@@ -1035,6 +1038,18 @@ def package_qa_check_deps(pkg, pkgdest, skip, d):
     check_valid_deps('RREPLACES')
     check_valid_deps('RCONFLICTS')
 
+QAPKGTEST[usrmerge] = "package_qa_check_usrmerge"
+def package_qa_check_usrmerge(pkg, d, messages):
+    pkgdest = d.getVar('PKGDEST')
+    pkg_dir = pkgdest + os.sep + pkg + os.sep
+    merged_dirs = ['bin', 'sbin', 'lib'] + d.getVar('MULTILIB_VARIANTS').split()
+    for f in merged_dirs:
+        if os.path.exists(pkg_dir + f) and not os.path.islink(pkg_dir + f):
+            msg = "%s package is not obeying usrmerge distro feature. /%s should be relocated to /usr." % (pkg, f)
+            package_qa_add_message(messages, "usrmerge", msg)
+            return False
+    return True
+
 QAPKGTEST[expanded-d] = "package_qa_check_expanded_d"
 def package_qa_check_expanded_d(package, d, messages):
     """
@@ -1108,6 +1123,7 @@ def package_qa_check_host_user(path, name, d, elf, messages):
             return False
     return True
 
+
 # The PACKAGE FUNC to scan each package
 python do_package_qa () {
     import subprocess
-- 
2.7.4



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

* Re: [PATCH v2 19/25] mdadm: Avoid using hardocded udev, sbin paths
  2017-02-22  8:27   ` [PATCH v2 19/25] mdadm: Avoid using hardocded udev, sbin paths Amarnath Valluri
@ 2017-03-02 20:11     ` Burton, Ross
  2017-03-03 12:27       ` [OE-Core[[PATCH v3 19/25] mdadm: Avoid using hardocded sbin path Amarnath Valluri
  0 siblings, 1 reply; 88+ messages in thread
From: Burton, Ross @ 2017-03-02 20:11 UTC (permalink / raw)
  To: Amarnath Valluri; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 887 bytes --]

On 22 February 2017 at 08:27, Amarnath Valluri <amarnath.valluri@intel.com>
wrote:

> Use appropriate bitbake variables inplace of below hardcoded locations:
>   /sbin -> ${base_sbindir}
>   /lib/udev -> ${nonarch_base_libdir}/udev
>

Something went wrong:

packages/corei7-64-poky-linux/mdadm/mdadm-dbg: PKGSIZE changed from 5000047
to 416785 (-91%)
packages/corei7-64-poky-linux/mdadm/mdadm-ptest: RDEPENDS: removed "mdadm"
packages/corei7-64-poky-linux/mdadm/mdadm: PKGSIZE changed from 889228 to
3524 (-99%)
  * FILELIST: removed "/sbin/mdadm /sbin/mdmon"
packages/corei7-64-poky-linux/mdadm/mdadm: RDEPENDS: removed all items
"glibc (['>= 2.25'])"
packages/corei7-64-poky-linux/mdadm/mdadm: FILELIST: removed "/sbin/mdadm
/sbin/mdmon"

$ bb contents mdadm
mdadm:
/lib/udev/rules.d/63-md-raid-arrays.rules
/lib/udev/rules.d/64-md-raid-assembly.rules

Ross

[-- Attachment #2: Type: text/html, Size: 1941 bytes --]

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

* Re: [PATCH v2 22/25] lsb: Make use of appropriate bitbake variables.
  2017-02-22  8:27   ` [PATCH v2 22/25] lsb: Make use of appropriate bitbake variables Amarnath Valluri
@ 2017-03-02 20:13     ` Burton, Ross
  2017-03-03 12:36       ` [PATCH v3] " Amarnath Valluri
  0 siblings, 1 reply; 88+ messages in thread
From: Burton, Ross @ 2017-03-02 20:13 UTC (permalink / raw)
  To: Amarnath Valluri; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

On 22 February 2017 at 08:27, Amarnath Valluri <amarnath.valluri@intel.com>
wrote:

> Using of bitbake environment variables in-place of hardcoded strings makes
> this
> recipe portable to all environments.
>

packages/corei7-64-poky-linux/lsb/lsb: FILELIST: directory renamed /bin ->
/usr/bin, removed "/usr/lib/lsb/install_initd /usr/lib/lsb/remove_initd",
added "/lib/lsb/remove_initd /lib/lsb/install_initd"

The commit log makes it sound like there are no changes in the usual case,
but files are moved around quite a lot.  Can you either stop files being
moved in the default case, or explain the moves.

Ross

[-- Attachment #2: Type: text/html, Size: 1160 bytes --]

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

* [OE-Core[[PATCH v3 19/25] mdadm: Avoid using hardocded sbin path
  2017-03-02 20:11     ` Burton, Ross
@ 2017-03-03 12:27       ` Amarnath Valluri
  0 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-03-03 12:27 UTC (permalink / raw)
  To: openembedded-core

Use appropriate bitbake variable inplace of hardcoded sbin path in Makefile

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/mdadm/mdadm_4.0.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-extended/mdadm/mdadm_4.0.bb b/meta/recipes-extended/mdadm/mdadm_4.0.bb
index c228899..62614f0 100644
--- a/meta/recipes-extended/mdadm/mdadm_4.0.bb
+++ b/meta/recipes-extended/mdadm/mdadm_4.0.bb
@@ -33,6 +33,8 @@ CFLAGS_append_mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__'
 CFLAGS_append_mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__'
 
 do_compile() {
+	# Point to right sbindir
+	sed -i -e "s;BINDIR  = /sbin;BINDIR = $base_sbindir;" ${S}/Makefile
 	oe_runmake SYSROOT="${STAGING_DIR_TARGET}"
 }
 
@@ -51,7 +53,7 @@ do_install_ptest() {
 	cp -a ${S}/tests ${D}${PTEST_PATH}/tests
 	cp ${S}/test ${D}${PTEST_PATH}
 	sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test
-	ln -s /sbin/mdadm ${D}${PTEST_PATH}/mdadm
+	ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm
 	for prg in test_stripe swap_super raid6check
 	do
 		install -D -m 755 $prg ${D}${PTEST_PATH}/
-- 
2.7.4



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

* [PATCH v3] lsb: Make use of appropriate bitbake variables.
  2017-03-02 20:13     ` Burton, Ross
@ 2017-03-03 12:36       ` Amarnath Valluri
  0 siblings, 0 replies; 88+ messages in thread
From: Amarnath Valluri @ 2017-03-03 12:36 UTC (permalink / raw)
  To: openembedded-core

Using of bitbake environment variables in-place of hardcoded strings makes this
recipe portable to all environments.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 meta/recipes-extended/lsb/lsb_4.1.bb | 40 +++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/meta/recipes-extended/lsb/lsb_4.1.bb b/meta/recipes-extended/lsb/lsb_4.1.bb
index b4e8832..39cb544 100644
--- a/meta/recipes-extended/lsb/lsb_4.1.bb
+++ b/meta/recipes-extended/lsb/lsb_4.1.bb
@@ -34,14 +34,13 @@ S = "${WORKDIR}/lsb-release-1.4"
 CLEANBROKEN = "1"
 
 do_install(){
-	oe_runmake install prefix=${D}  mandir=${D}/${datadir}/man/ DESTDIR=${D}
+	oe_runmake install prefix=${D}/${base_prefix}  mandir=${D}/${datadir}/man/ DESTDIR=${D}
 
 	# this 2 dirs are needed by package lsb-dist-checker
 	mkdir -p ${D}${sysconfdir}/opt
 	mkdir -p ${D}${localstatedir}/opt
 
-	mkdir -p ${D}${base_bindir}
-	mkdir -p ${D}/${baselib}
+	mkdir -p ${D}${base_libdir}
 	mkdir -p ${D}${sysconfdir}/lsb-release.d
 	printf "LSB_VERSION=\"core-4.1-noarch:" > ${D}${sysconfdir}/lsb-release
 
@@ -87,47 +86,46 @@ do_install_append(){
            install -m 0755 ${WORKDIR}/${i} ${D}${sysconfdir}/core-lsb
        done
 
-       install -d ${D}/lib/lsb
-       install -m 0755 ${WORKDIR}/init-functions ${D}/lib/lsb
+       install -d ${D}/${nonarch_base_libdir}/lsb
+       install -m 0755 ${WORKDIR}/init-functions ${D}/${nonarch_base_libdir}/lsb
 
        # creat links for LSB test
-       install -d ${D}/usr/lib/lsb
-       ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/install_initd
-       ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/remove_initd
+       if [ "${nonarch_base_libdir}" != "${nonarch_libdir}" ] ; then
+               install -d ${D}/${nonarch_libdir}/lsb
+       fi
+       ln -sf ${sbindir}/chkconfig ${D}/${nonarch_libdir}/lsb/install_initd
+       ln -sf ${sbindir}/chkconfig ${D}/${nonarch_libdir}/lsb/remove_initd
 
        if [ "${TARGET_ARCH}" = "x86_64" ];then
-	       cd ${D}
                if [ "${baselib}" != "lib64" ]; then
-                   ln -sf ${baselib} lib64
+                   lnr ${D}${base_libdir} ${D}/lib64
                fi
-	       cd ${D}/${baselib}
+	       cd ${D}/${base_libdir}
                ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.2
                ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3
        fi
        if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
-	       cd ${D}/${baselib}
+	       cd ${D}/${base_libdir}
                ln -sf ld-linux.so.2 ld-lsb.so.2
                ln -sf ld-linux.so.2 ld-lsb.so.3
        fi
 
        if [ "${TARGET_ARCH}" = "powerpc64" ];then
-               cd ${D}
                if [ "${baselib}" != "lib64" ]; then
-                   ln -sf ${baselib} lib64
+                   lnr  ${D}${base_libdir} ${D}/lib64
                fi
-               cd ${D}/${baselib}
+               cd ${D}/${base_libdir}
                ln -sf ld64.so.1 ld-lsb-ppc64.so.2
                ln -sf ld64.so.1 ld-lsb-ppc64.so.3
        fi
        if [ "${TARGET_ARCH}" = "powerpc" ];then
-	       cd ${D}/${baselib}
+	       cd ${D}/${base_libdir}
                ln -sf ld.so.1 ld-lsb-ppc32.so.2
                ln -sf ld.so.1 ld-lsb-ppc32.so.3
        fi
 }
-FILES_${PN} += "/lib64 \
+FILES_${PN} += "${@'/lib64' if d.getVar('TARGET_ARCH')  == ('x86_64' or 'powerpc64') and '${baselib}' != 'lib64' else ''} \
                 ${base_libdir} \
-                /usr/lib/lsb \
-                ${base_libdir}/lsb/* \
-                /lib/lsb/* \
-               "
+                ${nonarch_libdir}/lsb \
+                ${nonarch_base_libdir}/lsb/* \
+                "
-- 
2.7.4



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

* Re: [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
  2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
                     ` (25 preceding siblings ...)
  2017-02-22  8:27   ` [PATCH v2 25/25] insane.bbclass: Add package QA check " Amarnath Valluri
@ 2017-06-07 11:52   ` Richard Purdie
  2017-06-07 14:31     ` Patrick Ohly
  26 siblings, 1 reply; 88+ messages in thread
From: Richard Purdie @ 2017-06-07 11:52 UTC (permalink / raw)
  To: Amarnath Valluri, openembedded-core; +Cc: Joshua Lock

On Wed, 2017-02-22 at 10:26 +0200, Amarnath Valluri wrote:
> From: Joshua Lock <joshua.g.lock@intel.com>
> 
> Modify bindir, libdir and sbindir to be exec_prefix/$d, rather than
> base_prefix/$d, when the usrmerge DISTRO_FEATURE is enabled.
> 
> Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
> ---
>  meta/conf/bitbake.conf | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)

I was asked to clarify the status of this series. We've taken many of
the changes but the core changes to bitbake.conf haven't been merged.

Ross/I discussed it and we both feel that the bitbake.conf make the
file pretty unreadable. We'd therefore like to see this implemented as
a .inc file which gets included when the relevant DISTRO_FEATURE is set
(or could just be included by the appropriate distro configs). This
.inc file would then simply override the paths. I believe this would be
a lot more readable than the current approach which is a key concern in
the core config.

The merge of the rest of this feature is therefore pending on the
development of such a patch, or a discussion convincing Ross/I why we
shouldn't take that approach for some reason.

Cheers,

Richard


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

* Re: [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
  2017-06-07 11:52   ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Richard Purdie
@ 2017-06-07 14:31     ` Patrick Ohly
  2017-06-07 17:04       ` Peter Kjellerstedt
  0 siblings, 1 reply; 88+ messages in thread
From: Patrick Ohly @ 2017-06-07 14:31 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Joshua Lock, openembedded-core

On Wed, 2017-06-07 at 12:52 +0100, Richard Purdie wrote:
> On Wed, 2017-02-22 at 10:26 +0200, Amarnath Valluri wrote:
> > From: Joshua Lock <joshua.g.lock@intel.com>
> > 
> > Modify bindir, libdir and sbindir to be exec_prefix/$d, rather than
> > base_prefix/$d, when the usrmerge DISTRO_FEATURE is enabled.
> > 
> > Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
> > ---
> >  meta/conf/bitbake.conf | 12 ++++++++----
> >  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> I was asked to clarify the status of this series. We've taken many of
> the changes but the core changes to bitbake.conf haven't been merged.
> 
> Ross/I discussed it and we both feel that the bitbake.conf make the
> file pretty unreadable. We'd therefore like to see this implemented as
> a .inc file which gets included when the relevant DISTRO_FEATURE is set
> (or could just be included by the appropriate distro configs). This
> .inc file would then simply override the paths. I believe this would be
> a lot more readable than the current approach which is a key concern in
> the core config.
> 
> The merge of the rest of this feature is therefore pending on the
> development of such a patch, or a discussion convincing Ross/I why we
> shouldn't take that approach for some reason.

Such a .inc file would have to be included after the "Include the rest
of the config files." section, because DISTRO_FEATURES only has its
final value (?) at that point. One also needs the patch that I
coincidentally just sent today to the bitbake list which allows
including such a file only when "usrmerge" is in DISTRO_FEATURES.

Would that be okay?

One downside is that code using the variables earlier will just see the
non-usrmerge version, with no indication in "bitbake -e" that the value
might have been different in the middle of parsing. The if check in the
proposed patch has the same effect on the actual values, but at least it
shows up in "bitbake -e". This is not a particularly strong argument
either way, I just wanted to mention it.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.





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

* Re: [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
  2017-06-07 14:31     ` Patrick Ohly
@ 2017-06-07 17:04       ` Peter Kjellerstedt
  2017-06-08  6:18         ` Patrick Ohly
  2017-06-08  6:37         ` Richard Purdie
  0 siblings, 2 replies; 88+ messages in thread
From: Peter Kjellerstedt @ 2017-06-07 17:04 UTC (permalink / raw)
  To: Patrick Ohly, Richard Purdie; +Cc: Joshua Lock, openembedded-core

> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Patrick Ohly
> Sent: den 7 juni 2017 16:32
> To: Richard Purdie <richard.purdie@linuxfoundation.org>
> Cc: Joshua Lock <joshua.g.lock@intel.com>; openembedded-
> core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH v2 01/25] bitbake.conf: support for
> merged usr with DISTRO_FEATURE usrmerge
> 
> On Wed, 2017-06-07 at 12:52 +0100, Richard Purdie wrote:
> > On Wed, 2017-02-22 at 10:26 +0200, Amarnath Valluri wrote:
> > > From: Joshua Lock <joshua.g.lock@intel.com>
> > >
> > > Modify bindir, libdir and sbindir to be exec_prefix/$d, rather than
> > > base_prefix/$d, when the usrmerge DISTRO_FEATURE is enabled.
> > >
> > > Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
> > > ---
> > >  meta/conf/bitbake.conf | 12 ++++++++----
> > >  1 file changed, 8 insertions(+), 4 deletions(-)
> >
> > I was asked to clarify the status of this series. We've taken many of
> > the changes but the core changes to bitbake.conf haven't been merged.
> >
> > Ross/I discussed it and we both feel that the bitbake.conf make the
> > file pretty unreadable. We'd therefore like to see this implemented
> > as a .inc file which gets included when the relevant DISTRO_FEATURE 
> > is set (or could just be included by the appropriate distro configs). 
> > This .inc file would then simply override the paths. I believe this 
> > would be a lot more readable than the current approach which is a 
> > key concern in the core config.

I actually suggested an alternative change to bitbake.conf in the GitHub 
review that changes bitbake.conf to take usrmerge into account:

https://github.com/avalluri/openembedded-core/commit/1655a93238902a883052a55d88ae14dd02243530

I will include my suggested solution here since I will refer to it 
below:

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 0f27e92e96..305eaff583 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -17,11 +17,13 @@ export base_prefix = ""
 export prefix = "/usr"
 export exec_prefix = "${prefix}"
 
+root_prefix = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}', '${base_prefix}', d)}"
+
 # Base paths
-export base_bindir = "${base_prefix}/bin"
-export base_sbindir = "${base_prefix}/sbin"
-export base_libdir = "${base_prefix}/${baselib}"
-export nonarch_base_libdir = "${base_prefix}/lib"
+export base_bindir = "${root_prefix}/bin"
+export base_sbindir = "${root_prefix}/sbin"
+export base_libdir = "${root_prefix}/${baselib}"
+export nonarch_base_libdir = "${root_prefix}/lib"
 
 # Architecture independent paths
 export sysconfdir = "${base_prefix}/etc"

I think that better maintains the readability of the bitbake.conf file, 
while making the $root_prefix variable available as it can be useful in 
its own (e.g., in the systemd recipe).

> > The merge of the rest of this feature is therefore pending on the
> > development of such a patch, or a discussion convincing Ross/I why we
> > shouldn't take that approach for some reason.
> 
> Such a .inc file would have to be included after the "Include the rest
> of the config files." section, because DISTRO_FEATURES only has its
> final value (?) at that point. One also needs the patch that I
> coincidentally just sent today to the bitbake list which allows
> including such a file only when "usrmerge" is in DISTRO_FEATURES.
> 
> Would that be okay?
> 
> One downside is that code using the variables earlier will just see the
> non-usrmerge version, with no indication in "bitbake -e" that the value
> might have been different in the middle of parsing. The if check in the
> proposed patch has the same effect on the actual values, but at least
> it shows up in "bitbake -e". This is not a particularly strong argument
> either way, I just wanted to mention it.

Based on your concerns about when the path variables affected by 
usrmerge would have what values, maybe my suggested change above 
should be changed to define root_prefix like this instead:

root_prefix ?= "${base_prefix}"

and then we create a usrmerge.inc file with the following contents:

DISTRO_FEATURES_append = " usrmerge"

root_prefix = "${exec_prefix}"

This file should then be required by a layer.conf file so that 
root_prefix is set before bitbake.conf is read. That should make sure 
that there never is any risk of the paths being defined differently 
based on whether usrmerge has been added to DISTRO_FEATURES yet or not.
And it should be clear in bitbake -e how such a variable got its value.

The only minor drawback I see is that the usrmerge.inc file needs to 
be required from a layer.conf file rather than just adding usrmerge 
to DISTRO_FEATURES in ${DISTRO}.conf, but at least I could live with 
that. One could of course add an appropriate comment before the 
definition of the root_prefix variable, to clarify its use and maybe 
even point at the usrmerge.inc file.

> --
> Best Regards, Patrick Ohly
> 
> The content of this message is my personal opinion only and although
> I am an employee of Intel, the statements I make here in no way
> represent Intel's position on the issue, nor am I authorized to speak
> on behalf of Intel on this matter.

//Peter



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

* Re: [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
  2017-06-07 17:04       ` Peter Kjellerstedt
@ 2017-06-08  6:18         ` Patrick Ohly
  2017-06-08  6:37         ` Richard Purdie
  1 sibling, 0 replies; 88+ messages in thread
From: Patrick Ohly @ 2017-06-08  6:18 UTC (permalink / raw)
  To: Peter Kjellerstedt; +Cc: Joshua Lock, openembedded-core

On Wed, 2017-06-07 at 17:04 +0000, Peter Kjellerstedt wrote:

> I actually suggested an alternative change to bitbake.conf in the GitHub 
> review that changes bitbake.conf to take usrmerge into account:
> 
> https://github.com/avalluri/openembedded-core/commit/1655a93238902a883052a55d88ae14dd02243530
> 
> I will include my suggested solution here since I will refer to it 
> below:
> 
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 0f27e92e96..305eaff583 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -17,11 +17,13 @@ export base_prefix = ""
>  export prefix = "/usr"
>  export exec_prefix = "${prefix}"
>  
> +root_prefix = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}', '${base_prefix}', d)}"
> +
>  # Base paths
> -export base_bindir = "${base_prefix}/bin"
> -export base_sbindir = "${base_prefix}/sbin"
> -export base_libdir = "${base_prefix}/${baselib}"
> -export nonarch_base_libdir = "${base_prefix}/lib"
> +export base_bindir = "${root_prefix}/bin"
> +export base_sbindir = "${root_prefix}/sbin"
> +export base_libdir = "${root_prefix}/${baselib}"
> +export nonarch_base_libdir = "${root_prefix}/lib"
>  
>  # Architecture independent paths
>  export sysconfdir = "${base_prefix}/etc"
> 
> I think that better maintains the readability of the bitbake.conf file, 
> while making the $root_prefix variable available as it can be useful in 
> its own (e.g., in the systemd recipe).

Looks good to me.

> > One downside is that code using the variables earlier will just see the
> > non-usrmerge version, with no indication in "bitbake -e" that the value
> > might have been different in the middle of parsing. The if check in the
> > proposed patch has the same effect on the actual values, but at least
> > it shows up in "bitbake -e". This is not a particularly strong argument
> > either way, I just wanted to mention it.
> 
> Based on your concerns about when the path variables affected by 
> usrmerge would have what values, maybe my suggested change above 
> should be changed to define root_prefix like this instead:
> 
> root_prefix ?= "${base_prefix}"
> 
> and then we create a usrmerge.inc file with the following contents:
> 
> DISTRO_FEATURES_append = " usrmerge"
> 
> root_prefix = "${exec_prefix}"
> 
> This file should then be required by a layer.conf file so that 
> root_prefix is set before bitbake.conf is read.

That's already a big no-no to me. It would get us back to where merely
adding a layer makes fundamental build configuration changes. Including
it in a distro config would not solve the problem and still be less
flexible than the current approach (user cannot enable or disable the
feature merely via changing DISTRO_FEATURES in local.conf).

So I think we have to and can live with the paths changing during base
configuration parsing.

Perhaps we can move the definitions below the include section? That
would emphasize that they are only final at that point and might flush
out any unwanted evaluation of them during the include phase.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.





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

* Re: [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
  2017-06-07 17:04       ` Peter Kjellerstedt
  2017-06-08  6:18         ` Patrick Ohly
@ 2017-06-08  6:37         ` Richard Purdie
  2017-06-09 12:52           ` Valluri, Amarnath
  1 sibling, 1 reply; 88+ messages in thread
From: Richard Purdie @ 2017-06-08  6:37 UTC (permalink / raw)
  To: Peter Kjellerstedt, Patrick Ohly; +Cc: Joshua Lock, openembedded-core

On Wed, 2017-06-07 at 17:04 +0000, Peter Kjellerstedt wrote:
> > 
> > -----Original Message-----
> > From: openembedded-core-bounces@lists.openembedded.org
> > [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf
> > Of
> > Patrick Ohly
> > Sent: den 7 juni 2017 16:32
> > To: Richard Purdie <richard.purdie@linuxfoundation.org>
> > Cc: Joshua Lock <joshua.g.lock@intel.com>; openembedded-
> > core@lists.openembedded.org
> > Subject: Re: [OE-core] [PATCH v2 01/25] bitbake.conf: support for
> > merged usr with DISTRO_FEATURE usrmerge
> > 
> > On Wed, 2017-06-07 at 12:52 +0100, Richard Purdie wrote:
> > > 
> > > On Wed, 2017-02-22 at 10:26 +0200, Amarnath Valluri wrote:
> > > > 
> > > > From: Joshua Lock <joshua.g.lock@intel.com>
> > > > 
> > > > Modify bindir, libdir and sbindir to be exec_prefix/$d, rather
> > > > than
> > > > base_prefix/$d, when the usrmerge DISTRO_FEATURE is enabled.
> > > > 
> > > > Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
> > > > ---
> > > >  meta/conf/bitbake.conf | 12 ++++++++----
> > > >  1 file changed, 8 insertions(+), 4 deletions(-)
> > > I was asked to clarify the status of this series. We've taken
> > > many of
> > > the changes but the core changes to bitbake.conf haven't been
> > > merged.
> > > 
> > > Ross/I discussed it and we both feel that the bitbake.conf make
> > > the
> > > file pretty unreadable. We'd therefore like to see this
> > > implemented
> > > as a .inc file which gets included when the relevant
> > > DISTRO_FEATURE 
> > > is set (or could just be included by the appropriate distro
> > > configs). 
> > > This .inc file would then simply override the paths. I believe
> > > this 
> > > would be a lot more readable than the current approach which is
> > > a 
> > > key concern in the core config.
> I actually suggested an alternative change to bitbake.conf in the
> GitHub 
> review that changes bitbake.conf to take usrmerge into account:
> 
> https://github.com/avalluri/openembedded-core/commit/1655a93238902a88
> 3052a55d88ae14dd02243530
> 
> I will include my suggested solution here since I will refer to it 
> below:
> 
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 0f27e92e96..305eaff583 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -17,11 +17,13 @@ export base_prefix = ""
>  export prefix = "/usr"
>  export exec_prefix = "${prefix}"
>  
> +root_prefix = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge',
> '${exec_prefix}', '${base_prefix}', d)}"
> +
>  # Base paths
> -export base_bindir = "${base_prefix}/bin"
> -export base_sbindir = "${base_prefix}/sbin"
> -export base_libdir = "${base_prefix}/${baselib}"
> -export nonarch_base_libdir = "${base_prefix}/lib"
> +export base_bindir = "${root_prefix}/bin"
> +export base_sbindir = "${root_prefix}/sbin"
> +export base_libdir = "${root_prefix}/${baselib}"
> +export nonarch_base_libdir = "${root_prefix}/lib"
>  
>  # Architecture independent paths
>  export sysconfdir = "${base_prefix}/etc"
> 
> I think that better maintains the readability of the bitbake.conf
> file, 
> while making the $root_prefix variable available as it can be useful
> in 
> its own (e.g., in the systemd recipe).

Agreed, I'm happier with this and can probably accept a single
DISTO_FEATURES line without the .inc stuff...

Cheers,

Richard


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

* Re: [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
  2017-06-08  6:37         ` Richard Purdie
@ 2017-06-09 12:52           ` Valluri, Amarnath
  0 siblings, 0 replies; 88+ messages in thread
From: Valluri, Amarnath @ 2017-06-09 12:52 UTC (permalink / raw)
  To: peter.kjellerstedt, richard.purdie, Ohly, Patrick
  Cc: Lock, Joshua G, openembedded-core

On Thu, 2017-06-08 at 07:37 +0100, Richard Purdie wrote:
> On Wed, 2017-06-07 at 17:04 +0000, Peter Kjellerstedt wrote:
> > 
> > > 
> > > 
> > > -----Original Message-----
> > > From: openembedded-core-bounces@lists.openembedded.org
> > > [mailto:openembedded-core-bounces@lists.openembedded.org] On
> > > Behalf
> > > Of
> > > Patrick Ohly
> > > Sent: den 7 juni 2017 16:32
> > > To: Richard Purdie <richard.purdie@linuxfoundation.org>
> > > Cc: Joshua Lock <joshua.g.lock@intel.com>; openembedded-
> > > core@lists.openembedded.org
> > > Subject: Re: [OE-core] [PATCH v2 01/25] bitbake.conf: support for
> > > merged usr with DISTRO_FEATURE usrmerge
> > > 
> > > On Wed, 2017-06-07 at 12:52 +0100, Richard Purdie wrote:
> > > > 
> > > > 
> > > > On Wed, 2017-02-22 at 10:26 +0200, Amarnath Valluri wrote:
> > > > > 
> > > > > 
> > > > > From: Joshua Lock <joshua.g.lock@intel.com>
> > > > > 
> > > > > Modify bindir, libdir and sbindir to be exec_prefix/$d,
> > > > > rather
> > > > > than
> > > > > base_prefix/$d, when the usrmerge DISTRO_FEATURE is enabled.
> > > > > 
> > > > > Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
> > > > > ---
> > > > >  meta/conf/bitbake.conf | 12 ++++++++----
> > > > >  1 file changed, 8 insertions(+), 4 deletions(-)
> > > > I was asked to clarify the status of this series. We've taken
> > > > many of
> > > > the changes but the core changes to bitbake.conf haven't been
> > > > merged.
> > > > 
> > > > Ross/I discussed it and we both feel that the bitbake.conf make
> > > > the
> > > > file pretty unreadable. We'd therefore like to see this
> > > > implemented
> > > > as a .inc file which gets included when the relevant
> > > > DISTRO_FEATURE 
> > > > is set (or could just be included by the appropriate distro
> > > > configs). 
> > > > This .inc file would then simply override the paths. I believe
> > > > this 
> > > > would be a lot more readable than the current approach which is
> > > > a 
> > > > key concern in the core config.
> > I actually suggested an alternative change to bitbake.conf in the
> > GitHub 
> > review that changes bitbake.conf to take usrmerge into account:
> > 
> > https://github.com/avalluri/openembedded-core/commit/1655a93238902a
> > 88
> > 3052a55d88ae14dd02243530
> > 
> > I will include my suggested solution here since I will refer to it 
> > below:
> > 
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index 0f27e92e96..305eaff583 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -17,11 +17,13 @@ export base_prefix = ""
> >  export prefix = "/usr"
> >  export exec_prefix = "${prefix}"
> >  
> > +root_prefix = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge',
> > '${exec_prefix}', '${base_prefix}', d)}"
> > +
> >  # Base paths
> > -export base_bindir = "${base_prefix}/bin"
> > -export base_sbindir = "${base_prefix}/sbin"
> > -export base_libdir = "${base_prefix}/${baselib}"
> > -export nonarch_base_libdir = "${base_prefix}/lib"
> > +export base_bindir = "${root_prefix}/bin"
> > +export base_sbindir = "${root_prefix}/sbin"
> > +export base_libdir = "${root_prefix}/${baselib}"
> > +export nonarch_base_libdir = "${root_prefix}/lib"
> >  
> >  # Architecture independent paths
> >  export sysconfdir = "${base_prefix}/etc"
> > 
> > I think that better maintains the readability of the bitbake.conf
> > file, 
> > while making the $root_prefix variable available as it can be
> > useful
> > in 
> > its own (e.g., in the systemd recipe).
> Agreed, I'm happier with this and can probably accept a single
> DISTO_FEATURES line without the .inc stuff...
Richard, We need the DISTO_FEATURE check even for setting
nativesdk_base_ paths, As nativesdks cannot use this ${root_prefix}.

+root_prefix_nativesdk = "${@bb.utils.contains('DISTRO_FEATURES',
'usrmerge', '${prefix_nativesdk}', '', d)}"
-base_bindir_nativesdk = "/bin"
-base_sbindir_nativesdk = "/sbin"
+base_bindir_nativesdk = "${root_prefix_nativesdk}/bin"
+base_sbindir_nativesdk = "${root_prefix_nativesdk}/sbin"
-base_libdir_nativesdk = "/lib"
+base_libdir_nativesdk = "${root_prefix_nativesdk}/lib"

If ok with this, I can send the revised patch.

- Amarnath

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

end of thread, other threads:[~2017-06-09 12:52 UTC | newest]

Thread overview: 88+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-10 13:42 [PATCH 00/23] Fix for #7040 - Support for /usr merge Amarnath Valluri
2017-02-10 13:42 ` [PATCH 01/23] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
2017-02-10 16:29   ` Christopher Larson
2017-02-10 13:42 ` [PATCH 02/23] bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE Amarnath Valluri
2017-02-10 13:42 ` [PATCH 03/23] cross.bbclass: merged /usr support Amarnath Valluri
2017-02-10 13:42 ` [PATCH 04/23] base-files: support merged /usr Amarnath Valluri
2017-02-10 13:42 ` [PATCH 05/23] systemd: chagnes to " Amarnath Valluri
2017-02-10 13:42 ` [PATCH 06/23] bash: changes " Amarnath Valluri
2017-02-10 13:42 ` [PATCH 07/23] busybox: " Amarnath Valluri
2017-02-10 13:42 ` [PATCH 08/23] sed: " Amarnath Valluri
2017-02-10 13:42 ` [PATCH 09/23] package_deb.bbclass: Ignore file paths in RPROVIDES Amarnath Valluri
2017-02-13 12:57   ` Alexander Kanavin
2017-02-10 13:42 ` [PATCH 10/23] musl: Fix issues in relative symlink creation Amarnath Valluri
2017-02-10 13:42 ` [PATCH 11/23] glibc: Ensure ldconfig is packaged into glibc Amarnath Valluri
2017-02-10 13:42 ` [PATCH 12/23] util-linux: Fix packaging with "usrmerge" Amarnath Valluri
2017-02-10 13:42 ` [PATCH 13/23] attr/acl: Do not create broken static library link when not needed Amarnath Valluri
2017-02-10 13:42 ` [PATCH 14/23] systemd: Do not add libnss_* to systemd package Amarnath Valluri
2017-02-10 13:42 ` [PATCH 15/23] util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package Amarnath Valluri
2017-02-10 13:42 ` [PATCH 16/23] util-linux, shadow: Make 'nologin' alternative command Amarnath Valluri
2017-02-10 13:42 ` [PATCH 17/23] libarchive: Backport upstream fixes Amarnath Valluri
2017-02-10 13:42 ` [PATCH 18/23] kernel: use ${nonarch_base_libdir} for kernel modules installation Amarnath Valluri
2017-02-10 13:42 ` [PATCH 19/23] firmware: use ${nonarch_base_libdir} for firmware installation Amarnath Valluri
2017-02-10 13:42 ` [PATCH 20/23] mdadm: Avoid using hardocded udev, sbin paths Amarnath Valluri
2017-02-10 13:42 ` [PATCH 21/23] mktemp: Move installed files only when needed Amarnath Valluri
2017-02-10 13:42 ` [PATCH 22/23] net-tools: Place package content as per bitbake environment Amarnath Valluri
2017-02-10 13:42 ` [PATCH 23/23] lsb: Make use of appropriate bitbake variables Amarnath Valluri
2017-02-10 13:59 ` ✗ patchtest: failure for Fix for #7040 - Support for /usr merge Patchwork
2017-02-22  8:26 ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
2017-02-22  8:26   ` [PATCH v2 00/25] Fix for #7040 - Support for /usr merge Amarnath Valluri
2017-02-22  8:26   ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Amarnath Valluri
2017-02-22  8:26   ` [PATCH v2 02/25] bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 03/25] cross.bbclass: merged /usr support Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 04/25] base-files: Replace hardcoded root paths with appropriate bitbake variables Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 05/25] systemd: chagnes to support merged /usr Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 06/25] bash: changes " Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 07/25] busybox: " Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 08/25] sed: " Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 09/25] musl: Fix issues in relative symlink creation Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 10/25] glibc: Ensure ldconfig is packaged into glibc Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 11/25] util-linux: Fix packaging with "usrmerge" Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 12/25] attr/acl: Do not create broken static library link when not needed Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 13/25] systemd: Do not add libnss_* to systemd package Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 14/25] util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 15/25] util-linux, shadow: Make 'nologin' alternative command Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 16/25] libarchive: Backport upstream fixes Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 17/25] kernel: use ${nonarch_base_libdir} for kernel modules installation Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 18/25] firmware: use ${nonarch_base_libdir} for firmware installation Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 19/25] mdadm: Avoid using hardocded udev, sbin paths Amarnath Valluri
2017-03-02 20:11     ` Burton, Ross
2017-03-03 12:27       ` [OE-Core[[PATCH v3 19/25] mdadm: Avoid using hardocded sbin path Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 20/25] mktemp: Move installed files only when needed Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 21/25] net-tools: Place package content as per bitbake environment Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 22/25] lsb: Make use of appropriate bitbake variables Amarnath Valluri
2017-03-02 20:13     ` Burton, Ross
2017-03-03 12:36       ` [PATCH v3] " Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 23/25] lttng-modules: Replace '/lib' with ${nonarch_base_libdir} Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 24/25] image: create symlinks needed for merged /usr Amarnath Valluri
2017-02-22  8:27   ` [PATCH v2 25/25] insane.bbclass: Add package QA check " Amarnath Valluri
2017-06-07 11:52   ` [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge Richard Purdie
2017-06-07 14:31     ` Patrick Ohly
2017-06-07 17:04       ` Peter Kjellerstedt
2017-06-08  6:18         ` Patrick Ohly
2017-06-08  6:37         ` Richard Purdie
2017-06-09 12:52           ` Valluri, Amarnath
2017-02-22  8:26 ` [PATCH v2 02/25] bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 03/25] cross.bbclass: merged /usr support Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 04/25] base-files: Replace hardcoded root paths with appropriate bitbake variables Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 05/25] systemd: chagnes to support merged /usr Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 06/25] bash: changes " Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 07/25] busybox: " Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 08/25] sed: " Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 09/25] musl: Fix issues in relative symlink creation Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 10/25] glibc: Ensure ldconfig is packaged into glibc Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 11/25] util-linux: Fix packaging with "usrmerge" Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 12/25] attr/acl: Do not create broken static library link when not needed Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 13/25] systemd: Do not add libnss_* to systemd package Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 14/25] util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 15/25] util-linux, shadow: Make 'nologin' alternative command Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 16/25] libarchive: Backport upstream fixes Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 17/25] kernel: use ${nonarch_base_libdir} for kernel modules installation Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 18/25] firmware: use ${nonarch_base_libdir} for firmware installation Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 19/25] mdadm: Avoid using hardocded udev, sbin paths Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 20/25] mktemp: Move installed files only when needed Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 21/25] net-tools: Place package content as per bitbake environment Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 22/25] lsb: Make use of appropriate bitbake variables Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 23/25] lttng-modules: Replace '/lib' with ${nonarch_base_libdir} Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 24/25] image: create symlinks needed for merged /usr Amarnath Valluri
2017-02-22  8:26 ` [PATCH v2 25/25] insane.bbclass: Add package QA check " Amarnath Valluri

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.