Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] core: use merged /usr in staging (branch merged-usr-staging)
@ 2015-11-26 22:13 Yann E. MORIN
  2015-11-26 22:13 ` [Buildroot] [PATCH 1/2] package/skeleton: parametrise the symlinks-or-mkdir macro Yann E. MORIN
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Yann E. MORIN @ 2015-11-26 22:13 UTC (permalink / raw)
  To: buildroot

Hello All!

As reported by Pieterjan, when doing remote debugging with gdbserver on
a merged /usr setup, the remote gdb would only look for libraries in
staging/lib and never in staging/usr/lib.

This series replicates in staging the same merged /usr handling as we
have for target/.

This is implemented in the skeleton package, as it is the only easy
place that is guaranteed to be before all other packages *and* before
the toolchains.

Regards,
Yann E. MORIN.


The following changes since commit 66fb7028ed2779fcba45221143d6d2c5b9084303:

  strongswan: bump to version 5.3.5 (2015-11-26 21:23:18 +0100)

are available in the git repository at:

  git://git.busybox.net/~ymorin/git/buildroot merged-usr-staging

for you to fetch changes up to 0934812eeec64cb2cdc2b7600879b53695859652:

  package/skeleton: also handle merged /usr in the staging (2015-11-26 23:00:48 +0100)

----------------------------------------------------------------
Yann E. MORIN (2):
      package/skeleton: parametrise the symlinks-or-mkdir macro
      package/skeleton: also handle merged /usr in the staging

 Makefile                     |  9 ++------
 package/skeleton/skeleton.mk | 49 ++++++++++++++++++++++++++++++--------------
 2 files changed, 36 insertions(+), 22 deletions(-)

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 1/2] package/skeleton: parametrise the symlinks-or-mkdir macro
  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 ` Yann E. MORIN
  2015-11-27 21:58   ` Arnout Vandecappelle
  2015-11-26 22:13 ` [Buildroot] [PATCH 2/2] package/skeleton: also handle merged /usr in the staging Yann E. MORIN
  2015-11-28 22:10 ` [Buildroot] [PATCH 0/2] core: use merged /usr in staging (branch merged-usr-staging) Peter Korsgaard
  2 siblings, 1 reply; 9+ messages in thread
From: Yann E. MORIN @ 2015-11-26 22:13 UTC (permalink / raw)
  To: buildroot

currently, we only make the merged symlinks or non-merged mkdirs in the
target directory. This is fine, as long as one does not run gdb.

However, as soon as one wants to run gdb (or gdbserver) on the target,
gdb will only search for libraries in /lib in the sysroot.

In preparation for a patch to fix that, make the symlink-or-mkdir macro
a function that takes as parameter the base directory where to create
symlinks or mkdir in.

Move the function declarations our of the custom/non-custom skeleton
conditional block, so they are always available.

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>
---
 package/skeleton/skeleton.mk | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
index 46e8cc4..b296cbd 100644
--- a/package/skeleton/skeleton.mk
+++ b/package/skeleton/skeleton.mk
@@ -57,27 +57,28 @@ else # ! custom skeleton
 
 SKELETON_PATH = system/skeleton
 
-ifeq ($(BR2_ROOTFS_MERGED_USR),y)
-define SKELETON_USR_SYMLINKS_OR_DIRS
-	ln -snf usr/bin $(TARGET_DIR)/bin
-	ln -snf usr/sbin $(TARGET_DIR)/sbin
-	ln -snf usr/lib $(TARGET_DIR)/lib
-endef
-else
-define SKELETON_USR_SYMLINKS_OR_DIRS
-	$(INSTALL) -d -m 0755 $(TARGET_DIR)/bin
-	$(INSTALL) -d -m 0755 $(TARGET_DIR)/sbin
-	$(INSTALL) -d -m 0755 $(TARGET_DIR)/lib
-endef
-endif
-
 endif # ! custom skeleton
 
+# This function handles the merged or non-merged /usr cases
+ifeq ($(BR2_ROOTFS_MERGED_USR),y)
+define SKELETON_USR_SYMLINKS_OR_DIRS
+	ln -snf usr/bin $(1)/bin
+	ln -snf usr/sbin $(1)/sbin
+	ln -snf usr/lib $(1)/lib
+endef
+else
+define SKELETON_USR_SYMLINKS_OR_DIRS
+	$(INSTALL) -d -m 0755 $(1)/bin
+	$(INSTALL) -d -m 0755 $(1)/sbin
+	$(INSTALL) -d -m 0755 $(1)/lib
+endef
+endif
+
 define SKELETON_INSTALL_TARGET_CMDS
 	rsync -a --ignore-times $(SYNC_VCS_EXCLUSIONS) \
 		--chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
 		$(SKELETON_PATH)/ $(TARGET_DIR)/
-	$(SKELETON_USR_SYMLINKS_OR_DIRS)
+	$(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
 	ln -snf lib $(TARGET_DIR)/$(LIB_SYMLINK)
 	ln -snf lib $(TARGET_DIR)/usr/$(LIB_SYMLINK)
 	$(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
-- 
1.9.1

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

* [Buildroot] [PATCH 2/2] package/skeleton: also handle merged /usr in the staging
  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-26 22:13 ` Yann E. MORIN
  2015-11-27 22:34   ` Arnout Vandecappelle
  2015-11-28 22:10 ` [Buildroot] [PATCH 0/2] core: use merged /usr in staging (branch merged-usr-staging) Peter Korsgaard
  2 siblings, 1 reply; 9+ messages in thread
