From: Daan De Meyer Date: Sun, 28 Apr 2024 17:09:44 +0000 (+0200) Subject: mkosi: Use symlinks instead of bind mounts for Arch X-Git-Tag: v256-rc2~139^2~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e839cb1cf878e86d41cadc49302483aca444fd32;p=thirdparty%2Fsystemd.git mkosi: Use symlinks instead of bind mounts for Arch With bind mounts, the directories we bind mount to get recorded as the meson source and build directories. This means meson will complain if we later try to run meson install -C /work/build in the virtual machine or container. If we use symlinks, the directories we symlink to will be recorded as the meson source and build directories, which means meson install -C /work/build will work when executed after booting the VM or container. I tried to do the same for debian as well but the debian package tooling changes directory into the build directory and then does meson setup .. which is completely broken when switching to a symlink. --- diff --git a/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.build.chroot b/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.build.chroot index 04eeaf1e37c..33a64cb1d55 100755 --- a/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.build.chroot +++ b/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.build.chroot @@ -10,12 +10,12 @@ if [ ! -f "pkg/$ID/PKGBUILD" ]; then exit 1 fi -# We can't configure the source or build directory so we use bind mounts instead to make sure they are in the +# We can't configure the source or build directory so we use symlinks instead to make sure they are in the # expected locations. -mount --mkdir --bind "$SRCDIR" "pkg/$ID/systemd-stable/" -mount --mkdir --bind "$BUILDDIR" "pkg/$ID/build/" +ln --symbolic "$SRCDIR" "pkg/$ID/systemd-stable" +ln --symbolic "$BUILDDIR" "pkg/$ID/build" # Because we run with --noextract we are responsible for making sure the source files appear in src/. -mount --mkdir --rbind "$PWD/pkg/$ID" "pkg/$ID/src/" +ln --symbolic . "pkg/$ID/src" # shellcheck source=/dev/null . /etc/makepkg.conf