system: add support for merged /usr/sbin (aka merged-bin)

Starting with version 256 [0], systemd warns when /usr/bin and
/usr/sbin are different directories; in the future, it may even
refuse to boot in such a situation.

Add support for merged-bin, not unlike the support we have for
merged-usr; we also make merged-bin a sub-case of merged-usr
(i.e. it is not possible to do merged-bin without merged-usr).

[0] https://github.com/systemd/systemd/blob/v256/NEWS#L265

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Acked-by: Arnout Vandecappelle <arnout@mind.be>
Acked-by: TIAN Yuanhao <tianyuanhao3@163.com>
Cc: Edgar Bonet <bonet@grenoble.cnrs.fr>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
This commit is contained in:
Yann E. MORIN
2025-09-01 11:01:20 +02:00
committed by Romain Naour
parent fc3cdc6d1e
commit 428ac6fcc4
6 changed files with 45 additions and 4 deletions

View File

@@ -32,18 +32,30 @@
# set inittab to remount root read-write or read-only
#
# This function handles the merged or non-merged /usr cases
# This function handles the merged or non-merged /usr, and merged or
# non-merged /usr/bin cases
ifeq ($(BR2_ROOTFS_MERGED_USR),y)
ifeq ($(BR2_ROOTFS_MERGED_BIN),y)
define SYSTEM_SBIN_SYMLINKS_OR_DIRS
ln -snf bin $(1)/usr/sbin
endef
else
define SYSTEM_SBIN_SYMLINKS_OR_DIRS
$(INSTALL) -d -m 0755 $(1)/usr/sbin
endef
endif
define SYSTEM_USR_SYMLINKS_OR_DIRS
ln -snf usr/bin $(1)/bin
ln -snf usr/sbin $(1)/sbin
ln -snf usr/lib $(1)/lib
$(SYSTEM_SBIN_SYMLINKS_OR_DIRS)
endef
else
define SYSTEM_USR_SYMLINKS_OR_DIRS
$(INSTALL) -d -m 0755 $(1)/bin
$(INSTALL) -d -m 0755 $(1)/sbin
$(INSTALL) -d -m 0755 $(1)/lib
$(INSTALL) -d -m 0755 $(1)/usr/sbin
endef
endif