From: Yann E. MORIN @ 2015-11-26 22:13 UTC (permalink / raw)
  To: buildroot

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>
---
 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
+	$(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))
-- 
1.9.1

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

* [Buildroot] [PATCH 1/2] package/skeleton: parametrise the symlinks-or-mkdir macro
  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
  0 siblings, 1 reply; 9+ messages in thread
From: Arnout Vandecappelle @ 2015-11-27 21:58 UTC (permalink / raw)
  To: buildroot

On 26-11-15 23:13, Yann E. MORIN wrote:
> currently, we only make the merged symlinks or non-merged mkdirs in the
> target directory. This is fine, as long as one does not run gdb.
> 
> However, as soon as one wants to run gdb (or gdbserver) on the target,
> gdb will only search for libraries in /lib in the sysroot.
> 
> In preparation for a patch to fix that, make the symlink-or-mkdir macro
> a function that takes as parameter the base directory where to create
> symlinks or mkdir in.
> 
> Move the function declarations our of the custom/non-custom skeleton
> conditional block, so they are always available.
> 
> 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>

 But...

> ---
>  package/skeleton/skeleton.mk | 31 ++++++++++++++++---------------
>  1 file changed, 16 insertions(+), 15 deletions(-)
> 
> diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
> index 46e8cc4..b296cbd 100644
> --- a/package/skeleton/skeleton.mk
> +++ b/package/skeleton/skeleton.mk
> @@ -57,27 +57,28 @@ else # ! custom skeleton
>  
>  SKELETON_PATH = system/skeleton
>  
> -ifeq ($(BR2_ROOTFS_MERGED_USR),y)
> -define SKELETON_USR_SYMLINKS_OR_DIRS
> -	ln -snf usr/bin $(TARGET_DIR)/bin
> -	ln -snf usr/sbin $(TARGET_DIR)/sbin
> -	ln -snf usr/lib $(TARGET_DIR)/lib
> -endef
> -else
> -define SKELETON_USR_SYMLINKS_OR_DIRS
> -	$(INSTALL) -d -m 0755 $(TARGET_DIR)/bin
> -	$(INSTALL) -d -m 0755 $(TARGET_DIR)/sbin
> -	$(INSTALL) -d -m 0755 $(TARGET_DIR)/lib
> -endef
> -endif
> -
>  endif # ! custom skeleton
>  
> +# This function handles the merged or non-merged /usr cases
> +ifeq ($(BR2_ROOTFS_MERGED_USR),y)
> +define SKELETON_USR_SYMLINKS_OR_DIRS

 We usually make functions lowercase rather than uppercase, although there are
