All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Implement merged /usr
@ 2015-12-16 18:11 Matthias Schiffer
  2015-12-16 18:11 ` [PATCH 1/4] busybox: generalize recipe to work with arbitrary install directories Matthias Schiffer
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Matthias Schiffer @ 2015-12-16 18:11 UTC (permalink / raw)
  To: openembedded-core

Hi,
this patchset implements Fedora-style merged /usr with symlinks, and fixes
the kernel and busybox recipes to work with this. There are probably more
packages which need similar fixes.

The creation of the symlinks is controlled by the merged-usr DISTRO_FEATURE
as suggested in [YOCTO #7040]. The variables base_bindir, base_sbindir,
sbindir, base_libdir and nonarch_base_libdir need to be set explicitly in
the distro config in addition to the DISTRO_FEATURE to make this feature
as flexible as possible (see the commit message of PATCH 4/4).


Matthias Schiffer (4):
  busybox: generalize recipe to work with arbitrary install directories
  kernel: allow kernel module and firmware installation with
    ${base_libdir} != "/lib"
  base-files: create ${base_bindir} etc. instead of /bin, /sbin and /lib
  base-files: create typical merged /usr symlinks if the "merged-usr"
    distro feature is set

 meta/classes/kernel-module-split.bbclass          |  4 +--
 meta/classes/kernel.bbclass                       | 25 +++++++++++-----
 meta/recipes-core/base-files/base-files_3.0.14.bb | 26 +++++++++++++++--
 meta/recipes-core/busybox/busybox.inc             | 35 ++++++++---------------
 4 files changed, 56 insertions(+), 34 deletions(-)

-- 
2.6.4



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

* [PATCH 1/4] busybox: generalize recipe to work with arbitrary install directories
  2015-12-16 18:11 [PATCH 0/4] Implement merged /usr Matthias Schiffer
@ 2015-12-16 18:11 ` Matthias Schiffer
  2015-12-16 18:11 ` [PATCH 2/4] kernel: allow kernel module and firmware installation with ${base_libdir} != "/lib" Matthias Schiffer
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Matthias Schiffer @ 2015-12-16 18:11 UTC (permalink / raw)
  To: openembedded-core

Allow configuring base_bindir, base_sbindir, bindir and sbindir
arbitrarily.

Also change the temporary symlinks created in the postinst script from
relative to absolute to make the code simpler and more flexible. There was
no reason to use relative links anyways, as directly afterwards
update-alternatives would replace them by absolute links anyways.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
---
 meta/recipes-core/busybox/busybox.inc | 35 ++++++++++++-----------------------
 1 file changed, 12 insertions(+), 23 deletions(-)

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index fba956e..9541123 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -171,20 +171,20 @@ do_compile() {
 }
 
 do_install () {
-	if [ "${prefix}" != "/usr" ]; then
-		sed -i "s:^/usr/:${prefix}/:" busybox.links*
-	fi
-	if [ "${base_sbindir}" != "/sbin" ]; then
-		sed -i "s:^/sbin/:${base_sbindir}/:" busybox.links*
-	fi
-	if [ "${base_bindir}" != "/bin" ]; then
-		sed -i "s:^/bin/:${base_bindir}/:" busybox.links*
-	fi
+	sed -i "s:^/bin/:BASE_BINDIR/:" busybox.links*
+	sed -i "s:^/sbin/:BASE_SBINDIR/:" busybox.links*
+	sed -i "s:^/usr/bin/:BINDIR/:" busybox.links*
+	sed -i "s:^/usr/sbin/:SBINDIR/:" busybox.links*
+
+	sed -i "s:^BASE_BINDIR/:${base_bindir}/:" busybox.links*
+	sed -i "s:^BASE_SBINDIR/:${base_sbindir}/:" busybox.links*
+	sed -i "s:^BINDIR/:${bindir}/:" busybox.links*
+	sed -i "s:^SBINDIR/:${sbindir}/:" busybox.links*
 
 	install -d ${D}${sysconfdir}/init.d
 
 	if ! grep -q "CONFIG_FEATURE_INDIVIDUAL=y" ${B}/.config; then
-		# Install /bin/busybox, and the /bin/sh link so the postinst script
+		# Install ${base_bindir}/busybox, and the ${base_bindir}/sh link so the postinst script
 		# can run. Let update-alternatives handle the rest.
 		install -d ${D}${base_bindir}
 		if [ "${BUSYBOX_SPLIT_SUID}" = "1" ]; then
@@ -212,7 +212,7 @@ do_install () {
 			# We make this symlink here to eliminate the error when upgrading together
 			# with busybox-syslog. Without this symlink, the opkg may think of the
 			# busybox.nosuid as obsolete and remove it, resulting in dead links like
-			# /bin/sed -> /bin/busybox.nosuid. This will make upgrading busybox-syslog fail.
+			# ${base_bindir}/sed -> ${base_bindir}/busybox.nosuid. This will make upgrading busybox-syslog fail.
 			# This symlink will be safely deleted in postinst, thus no negative effect.
 			ln -sf busybox ${D}${base_bindir}/busybox.nosuid
 		fi
@@ -368,21 +368,10 @@ pkg_postinst_${PN} () {
 			if test -e ${sysconfdir}/busybox.links$suffix; then
 				while read link; do
 					if test ! -e "$link"; then
-						case "$link" in
-							/*/*/*)
-								to="../..${base_bindir}/busybox$suffix"
-								;;
-							/bin/*)
-								to="busybox$suffix"
-								;;
-							/*/*)
-								to="..${base_bindir}/busybox$suffix"
-								;;
-						esac
 						# we can use busybox here because even if we are using splitted busybox
 						# we've made a symlink from /bin/busybox to /bin/busybox.nosuid.
 						busybox rm -f $link
-						busybox ln -s $to $link
+						busybox ln -s "${base_bindir}/busybox$suffix" $link
 					fi
 				done < ${sysconfdir}/busybox.links$suffix
 			fi
-- 
2.6.4



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

* [PATCH 2/4] kernel: allow kernel module and firmware installation with ${base_libdir} != "/lib"
  2015-12-16 18:11 [PATCH 0/4] Implement merged /usr Matthias Schiffer
  2015-12-16 18:11 ` [PATCH 1/4] busybox: generalize recipe to work with arbitrary install directories Matthias Schiffer
