Skip to contentSkip to conversation

base-files: Drop /bin/sh dependency

PATCH New Marek Vasut 1 participant 1 message Jan 24, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 base-files: Drop /bin/sh dependency

Remove /bin/sh from bash RPROVIDES as this has a side-effect which confuses rpm package manager when also busybox provides /bin/sh and base-files depend on /bin/sh . The problem is broken down below.

First, bash depends on base-files and bash pkg_postinst must run after base-files was installed, because it requires /etc/shells provided by base-files to be in place.

Second, base-files depends on /bin/sh, which is provided by either bash or busybox in this case. This is the actual problem here, if bash is selected as /bin/sh provider, then there is cyclic dependency between bash and base-files, and that confuses dnf which may install the packages in the wrong order, bash first and base-files second .

To make this worse, if busybox is also /bin/sh provider, it can and does happen that some systems pick busybox as the /bin/sh provider, while others pick bash as the /bin/sh provider, and that cyclic dependency does not always appear.

Attempt to break this dependency, remove pre-inst script from the base-files recipe, which removes its dependency on /bin/sh and allows it to be installed very early, and always before bash.

---
Cc: Alexander Kanavin <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Khem Raj <[email protected]>
Cc: Mark Hatle <[email protected]>
Cc: Richard Purdie <[email protected]>
---
V2: - Rename from bash: Drop /bin/sh from RPROVIDES
- Replace the bash change with removal of base-files preinst script
- Drop the RFC part
- Update commit message

---
 .../base-files/base-files_3.0.14.bb           | 23 -------------------
 1 file changed, 23 deletions(-)
meta/recipes-core/base-files/base-files_3.0.14.bb +0 -23
index 8bcd91e699d..60253fcd421 100644
@@ -72,29 +72,6 @@ hostname = "${MACHINE}"
 
 BASEFILESISSUEINSTALL ?= "do_install_basefilesissue"
 
-# In previous versions of base-files, /run was a softlink to /var/run and the
-# directory was located in /var/volatlie/run.  Also, /var/lock was a softlink
-# to /var/volatile/lock which is where the real directory was located.  Now,
-# /run and /run/lock are the real directories.  If we are upgrading, we may
-# need to remove the symbolic links first before we create the directories.
-# Otherwise the directory creation will fail and we will have circular symbolic
-# links.
-# 
-pkg_preinst:${PN} () {
-    #!/bin/sh -e
-    if [ x"$D" = "x" ]; then
-        if [ -h "/var/lock" ]; then
-            # Remove the symbolic link
-            rm -f /var/lock
-        fi
-
-        if [ -h "/run" ]; then
-            # Remove the symbolic link
-            rm -f /run
-        fi
-    fi     
-}
-
 do_install () {
 	for d in ${dirs555}; do
 		install -m 0555 -d ${D}$d
Signature · 1 line
2.45.2