notable exceptions like MESSAGE and UPPERCASE.

 But since it's specific to the skeleton package, it's probably better to keep
it uppercase.

 Regards,
 Arnout

> +	ln -snf usr/bin $(1)/bin
> +	ln -snf usr/sbin $(1)/sbin
> +	ln -snf usr/lib $(1)/lib
> +endef
> +else
> +define SKELETON_USR_SYMLINKS_OR_DIRS
> +	$(INSTALL) -d -m 0755 $(1)/bin
> +	$(INSTALL) -d -m 0755 $(1)/sbin
> +	$(INSTALL) -d -m 0755 $(1)/lib
> +endef
> +endif
> +
>  define SKELETON_INSTALL_TARGET_CMDS
>  	rsync -a --ignore-times $(SYNC_VCS_EXCLUSIONS) \
>  		--chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
>  		$(SKELETON_PATH)/ $(TARGET_DIR)/
> -	$(SKELETON_USR_SYMLINKS_OR_DIRS)
> +	$(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
>  	ln -snf lib $(TARGET_DIR)/$(LIB_SYMLINK)
>  	ln -snf lib $(TARGET_DIR)/usr/$(LIB_SYMLINK)
>  	$(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
> 


-- 
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

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

* [Buildroot] [PATCH 2/2] package/skeleton: also handle merged /usr in the staging
  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
  2015-11-27 22:48     ` Yann E. MORIN
  0 siblings, 1 reply; 9+ messages in thread
From: Arnout Vandecappelle @ 2015-11-27 22:34 UTC (permalink / raw)
  To: buildroot

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

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

* [Buildroot] [PATCH 2/2] package/skeleton: also handle merged /usr in the staging
  2015-11-27 22:34   ` Arnout Vandecappelle
@ 2015-11-27 22:48     ` Yann E. MORIN
  2015-11-28 16:46       ` Pieterjan Camerlynck
  0 siblings, 1 reply; 9+ messages in thread
From: Yann E. MORIN @ 2015-11-27 22:48 UTC (permalink / raw)
  To: buildroot

Arnout, All,

On 2015-11-27 23:34 +0100, Arnout Vandecappelle spake thusly:
> 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...

Hmmm... Surely this patch was done against master, not next. Or did I
foobared my tree?... ;-)

Yes, I'd like we get that in master, but I'd like some testing first (of
course, I did my homework, but a note from the reporter would have been
great, too).

>  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.

*That* would be for next. Or after the release, since it's so close...

Thanks! :-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 1/2] package/skeleton: parametrise the symlinks-or-mkdir macro
  2015-11-27 21:58   ` Arnout Vandecappelle
@ 2015-11-27 22:50     ` Yann E. MORIN
  0 siblings, 0 replies; 9+ messages in thread
From: Yann E. MORIN @ 2015-11-27 22:50 UTC (permalink / raw)
  To: buildroot

Arnout, All,

