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 16 messages Sep 3, 2015 – Oct 7, 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 increasingly expecting things to live in /usr/bin or /usr/sbin. It has inherited those expectations from a Fedora change:
https://fedoraproject.org/wiki/Features/UsrMove

Note however, that systemd does support /usr being on a separate filesystem; it just expects an initramfs to mount it before the final switchroot over to the actual rootfs.

But the traditional use-case for Buildroot is not to boot with an initramfs; although that is totally feasible, that's probably not what is commonly done in the vast majority of cases.

However, a lot of packages still install stuff directly into /bin or /sbin, which systemd may need early-on in the boot process, even before it may have a chance to mount /usr. Even though we can tell systemd, at configure-time, where it should expect programs to be at runtime, it does not make sense to go head-first against an upstream wa^Hill.

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.

Furthermore, this means we're no longer supporting a split-usr setup, so the corresponding configure options have been removed as well for systemd and, when using a merged /usr, for eudev as well.

Note: we need not handle /lib32 or /lib64, as they already are symlinks to /lib, which means they will automatically be redirected to /usr/lib.

Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
Cc Mike Williams <[email protected]>
Cc Vicente Olivert Riera <[email protected]>
---
 package/eudev/eudev.mk       |  2 --
 package/skeleton/skeleton.mk | 20 +++++++++++++++++---
 package/systemd/systemd.mk   |  2 --
 system/Config.in             | 13 +++++++++++++
 system/skeleton/bin/.empty   |  0
 system/skeleton/lib/.empty   |  0
 system/skeleton/sbin/.empty  |  0
 7 files changed, 30 insertions(+), 7 deletions(-)
 delete mode 100644 system/skeleton/bin/.empty
 delete mode 100644 system/skeleton/lib/.empty
 delete mode 100644 system/skeleton/sbin/.empty
package/eudev/eudev.mk +0 -2
index 1aa74b3..24fe4ed 100644
@@ -22,11 +22,9 @@ EUDEV_CONF_ENV += LIBS=-lrt
 EUDEV_CONF_OPTS =		\
 	--disable-manpages	\
 	--sbindir=/sbin		\
-	--with-rootlibdir=/lib	\
 	--libexecdir=/lib	\
 	--with-firmware-path=/lib/firmware	\
 	--disable-introspection			\
-	--enable-split-usr			\
 	--enable-libkmod
 
 EUDEV_DEPENDENCIES = host-gperf host-pkgconf util-linux kmod
package/skeleton/skeleton.mk +17 -3
index 48e7085..920d3b4 100644
@@ -19,15 +19,29 @@ else
 SKELETON_PATH = system/skeleton
 endif
 
+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
+
 define SKELETON_INSTALL_TARGET_CMDS
 	rsync -a --ignore-times $(SYNC_VCS_EXCLUSIONS) \
 		--chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
 		$(SKELETON_PATH)/ $(TARGET_DIR)/