@ 2015-12-16 18:11 ` Matthias Schiffer
  2015-12-16 19:48   ` Roman Khimov
  2015-12-16 19:49   ` Roman Khimov
  2015-12-16 18:11 ` [PATCH 3/4] base-files: create ${base_bindir} etc. instead of /bin, /sbin and /lib Matthias Schiffer
  2015-12-16 18:12 ` [PATCH 4/4] base-files: create typical merged /usr symlinks if the "merged-usr" distro feature is set Matthias Schiffer
  3 siblings, 2 replies; 13+ messages in thread
From: Matthias Schiffer @ 2015-12-16 18:11 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
---
 meta/classes/kernel-module-split.bbclass |  4 ++--
 meta/classes/kernel.bbclass              | 25 ++++++++++++++++++-------
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/meta/classes/kernel-module-split.bbclass b/meta/classes/kernel-module-split.bbclass
index e1a70e6..172b8df 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -109,7 +109,7 @@ python split_kernel_module_packages () {
         # file no longer includes PKGD
         file = file.replace(d.getVar('PKGD', True) or '', '', 1)
         # instead is prefixed with /lib/modules/${KERNEL_VERSION}
-        file = file.replace("/lib/modules/%s/" % d.getVar('KERNEL_VERSION', True) or '', '', 1)
+        file = file.replace("%s/modules/%s/" % (d.getVar('base_libdir', True), d.getVar('KERNEL_VERSION', True)), '', 1)
 
         if file in module_deps:
             dependencies = []
@@ -186,7 +186,7 @@ python split_kernel_module_packages () {
     postinst = d.getVar('pkg_postinst_modules', True)
     postrm = d.getVar('pkg_postrm_modules', True)
 
-    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", True)))
+    modules = do_split_packages(d, root='%s/modules' % d.getVar('base_libdir', True), 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", True)))
     if modules:
         metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE', True)
         d.appendVar('RDEPENDS_' + metapkg, ' '+' '.join(modules))
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 4ce1611..8fc1d5d 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -242,6 +242,11 @@ kernel_do_install() {
 		rm "${D}/lib/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"
+
+		if [ "${base_libdir}" != "/lib" ]; then
+			install -d "${D}${base_libdir}"
+			mv "${D}/lib/modules" "${D}${base_libdir}"
+		fi
 	else
 		bbnote "no modules to install"
 	fi
@@ -258,6 +263,12 @@ kernel_do_install() {
 	[ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION}
 	install -d ${D}${sysconfdir}/modules-load.d
 	install -d ${D}${sysconfdir}/modprobe.d
+
+	if [ "${base_libdir}" != "/lib" ]; then
+		install -d "${D}${base_libdir}"
+		mv "${D}/lib/firmware" "${D}${base_libdir}"
+		rmdir --ignore-fail-on-non-empty "${D}/lib"
+	fi
 }
 do_install[prefuncs] += "package_get_auto_pr"
 
@@ -364,9 +375,9 @@ EXPORT_FUNCTIONS do_compile do_install do_configure
 # kernel-image becomes kernel-image-${KERNEL_VERISON}
 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 = "${base_libdir}/modules/${KERNEL_VERSION}/modules.order ${base_libdir}/modules/${KERNEL_VERSION}/modules.builtin"
 FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
-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} ${base_libdir}/modules/${KERNEL_VERSION}/build"
 FILES_kernel-vmlinux = "/boot/vmlinux*"
 FILES_kernel-modules = ""
 RDEPENDS_kernel = "kernel-base"
@@ -384,8 +395,8 @@ ALLOW_EMPTY_kernel-modules = "1"
 DESCRIPTION_kernel-modules = "Kernel modules meta package"
 
 pkg_postinst_kernel-base () {
-	if [ ! -e "$D/lib/modules/${KERNEL_VERSION}" ]; then
-		mkdir -p $D/lib/modules/${KERNEL_VERSION}
+	if [ ! -e "$D${base_libdir}/modules/${KERNEL_VERSION}" ]; then
+		mkdir -p $D${base_libdir}/modules/${KERNEL_VERSION}
 	fi
 	if [ -n "$D" ]; then
 		depmodwrapper -a -b $D ${KERNEL_VERSION}
@@ -405,7 +416,7 @@ pkg_postrm_kernel-image () {
 PACKAGESPLITFUNCS_prepend = "split_kernel_packages "
 
 python split_kernel_packages () {
-    do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.(bin|fw|cis|dsp)$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
+    do_split_packages(d, root='%s/firmware' % d.getVar('base_libdir', True), file_regex='^(.*)\.(bin|fw|cis|dsp)$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
 }
 
 do_strip() {
@@ -469,8 +480,8 @@ MODULE_TARBALL_DEPLOY ?= "1"
 kernel_do_deploy() {
 	install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
 	if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
-		mkdir -p ${D}/lib
-		tar -cvzf ${DEPLOYDIR}/${MODULE_TARBALL_BASE_NAME} -C ${D} lib
+		mkdir -p ${D}${base_libdir}
+		tar -cvzf ${DEPLOYDIR}/${MODULE_TARBALL_BASE_NAME} -C ${D} ${@d.getVar('base_libdir', True)[1:]}
 		ln -sf ${MODULE_TARBALL_BASE_NAME} ${DEPLOYDIR}/${MODULE_TARBALL_SYMLINK_NAME}
 	fi
 
-- 
2.6.4



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

* [PATCH 3/4] base-files: create ${base_bindir} etc. instead of /bin, /sbin and /lib
  2015-12-16 18:11 [PATCH 0/4] Implement merged /usr Matthias Schiffer
  2015-12-16 18:11 ` [PATCH 1/4] busybox: generalize recipe to work with arbitrary install directories Matthias Schiffer
  2015-12-16 18:11 ` [PATCH 2/4] kernel: allow kernel module and firmware installation with ${base_libdir} != "/lib" Matthias Schiffer
@ 2015-12-16 18:11 ` Matthias Schiffer
  2015-12-22 17:31   ` Burton, Ross
  2015-12-16 18:12 ` [PATCH 4/4] base-files: create typical merged /usr symlinks if the "merged-usr" distro feature is set Matthias Schiffer
  3 siblings, 1 reply; 13+ messages in thread