On 2015-11-27 22:58 +0100, Arnout Vandecappelle spake thusly:
> On 26-11-15 23:13, Yann E. MORIN wrote:
> > currently, we only make the merged symlinks or non-merged mkdirs in the
> > target directory. This is fine, as long as one does not run gdb.
> > 
> > However, as soon as one wants to run gdb (or gdbserver) on the target,
> > gdb will only search for libraries in /lib in the sysroot.
> > 
> > In preparation for a patch to fix that, make the symlink-or-mkdir macro
> > a function that takes as parameter the base directory where to create
> > symlinks or mkdir in.
> > 
> > Move the function declarations our of the custom/non-custom skeleton
> > conditional block, so they are always available.
> > 
> > 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>
> 
>  But...
> 
> > ---
> >  package/skeleton/skeleton.mk | 31 ++++++++++++++++---------------
> >  1 file changed, 16 insertions(+), 15 deletions(-)
> > 
> > diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
> > index 46e8cc4..b296cbd 100644
> > --- a/package/skeleton/skeleton.mk
> > +++ b/package/skeleton/skeleton.mk
> > @@ -57,27 +57,28 @@ else # ! custom skeleton
> >  
> >  SKELETON_PATH = system/skeleton
> >  
> > -ifeq ($(BR2_ROOTFS_MERGED_USR),y)
> > -define SKELETON_USR_SYMLINKS_OR_DIRS
> > -	ln -snf usr/bin $(TARGET_DIR)/bin
> > -	ln -snf usr/sbin $(TARGET_DIR)/sbin
> > -	ln -snf usr/lib $(TARGET_DIR)/lib
> > -endef
> > -else
> > -define SKELETON_USR_SYMLINKS_OR_DIRS
> > -	$(INSTALL) -d -m 0755 $(TARGET_DIR)/bin
> > -	$(INSTALL) -d -m 0755 $(TARGET_DIR)/sbin
> > -	$(INSTALL) -d -m 0755 $(TARGET_DIR)/lib
> > -endef
> > -endif
> > -
> >  endif # ! custom skeleton
> >  
> > +# This function handles the merged or non-merged /usr cases
> > +ifeq ($(BR2_ROOTFS_MERGED_USR),y)
> > +define SKELETON_USR_SYMLINKS_OR_DIRS
> 
>  We usually make functions lowercase rather than uppercase, although there are
> notable exceptions like MESSAGE and UPPERCASE.

Well, one may argue that hooks are functions like any other, and we
write them in upper-case.

So yes, we usually write lower-case functions in the infras. But
(almost?) everything in packages is upper-case, so I think it is
best to not get diverge too much to what we do in other packages.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 2/2] package/skeleton: also handle merged /usr in the staging
  2015-11-27 22:48     ` Yann E. MORIN
@ 2015-11-28 16:46       ` Pieterjan Camerlynck
  0 siblings, 0 replies; 9+ messages in thread
From: Pieterjan Camerlynck @ 2015-11-28 16:46 UTC (permalink / raw)
  To: buildroot

Yann,

Sorry for the delay. I've tested the patch and everything seems ok to me.

Thanks!
Pieterjan

2015-11-27 23:48 GMT+01:00 Yann E. MORIN <yann.morin.1998@free.fr>:
> Arnout, All,
>
> On 2015-11-27 23:34 +0100, Arnout Vandecappelle spake thusly:
>> 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...
>
> Hmmm... Surely this patch was done against master, not next. Or did I
> foobared my tree?... ;-)
>
> Yes, I'd like we get that in master, but I'd like some testing first (of
> course, I did my homework, but a note from the reporter would have been
> great, too).
>
>>  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.
>
> *That* would be for next. Or after the release, since it's so close...
>
> Thanks! :-)
>
> Regards,
> Yann E. MORIN.
>
> --
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 0/2] core: use merged /usr in staging (branch merged-usr-staging)
  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-26 22:13 ` [Buildroot] [PATCH 2/2] package/skeleton: also handle merged /usr in the staging Yann E. MORIN
@ 2015-11-28 22:10 ` Peter Korsgaard
  2 siblings, 0 replies; 9+ messages in thread
From: Peter Korsgaard @ 2015-11-28 22:10 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Hello All!
 > As reported by Pieterjan, when doing remote debugging with gdbserver on
 > a merged /usr setup, the remote gdb would only look for libraries in
 > staging/lib and never in staging/usr/lib.

 > This series replicates in staging the same merged /usr handling as we
 > have for target/.

 > This is implemented in the skeleton package, as it is the only easy
 > place that is guaranteed to be before all other packages *and* before
 > the toolchains.

Committed series, thanks.

-- 
Bye, Peter Korsgaard

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

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

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox