From: Daan De Meyer Date: Wed, 3 Jul 2024 12:28:21 +0000 (+0200) Subject: mkosi: Copy packages to the build directory as well X-Git-Tag: v257-rc1~983 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=690a85b1d4e794af62bca6d1ea530ffc530ee58c;p=thirdparty%2Fsystemd.git mkosi: Copy packages to the build directory as well With the latest mkosi, mkosi -t none can be used to rerun the build script without messing with a previously built image. This allows one to run "mkosi -t disk -f qemu" in one terminal to build and boot an image in qemu and then run "mkosi -t none" in another terminal to rebuild the packages. If one then has "RuntimeBuildSources=yes" set in their mkosi configuration, the build directory is mounted into the virtual machine, which means that one can then run "dnf upgrade /work/build/*.rpm" from within the VM to install the new packages. This allows for quickly iterating on changes without having to rebuild the image all the time. We'll probably want to document this at some point, but let's start with making it possible by copying the built packages to the build directory. --- 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 1f6e0c328cd..d5913dd1d0f 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 @@ -91,3 +91,4 @@ env --chdir="pkg/$ID" \ MESON_EXTRA_CONFIGURE_OPTIONS="$MKOSI_MESON_OPTIONS $MESON_OPTIONS" cp "$OUTPUTDIR"/*.pkg.tar "$PACKAGEDIR" +cp "$OUTPUTDIR"/*.pkg.tar "$BUILDDIR" diff --git a/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot b/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot index 2c057876544..5e7e29612af 100755 --- a/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot +++ b/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot @@ -114,3 +114,4 @@ CXX_LD="$( ((LLVM)) && echo lld)" \ "pkg/$ID/systemd.spec" cp "$OUTPUTDIR"/*.rpm "$PACKAGEDIR" +cp "$OUTPUTDIR"/*.rpm "$BUILDDIR" diff --git a/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.build.chroot b/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.build.chroot index 7e4eab99400..6b6f7a287b2 100755 --- a/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.build.chroot +++ b/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.build.chroot @@ -139,4 +139,5 @@ fi shopt -s nullglob cp ../*.deb ../*.ddeb "$PACKAGEDIR" cp ../*.deb ../*.ddeb "$OUTPUTDIR" + cp ../*.deb ../*.ddeb "$BUILDDIR" ) diff --git a/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot b/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot index dbf3f2fa83e..3adf036af40 100755 --- a/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot +++ b/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot @@ -133,3 +133,4 @@ if ! build; then fi cp "$OUTPUTDIR"/*.rpm "$PACKAGEDIR" +cp "$OUTPUTDIR"/*.rpm "$BUILDDIR"