]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Copy packages to the build directory as well
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 3 Jul 2024 12:28:21 +0000 (14:28 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 3 Jul 2024 13:44:27 +0000 (15:44 +0200)
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.

mkosi.images/system/mkosi.conf.d/10-arch/mkosi.build.chroot
mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot
mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.build.chroot
mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot

index 1f6e0c328cd123c9581077f569cd4aa6aed909e9..d5913dd1d0fc78517ee30a3d79e705312efd2ee3 100755 (executable)
@@ -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"
index 2c057876544080fbc377b9efde82be6ae118a6e2..5e7e29612af362dd99f8358edb0af7fecd0d277e 100755 (executable)
@@ -114,3 +114,4 @@ CXX_LD="$( ((LLVM)) && echo lld)" \
     "pkg/$ID/systemd.spec"
 
 cp "$OUTPUTDIR"/*.rpm "$PACKAGEDIR"
+cp "$OUTPUTDIR"/*.rpm "$BUILDDIR"
index 7e4eab994005dd5bc41686f636856016689e22b9..6b6f7a287b2efcc4483fc0ab66c0476ed28ae788 100755 (executable)
@@ -139,4 +139,5 @@ fi
     shopt -s nullglob
     cp ../*.deb ../*.ddeb "$PACKAGEDIR"
     cp ../*.deb ../*.ddeb "$OUTPUTDIR"
+    cp ../*.deb ../*.ddeb "$BUILDDIR"
 )
index dbf3f2fa83e2d9a8964479522baa0cb87ae645d5..3adf036af4014553f64b8cfc5f01dac1c2cba9a7 100755 (executable)
@@ -133,3 +133,4 @@ if ! build; then
 fi
 
 cp "$OUTPUTDIR"/*.rpm "$PACKAGEDIR"
+cp "$OUTPUTDIR"/*.rpm "$BUILDDIR"