Skip to contentSkip to conversation

system: add options for /bin /sbin and /lib to be symlinks into /usr

PATCH New Yann E. MORIN 6 participants 18 messages Sep 1, 2015 – Sep 3, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

systemd is incresaingly expected things to live in /usr/bin or /usr/sbin.

However, a lot of packages stil install stuff directly into /bin or /sbin.

Add an option so that /bin and /sbin be symlinks to /usr/bin and /usr/sbin. Ditto for .lib for consistency.

That option is forcibly enabled when the init system is systemd.

---
 package/skeleton/skeleton.mk | 17 ++++++++++++++++-
 system/Config.in             | 13 +++++++++++++
 system/skeleton/bin/.empty   |  0
 system/skeleton/lib/.empty   |  0
 system/skeleton/sbin/.empty  |  0
 5 files changed, 29 insertions(+), 1 deletion(-)
 delete mode 100644 system/skeleton/bin/.empty
 delete mode 100644 system/skeleton/lib/.empty
 delete mode 100644 system/skeleton/sbin/.empty
package/skeleton/skeleton.mk +16 -1
index 48e7085..173b485 100644
@@ -19,14 +19,29 @@ else
 SKELETON_PATH = system/skeleton
 endif
 
+ifeq ($(BR2_ROOTFS_USR_SYMLINKS),y)
+define SKELETON_USR_SYMLINKS
+	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_NO_USR_SYMLINKS
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/bin
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/sbin
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/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_NO_USR_SYMLINKS)
+	$(SKELETON_USR_SYMLINKS)
 	$(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
 		$(TARGET_DIR_WARNING_FILE)
 	ln -snf lib $(TARGET_DIR)/$(LIB_SYMLINK)
-	mkdir -p $(TARGET_DIR)/usr
 	ln -snf lib $(TARGET_DIR)/usr/$(LIB_SYMLINK)
 endef
 
system/Config.in +13 -0
index fad829d..96860d1 100644
@@ -88,6 +88,7 @@ config BR2_INIT_SYSTEMD
 	depends on BR2_USE_MMU
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
+	select BR2_ROOTFS_USR_SYMLINKS
 	select BR2_PACKAGE_SYSTEMD
 
 comment 'systemd needs an (e)glibc toolchain, headers >= 3.10'
@@ -178,6 +179,18 @@ endif
 
 if BR2_ROOTFS_SKELETON_DEFAULT
 
+config BR2_ROOTFS_USR_SYMLINKS
+	bool "Use symlinks to /usr for /bin, /sbin and /lib"
+	help
+	  If you say 'n' here, then /bin /sbin and /lib and their
+	  counterparts in /usr will be separate directories. This
+	  is the traditional UNIX way. In this case, /usr can be a
+	  partition separate from / .
+
+	  If you say 'y' here, then /bin /sbin and /lib will be symlinks
+	  to their counterparts in /usr. This is the new systemd way. In
+	  this case, /usr has to be on the / partition.
+
 config BR2_TARGET_ENABLE_ROOT_LOGIN
 	bool "Enable root login with password"
 	default y
system/skeleton/bin/.empty deleted +0 -0
deleted file mode 100644
index e69de29..0000000
system/skeleton/lib/.empty deleted +0 -0
deleted file mode 100644
index e69de29..0000000
system/skeleton/sbin/.empty deleted +0 -0
deleted file mode 100644
index e69de29..0000000
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

Hi Yann,

Quoted 2 lines · Yann E. MORIN

systemd is incresaingly expected things to live in /usr/bin or /usr/sbin.

s/expected/expecting/

Can you be more specific? What actually breaks?

baruch

Quoted 10 lines

However, a lot of packages stil install stuff directly into /bin or /sbin.

Add an option so that /bin and /sbin be symlinks to /usr/bin and /usr/sbin. Ditto for .lib for consistency.

That option is forcibly enabled when the init system is systemd.

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#2 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

In reply to Yann E. MORIN

Dear Yann E. MORIN,

Quoted 6 lines · Yann E. MORIN

systemd is incresaingly expected things to live in /usr/bin or /usr/sbin.

However, a lot of packages stil install stuff directly into /bin or /sbin.

Quoted 6 lines

Add an option so that /bin and /sbin be symlinks to /usr/bin and /usr/sbin. Ditto for .lib for consistency.

That option is forcibly enabled when the init system is systemd.

But do we actually need this? Vicente sent a patch to fix the systemd issues that were discussed on the list:

[PATCH] systemd: override the path for kill, sulogin, mount and umount

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

Quoted 12 lines · Thomas Petazzoni

Dear Yann E. MORIN,

Quoted 9 lines · Yann E. MORIN

systemd is incresaingly expected things to live in /usr/bin or /usr/sbin.

However, a lot of packages stil install stuff directly into /bin or /sbin.

Add an option so that /bin and /sbin be symlinks to /usr/bin and /usr/sbin. Ditto for .lib for consistency.

Quoted 9 lines
Quoted 3 lines

That option is forcibly enabled when the init system is systemd.

But do we actually need this? Vicente sent a patch to fix the systemd issues that were discussed on the list:

[PATCH] systemd: override the path for kill, sulogin, mount and umount

It's not just what systemd expects, many packages by default install their systemd-related items to /lib, etc. instead of /usr/lib, so we either have manual fixes to the .mk files for those packages or inconsistencies in where those items go. As an example, I believe rsyslog is passed a special flag setting its systemd install location to /usr/lib, and gpsd is still just installing to /lib/systemd/system.

It wouldn't surprise me if most of our systemd users had already merged their directories in their skeleton; I will probably do so soon as well.

Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20150902/aa8dc4b1/attachment.html>

#4 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

Dear Mike Williams,

Quoted 9 lines · Mike Williams

It's not just what systemd expects, many packages by default install their systemd-related items to /lib, etc. instead of /usr/lib, so we either have manual fixes to the .mk files for those packages or inconsistencies in where those items go. As an example, I believe rsyslog is passed a special flag setting its systemd install location to /usr/lib, and gpsd is still just installing to /lib/systemd/system.

It wouldn't surprise me if most of our systemd users had already merged their directories in their skeleton; I will probably do so soon as well.

Hum, right, I see. Then maybe Yann's patch is the right answer. In fact what I'd like to see in Buildroot is a group of people taking care of the systemd-related issues. So if you're willing (with others) to tackle that, it would be very useful. If you agree with Yann's patch, can you please test it and give your formal Tested-by/Reviewed-by?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

Quoted 23 lines · Thomas Petazzoni

Dear Mike Williams,

Quoted 1 line · Mike Williams

It's not just what systemd expects, many packages by default install

their

Quoted 1 line

systemd-related items to /lib, etc. instead of /usr/lib, so we either

have

Quoted 2 lines

manual fixes to the .mk files for those packages or inconsistencies in where those items go. As an example, I believe rsyslog is passed a

special

Quoted 5 lines

flag setting its systemd install location to /usr/lib, and gpsd is still just installing to /lib/systemd/system.

It wouldn't surprise me if most of our systemd users had already merged their directories in their skeleton; I will probably do so soon as well.

Hum, right, I see. Then maybe Yann's patch is the right answer. In fact what I'd like to see in Buildroot is a group of people taking care of the systemd-related issues. So if you're willing (with others) to tackle that, it would be very useful. If you agree with Yann's patch, can you please test it and give your formal Tested-by/Reviewed-by?

Quoted 4 lines

Thanks,

Thomas

Sure, I'll get it tested tomorrow.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20150902/fcd11db5/attachment.html>

#6 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

Mike, All,

On 2015-09-02 10:05 -0400, Mike Williams spake thusly:

Quoted 17 lines
Quoted 15 lines · Thomas Petazzoni

Dear Mike Williams,

Quoted 1 line · Mike Williams

It's not just what systemd expects, many packages by default install

their

Quoted 1 line

systemd-related items to /lib, etc. instead of /usr/lib, so we either

have

Quoted 2 lines

manual fixes to the .mk files for those packages or inconsistencies in where those items go. As an example, I believe rsyslog is passed a

special

Quoted 5 lines

flag setting its systemd install location to /usr/lib, and gpsd is still just installing to /lib/systemd/system.

It wouldn't surprise me if most of our systemd users had already merged their directories in their skeleton; I will probably do so soon as well.

Quoted 7 lines
Quoted 5 lines

Hum, right, I see. Then maybe Yann's patch is the right answer. In fact what I'd like to see in Buildroot is a group of people taking care of the systemd-related issues. So if you're willing (with others) to tackle that, it would be very useful. If you agree with Yann's patch, can you please test it and give your formal Tested-by/Reviewed-by?

Sure, I'll get it tested tomorrow.

Great, thanks! If you can think of a better commit log to suggest, then that would be great, too! ;-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#7 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

In reply to Thomas Petazzoni

Dear Thomas Petazzoni,

Quoted 20 lines · Thomas Petazzoni

Dear Mike Williams,

Quoted 9 lines · Mike Williams

It's not just what systemd expects, many packages by default install their systemd-related items to /lib, etc. instead of /usr/lib, so we either have manual fixes to the .mk files for those packages or inconsistencies in where those items go. As an example, I believe rsyslog is passed a special flag setting its systemd install location to /usr/lib, and gpsd is still just installing to /lib/systemd/system.

It wouldn't surprise me if most of our systemd users had already merged their directories in their skeleton; I will probably do so soon as well.

Hum, right, I see. Then maybe Yann's patch is the right answer. In fact what I'd like to see in Buildroot is a group of people taking care of the systemd-related issues. So if you're willing (with others) to tackle that, it would be very useful. If you agree with Yann's patch, can you please test it and give your formal Tested-by/Reviewed-by?

Quoted 4 lines

Thanks,

Thomas

and what about also selecting BR2_ROOTFS_USR_SYMLINKS in systemd's Config.in?

Regards,

Vincent.

#8 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

Vincent, All,

On 2015-09-02 15:07 +0100, Vicente Olivert Riera spake thusly:

Quoted 21 lines · Thomas Petazzoni
Quoted 20 lines

Dear Mike Williams,

Quoted 9 lines · Mike Williams

It's not just what systemd expects, many packages by default install their systemd-related items to /lib, etc. instead of /usr/lib, so we either have manual fixes to the .mk files for those packages or inconsistencies in where those items go. As an example, I believe rsyslog is passed a special flag setting its systemd install location to /usr/lib, and gpsd is still just installing to /lib/systemd/system.

It wouldn't surprise me if most of our systemd users had already merged their directories in their skeleton; I will probably do so soon as well.

Hum, right, I see. Then maybe Yann's patch is the right answer. In fact what I'd like to see in Buildroot is a group of people taking care of the systemd-related issues. So if you're willing (with others) to tackle that, it would be very useful. If you agree with Yann's patch, can you please test it and give your formal Tested-by/Reviewed-by?

Quoted 7 lines
Quoted 4 lines

Thanks,

Thomas

and what about also selecting BR2_ROOTFS_USR_SYMLINKS in systemd's Config.in?

It's already done by BR2_INIT_SYSTEMD.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#9 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

In reply to Vicente Olivert Riera

Dear Vicente Olivert Riera,

Quoted 2 lines · Vicente Olivert Riera

and what about also selecting BR2_ROOTFS_USR_SYMLINKS in systemd's Config.in?

From Yann's patch:

@@ -88,6 +88,7 @@ config BR2_INIT_SYSTEMD
depends on BR2_USE_MMU
depends on !BR2_STATIC_LIBS
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
+ select BR2_ROOTFS_USR_SYMLINKS
select BR2_PACKAGE_SYSTEMD

Isn't that enough?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#10 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

Dear all,

Quoted 16 lines · Thomas Petazzoni

Dear Vicente Olivert Riera,

Quoted 2 lines · Vicente Olivert Riera

and what about also selecting BR2_ROOTFS_USR_SYMLINKS in systemd's Config.in?

From Yann's patch:

system/Config.in +1 -0
@@ -88,6 +88,7 @@ config BR2_INIT_SYSTEMD
 	depends on BR2_USE_MMU
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
+	select BR2_ROOTFS_USR_SYMLINKS
 	select BR2_PACKAGE_SYSTEMD
 
Quoted 1 line

Isn't that enough?

Shame on me. I missed that part of the patch, sorry.

Regards,

Vincent.

Quoted 2 lines

Thomas

#11 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

In reply to Yann E. MORIN
Quoted 1 line · Yann E. MORIN

systemd is incresaingly expected things to live in /usr/bin or

increasingly

Quoted 3 lines

/usr/sbin.

However, a lot of packages stil install stuff directly into /bin or

still

Quoted 3 lines

/sbin.

Add an option so that /bin and /sbin be symlinks to /usr/bin and

be -> are

Quoted 1 line

/usr/sbin. Ditto for .lib for consistency.

.lib -> /lib

In reality, this option is only tangentially related to systemd. Rather, it's a
Fedora feature [1] that was taken over by Lennart P. and therefore by systemd [2]. A better name for the feature is "merged /usr".

Quoted 20 lines

That option is forcibly enabled when the init system is systemd.

---
 package/skeleton/skeleton.mk | 17 ++++++++++++++++-
 system/Config.in             | 13 +++++++++++++
 system/skeleton/bin/.empty   |  0
 system/skeleton/lib/.empty   |  0
 system/skeleton/sbin/.empty  |  0
 5 files changed, 29 insertions(+), 1 deletion(-)
 delete mode 100644 system/skeleton/bin/.empty
 delete mode 100644 system/skeleton/lib/.empty
 delete mode 100644 system/skeleton/sbin/.empty
package/skeleton/skeleton.mk +0 -0
index 48e7085..173b485 100644
@@ -19,14 +19,29 @@ else
 SKELETON_PATH = system/skeleton

package/skeleton/skeleton.mk else · line 29

Quoted 10 lines
package/skeleton/skeleton.mk +8 -0
 endif
 
+ifeq ($(BR2_ROOTFS_USR_SYMLINKS),y)
+define SKELETON_USR_SYMLINKS
+	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_NO_USR_SYMLINKS

I would define only a single variable: SKELETON_USR_SYMLINKS_OR_DIRECTORIES.

Quoted 32 lines
package/skeleton/skeleton.mk +8 -1
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/bin
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/sbin
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/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_NO_USR_SYMLINKS)
+	$(SKELETON_USR_SYMLINKS)
 	$(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
 		$(TARGET_DIR_WARNING_FILE)
 	ln -snf lib $(TARGET_DIR)/$(LIB_SYMLINK)
-	mkdir -p $(TARGET_DIR)/usr
 	ln -snf lib $(TARGET_DIR)/usr/$(LIB_SYMLINK)
 endef
 
system/Config.in +1 -0
index fad829d..96860d1 100644
@@ -88,6 +88,7 @@ config BR2_INIT_SYSTEMD
 	depends on BR2_USE_MMU
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
+	select BR2_ROOTFS_USR_SYMLINKS
 	select BR2_PACKAGE_SYSTEMD
 
 comment 'systemd needs an (e)glibc toolchain, headers >= 3.10'

system/Config.in endif · line 183

Quoted 5 lines
system/Config.in +2 -0
@@ -178,6 +179,18 @@ endif
 
 if BR2_ROOTFS_SKELETON_DEFAULT
 
+config BR2_ROOTFS_USR_SYMLINKS
+	bool "Use symlinks to /usr for /bin, /sbin and /lib"

I like this summary!

system/Config.in endif · line 190

Quoted 7 lines
system/Config.in +7 -0
+	help
+	  If you say 'n' here, then /bin /sbin and /lib and their
+	  counterparts in /usr will be separate directories. This
+	  is the traditional UNIX way. In this case, /usr can be a
+	  partition separate from / .
+
+	  If you say 'y' here, then /bin /sbin and /lib will be symlinks

If you say 'y' here, then /bin, /sbin and /lib will be merged to their
counterparts in /usr and replaced by symlinks.

system/Config.in endif · line 191

Quoted 1 line
system/Config.in +1 -0
+	  to their counterparts in /usr. This is the new systemd way. In

There's not much point to refer to systemd here, since it is forcibly selected
in the systemd case.

system/Config.in endif · line 192

Quoted 1 line
system/Config.in +1 -0
+	  this case, /usr has to be on the / partition.

/usr cannot be a separate filesystem.

BTW I wouldn't mind if this option would default to y eventually. I've been
doing this (using a custom skeleton) for quite a while now.

Regards,
Arnout

system/skeleton/sbin/.empty

Quoted 14 lines
system/Config.in +1 -0
+
 config BR2_TARGET_ENABLE_ROOT_LOGIN
 	bool "Enable root login with password"
 	default y
system/skeleton/bin/.empty deleted +0 -0
deleted file mode 100644
index e69de29..0000000
system/skeleton/lib/.empty deleted +0 -0
deleted file mode 100644
index e69de29..0000000
system/skeleton/sbin/.empty deleted +0 -0
deleted file mode 100644
index e69de29..0000000

[1] https://fedoraproject.org/wiki/Features/UsrMove
[2] http://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge

Signature · 6 lines
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
#12 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

Quoted 13 lines · Arnout Vandecappelle
Quoted 1 line · Yann E. MORIN

systemd is incresaingly expected things to live in /usr/bin or

increasingly

Quoted 3 lines

/usr/sbin.

However, a lot of packages stil install stuff directly into /bin or

still

Quoted 2 lines

/sbin.

Quoted 7 lines
Quoted 1 line

Add an option so that /bin and /sbin be symlinks to /usr/bin and

be -> are

Quoted 1 line

/usr/sbin. Ditto for .lib for consistency.

.lib -> /lib

One more thing: it would be good to mention explicitly in the commit log that
/lib64 (or /lib32 or /libx32) doesn't need to be handled because that is already a symlink to lib.

Regards,
Arnout

[snip]

Signature · 6 lines
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
#13 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

Arnout, All,

On 2015-09-02 23:17 +0200, Arnout Vandecappelle spake thusly:

Quoted 8 lines · Arnout Vandecappelle
Quoted 7 lines · Yann E. MORIN
Quoted 6 lines

systemd is incresaingly expected things to live in /usr/bin or /usr/sbin.

However, a lot of packages stil install stuff directly into /bin or /sbin.

Quoted 6 lines
Quoted 2 lines
Quoted 2 lines

Add an option so that /bin and /sbin be symlinks to /usr/bin and /usr/sbin. Ditto for .lib for consistency.

One more thing: it would be good to mention explicitly in the commit log that
/lib64 (or /lib32 or /libx32) doesn't need to be handled because that is already a symlink to lib.

Yeah, I almost mentionned them, but refrained from doing so, as I thought it was already well-known that they were synlinks already.

But I'll add this before I resubmit.

Thanks! :-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#14 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

Yann,

Quoted 15 lines · Yann E. MORIN

Arnout, All,

On 2015-09-02 23:17 +0200, Arnout Vandecappelle spake thusly:

Quoted 11 lines · Arnout Vandecappelle
Quoted 9 lines · Yann E. MORIN
Quoted 8 lines

systemd is incresaingly expected things to live in /usr/bin or /usr/sbin.

However, a lot of packages stil install stuff directly into /bin or /sbin.

Add an option so that /bin and /sbin be symlinks to /usr/bin and /usr/sbin. Ditto for .lib for consistency.

Quoted 8 lines
Quoted 3 lines

One more thing: it would be good to mention explicitly in the commit log that
/lib64 (or /lib32 or /libx32) doesn't need to be handled because that is already a symlink to lib.

Yeah, I almost mentionned them, but refrained from doing so, as I thought it was already well-known that they were synlinks already.

But I'll add this before I resubmit.

The systemd build failed for me unless I modified systemd.mk as such:

-- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -28,7 +28,6 @@ endif

SYSTEMD_CONF_OPTS += \
       --with-rootprefix= \
-       --with-rootlibdir=/lib \
       --enable-static=no \
       --disable-manpages \
       --disable-selinux \
@@ -37,7 +36,6 @@ SYSTEMD_CONF_OPTS += \
       --with-dbuspolicydir=/etc/dbus-1/system.d \
       --with-dbussessionservicedir=/usr/share/dbus-1/services \
       --with-dbussystemservicedir=/usr/share/dbus-1/system-services \
-       --enable-split-usr \
       --disable-efi \
       --disable-gnuefi \
       --disable-tests \

Once those changes were made everything worked fine so feel free to add my Tested-by: Mike Williams <[email protected]> if your next patch spin includes them.

Mike

#15 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

Dear Yann E. MORIN,

Quoted 22 lines · Mike Williams

Yann,

Quoted 19 lines · Yann E. MORIN

Arnout, All,

On 2015-09-02 23:17 +0200, Arnout Vandecappelle spake thusly:

Quoted 14 lines · Arnout Vandecappelle
Quoted 9 lines · Yann E. MORIN
Quoted 8 lines

systemd is incresaingly expected things to live in /usr/bin or /usr/sbin.

However, a lot of packages stil install stuff directly into /bin or /sbin.

Add an option so that /bin and /sbin be symlinks to /usr/bin and /usr/sbin. Ditto for .lib for consistency.

One more thing: it would be good to mention explicitly in the commit log that
/lib64 (or /lib32 or /libx32) doesn't need to be handled because that is already a symlink to lib.

Quoted 7 lines
Quoted 4 lines

Yeah, I almost mentionned them, but refrained from doing so, as I thought it was already well-known that they were synlinks already.

But I'll add this before I resubmit.

The systemd build failed for me unless I modified systemd.mk as such:

same problem here:

mv:
/home/ldap/vriera/git-clones/buildroot-1/output/target/usr/lib/libsystemd.so.0' and /home/ldap/vriera/git-clones/buildroot-1/output/target/lib/libsystemd.so.0' are the same file
mv:
/home/ldap/vriera/git-clones/buildroot-1/output/target/usr/lib/libsystemd.so.0.8.0' and /home/ldap/vriera/git-clones/buildroot-1/output/target/lib/libsystemd.so.0.8.0' are the same file
make[5]: *** [libsystemd-install-hook] Error 1

Quoted 19 lines

-- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk

(quoted diff) +0 -2
@@ -28,7 +28,6 @@ endif
 
 SYSTEMD_CONF_OPTS += \
       --with-rootprefix= \
-       --with-rootlibdir=/lib \
       --enable-static=no \
       --disable-manpages \
       --disable-selinux \
@@ -37,7 +36,6 @@ SYSTEMD_CONF_OPTS += \
       --with-dbuspolicydir=/etc/dbus-1/system.d \
       --with-dbussessionservicedir=/usr/share/dbus-1/services \
       --with-dbussystemservicedir=/usr/share/dbus-1/system-services \
-       --enable-split-usr \
       --disable-efi \
       --disable-gnuefi \
       --disable-tests \
Quoted 3 lines

Once those changes were made everything worked fine so feel free to add my Tested-by: Mike Williams <[email protected]> if your next patch spin includes them.

But I only needed to remove the "--with-rootlibdir=/lib \" line to make it build fine.

Regards,

Vincent.

Quoted 6 lines

Mike
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#16 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

Mike, Vincent, All,

On 2015-09-03 16:12 +0100, Vicente Olivert Riera spake thusly:

Quoted 47 lines · Mike Williams
Quoted 5 lines · Yann E. MORIN
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines · Yann E. MORIN
Quoted 3 lines

systemd is incresaingly expected things to live in /usr/bin or /usr/sbin.

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

However, a lot of packages stil install stuff directly into /bin or /sbin.

Add an option so that /bin and /sbin be symlinks to /usr/bin and /usr/sbin. Ditto for .lib for consistency.

The systemd build failed for me unless I modified systemd.mk as such:

same problem here:

mv:
/home/ldap/vriera/git-clones/buildroot-1/output/target/usr/lib/libsystemd.so.0' and /home/ldap/vriera/git-clones/buildroot-1/output/target/lib/libsystemd.so.0' are the same file
mv:
/home/ldap/vriera/git-clones/buildroot-1/output/target/usr/lib/libsystemd.so.0.8.0' and /home/ldap/vriera/git-clones/buildroot-1/output/target/lib/libsystemd.so.0.8.0' are the same file
make[5]: *** [libsystemd-install-hook] Error 1

Quoted 19 lines

-- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk

(quoted diff) +0 -2
@@ -28,7 +28,6 @@ endif
 
 SYSTEMD_CONF_OPTS += \
       --with-rootprefix= \
-       --with-rootlibdir=/lib \
       --enable-static=no \
       --disable-manpages \
       --disable-selinux \
@@ -37,7 +36,6 @@ SYSTEMD_CONF_OPTS += \
       --with-dbuspolicydir=/etc/dbus-1/system.d \
       --with-dbussessionservicedir=/usr/share/dbus-1/services \
       --with-dbussystemservicedir=/usr/share/dbus-1/system-services \
-       --enable-split-usr \
       --disable-efi \
       --disable-gnuefi \
       --disable-tests \
Quoted 6 lines
Quoted 3 lines

Once those changes were made everything worked fine so feel free to add my Tested-by: Mike Williams <[email protected]> if your next patch spin includes them.

But I only needed to remove the "--with-rootlibdir=/lib \" line to make it build fine.

Well, since we're effectively ditching the split-usr case, there's no reason to keep the --enable-split-usr configure option, is there?

Anyway, thanks both for testing! :-)

Mike, I won't carry your reviewd and tested tags, since I've made quite some changes after all the comments, so that would not be fair to list a review and test which would not have been conducted on the new code. However, that's much appreciated! :-) Do not hesitate to retest the new version when I send it (soonish). Thanks! :-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#17 lore raw

PATCH 1/1 system: add options for /bin /sbin and /lib to be symlinks into /usr

In reply to Arnout Vandecappelle

Arnout, All,

On 2015-09-02 22:59 +0200, Arnout Vandecappelle spake thusly:

Quoted 3 lines · Yann E. MORIN
Quoted 1 line

systemd is incresaingly expected things to live in /usr/bin or

increasingly

Yup, as noted by Baruch.

Quoted 4 lines
Quoted 3 lines

/usr/sbin.

However, a lot of packages stil install stuff directly into /bin or

still

Yup.

Quoted 4 lines
Quoted 3 lines

/sbin.

Add an option so that /bin and /sbin be symlinks to /usr/bin and

be -> are

Nope, this is subjunctive. ;-)

https://en.wikipedia.org/wiki/Subjunctive_mood

Subjunctives occur most often, although not exclusively, in subordinate clauses, particularly that-clauses. Examples of subjunctive use can be found in the English sentences "I suggest that you be careful" [...]

Quoted 2 lines
Quoted 1 line

/usr/sbin. Ditto for .lib for consistency.

.lib -> /lib

Yup.

Quoted 3 lines

In reality, this option is only tangentially related to systemd. Rather, it's a
Fedora feature [1] that was taken over by Lennart P. and therefore by systemd [2]. A better name for the feature is "merged /usr".

ACK, thanks for the history lesson. :-)

/me has laways been pretty bad in history.
/me is ready to trade history lessons for grammatical lessons. But not ortograph, as it seems, nor typing lessons. ;-)

[--SNIP--]

Quoted 10 lines

package/skeleton/skeleton.mk else · line 29

Quoted 8 lines
package/skeleton/skeleton.mk +8 -0
+ifeq ($(BR2_ROOTFS_USR_SYMLINKS),y)
+define SKELETON_USR_SYMLINKS
+	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_NO_USR_SYMLINKS

I would define only a single variable: SKELETON_USR_SYMLINKS_OR_DIRECTORIES.

Yeah, I wandered between the two options: a single variable or two. Since I could not find a good name for the single-variable solution, I went for two variables.

I'll switch (and maybe rename the variable to SKELETON_USR_SYMLINKS_OR_DIRS.

[--SNIP--]

Quoted 8 lines

system/Config.in endif · line 183

Quoted 6 lines
system/Config.in +2 -0
@@ -178,6 +179,18 @@ endif
 
 if BR2_ROOTFS_SKELETON_DEFAULT
 
+config BR2_ROOTFS_USR_SYMLINKS
+	bool "Use symlinks to /usr for /bin, /sbin and /lib"

I like this summary!

Thanks! ;-)

Quoted 10 lines

system/Config.in endif · line 190

Quoted 7 lines
system/Config.in +7 -0
+	help
+	  If you say 'n' here, then /bin /sbin and /lib and their
+	  counterparts in /usr will be separate directories. This
+	  is the traditional UNIX way. In this case, /usr can be a
+	  partition separate from / .
+
+	  If you say 'y' here, then /bin /sbin and /lib will be symlinks

If you say 'y' here, then /bin, /sbin and /lib will be merged to their
counterparts in /usr and replaced by symlinks.

It's not that they will be merged, since we do not install things in /bin and /sbin, and them merge the two; they are one from the beginning.

So, I'm a bit uneasy at using 'merge' in this case.

Quoted 4 lines

system/Config.in endif · line 191

Quoted 1 line
system/Config.in +1 -0
+	  to their counterparts in /usr. This is the new systemd way. In

There's not much point to refer to systemd here, since it is forcibly selected
in the systemd case.

After reading what you said above: ACK.

Quoted 3 lines

system/Config.in endif · line 192

Quoted 1 line
system/Config.in +1 -0
+	  this case, /usr has to be on the / partition.

/usr cannot be a separate filesystem.

ACK.

Quoted 2 lines

BTW I wouldn't mind if this option would default to y eventually. I've been
doing this (using a custom skeleton) for quite a while now.

Well, I certainly know some caes where /usr is a separate partition, and defaulting that option to 'y' would break the unsuspecting users.

I'd rather we keep it 'n' at least for the foreseeable future (1 year?)

Quoted 2 lines

[1] https://fedoraproject.org/wiki/Features/UsrMove
[2] http://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge

Thanks! :-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'