]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: support the case /sbin/init is an absolute symbolic link 38924/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 14 Sep 2025 03:13:20 +0000 (12:13 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 17 Sep 2025 13:21:11 +0000 (22:21 +0900)
In that case, the link points to the host file, thus we cannot update
the file.

mkosi/mkosi.images/minimal-base/mkosi.postinst

index 777bdfd449e52c623b99e49e620cea0dfcedd0ca..475f40fdc0c35ed88854af4840f6de36a2e3f5ef 100755 (executable)
@@ -3,6 +3,8 @@ set -e
 
 # We don't use mkosi.extra because /usr/sbin could be a symlink and cp doesn't handle that properly until
 # coreutils 9.5 or newer.
+mkdir -p "$BUILDROOT/sbin"
+rm -f "$BUILDROOT/sbin/init"
 cat >"$BUILDROOT/sbin/init" <<EOF
 #!/bin/bash
 echo "Hello from dummy init, beautiful day, innit?"