From: Mark Hatle <mark.hatle@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH v2 3/3] base-files: create typical merged /usr symlinks if the "merged-usr" distro feature is set
Date: Mon, 4 Jan 2016 16:59:05 -0600 [thread overview]
Message-ID: <568AF939.7070700@windriver.com> (raw)
In-Reply-To: <7ef127138c4ba5c89b42b892c84aaa7766f78a4c.1451778497.git.mschiffer@universe-factory.net>
On 1/2/16 5:53 PM, Matthias Schiffer wrote:
> 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>
> ---
> v2:
> * add the merged-usr symlinks in a separate task, so do_install can be
> overridden independently of the merged-usr feature.
> * add PACKAGECONFIG for merged-usr, so the package is rebuilt when the
> distro feature is changed.
>
>
> meta/recipes-core/base-files/base-files_3.0.14.bb | 36 +++++++++++++++++++++++
> 1 file changed, 36 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 2af7ecd..21a740f 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
> @@ -30,6 +30,13 @@ S = "${WORKDIR}"
>
> INHIBIT_DEFAULT_DEPS = "1"
>
> +PACKAGECONFIG ??= " \
> + ${@bb.utils.contains('DISTRO_FEATURES', 'merged-usr','merged-usr', '', d)} \
> +"
> +
> +PACKAGECONFIG[merged-usr] = ",,"
> +
> +
> docdir_append = "/${P}"
> dirs1777 = "/tmp ${localstatedir}/volatile/tmp"
> dirs2775 = ""
> @@ -136,6 +143,35 @@ do_install () {
> ln -sf /proc/mounts ${D}${sysconfdir}/mtab
> }
>
> +do_install_merged_usr () {
> + if ${@bb.utils.contains('PACKAGECONFIG','merged-usr','false','true',d)}; then
> + return
> + fi
> +
> + 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
> +}
The stuff above really seems to me that it should be done by the fs-perms setup.
Is the real problem here that people don't understand the fs-perms and how to
configure it for these alternative filesystem configurations?
(or if the code in the packaging isn't working, we should fix it.)
--Mark
> +
> +addtask install_merged_usr after do_install before do_package do_populate_sysroot
> +
> +
> DISTRO_VERSION[vardepsexclude] += "DATE"
> do_install_basefilesissue () {
> if [ "${hostname}" ]; then
>
prev parent reply other threads:[~2016-01-04 22:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-02 23:52 [PATCH v2 1/3] kernel: allow kernel module and firmware installation with ${nonarch_base_libdir} != "/lib" Matthias Schiffer
2016-01-02 23:53 ` [PATCH v2 2/3] base-files: create ${base_bindir} etc. instead of /bin, /sbin and /lib Matthias Schiffer
2016-01-04 22:59 ` Mark Hatle
2016-01-04 23:46 ` Matthias Schiffer
2016-01-05 0:16 ` Mark Hatle
2016-01-10 17:13 ` Matthias Schiffer
2016-01-10 17:52 ` Roman Khimov
2016-01-10 18:01 ` Matthias Schiffer
2016-01-10 22:18 ` Phil Blundell
2016-01-11 15:00 ` Mark Hatle
2016-01-02 23:53 ` [PATCH v2 3/3] base-files: create typical merged /usr symlinks if the "merged-usr" distro feature is set Matthias Schiffer
2016-01-03 13:01 ` Phil Blundell
2016-01-04 22:38 ` Matthias Schiffer
2016-01-05 22:04 ` Phil Blundell
2016-01-04 22:59 ` Mark Hatle [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=568AF939.7070700@windriver.com \
--to=mark.hatle@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox