Fix for #7040 - Support for /usr merge
cover Fix for #7040 - Support for /usr merge
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
Signature · 1 line
2.7.4
PATCH 1/23 bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
From: Joshua Lock <[email protected]>
Modify bindir, libdir and sbindir to be exec_prefix/$d, rather than base_prefix/$d, when the usrmerge DISTRO_FEATURE is enabled.
--- meta/conf/bitbake.conf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
meta/conf/bitbake.conf +8 -4
@@ -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"
Signature · 1 line
2.7.4
Re: [PATCH 01/23] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
Quoted 7 lines · Amarnath Valluri
From: Joshua Lock <[email protected]>
Modify bindir, libdir and sbindir to be exec_prefix/$d, rather than base_prefix/$d, when the usrmerge
DISTRO_FEATUREis enabled.Signed-off-by Joshua Lock <[email protected]>
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.
Signature · 4 lines
Christopher Larson kergoth at gmail dot com Founder - BitBake, OpenEmbedded, OpenZaurus Senior Software Engineer, Mentor Graphics
PATCH 2/23 bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE
In reply to Amarnath ValluriModify base bin, sbin, and lib nativesdk variables to be ${prefix_nativesdk}/$d, when the usrmerge DISTRO_FEATURE is enabled.
--- meta/conf/bitbake.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
meta/conf/bitbake.conf +4 -4
@@ -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" #
Signature · 1 line
2.7.4
PATCH 3/23 cross.bbclass: merged /usr support
In reply to Amarnath ValluriWhen 'usrmerge' distro feature enabled match target_base_libdir to ${target_libdir}.
--- meta/classes/cross.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/cross.bbclass +1 -1
@@ -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
Signature · 1 line
2.7.4
PATCH 4/23 base-files: support merged /usr
In reply to Amarnath ValluriFrom: Joshua Lock <[email protected]>
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
--- meta/recipes-core/base-files/base-files_3.0.14.bb | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-)
meta/recipes-core/base-files/base-files_3.0.14.bb +19 -4
@@ -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
Signature · 1 line
2.7.4
PATCH 5/23 systemd: chagnes to support merged /usr
In reply to Amarnath ValluriWhen the usrmerge DISTRO_FEATURE is selected disable the split-usr support and modify rootprefix to be exec_prefix, rather than base_prefix.
--- meta/recipes-core/systemd/systemd_232.bb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
meta/recipes-core/systemd/systemd_232.bb +3 -3
@@ -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
Signature · 1 line
2.7.4
PATCH 6/23 bash: changes to support merged /usr
In reply to Amarnath ValluriMost 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.
--- meta/recipes-extended/bash/bash.inc | 2 ++ 1 file changed, 2 insertions(+)
meta/recipes-extended/bash/bash.inc +2 -0
@@ -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)}"
Signature · 1 line
2.7.4
PATCH 7/23 busybox: changes to support merged /usr
In reply to Amarnath ValluriMost 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.
--- meta/recipes-core/busybox/busybox.inc | 2 ++ 1 file changed, 2 insertions(+)
meta/recipes-core/busybox/busybox.inc +2 -0
@@ -431,3 +431,5 @@ pkg_prerm_${PN}-syslog () { fi fi } + +RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh', '', d)}"
Signature · 1 line
2.7.4
PATCH 8/23 sed: changes to support merged /usr
In reply to Amarnath ValluriFew 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.
--- meta/recipes-extended/sed/sed_4.2.2.bb | 1 + 1 file changed, 1 insertion(+)
meta/recipes-extended/sed/sed_4.2.2.bb +1 -0
@@ -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)}"
Signature · 1 line
2.7.4
PATCH 9/23 package_deb.bbclass: Ignore file paths in RPROVIDES
In reply to Amarnath ValluriUnlike 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.
--- meta/classes/package_deb.bbclass | 4 ++++ 1 file changed, 4 insertions(+)
meta/classes/package_deb.bbclass +4 -0
@@ -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 "")
Signature · 1 line
2.7.4
Re: [PATCH 09/23] package_deb.bbclass: Ignore file paths in RPROVIDES
Quoted 3 lines · Amarnath Valluri
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
PATCH 10/23 musl: Fix issues in relative symlink creation
In reply to Amarnath ValluriMake use of lnr/ln -r while creating relative symlinks than guessing the relalive path.
--- ...dynamic-linker-a-relative-symlink-to-libc.patch | 58 ++++++++++++++++++---- meta/recipes-core/musl/musl_git.bb | 2 +- 2 files changed, 49 insertions(+), 11 deletions(-)
meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch +48 -10
@@ -1,6 +1,6 @@ -From 94c0b97b62125d8bbc92dce0694e387d5b2ad181 Mon Sep 17 00:00:00 2001 -From: Khem Raj <[email protected]> -Date: Sun, 10 Jan 2016 12:14:02 -0800 +From 0ec74744a4cba7c5fdfaa2685995119a4fca0260 Mon Sep 17 00:00:00 2001 +From: Amarnath Valluri <[email protected]> +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 <[email protected]> +Signed-off-by: Amarnath Valluri <[email protected]> --- 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
meta/recipes-core/musl/musl_git.bb +1 -1
@@ -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
Signature · 1 line
2.7.4
PATCH 11/23 glibc: Ensure ldconfig is packaged into glibc
In reply to Amarnath ValluriFrom: Jussi Kukkonen <[email protected]>
If "usrmerge" feature is used, /usr/sbin/ldconfig gets packaged into glibc-utils instead of glibc: Switch PACKAGES order to prevent this.
--- meta/recipes-core/glibc/glibc-package.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/glibc/glibc-package.inc +1 -1
@@ -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)"
Signature · 1 line
2.7.4
PATCH 12/23 util-linux: Fix packaging with "usrmerge"
In reply to Amarnath ValluriFrom: Jussi Kukkonen <[email protected]>
Make sure fsck.cramfs is packaged before fsck so the latter does not steal the fsck.cramfs binary when building with usrmerge DISTRO_FEATURE.
--- meta/recipes-core/util-linux/util-linux.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
meta/recipes-core/util-linux/util-linux.inc +3 -3
@@ -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)}"
Signature · 1 line
2.7.4
PATCH 13/23 attr/acl: Do not create broken static library link when not needed
In reply to Amarnath ValluriStop creating the static library archieve(liba(ttr|cl).a) when --disable-static configure option used.
--- 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
meta/recipes-support/attr/ea-acl.inc +2 -0
@@ -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
meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch new file +70 -0
70 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 14/23 systemd: Do not add libnss_* to systemd package
In reply to Amarnath Vallurilibnss_* 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}.
--- meta/recipes-core/systemd/systemd_232.bb | 1 - 1 file changed, 1 deletion(-)
meta/recipes-core/systemd/systemd_232.bb +0 -1
@@ -451,7 +451,6 @@ FILES_${PN} = " ${base_bindir}/* \ ${rootlibexecdir}/systemd/* \ ${systemd_unitdir}/* \ ${base_libdir}/security/*.so \ - ${libdir}/libnss_* \ /cgroup \ ${bindir}/systemd* \ ${bindir}/busctl \
Signature · 1 line
2.7.4
PATCH 15/23 util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package.
In reply to Amarnath Valluriupdate-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.
--- meta/recipes-core/util-linux/util-linux.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/util-linux/util-linux.inc +2 -2
@@ -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"
Signature · 1 line
2.7.4
PATCH 16/23 util-linux, shadow: Make 'nologin' alternative command
In reply to Amarnath ValluriBoth 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.
--- meta/recipes-core/util-linux/util-linux.inc | 5 +++-- meta/recipes-extended/shadow/shadow.inc | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)
meta/recipes-core/util-linux/util-linux.inc +3 -2
@@ -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"
meta/recipes-extended/shadow/shadow.inc +2 -1
@@ -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"
Signature · 1 line
2.7.4
PATCH 17/23 libarchive: Backport upstream fixes.
In reply to Amarnath ValluriThese set of patches backported from upstream, which fixes the issues in extracting hardlinks over softlinks while etracting packages by opkg.
--- ...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
meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch new file +242 -0
@@ -0,0 +1,242 @@ +From 90881d24d3f6d5fb207e97df3b91bbea8598e84e Mon Sep 17 00:00:00 2001 +From: Martin Matuska <[email protected]> +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 +
meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch new file +116 -0
116 lines not on this page · raw message
meta/recipes-extended/libarchive/libarchive_3.2.2.bb +2 -0
@@ -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"
Signature · 1 line
2.7.4
PATCH 18/23 kernel: use ${nonarch_base_libdir} for kernel modules installation.
In reply to Amarnath ValluriReplace hardcoded '/lib' in kernel modules installation path with ${nonarch_base_libdir}, which is ment exactly for this.
--- meta/classes/kernel-module-split.bbclass | 2 +- meta/classes/kernel.bbclass | 14 +++++++------- meta/classes/module.bbclass | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-)
meta/classes/kernel-module-split.bbclass +1 -1
@@ -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))
meta/classes/kernel.bbclass +7 -7
@@ -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
meta/classes/module.bbclass +1 -1
@@ -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}
Signature · 1 line
2.7.4
PATCH 19/23 firmware: use ${nonarch_base_libdir} for firmware installation.
In reply to Amarnath ValluriReplace hardcoded '/lib' in kernel firmware installation path with ${nonarch_base_libdir}.
--- .../linux-firmware/linux-firmware_git.bb | 168 ++++++++++----------- 1 file changed, 84 insertions(+), 84 deletions(-)
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +84 -84
@@ -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"
Signature · 1 line
2.7.4
PATCH 20/23 mdadm: Avoid using hardocded udev, sbin paths
In reply to Amarnath ValluriUse appropriate bitbake variables inplace of below hardcoded locations:
/sbin -> ${base_sbindir}
/lib/udev -> ${nonarch_base_libdir}/udev
--- meta/recipes-extended/mdadm/mdadm_4.0.bb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
meta/recipes-extended/mdadm/mdadm_4.0.bb +4 -2
@@ -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}/
Signature · 1 line
2.7.4
PATCH 21/23 mktemp: Move installed files only when needed
In reply to Amarnath ValluriMove binary(ies) only when ${base_bindir} != ${bindir}.
When usrmerge distro feature is enabled they both might point to same location.
--- meta/recipes-extended/mktemp/mktemp_1.7.bb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
meta/recipes-extended/mktemp/mktemp_1.7.bb +5 -3
@@ -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"
Signature · 1 line
2.7.4
PATCH 22/23 net-tools: Place package content as per bitbake environment.
In reply to Amarnath Vallurinet-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}.
--- meta/recipes-extended/net-tools/net-tools_1.60-26.bb | 11 +++++++++++ 1 file changed, 11 insertions(+)
meta/recipes-extended/net-tools/net-tools_1.60-26.bb +11 -0
@@ -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
Signature · 1 line
2.7.4
PATCH 23/23 lsb: Make use of appropriate bitbake variables.
In reply to Amarnath ValluriUsing of bitbake environment variables in-place of hardcoded strings makes this recipe portable to all environments.
--- meta/recipes-extended/lsb/lsb_4.1.bb | 40 +++++++++++++++++------------------- 1 file changed, 19 insertions(+), 21 deletions(-)
meta/recipes-extended/lsb/lsb_4.1.bb +19 -21
@@ -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 ''}"
Signature · 1 line
2.7.4
✗ patchtest: failure for Fix for #7040 - Support for /usr merge
In reply to Amarnath Valluri== 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 ([email protected]) 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
PATCH v2 1/25 bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
In reply to Amarnath ValluriFrom: Joshua Lock <[email protected]>
Modify bindir, libdir and sbindir to be exec_prefix/$d, rather than base_prefix/$d, when the usrmerge DISTRO_FEATURE is enabled.
--- meta/conf/bitbake.conf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
meta/conf/bitbake.conf +8 -4
@@ -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"
Signature · 1 line
2.7.4
PATCH v2 1/25 bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
From: Joshua Lock <[email protected]>
Modify bindir, libdir and sbindir to be exec_prefix/$d, rather than base_prefix/$d, when the usrmerge DISTRO_FEATURE is enabled.
--- meta/conf/bitbake.conf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
meta/conf/bitbake.conf +8 -4
@@ -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"
Signature · 1 line
2.7.4
PATCH v2 2/25 bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE
In reply to Amarnath ValluriModify base bin, sbin, and lib nativesdk variables to be ${prefix_nativesdk}/$d, when the usrmerge DISTRO_FEATURE is enabled.
--- meta/conf/bitbake.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
meta/conf/bitbake.conf +4 -4
@@ -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" #
Signature · 1 line
2.7.4
PATCH v2 2/25 bitbake.conf: Modify nativesdk variables to support 'usrmerge' DISTRO_FEATURE
In reply to Amarnath ValluriModify base bin, sbin, and lib nativesdk variables to be ${prefix_nativesdk}/$d, when the usrmerge DISTRO_FEATURE is enabled.
--- meta/conf/bitbake.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
meta/conf/bitbake.conf +4 -4
@@ -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" #
Signature · 1 line
2.7.4
PATCH v2 3/25 cross.bbclass: merged /usr support
In reply to Amarnath ValluriWhen 'usrmerge' distro feature enabled match target_base_libdir to ${target_libdir}.
--- meta/classes/cross.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/cross.bbclass +1 -1
@@ -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
Signature · 1 line
2.7.4
PATCH v2 3/25 cross.bbclass: merged /usr support
In reply to Amarnath ValluriWhen 'usrmerge' distro feature enabled match target_base_libdir to ${target_libdir}.
--- meta/classes/cross.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/cross.bbclass +1 -1
@@ -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
Signature · 1 line
2.7.4
PATCH v2 4/25 base-files: Replace hardcoded root paths with appropriate bitbake variables
In reply to Amarnath Valluri/bin, /sbin, /lib are replaced with ${base_bindir}, ${base_sbindir} and ${base_libdir}.
--- meta/recipes-core/base-files/base-files_3.0.14.bb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-core/base-files/base-files_3.0.14.bb +3 -2
@@ -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} \
Signature · 1 line
2.7.4
PATCH v2 4/25 base-files: Replace hardcoded root paths with appropriate bitbake variables
In reply to Amarnath Valluri/bin, /sbin, /lib are replaced with ${base_bindir}, ${base_sbindir} and ${base_libdir}.
--- meta/recipes-core/base-files/base-files_3.0.14.bb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-core/base-files/base-files_3.0.14.bb +3 -2
@@ -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} \
Signature · 1 line
2.7.4
PATCH v2 5/25 systemd: chagnes to support merged /usr
In reply to Amarnath ValluriWhen the usrmerge DISTRO_FEATURE is selected disable the split-usr support and modify rootprefix to be exec_prefix, rather than base_prefix.
--- meta/recipes-core/systemd/systemd_232.bb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
meta/recipes-core/systemd/systemd_232.bb +3 -3
@@ -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
Signature · 1 line
2.7.4
PATCH v2 5/25 systemd: chagnes to support merged /usr
In reply to Amarnath ValluriWhen the usrmerge DISTRO_FEATURE is selected disable the split-usr support and modify rootprefix to be exec_prefix, rather than base_prefix.
--- meta/recipes-core/systemd/systemd_232.bb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
meta/recipes-core/systemd/systemd_232.bb +3 -3
@@ -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
Signature · 1 line
2.7.4
PATCH v2 6/25 bash: changes to support merged /usr
In reply to Amarnath ValluriMost 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.
--- meta/recipes-extended/bash/bash.inc | 2 ++ 1 file changed, 2 insertions(+)
meta/recipes-extended/bash/bash.inc +2 -0
@@ -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)}"
Signature · 1 line
2.7.4
PATCH v2 6/25 bash: changes to support merged /usr
In reply to Amarnath ValluriMost 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.
--- meta/recipes-extended/bash/bash.inc | 2 ++ 1 file changed, 2 insertions(+)
meta/recipes-extended/bash/bash.inc +2 -0
@@ -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)}"
Signature · 1 line
2.7.4
PATCH v2 7/25 busybox: changes to support merged /usr
In reply to Amarnath ValluriMost 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.
--- meta/recipes-core/busybox/busybox.inc | 2 ++ 1 file changed, 2 insertions(+)
meta/recipes-core/busybox/busybox.inc +2 -0
@@ -431,3 +431,5 @@ pkg_prerm_${PN}-syslog () { fi fi } + +RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh', '', d)}"
Signature · 1 line
2.7.4
PATCH v2 7/25 busybox: changes to support merged /usr
In reply to Amarnath ValluriMost 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.
--- meta/recipes-core/busybox/busybox.inc | 2 ++ 1 file changed, 2 insertions(+)
meta/recipes-core/busybox/busybox.inc +2 -0
@@ -431,3 +431,5 @@ pkg_prerm_${PN}-syslog () { fi fi } + +RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh', '', d)}"
Signature · 1 line
2.7.4
PATCH v2 8/25 sed: changes to support merged /usr
In reply to Amarnath ValluriFew 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.
--- meta/recipes-extended/sed/sed_4.2.2.bb | 1 + 1 file changed, 1 insertion(+)
meta/recipes-extended/sed/sed_4.2.2.bb +1 -0
@@ -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)}"
Signature · 1 line
2.7.4
PATCH v2 8/25 sed: changes to support merged /usr
In reply to Amarnath ValluriFew 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.
--- meta/recipes-extended/sed/sed_4.2.2.bb | 1 + 1 file changed, 1 insertion(+)
meta/recipes-extended/sed/sed_4.2.2.bb +1 -0
@@ -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)}"
Signature · 1 line
2.7.4
PATCH v2 9/25 musl: Fix issues in relative symlink creation
In reply to Amarnath ValluriMake use of lnr/ln -r while creating relative symlinks than guessing the relalive path.
--- ...dynamic-linker-a-relative-symlink-to-libc.patch | 62 ++++++++++++++++++---- meta/recipes-core/musl/musl_git.bb | 2 +- 2 files changed, 53 insertions(+), 11 deletions(-)
meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch +52 -10
@@ -1,6 +1,6 @@ -From 94c0b97b62125d8bbc92dce0694e387d5b2ad181 Mon Sep 17 00:00:00 2001 -From: Khem Raj <[email protected]> -Date: Sun, 10 Jan 2016 12:14:02 -0800 +From 0ec74744a4cba7c5fdfaa2685995119a4fca0260 Mon Sep 17 00:00:00 2001 +From: Amarnath Valluri <[email protected]> +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 <[email protected]> +Signed-off-by: Amarnath Valluri <[email protected]> --- 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
meta/recipes-core/musl/musl_git.bb +1 -1
@@ -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
Signature · 1 line
2.7.4
PATCH v2 9/25 musl: Fix issues in relative symlink creation
In reply to Amarnath ValluriMake use of lnr/ln -r while creating relative symlinks than guessing the relalive path.
--- ...dynamic-linker-a-relative-symlink-to-libc.patch | 62 ++++++++++++++++++---- meta/recipes-core/musl/musl_git.bb | 2 +- 2 files changed, 53 insertions(+), 11 deletions(-)
meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch +52 -10
@@ -1,6 +1,6 @@ -From 94c0b97b62125d8bbc92dce0694e387d5b2ad181 Mon Sep 17 00:00:00 2001 -From: Khem Raj <[email protected]> -Date: Sun, 10 Jan 2016 12:14:02 -0800 +From 0ec74744a4cba7c5fdfaa2685995119a4fca0260 Mon Sep 17 00:00:00 2001 +From: Amarnath Valluri <[email protected]> +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 <[email protected]> +Signed-off-by: Amarnath Valluri <[email protected]> --- 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
meta/recipes-core/musl/musl_git.bb +1 -1
@@ -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
Signature · 1 line
2.7.4
PATCH v2 10/25 glibc: Ensure ldconfig is packaged into glibc
In reply to Amarnath ValluriFrom: Jussi Kukkonen <[email protected]>
If "usrmerge" feature is used, /usr/sbin/ldconfig gets packaged into glibc-utils instead of glibc: Switch PACKAGES order to prevent this.
--- meta/recipes-core/glibc/glibc-package.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/glibc/glibc-package.inc +1 -1
@@ -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)"
Signature · 1 line
2.7.4
PATCH v2 10/25 glibc: Ensure ldconfig is packaged into glibc
In reply to Amarnath ValluriFrom: Jussi Kukkonen <[email protected]>
If "usrmerge" feature is used, /usr/sbin/ldconfig gets packaged into glibc-utils instead of glibc: Switch PACKAGES order to prevent this.
--- meta/recipes-core/glibc/glibc-package.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/glibc/glibc-package.inc +1 -1
@@ -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)"
Signature · 1 line
2.7.4
PATCH v2 11/25 util-linux: Fix packaging with "usrmerge"
In reply to Amarnath ValluriFrom: Jussi Kukkonen <[email protected]>
Make sure fsck.cramfs is packaged before fsck so the latter does not steal the fsck.cramfs binary when building with usrmerge DISTRO_FEATURE.
--- meta/recipes-core/util-linux/util-linux.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
meta/recipes-core/util-linux/util-linux.inc +3 -3
@@ -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)}"
Signature · 1 line
2.7.4
PATCH v2 11/25 util-linux: Fix packaging with "usrmerge"
In reply to Amarnath ValluriFrom: Jussi Kukkonen <[email protected]>
Make sure fsck.cramfs is packaged before fsck so the latter does not steal the fsck.cramfs binary when building with usrmerge DISTRO_FEATURE.
--- meta/recipes-core/util-linux/util-linux.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
meta/recipes-core/util-linux/util-linux.inc +3 -3
@@ -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)}"
Signature · 1 line
2.7.4
PATCH v2 12/25 attr/acl: Do not create broken static library link when not needed
In reply to Amarnath ValluriStop creating the static library archieve(liba(ttr|cl).a) when --disable-static configure option used.
--- 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
meta/recipes-support/attr/ea-acl.inc +2 -0
@@ -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
meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch new file +70 -0
70 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 12/25 attr/acl: Do not create broken static library link when not needed
In reply to Amarnath ValluriStop creating the static library archieve(liba(ttr|cl).a) when --disable-static configure option used.
--- 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
meta/recipes-support/attr/ea-acl.inc +2 -0
@@ -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
meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch new file +70 -0
70 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 13/25 systemd: Do not add libnss_* to systemd package
In reply to Amarnath Vallurilibnss_* 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}.
--- meta/recipes-core/systemd/systemd_232.bb | 1 - 1 file changed, 1 deletion(-)
meta/recipes-core/systemd/systemd_232.bb +0 -1
@@ -451,7 +451,6 @@ FILES_${PN} = " ${base_bindir}/* \ ${rootlibexecdir}/systemd/* \ ${systemd_unitdir}/* \ ${base_libdir}/security/*.so \ - ${libdir}/libnss_* \ /cgroup \ ${bindir}/systemd* \ ${bindir}/busctl \
Signature · 1 line
2.7.4
v2 cover Fix for #7040 - Support for /usr merge
In reply to Amarnath ValluriThis 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
Signature · 1 line
2.7.4
PATCH v2 13/25 systemd: Do not add libnss_* to systemd package
In reply to Amarnath Vallurilibnss_* 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}.
--- meta/recipes-core/systemd/systemd_232.bb | 1 - 1 file changed, 1 deletion(-)
meta/recipes-core/systemd/systemd_232.bb +0 -1
@@ -451,7 +451,6 @@ FILES_${PN} = " ${base_bindir}/* \ ${rootlibexecdir}/systemd/* \ ${systemd_unitdir}/* \ ${base_libdir}/security/*.so \ - ${libdir}/libnss_* \ /cgroup \ ${bindir}/systemd* \ ${bindir}/busctl \
Signature · 1 line
2.7.4
PATCH v2 14/25 util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package.
In reply to Amarnath Valluriupdate-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.
util-linux
--- meta/recipes-core/util-linux/util-linux.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/util-linux/util-linux.inc +1 -1
@@ -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"
Signature · 1 line
2.7.4
PATCH v2 14/25 util-linux: Make sure '${base_bindir}/reset' is part of util-linux-reset package.
In reply to Amarnath Valluriupdate-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.
util-linux
--- meta/recipes-core/util-linux/util-linux.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/util-linux/util-linux.inc +1 -1
@@ -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"
Signature · 1 line
2.7.4
PATCH v2 15/25 util-linux, shadow: Make 'nologin' alternative command
In reply to Amarnath ValluriBoth 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.
--- meta/recipes-core/util-linux/util-linux.inc | 5 +++-- meta/recipes-extended/shadow/shadow.inc | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)
meta/recipes-core/util-linux/util-linux.inc +3 -2
@@ -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"
meta/recipes-extended/shadow/shadow.inc +2 -1
@@ -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"
Signature · 1 line
2.7.4
PATCH v2 15/25 util-linux, shadow: Make 'nologin' alternative command
In reply to Amarnath ValluriBoth 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.
--- meta/recipes-core/util-linux/util-linux.inc | 5 +++-- meta/recipes-extended/shadow/shadow.inc | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)
meta/recipes-core/util-linux/util-linux.inc +3 -2
@@ -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"
meta/recipes-extended/shadow/shadow.inc +2 -1
@@ -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"
Signature · 1 line
2.7.4
PATCH v2 16/25 libarchive: Backport upstream fixes.
In reply to Amarnath ValluriThese set of patches backported from upstream, which fixes the issues in extracting hardlinks over softlinks while etracting packages by opkg.
--- ...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
meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch new file +245 -0
@@ -0,0 +1,245 @@ +From 90881d24d3f6d5fb207e97df3b91bbea8598e84e Mon Sep 17 00:00:00 2001 +From: Martin Matuska <[email protected]> +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 <[email protected]> +--- + 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 +
meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch new file +120 -0
120 lines not on this page · raw message
meta/recipes-extended/libarchive/libarchive_3.2.2.bb +2 -0
@@ -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"
Signature · 1 line
2.7.4
PATCH v2 16/25 libarchive: Backport upstream fixes.
In reply to Amarnath ValluriThese set of patches backported from upstream, which fixes the issues in extracting hardlinks over softlinks while etracting packages by opkg.
--- ...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
meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch new file +245 -0
@@ -0,0 +1,245 @@ +From 90881d24d3f6d5fb207e97df3b91bbea8598e84e Mon Sep 17 00:00:00 2001 +From: Martin Matuska <[email protected]> +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 <[email protected]> +--- + 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 +
meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch new file +120 -0
120 lines not on this page · raw message
meta/recipes-extended/libarchive/libarchive_3.2.2.bb +2 -0
@@ -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"
Signature · 1 line
2.7.4
PATCH v2 17/25 kernel: use ${nonarch_base_libdir} for kernel modules installation.
In reply to Amarnath ValluriReplace hardcoded '/lib' in kernel modules installation path with ${nonarch_base_libdir}, which is meant exactly for this.
--- meta/classes/kernel-module-split.bbclass | 2 +- meta/classes/kernel.bbclass | 14 +++++++------- meta/classes/module.bbclass | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-)
meta/classes/kernel-module-split.bbclass +1 -1
@@ -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))
meta/classes/kernel.bbclass +7 -7
@@ -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
meta/classes/module.bbclass +1 -1
@@ -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}
Signature · 1 line
2.7.4
PATCH v2 17/25 kernel: use ${nonarch_base_libdir} for kernel modules installation.
In reply to Amarnath ValluriReplace hardcoded '/lib' in kernel modules installation path with ${nonarch_base_libdir}, which is meant exactly for this.
--- meta/classes/kernel-module-split.bbclass | 2 +- meta/classes/kernel.bbclass | 14 +++++++------- meta/classes/module.bbclass | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-)
meta/classes/kernel-module-split.bbclass +1 -1
@@ -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))
meta/classes/kernel.bbclass +7 -7
@@ -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
meta/classes/module.bbclass +1 -1
@@ -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}
Signature · 1 line
2.7.4
PATCH v2 18/25 firmware: use ${nonarch_base_libdir} for firmware installation.
In reply to Amarnath ValluriReplace hardcoded '/lib' in kernel firmware installation path with ${nonarch_base_libdir}.
--- .../linux-firmware/linux-firmware_git.bb | 168 ++++++++++----------- 1 file changed, 84 insertions(+), 84 deletions(-)
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +84 -84
@@ -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"
Signature · 1 line
2.7.4
PATCH v2 18/25 firmware: use ${nonarch_base_libdir} for firmware installation.
In reply to Amarnath ValluriReplace hardcoded '/lib' in kernel firmware installation path with ${nonarch_base_libdir}.
--- .../linux-firmware/linux-firmware_git.bb | 168 ++++++++++----------- 1 file changed, 84 insertions(+), 84 deletions(-)
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +84 -84
@@ -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"
Signature · 1 line
2.7.4
PATCH v2 19/25 mdadm: Avoid using hardocded udev, sbin paths
In reply to Amarnath ValluriUse appropriate bitbake variables inplace of below hardcoded locations:
/sbin -> ${base_sbindir}
/lib/udev -> ${nonarch_base_libdir}/udev
--- meta/recipes-extended/mdadm/mdadm_4.0.bb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
meta/recipes-extended/mdadm/mdadm_4.0.bb +4 -2
@@ -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}/
Signature · 1 line
2.7.4
PATCH v2 19/25 mdadm: Avoid using hardocded udev, sbin paths
In reply to Amarnath ValluriUse appropriate bitbake variables inplace of below hardcoded locations:
/sbin -> ${base_sbindir}
/lib/udev -> ${nonarch_base_libdir}/udev
--- meta/recipes-extended/mdadm/mdadm_4.0.bb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
meta/recipes-extended/mdadm/mdadm_4.0.bb +4 -2
@@ -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}/
Signature · 1 line
2.7.4
Re: [PATCH v2 19/25] mdadm: Avoid using hardocded udev, sbin paths
Quoted 4 lines · Amarnath Valluri
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
PATCH v3 19/25 mdadm: Avoid using hardocded sbin path
Use appropriate bitbake variable inplace of hardcoded sbin path in Makefile
--- meta/recipes-extended/mdadm/mdadm_4.0.bb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-extended/mdadm/mdadm_4.0.bb +3 -1
@@ -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}/
Signature · 1 line
2.7.4
PATCH v2 20/25 mktemp: Move installed files only when needed
In reply to Amarnath ValluriMove binary(ies) only when ${base_bindir} != ${bindir}.
When usrmerge distro feature is enabled they both might point to same location.
--- meta/recipes-extended/mktemp/mktemp_1.7.bb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
meta/recipes-extended/mktemp/mktemp_1.7.bb +5 -3
@@ -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"
Signature · 1 line
2.7.4
PATCH v2 20/25 mktemp: Move installed files only when needed
In reply to Amarnath ValluriMove binary(ies) only when ${base_bindir} != ${bindir}.
When usrmerge distro feature is enabled they both might point to same location.
--- meta/recipes-extended/mktemp/mktemp_1.7.bb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
meta/recipes-extended/mktemp/mktemp_1.7.bb +5 -3
@@ -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"
Signature · 1 line
2.7.4
PATCH v2 21/25 net-tools: Place package content as per bitbake environment.
In reply to Amarnath Vallurinet-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}.
--- meta/recipes-extended/net-tools/net-tools_1.60-26.bb | 11 +++++++++++ 1 file changed, 11 insertions(+)
meta/recipes-extended/net-tools/net-tools_1.60-26.bb +11 -0
@@ -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
Signature · 1 line
2.7.4
PATCH v2 21/25 net-tools: Place package content as per bitbake environment.
In reply to Amarnath Vallurinet-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}.
--- meta/recipes-extended/net-tools/net-tools_1.60-26.bb | 11 +++++++++++ 1 file changed, 11 insertions(+)
meta/recipes-extended/net-tools/net-tools_1.60-26.bb +11 -0
@@ -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
Signature · 1 line
2.7.4
PATCH v2 22/25 lsb: Make use of appropriate bitbake variables.
In reply to Amarnath ValluriUsing of bitbake environment variables in-place of hardcoded strings makes this recipe portable to all environments.
--- meta/recipes-extended/lsb/lsb_4.1.bb | 40 +++++++++++++++++------------------- 1 file changed, 19 insertions(+), 21 deletions(-)
meta/recipes-extended/lsb/lsb_4.1.bb +19 -21
@@ -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 ''}"
Signature · 1 line
2.7.4
PATCH v2 22/25 lsb: Make use of appropriate bitbake variables.
In reply to Amarnath ValluriUsing of bitbake environment variables in-place of hardcoded strings makes this recipe portable to all environments.
--- meta/recipes-extended/lsb/lsb_4.1.bb | 40 +++++++++++++++++------------------- 1 file changed, 19 insertions(+), 21 deletions(-)
meta/recipes-extended/lsb/lsb_4.1.bb +19 -21
@@ -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 ''}"
Signature · 1 line
2.7.4
Re: [PATCH v2 22/25] lsb: Make use of appropriate bitbake variables.
Quoted 4 lines · Amarnath Valluri
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
PATCH v3 1/1 lsb: Make use of appropriate bitbake variables.
Using of bitbake environment variables in-place of hardcoded strings makes this recipe portable to all environments.
--- meta/recipes-extended/lsb/lsb_4.1.bb | 40 +++++++++++++++++------------------- 1 file changed, 19 insertions(+), 21 deletions(-)
meta/recipes-extended/lsb/lsb_4.1.bb +19 -21
@@ -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/* \ + "
Signature · 1 line
2.7.4
PATCH v2 23/25 lttng-modules: Replace '/lib' with ${nonarch_base_libdir}
In reply to Amarnath ValluriDo 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.
--- meta/recipes-kernel/lttng/lttng-modules_2.9.0.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-kernel/lttng/lttng-modules_2.9.0.bb +2 -2
@@ -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')) }
Signature · 1 line
2.7.4
PATCH v2 23/25 lttng-modules: Replace '/lib' with ${nonarch_base_libdir}
In reply to Amarnath ValluriDo 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.
--- meta/recipes-kernel/lttng/lttng-modules_2.9.0.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-kernel/lttng/lttng-modules_2.9.0.bb +2 -2
@@ -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')) }
Signature · 1 line
2.7.4
PATCH v2 24/25 image: create symlinks needed for merged /usr
In reply to Amarnath ValluriPrepare 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"
--- meta/classes/image.bbclass | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
meta/classes/image.bbclass +23 -0
@@ -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)}"
Signature · 1 line
2.7.4
PATCH v2 24/25 image: create symlinks needed for merged /usr
In reply to Amarnath ValluriPrepare 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"
--- meta/classes/image.bbclass | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
meta/classes/image.bbclass +23 -0
@@ -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)}"
Signature · 1 line
2.7.4
PATCH v2 25/25 insane.bbclass: Add package QA check for merged /usr.
In reply to Amarnath ValluriThis check makes sure that, when usrmerge distro feature enabled, no package installs files to root (/bin, /sbin, /lib, /lib64) folders.
--- meta/classes/insane.bbclass | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
meta/classes/insane.bbclass +16 -0
@@ -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
Signature · 1 line
2.7.4
PATCH v2 25/25 insane.bbclass: Add package QA check for merged /usr.
In reply to Amarnath ValluriThis check makes sure that, when usrmerge distro feature enabled, no package installs files to root (/bin, /sbin, /lib, /lib64) folders.
--- meta/classes/insane.bbclass | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
meta/classes/insane.bbclass +16 -0
@@ -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
Signature · 1 line
2.7.4
Re: [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
In reply to Amarnath ValluriQuoted 9 lines · Amarnath Valluri
From: Joshua Lock <[email protected]>
Modify bindir, libdir and sbindir to be exec_prefix/$d, rather than base_prefix/$d, when the usrmerge
DISTRO_FEATUREis enabled.Signed-off-by Joshua Lock <[email protected]>---
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
Re: [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
Quoted 22 lines · Richard Purdie
Quoted 9 lines · Amarnath Valluri
From: Joshua Lock <[email protected]>
Modify bindir, libdir and sbindir to be exec_prefix/$d, rather than base_prefix/$d, when the usrmerge
DISTRO_FEATUREis enabled.Signed-off-by Joshua Lock <[email protected]>--- 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_FEATUREis 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.
Quoted 3 lines
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.
Signature · 6 lines
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.
Re: [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
Quoted 11 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Patrick Ohly
Sent: den 7 juni 2017 16:32
To: Richard Purdie <[email protected]>
Cc: Joshua Lock <[email protected]>; openembedded- [email protected]
Subject: Re: [OE-core] [PATCH v2 01/25] bitbake.conf: support for merged usr withDISTRO_FEATUREusrmerge
Quoted 22 lines
Quoted 21 lines · Richard Purdie
Quoted 9 lines · Amarnath Valluri
From: Joshua Lock <[email protected]>
Modify bindir, libdir and sbindir to be exec_prefix/$d, rather than base_prefix/$d, when the usrmerge
DISTRO_FEATUREis enabled.Signed-off-by Joshua Lock <[email protected]>--- 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_FEATUREis 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:
meta/conf/bitbake.conf +6 -4
@@ -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).
Quoted 10 lines
Quoted 3 lines
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_FEATURESonly 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 inDISTRO_FEATURES.
Quoted 8 lines
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.
Quoted 7 lines
--
Best Regards, Patrick OhlyThe 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
Re: [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
Quoted 31 lines · Peter Kjellerstedt
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:
meta/conf/bitbake.conf +6
-4@@ -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"
Quoted 3 lines
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.
Quoted 13 lines
Quoted 6 lines
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_prefixlike this instead:
root_prefix?= "${base_prefix}"
Quoted 8 lines
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_prefixis 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.
Signature · 6 lines
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.
Re: [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
In reply to Peter KjellerstedtQuoted 79 lines · Peter Kjellerstedt
Quoted 13 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of
Patrick Ohly
Sent: den 7 juni 2017 16:32
To: Richard Purdie <[email protected]>
Cc: Joshua Lock <[email protected]>; openembedded- [email protected]
Subject: Re: [OE-core] [PATCH v2 01/25] bitbake.conf: support for merged usr withDISTRO_FEATUREusrmergeQuoted 32 lines
Quoted 31 lines · Richard Purdie
Quoted 11 lines · Amarnath Valluri
From: Joshua Lock <[email protected]>
Modify bindir, libdir and sbindir to be exec_prefix/$d, rather than
base_prefix/$d, when the usrmergeDISTRO_FEATUREis enabled.Signed-off-by Joshua Lock <[email protected]>---
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 relevantDISTRO_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
3052a55d88ae14dd02243530I will include my suggested solution here since I will refer to it below:
meta/conf/bitbake.conf +0
-0@@ -17,11 +17,13 @@ export base_prefix = ""export prefix = "/usr"
exportexec_prefix= "${prefix}"
+root_prefix = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}', '${base_prefix}', d)}"
+
# Base pathsmeta/conf/bitbake.conf +4
-4-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"
Quoted 5 lines
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
Re: [PATCH v2 01/25] bitbake.conf: support for merged usr with DISTRO_FEATURE usrmerge
Quoted 87 lines · Richard Purdie
Quoted 86 lines · Peter Kjellerstedt
Quoted 16 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of
Patrick Ohly
Sent: den 7 juni 2017 16:32
To: Richard Purdie <[email protected]>
Cc: Joshua Lock <[email protected]>; openembedded- [email protected]
Subject: Re: [OE-core] [PATCH v2 01/25] bitbake.conf: support for merged usr withDISTRO_FEATUREusrmergeQuoted 35 lines
Quoted 34 lines · Richard Purdie
Quoted 9 lines · Amarnath Valluri
From: Joshua Lock <[email protected]>
Modify bindir, libdir and sbindir to be exec_prefix/$d, rather
than
base_prefix/$d, when the usrmergeDISTRO_FEATUREis enabled.Quoted 4 lines
Signed-off-by Joshua Lock <[email protected]>---
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 relevantDISTRO_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
883052a55d88ae14dd02243530I will include my suggested solution here since I will refer to it below:
meta/conf/bitbake.conf +0
-0@@ -17,11 +17,13 @@ export base_prefix = ""export prefix = "/usr"
exportexec_prefix= "${prefix}"
+root_prefix = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}', '${base_prefix}', d)}"
+
# Base pathsmeta/conf/bitbake.conf +4
-4-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"
Quoted 8 lines
Quoted 6 lines
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_FEATURESline 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