-	$(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
-		$(TARGET_DIR_WARNING_FILE)
+	$(SKELETON_USR_SYMLINKS_OR_DIRS)
 	ln -snf lib $(TARGET_DIR)/$(LIB_SYMLINK)
-	mkdir -p $(TARGET_DIR)/usr
 	ln -snf lib $(TARGET_DIR)/usr/$(LIB_SYMLINK)
+	$(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
+		$(TARGET_DIR_WARNING_FILE)
 endef
 
 SKELETON_TARGET_GENERIC_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
package/systemd/systemd.mk +0 -2
index b62fc08..59ab103 100644
@@ -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 \
system/Config.in +13 -0
index fad829d..735ad62 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_MERGED_USR
 	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_MERGED_USR
+	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 historical UNIX way. In this case, /usr can be a
+	  filesystem on a partition separate from / .
+
+	  If you say 'y' here, then /bin, /sbin and /lib will be symlinks
+	  to their counterparts in /usr. In this case, /usr can not be a
+	  separate filesystem.
+
 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

Dear Yann E. MORIN,

I think you forgot to add "v2" to the subject prefix and also list the changes between v1 and v2.

Quoted 3 lines · Yann E. MORIN

Furthermore, this means we're no longer supporting a split-usr setup, so the corresponding configure options have been removed as well for systemd and, when using a merged /usr, for eudev as well.

taking the last line of that comment into account...

Quoted 6 lines
package/eudev/eudev.mk +0 -0
index 1aa74b3..24fe4ed 100644
@@ -22,11 +22,9 @@ EUDEV_CONF_ENV += LIBS=-lrt
 EUDEV_CONF_OPTS =		\

package/eudev/eudev.mk EUDEV_CONF_ENV += LIBS=-lrt · line 30

Quoted 10 lines
package/eudev/eudev.mk +0 -2
 	--disable-manpages	\
 	--sbindir=/sbin		\
-	--with-rootlibdir=/lib	\
 	--libexecdir=/lib	\
 	--with-firmware-path=/lib/firmware	\
 	--disable-introspection			\
-	--enable-split-usr			\
 	--enable-libkmod
 
 EUDEV_DEPENDENCIES = host-gperf host-pkgconf util-linux kmod

shouldn't you do that _ONLY_ when BR2_ROOTFS_MERGED_USR is selected?

Regards,

Vincent.

#2 lore raw

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

Quoted 27 lines · Vicente Olivert Riera

Dear Yann E. MORIN,

I think you forgot to add "v2" to the subject prefix and also list the changes between v1 and v2.

Quoted 3 lines · Yann E. MORIN

Furthermore, this means we're no longer supporting a split-usr setup, so the corresponding configure options have been removed as well for systemd and, when using a merged /usr, for eudev as well.

taking the last line of that comment into account...

Quoted 15 lines
package/eudev/eudev.mk +0 -2
index 1aa74b3..24fe4ed 100644
@@ -22,11 +22,9 @@ EUDEV_CONF_ENV += LIBS=-lrt
 EUDEV_CONF_OPTS =		\
 	--disable-manpages	\
 	--sbindir=/sbin		\
-	--with-rootlibdir=/lib	\
 	--libexecdir=/lib	\
 	--with-firmware-path=/lib/firmware	\
 	--disable-introspection			\
-	--enable-split-usr			\
 	--enable-libkmod
 
Quoted 3 lines

package/eudev/eudev.mk EUDEV_CONF_ENV += LIBS=-lrt · line 30

Quoted 1 line
package/eudev/eudev.mk +0 -0
 EUDEV_DEPENDENCIES = host-gperf host-pkgconf util-linux kmod

shouldn't you do that _ONLY_ when BR2_ROOTFS_MERGED_USR is selected?

In addition, are --sbindir and --libexecdir still needed?

[snip]

Quoted 9 lines

system/Config.in config BR2_INIT_SYSTEMD · line 91

Quoted 9 lines
system/Config.in +1 -0
index fad829d..735ad62 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_MERGED_USR

Wouldn't it be more appropriate to move this to package/systemd/Config.in,
which already has all the other selects?

OTOH, this is a system option while package/systemd/Config.in selects only
packages.

I think we should reason as follows: if we would ever support building the
systemd package without BR2_INIT_SYSTEMD, would we want to select BR2_ROOTFS_MERGED_USR? Perhaps the answer is yes, because the systemd package will simply not work in a split /usr unless --enable-split-usr is passed - which we don't.

Anyway, it's probably bikeshedding. But perhaps you can put a rationale in the
commit message for future reference. After all, your commit message is a bit short at the moment :-P

Regards,
Arnout

Quoted 8 lines

system/Config.in config BR2_INIT_SYSTEMD · line 92

Quoted 1 line
system/Config.in +0 -0
 	select BR2_PACKAGE_SYSTEMD

Regards,

Vincent.

Signature · 6 lines
Arnout Vandecappelle      arnout dot vandecappelle at essensium dot com
Senior Embedded Software Architect . . . . . . +32-478-010353 (mobile)
Essensium, Mind division . . . . . . . . . . . . . . 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
#3 lore raw

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

Arnout, All,

On 2015-09-04 10:16 +0200, Arnout Vandecappelle spake thusly:
[--SNIP--]

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
package/eudev/eudev.mk +0 -2
index 1aa74b3..24fe4ed 100644
@@ -22,11 +22,9 @@ EUDEV_CONF_ENV += LIBS=-lrt
 EUDEV_CONF_OPTS =		\
 	--disable-manpages	\
 	--sbindir=/sbin		\
-	--with-rootlibdir=/lib	\
 	--libexecdir=/lib	\
 	--with-firmware-path=/lib/firmware	\
 	--disable-introspection			\
-	--enable-split-usr			\
 	--enable-libkmod
 
Quoted 5 lines
Quoted 3 lines

package/eudev/eudev.mk EUDEV_CONF_ENV += LIBS=-lrt · line 30

Quoted 1 line
package/eudev/eudev.mk +0 -0
 EUDEV_DEPENDENCIES = host-gperf host-pkgconf util-linux kmod

shouldn't you do that _ONLY_ when BR2_ROOTFS_MERGED_USR is selected?

In addition, are --sbindir and --libexecdir still needed?

Dunno... Will test.

Quoted 13 lines
Quoted 9 lines

system/Config.in config BR2_INIT_SYSTEMD · line 91

Quoted 9 lines
system/Config.in +1 -0
index fad829d..735ad62 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_MERGED_USR

Wouldn't it be more appropriate to move this to package/systemd/Config.in,
which already has all the other selects?

Quoted 2 lines

OTOH, this is a system option while package/systemd/Config.in selects only
packages.

Well, I don't care. In fact, BR2_INIT_SYSTEMD and BR2_PACKAGE_SYSTEMD are in effect synonyms. So, it's completely arbiotrary where we put the selects.

I would have favoured pacakge dependencies, like libs and support stuff, to be selected by the package, while system-related dependencies would have been handled by the init sytem.

But as you say, this is a fringe case. After all, systemd *does* support a separate /usr, it's just that we in Buildroot decided (with this patch) not to support that case.

Quoted 2 lines

I think we should reason as follows: if we would ever support building the
systemd package without BR2_INIT_SYSTEMD,

But does that question even make sense to start with? systemd *is* an init system and nothing more, so there's no reason we would ever build systemd stand-alone.

At least, in the current state of affairs, for the foreseeable future, there's almost no chance we build systemd standalone.

Quoted 2 lines

Anyway, it's probably bikeshedding. But perhaps you can put a rationale in the
commit message for future reference.

Like:

In Buildroot, we decided not to support a split-usr when systemd is used as an init system. This is not a systemd issue, this is a deign decision. Thus the select is with BR2_INIT_SYSTEMD rather than with BR2_PACKAGE_SYSTEMD.

Quoted 2 lines

After all, your commit message is a bit
short at the moment :-P

I'll take that as an incitation at expanding it even more. The four lines above will make it! ;-p

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.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

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

Quoted 3 lines · Yann E. MORIN

Arnout, All,

On 2015-09-04 10:16 +0200, Arnout Vandecappelle spake thusly:

[snip]

Quoted 16 lines
Quoted 13 lines
Quoted 9 lines

system/Config.in config BR2_INIT_SYSTEMD · line 91

Quoted 9 lines
system/Config.in +1 -0
index fad829d..735ad62 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_MERGED_USR

Wouldn't it be more appropriate to move this to package/systemd/Config.in,
which already has all the other selects?

Quoted 2 lines

OTOH, this is a system option while package/systemd/Config.in selects only
packages.

Quoted 7 lines

Well, I don't care. In fact, BR2_INIT_SYSTEMD and BR2_PACKAGE_SYSTEMD are in effect synonyms. So, it's completely arbiotrary where we put the selects.

I would have favoured pacakge dependencies, like libs and support stuff, to be selected by the package, while system-related dependencies would have been handled by the init sytem.

Indeed.

Quoted 7 lines

But as you say, this is a fringe case. After all, systemd *does* support a separate /usr, it's just that we in Buildroot decided (with this patch) not to support that case.

Quoted 2 lines

I think we should reason as follows: if we would ever support building the
systemd package without BR2_INIT_SYSTEMD,

Quoted 6 lines

But does that question even make sense to start with? systemd *is* an init system and nothing more, so there's no reason we would ever build systemd stand-alone.

At least, in the current state of affairs, for the foreseeable future, there's almost no chance we build systemd standalone.

Yeah, you're right, not a good idea to design for things that may not happen.

Quoted 9 lines
Quoted 2 lines

Anyway, it's probably bikeshedding. But perhaps you can put a rationale in the
commit message for future reference.

Like:

In Buildroot, we decided not to support a split-usr when systemd is used as an init system. This is not a systemd issue, this is a deign decision. Thus the select is with BR2_INIT_SYSTEMD rather than with BR2_PACKAGE_SYSTEMD.

Perfect!

Regards,
Arnout

Quoted 10 lines
Quoted 3 lines

After all, your commit message is a bit
short at the moment :-P

I'll take that as an incitation at expanding it even more. The four lines above will make it! ;-p

Regards,
Yann E. MORIN.

Signature · 6 lines
Arnout Vandecappelle      arnout dot vandecappelle at essensium dot com
Senior Embedded Software Architect . . . . . . +32-478-010353 (mobile)
Essensium, Mind division . . . . . . . . . . . . . . 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
#5 lore raw

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

In reply to Vicente Olivert Riera

Vicente, All,

On 2015-09-04 08:48 +0100, Vicente Olivert Riera spake thusly:

Quoted 2 lines

I think you forgot to add "v2" to the subject prefix and also list the changes between v1 and v2.

Yup. I rushed that submission. That's bad on my part. Sorry.

Quoted 22 lines · Yann E. MORIN
Quoted 3 lines

Furthermore, this means we're no longer supporting a split-usr setup, so the corresponding configure options have been removed as well for systemd and, when using a merged /usr, for eudev as well.

taking the last line of that comment into account...

Quoted 15 lines
package/eudev/eudev.mk +0 -2
index 1aa74b3..24fe4ed 100644
@@ -22,11 +22,9 @@ EUDEV_CONF_ENV += LIBS=-lrt
 EUDEV_CONF_OPTS =		\
 	--disable-manpages	\
 	--sbindir=/sbin		\
-	--with-rootlibdir=/lib	\
 	--libexecdir=/lib	\
 	--with-firmware-path=/lib/firmware	\
 	--disable-introspection			\
-	--enable-split-usr			\
 	--enable-libkmod
 
Quoted 3 lines

package/eudev/eudev.mk EUDEV_CONF_ENV += LIBS=-lrt · line 30

Quoted 1 line
package/eudev/eudev.mk +0 -0
 EUDEV_DEPENDENCIES = host-gperf host-pkgconf util-linux kmod

shouldn't you do that _ONLY_ when BR2_ROOTFS_MERGED_USR is selected?

Yeah. I forgot to git-add before I git-commit --amend.

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

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

In reply to Yann E. MORIN

Yann,

system/Config.in endif · line 183

Quoted 2 lines · Yann E. MORIN
system/Config.in +2 -0
+config BR2_ROOTFS_MERGED_USR
+	bool "Use symlinks to /usr for /bin, /sbin and /lib"

Shouldn't we make this a blind option? I.e just do merged usr for systemd always, and never do it for !systemd.

Thomas

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

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

Quoted 9 lines · Thomas Petazzoni

Yann,

system/Config.in endif · line 183

Quoted 2 lines · Yann E. MORIN
system/Config.in +2 -0
+config BR2_ROOTFS_MERGED_USR
+	bool "Use symlinks to /usr for /bin, /sbin and /lib"

Shouldn't we make this a blind option? I.e just do merged usr for systemd always, and never do it for !systemd.

I will always turn this option on, even in non-systemd, because it makes for a
better environment. See the Fedora document for a long explanation why split /usr is just legacy baggage. Other parts of your system will also work better when this option is turned on - no more confusion between busybox installing something in /bin and the full package putting it in /usr/bin. No more worries about a shebang being correct.

So no, I don't want this to be hidden.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle      arnout dot vandecappelle at essensium dot com
Senior Embedded Software Architect . . . . . . +32-478-010353 (mobile)
Essensium, Mind division . . . . . . . . . . . . . . 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
#8 lore raw

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

Thomas, Arnout, All,

On 2015-09-04 10:19 +0200, Arnout Vandecappelle spake thusly:

Quoted 9 lines · Thomas Petazzoni
Quoted 7 lines · Yann E. MORIN

system/Config.in endif · line 183

Quoted 3 lines
system/Config.in +2 -0
+config BR2_ROOTFS_MERGED_USR
+	bool "Use symlinks to /usr for /bin, /sbin and /lib"

Shouldn't we make this a blind option? I.e just do merged usr for systemd always, and never do it for !systemd.

Quoted 8 lines

I will always turn this option on, even in non-systemd, because it makes for a
better environment. See the Fedora document for a long explanation why split /usr is just legacy baggage. Other parts of your system will also work better when this option is turned on - no more confusion between busybox installing something in /bin and the full package putting it in /usr/bin. No more worries about a shebang being correct.

So no, I don't want this to be hidden.

Ditto, I do not want this to be hidden. I want to have the choice of using a merged-usr even without systemd (and I even have a use-case in my head for that).

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

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Hi,

Quoted 7 lines
Quoted 7 lines

I will always turn this option on, even in non-systemd, because it makes for a better environment. See the Fedora document for a long explanation why split /usr is just legacy baggage. Other parts of your system will also work better when this option is turned on - no more confusion between busybox installing something in /bin and the full package putting it in /usr/bin. No more worries about a shebang being correct.

Quoted 5 lines
Quoted 1 line

So no, I don't want this to be hidden.

Ditto, I do not want this to be hidden. I want to have the choice of using a merged-usr even without systemd (and I even have a use-case in my head for that).

And as explained, we might even want to default it to y in the future, just because it is simpler when you have a single rootfs.

Is there any reason why we explicitly add the symlinks for /bin / /sbin and /lib and don't just do:

ln -sf . usr

Signature · 1 line
Bye, Peter Korsgaard
#10 lore raw

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

Peter, All,

On 2015-09-14 23:12 +0200, Peter Korsgaard spake thusly:

Quoted 14 lines
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

I will always turn this option on, even in non-systemd, because it makes for a better environment. See the Fedora document for a long explanation why split /usr is just legacy baggage. Other parts of your system will also work better when this option is turned on - no more confusion between busybox installing something in /bin and the full package putting it in /usr/bin. No more worries about a shebang being correct.

Quoted 5 lines
Quoted 1 line

So no, I don't want this to be hidden.

Ditto, I do not want this to be hidden. I want to have the choice of using a merged-usr even without systemd (and I even have a use-case in my head for that).

Quoted 7 lines

And as explained, we might even want to default it to y in the future, just because it is simpler when you have a single rootfs.

Is there any reason why we explicitly add the symlinks for /bin / /sbin and /lib and don't just do:

ln -sf . usr

Well, for one, I would not like to have that, otherwise, we would have an infinite hierarchy:

cd /usr/usr/usr/usr/usr/

and that's ugly... :-(

Also, I'd like we do not diverge too much from what distros are doing, and they are doing the /{bin,sbin,lib} symlink dance.

Finally, fundamentally, things are now to be put into /usr rather than / so it makes more sense to have the symlinks that way rather than the other way around as you suggest.

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.  |
'------------------------------^-------^------------------^--------------------'
#11 lore raw

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

In reply to Peter Korsgaard
Quoted 17 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Hi,

Quoted 7 lines
Quoted 7 lines

I will always turn this option on, even in non-systemd, because it makes for a better environment. See the Fedora document for a long explanation why split /usr is just legacy baggage. Other parts of your system will also work better when this option is turned on - no more confusion between busybox installing something in /bin and the full package putting it in /usr/bin. No more worries about a shebang being correct.

Quoted 5 lines
Quoted 1 line

So no, I don't want this to be hidden.

Ditto, I do not want this to be hidden. I want to have the choice of using a merged-usr even without systemd (and I even have a use-case in my head for that).

Quoted 7 lines

And as explained, we might even want to default it to y in the future, just because it is simpler when you have a single rootfs.

Is there any reason why we explicitly add the symlinks for /bin / /sbin and /lib and don't just do:

ln -sf . usr

Well, in Fedora I think the idea was that / could be an initramfs and /usr
would be mounted read-only. But since we don't directly support that use case, making /usr a symlink would indeed be an option.

However, I'm not really in favour of it. I don't see that it brings a lot of
benefit, other than reducing the number of symlinks from 3 to 1. But it does create /share and /local which looks weird could potentially conflict with existing user directories (e.g. a mountpoint for windows shares...). Also it makes it more complicated for the user to implement a fedora-like mounted /usr.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle      arnout dot vandecappelle at essensium dot com
Senior Embedded Software Architect . . . . . . +32-478-010353 (mobile)
Essensium, Mind division . . . . . . . . . . . . . . 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 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Hi,

Quoted 9 lines
Quoted 4 lines

Is there any reason why we explicitly add the symlinks for /bin / /sbin and /lib and don't just do:

ln -sf . usr

Well, in Fedora I think the idea was that / could be an initramfs and /usr
would be mounted read-only. But since we don't directly support that use case, making /usr a symlink would indeed be an option.

Quoted 6 lines

However, I'm not really in favour of it. I don't see that it brings
a lot of benefit, other than reducing the number of symlinks from 3 to 1. But it does create /share and /local which looks weird could potentially conflict with existing user directories (e.g. a mountpoint for windows shares...). Also it makes it more complicated for the user to implement a fedora-like mounted /usr.

Ok - fine, having 1 or 3 symlinks isn't really a big deal. Just symlinking /usr seemed the simplest possible solution.

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard 
#13 lore raw

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

All,

Quoted 11 lines

However, I'm not really in favour of it. I don't see that it brings

Quoted 5 lines

a lot of benefit, other than reducing the number of symlinks from 3 to 1. But it does create /share and /local which looks weird could potentially conflict with existing user directories (e.g. a mountpoint for windows shares...). Also it makes it more complicated for the user to implement a fedora-like mounted /usr.

Ok - fine, having 1 or 3 symlinks isn't really a big deal. Just symlinking /usr
seemed the simplest possible solution.

Any reason this wasn't committed? Just reviewing my list of out-of-tree patches...

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

#14 lore raw

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

Quoted 9 lines · Mike Williams

All,

> However, I'm not really in favour of it. I don't see that it brings
> a lot of benefit, other than reducing the number of symlinks from 3 > to 1. But it does create /share and /local which looks weird could > potentially conflict with existing user directories (e.g. a > mountpoint for windows shares...). Also it makes it more complicated > for the user to implement a fedora-like mounted /usr.

Quoted 5 lines

Ok - fine, having 1 or 3 symlinks isn't really a big deal. Just symlinking /usr seemed the simplest possible solution.

Any reason this wasn't committed? Just reviewing my list of out-of-tree patches...

Because it is a non-trivial change, and we don't have runtime testing to give
Peter sufficient trust to just commit it, so he will want to look at the patch in detail before committing. And by now it got snowed under by other patches...

So it's good that you push for it ;-).

Regards,
Arnout

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
#15 lore raw

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

In reply to Peter Korsgaard

Peter,

Quoted 13 lines · Peter Korsgaard
Quoted 7 lines
Quoted 7 lines

I will always turn this option on, even in non-systemd, because it makes for a better environment. See the Fedora document for a long explanation why split /usr is just legacy baggage. Other parts of your system will also work better when this option is turned on - no more confusion between busybox installing something in /bin and the full package putting it in /usr/bin. No more worries about a shebang being correct.

Quoted 5 lines
Quoted 1 line

So no, I don't want this to be hidden.

Ditto, I do not want this to be hidden. I want to have the choice of using a merged-usr even without systemd (and I even have a use-case in my head for that).

Quoted 7 lines

And as explained, we might even want to default it to y in the future, just because it is simpler when you have a single rootfs.

Is there any reason why we explicitly add the symlinks for /bin / /sbin and /lib and don't just do:

ln -sf . usr

Then you have /share, /local and so on?

Thomas

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