All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/2] package/skeleton: also handle merged /usr in the staging
Date: Fri, 27 Nov 2015 23:34:19 +0100	[thread overview]
Message-ID: <5658DA6B.8040305@mind.be> (raw)
In-Reply-To: <0934812eeec64cb2cdc2b7600879b53695859652.1448575841.git.yann.morin.1998@free.fr>

On 26-11-15 23:13, Yann E. MORIN wrote:
> When the target uses a merged /usr setup, gdbserver will only report
> paths in /lib to the remote gdb, which in turn will only look libraries
> in staging/lib and never in staging/usr/lib.
> 
> So. the mreged (or non-merged) /usr setup must be replicated in the
> staging.
> 
> The best solution where to do so is in the skeleton package, since it
> is guaranteed to come before any package that installs things in the
> staging, and even before the (internal or external) toolchain as well.
> 
> Reported-by: Pieterjan Camerlynck <pieterjan.camerlynck@gmail.com>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Pieterjan Camerlynck <pieterjan.camerlynck@gmail.com>
> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
> Cc: Peter Korsgaard <jacmet@uclibc.org>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 However, this only applies to next - shouldn't we do this on master as well?
This will be the first time we release the merged /usr, so we should probably
get it right...


 Also...

> ---
>  Makefile                     |  9 ++-------
>  package/skeleton/skeleton.mk | 18 ++++++++++++++++++
>  2 files changed, 20 insertions(+), 7 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 71c6836..2809e00 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -456,14 +456,9 @@ else
>  LIB_SYMLINK = lib32
>  endif
>  
> +# Populating the staging with the base directories in handled by the skeleton package
>  $(STAGING_DIR):
> -	@mkdir -p $(STAGING_DIR)/bin
> -	@mkdir -p $(STAGING_DIR)/lib
> -	@ln -snf lib $(STAGING_DIR)/$(LIB_SYMLINK)
> -	@mkdir -p $(STAGING_DIR)/usr/lib
> -	@ln -snf lib $(STAGING_DIR)/usr/$(LIB_SYMLINK)
> -	@mkdir -p $(STAGING_DIR)/usr/include
> -	@mkdir -p $(STAGING_DIR)/usr/bin
> +	@mkdir -p $(STAGING_DIR)
>  	@ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
>  
>  RSYNC_VCS_EXCLUSIONS = \
> diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
> index b296cbd..205687c 100644
> --- a/package/skeleton/skeleton.mk
> +++ b/package/skeleton/skeleton.mk
> @@ -13,6 +13,9 @@ SKELETON_SOURCE =
>  # on skeleton.
>  SKELETON_ADD_TOOLCHAIN_DEPENDENCY = NO
>  
> +# The skeleton also handles the merged /usr case in the sysroot
> +SKELETON_INSTALL_STAGING = YES
> +
>  ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y)
>  
>  SKELETON_PATH = $(call qstrip,$(BR2_ROOTFS_SKELETON_CUSTOM_PATH))
> @@ -85,6 +88,21 @@ define SKELETON_INSTALL_TARGET_CMDS
>  		$(TARGET_DIR_WARNING_FILE)
>  endef
>  
> +# For the staging dir, we don't really care about /bin and /sbin.
> +# But for consistency with the target dir, and to simplify the code,
> +# we still handle them for the merged or non-merged /usr cases.
> +# Since the toolchain is not yet available, the staging is not yet
> +# populated, so we need to create the directories in /usr
> +define SKELETON_INSTALL_STAGING_CMDS
> +	$(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/lib
> +	$(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/bin
> +	$(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/sbin

 Perhaps this would be a good time to move this to the
SKELETON_USR_SYMLINKS_OR_DIRS macro and remove these directories from the skeleton.


 Regards,
 Arnout


> +	$(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include
> +	$(call SKELETON_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR))
> +	ln -snf lib $(STAGING_DIR)/$(LIB_SYMLINK)
> +	ln -snf lib $(STAGING_DIR)/usr/$(LIB_SYMLINK)
> +endef
> +
>  SKELETON_TARGET_GENERIC_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
>  SKELETON_TARGET_GENERIC_ISSUE = $(call qstrip,$(BR2_TARGET_GENERIC_ISSUE))
>  SKELETON_TARGET_GENERIC_ROOT_PASSWD = $(call qstrip,$(BR2_TARGET_GENERIC_ROOT_PASSWD))
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

  reply	other threads:[~2015-11-27 22:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 22:13 [Buildroot] [PATCH 0/2] core: use merged /usr in staging (branch merged-usr-staging) Yann E. MORIN
2015-11-26 22:13 ` [Buildroot] [PATCH 1/2] package/skeleton: parametrise the symlinks-or-mkdir macro Yann E. MORIN
2015-11-27 21:58   ` Arnout Vandecappelle
2015-11-27 22:50     ` Yann E. MORIN
2015-11-26 22:13 ` [Buildroot] [PATCH 2/2] package/skeleton: also handle merged /usr in the staging Yann E. MORIN
2015-11-27 22:34   ` Arnout Vandecappelle [this message]
2015-11-27 22:48     ` Yann E. MORIN
2015-11-28 16:46       ` Pieterjan Camerlynck
2015-11-28 22:10 ` [Buildroot] [PATCH 0/2] core: use merged /usr in staging (branch merged-usr-staging) Peter Korsgaard

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=5658DA6B.8040305@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /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 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.