From: Matthias Schiffer @ 2015-12-16 18:11 UTC (permalink / raw)
  To: openembedded-core

These directories conflict with the symlinks created for merged-usr setups.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
---
 meta/recipes-core/base-files/base-files_3.0.14.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index b71d5c5..0c1171f 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -33,8 +33,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 = "${base_bindir} /boot /dev ${sysconfdir} ${sysconfdir}/default \
+           ${sysconfdir}/skel ${nonarch_base_libdir} /mnt /proc ${ROOT_HOME} /run ${base_sbindir} \
            ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
            ${libdir} ${sbindir} ${datadir} \
            ${datadir}/common-licenses ${datadir}/dict ${infodir} \
-- 
2.6.4



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

* [PATCH 4/4] base-files: create typical merged /usr symlinks if the "merged-usr" distro feature is set
  2015-12-16 18:11 [PATCH 0/4] Implement merged /usr Matthias Schiffer
                   ` (2 preceding siblings ...)
  2015-12-16 18:11 ` [PATCH 3/4] base-files: create ${base_bindir} etc. instead of /bin, /sbin and /lib Matthias Schiffer
@ 2015-12-16 18:12 ` Matthias Schiffer
  2015-12-16 19:46   ` Roman Khimov
  3 siblings, 1 reply; 13+ messages in thread
From: Matthias Schiffer @ 2015-12-16 18:12 UTC (permalink / raw)
  To: openembedded-core

The typical symlinks are:

* /bin -> usr/bin
* /sbin -> usr/sbin
* /lib -> usr/lib
* /usr/sbin -> bin

It is checked that only sane symlinks are created, so a half-merged /usr
(e.g, merging bin and sbin, but not lib) is feasible as well.

The following options in a distro configuration create a full Fedora-style
merged /usr:

  DISTRO_FEATURES_DEFAULT += "merged-usr"
  base_bindir = "${exec_prefix}/bin"
  base_sbindir = "${exec_prefix}/bin"
  sbindir = "${exec_prefix}/bin"
  base_libdir = "${exec_prefix}/${baselib}"
  nonarch_base_libdir = "${exec_prefix}/lib"

[YOCTO #7040]

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
---
 meta/recipes-core/base-files/base-files_3.0.14.bb | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index 0c1171f..852f4f5 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -134,6 +134,28 @@ do_install () {
 	fi
 
 	ln -sf /proc/mounts ${D}${sysconfdir}/mtab
+
+	if ${@bb.utils.contains('DISTRO_FEATURES','merged-usr','true','false',d)}; then
+		if [ "${base_bindir}" != "/bin" ]; then
+			ln -snf "${@d.getVar('base_bindir', True)[1:]}" ${D}/bin
+		fi
+
+		if [ "${base_sbindir}" != "/sbin"  ]; then
+			ln -snf "${@d.getVar('base_sbindir', True)[1:]}" ${D}/sbin
+		fi
+
+		if [ "${nonarch_base_libdir}" != "/lib" ]; then
+			ln -snf "${@d.getVar('nonarch_base_libdir', True)[1:]}" ${D}/lib
+		fi
+
+		if [ "${base_libdir}" != "/${baselib}" ]; then
+			ln -snf "${@d.getVar('base_libdir', True)[1:]}" ${D}/${baselib}
+		fi
+
+		if [ "${bindir}" = "${exec_prefix}/bin" -a "${sbindir}" = "${exec_prefix}/bin" ]; then
+			ln -snf bin ${D}${exec_prefix}/sbin
+		fi
+	fi
 }
 
 DISTRO_VERSION[vardepsexclude] += "DATE"
-- 
2.6.4



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

* Re: [PATCH 4/4] base-files: create typical merged /usr symlinks if the "merged-usr" distro feature is set
  2015-12-16 18:12 ` [PATCH 4/4] base-files: create typical merged /usr symlinks if the "merged-usr" distro feature is set Matthias Schiffer
@ 2015-12-16 19:46   ` Roman Khimov
  2015-12-17  9:47     ` Matthias Schiffer
  0 siblings, 1 reply; 13+ messages in thread
From: Roman Khimov @ 2015-12-16 19:46 UTC (permalink / raw)
  To: openembedded-core

В письме от 16 декабря 2015 19:12:00 пользователь Matthias Schiffer написал:
> The following options in a distro configuration create a full Fedora-style
> merged /usr:
> 
>   DISTRO_FEATURES_DEFAULT += "merged-usr"
>   base_bindir = "${exec_prefix}/bin"
>   base_sbindir = "${exec_prefix}/bin"
>   sbindir = "${exec_prefix}/bin"
>   base_libdir = "${exec_prefix}/${baselib}"
>   nonarch_base_libdir = "${exec_prefix}/lib"

Hmm. Why not just change the base_prefix? We've done it this way (not merging 
bin with sbin, but that's a separate thing):

+base_prefix = "/usr"
+sysconfdir = "/etc"
+localstatedir = "/var"

Also, you probably want to add this symlinks to fs-perms.txt. I don't quite 
remember which packages failed for me without it, but there were some.

-- 
 http://roman.khimov.ru
mailto: roman@khimov.ru
gpg --keyserver hkp://subkeys.pgp.net --recv-keys 0xE5E055C3


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

* Re: [PATCH 2/4] kernel: allow kernel module and firmware installation with ${base_libdir} != "/lib"
  2015-12-16 18:11 ` [PATCH 2/4] kernel: allow kernel module and firmware installation with ${base_libdir} != "/lib" Matthias Schiffer
@ 2015-12-16 19:48   ` Roman Khimov
  2015-12-16 19:49   ` Roman Khimov
  1 sibling, 0 replies; 13+ messages in thread
From: Roman Khimov @ 2015-12-16 19:48 UTC (permalink / raw)
  To: openembedded-core

В письме от 16 декабря 2015 19:11:58 пользователь Matthias Schiffer написал:
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 4ce1611..8fc1d5d 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -242,6 +242,11 @@ kernel_do_install() {
>  		rm "${D}/lib/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" +
> +		if [ "${base_libdir}" != "/lib" ]; then
> +			install -d "${D}${base_libdir}"
> +			mv "${D}/lib/modules" "${D}${base_libdir}"
> +		fi
>  	else
>  		bbnote "no modules to install"
>  	fi
> @@ -258,6 +263,12 @@ kernel_do_install() {
>  	[ -e Module.symvers ] && install -m 0644 Module.symvers
> ${D}/boot/Module.symvers-${KERNEL_VERSION} install -d
> ${D}${sysconfdir}/modules-load.d
>  	install -d ${D}${sysconfdir}/modprobe.d
> +
> +	if [ "${base_libdir}" != "/lib" ]; then
> +		install -d "${D}${base_libdir}"
> +		mv "${D}/lib/firmware" "${D}${base_libdir}"
> +		rmdir --ignore-fail-on-non-empty "${D}/lib"
> +	fi
>  }
>  do_install[prefuncs] += "package_get_auto_pr"

I think this hunks are not needed if you're to fix fs-perms.txt.

-- 
 http://roman.khimov.ru
mailto: roman@khimov.ru
gpg --keyserver hkp://subkeys.pgp.net --recv-keys 0xE5E055C3


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

* Re: [PATCH 2/4] kernel: allow kernel module and firmware installation with ${base_libdir} != "/lib"
  2015-12-16 18:11 ` [PATCH 2/4] kernel: allow kernel module and firmware installation with ${base_libdir} != "/lib" Matthias Schiffer
  2015-12-16 19:48   ` Roman Khimov
@ 2015-12-16 19:49   ` Roman Khimov
  1 sibling, 0 replies; 13+ messages in thread
From: Roman Khimov @ 2015-12-16 19:49 UTC (permalink / raw)
  To: openembedded-core

В письме от 16 декабря 2015 19:11:58 пользователь Matthias Schiffer написал:
>          # instead is prefixed with /lib/modules/${KERNEL_VERSION}
> -        file = file.replace("/lib/modules/%s/" % d.getVar('KERNEL_VERSION',
> True) or '', '', 1) +        file = file.replace("%s/modules/%s/" %
> (d.getVar('base_libdir', True), d.getVar('KERNEL_VERSION', True)), '', 1)

And, BTW, the comment still references /lib.

-- 
 http://roman.khimov.ru
mailto: roman@khimov.ru
gpg --keyserver hkp://subkeys.pgp.net --recv-keys 0xE5E055C3


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

* Re: [PATCH 4/4] base-files: create typical merged /usr symlinks if the "merged-usr" distro feature is set
  2015-12-16 19:46   ` Roman Khimov
@ 2015-12-17  9:47     ` Matthias Schiffer
  2015-12-17 11:49       ` Roman Khimov
  0 siblings, 1 reply; 13+ messages in thread
From: Matthias Schiffer @ 2015-12-17  9:47 UTC (permalink / raw)
  To: Roman Khimov; +Cc: openembedded-core

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

On 12/16/2015 08:46 PM, Roman Khimov wrote:
> В письме от 16 декабря 2015 19:12:00 пользователь Matthias Schiffer написал:
>> The following options in a distro configuration create a full Fedora-style
>> merged /usr:
>>
>>   DISTRO_FEATURES_DEFAULT += "merged-usr"
>>   base_bindir = "${exec_prefix}/bin"
>>   base_sbindir = "${exec_prefix}/bin"
>>   sbindir = "${exec_prefix}/bin"
>>   base_libdir = "${exec_prefix}/${baselib}"
>>   nonarch_base_libdir = "${exec_prefix}/lib"
> 
> Hmm. Why not just change the base_prefix? We've done it this way (not merging 
> bin with sbin, but that's a separate thing):
> 
> +base_prefix = "/usr"
> +sysconfdir = "/etc"
> +localstatedir = "/var"

My patches don't care how base_bindir etc. are set, your way would work
with it just fine. My recommendation is to set the dirs explicitly
instead of changing the base_prefix, as other things might depend on the
base_prefix, and symlinks are created for /bin, /sbin, /lib and
/${baselib} only.

> 
> Also, you probably want to add this symlinks to fs-perms.txt. I don't quite 
> remember which packages failed for me without it, but there were some.
> 

Is it even possible to have fs-perms.txt entries depending on a
DISTRO_FEATURE? And can fs-perms.txt move files from one directory to
another (as you suggested in your reply for PATCH 2)?

AFAICT, fs-perms.txt is only there to fix some common issues with
directory permissions. Most packages already respect base_libdir etc.
just fine, so in my opinion it would be preferable to just fix the
packages which don't if adding such things to fs-perms.txt is non-trivial.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 4/4] base-files: create typical merged /usr symlinks if the "merged-usr" distro feature is set
  2015-12-17  9:47     ` Matthias Schiffer
@ 2015-12-17 11:49       ` Roman Khimov
  0 siblings, 0 replies; 13+ messages in thread
From: Roman Khimov @ 2015-12-17 11:49 UTC (permalink / raw)
  To: Matthias Schiffer; +Cc: openembedded-core

В письме от 17 декабря 2015 10:47:28 пользователь Matthias Schiffer написал:
> On 12/16/2015 08:46 PM, Roman Khimov wrote:
> > В письме от 16 декабря 2015 19:12:00 пользователь Matthias Schiffer 
> > написал:
> > Also, you probably want to add this symlinks to fs-perms.txt. I don't
> > quite
> > remember which packages failed for me without it, but there were some.
> 
> Is it even possible to have fs-perms.txt entries depending on a
> DISTRO_FEATURE? 

Probably not.

> And can fs-perms.txt move files from one directory to
> another (as you suggested in your reply for PATCH 2)?

IIRC, yes.

> AFAICT, fs-perms.txt is only there to fix some common issues with
> directory permissions. Most packages already respect base_libdir etc.
> just fine, so in my opinion it would be preferable to just fix the
> packages which don't if adding such things to fs-perms.txt is non-trivial.

fs-perms can fix things automatically, with no additional code in recipes (and 
that's a nice thing IMO), but, yes, at the moment it probably can't do or 
don't do things based on DISTRO_FEATURE settings. Maybe using 
FILESYSTEM_PERMS_TABLES can help or even generating fs-perms on the fly taking 
into account real ${somedir} values.


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

* Re: [PATCH 3/4] base-files: create ${base_bindir} etc. instead of /bin, /sbin and /lib
  2015-12-16 18:11 ` [PATCH 3/4] base-files: create ${base_bindir} etc. instead of /bin, /sbin and /lib Matthias Schiffer
@ 2015-12-22 17:31   ` Burton, Ross
  2015-12-22 18:43     ` Matthias Schiffer
  0 siblings, 1 reply; 13+ messages in thread
From: Burton, Ross @ 2015-12-22 17:31 UTC (permalink / raw)
  To: Matthias Schiffer; +Cc: OE-core

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

On 16 December 2015 at 18:11, Matthias Schiffer <
mschiffer@universe-factory.net> wrote:

> -dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
> -           ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \
> +dirs755 = "${base_bindir} /boot /dev ${sysconfdir} ${sysconfdir}/default \
> +           ${sysconfdir}/skel ${nonarch_base_libdir} /mnt /proc
> ${ROOT_HOME} /run ${base_sbindir} \
>

I think the *intention* of /lib was to be $(base_libdir).

Ross

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

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

* Re: [PATCH 3/4] base-files: create ${base_bindir} etc. instead of /bin, /sbin and /lib
  2015-12-22 17:31   ` Burton, Ross
@ 2015-12-22 18:43     ` Matthias Schiffer
  2015-12-22 21:11       ` Burton, Ross
  0 siblings, 1 reply; 13+ messages in thread
From: Matthias Schiffer @ 2015-12-22 18:43 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

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

On 12/22/2015 06:31 PM, Burton, Ross wrote:
> On 16 December 2015 at 18:11, Matthias Schiffer <
> mschiffer@universe-factory.net> wrote:
> 
>> -dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
>> -           ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \
>> +dirs755 = "${base_bindir} /boot /dev ${sysconfdir} ${sysconfdir}/default \
>> +           ${sysconfdir}/skel ${nonarch_base_libdir} /mnt /proc
>> ${ROOT_HOME} /run ${base_sbindir} \
>>
> 
> I think the *intention* of /lib was to be $(base_libdir).
> 
> Ross
> 

Maybe adding both ${base_libdir} and ${nonarch_base_libdir} would make
sense?


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 3/4] base-files: create ${base_bindir} etc. instead of /bin, /sbin and /lib
  2015-12-22 18:43     ` Matthias Schiffer
@ 2015-12-22 21:11       ` Burton, Ross
  0 siblings, 0 replies; 13+ messages in thread
From: Burton, Ross @ 2015-12-22 21:11 UTC (permalink / raw)
  To: Matthias Schiffer; +Cc: OE-core

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

On 22 December 2015 at 18:43, Matthias Schiffer <
mschiffer@universe-factory.net> wrote:

> Maybe adding both ${base_libdir} and ${nonarch_base_libdir} would make
> sense?
>

Sure.

Ross

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

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

end of thread, other threads:[~2015-12-22 21:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-16 18:11 [PATCH 0/4] Implement merged /usr Matthias Schiffer
2015-12-16 18:11 ` [PATCH 1/4] busybox: generalize recipe to work with arbitrary install directories Matthias Schiffer
2015-12-16 18:11 ` [PATCH 2/4] kernel: allow kernel module and firmware installation with ${base_libdir} != "/lib" Matthias Schiffer
2015-12-16 19:48   ` Roman Khimov
2015-12-16 19:49   ` Roman Khimov
2015-12-16 18:11 ` [PATCH 3/4] base-files: create ${base_bindir} etc. instead of /bin, /sbin and /lib Matthias Schiffer
2015-12-22 17:31   ` Burton, Ross
2015-12-22 18:43     ` Matthias Schiffer
2015-12-22 21:11       ` Burton, Ross
2015-12-16 18:12 ` [PATCH 4/4] base-files: create typical merged /usr symlinks if the "merged-usr" distro feature is set Matthias Schiffer
2015-12-16 19:46   ` Roman Khimov
2015-12-17  9:47     ` Matthias Schiffer
2015-12-17 11:49       ` Roman Khimov

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