From 97eeecaa3caa9a78959577b657d7614f17f5e37b Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 14 Sep 2025 12:13:20 +0900 Subject: [PATCH] mkosi: support the case /sbin/init is an absolute symbolic link In that case, the link points to the host file, thus we cannot update the file. --- mkosi/mkosi.images/minimal-base/mkosi.postinst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkosi/mkosi.images/minimal-base/mkosi.postinst b/mkosi/mkosi.images/minimal-base/mkosi.postinst index 777bdfd449e..475f40fdc0c 100755 --- a/mkosi/mkosi.images/minimal-base/mkosi.postinst +++ b/mkosi/mkosi.images/minimal-base/mkosi.postinst @@ -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" <