From: Lucas Werkmeister Date: Mon, 26 Feb 2018 01:02:35 +0000 (+0100) Subject: add: mkosi files X-Git-Url: https://code.wpia.club/?p=gigi.git;a=commitdiff_plain;h=e484c80ea0ced66f8e028e8662a47f80c28da88d add: mkosi files mkosi is a tool to build operating system images, possibly with some software pre-built inside it. This commit adds mkosi configuration files for building the Debian packages for Gigi on any distribution supported by mkosi. The *.deb files will be placed in the srv/ directory of the resulting image (image/srv/*.deb). Note that mkosi doesn’t include git information in the build tree, so the changelog used for the packages is whatever is currently in the source tree. Consider running doc/scripts/genchangelog before mkosi. The packages are also, unfortunately, not yet deterministic. The strip-nondeterminism debhelper step uses the date from the changelog (so if doc/scripts/genchangelog was run before the build started, that part is deterministic), but it only seems to adjust the timestamps of the three files in the .deb archives, not of the files within those .tar.* archives. A post-install script is included that could potentially be used to actually install the packages inside the built image. However, that part doesn’t yet work, so it’s disabled for now: the post-install scripts of the packages have some extra requirements (more packages, an internet connection) which mkosi doesn’t satisfy by default, and I didn’t want to spend more time to find out if it can be made to work. This might be fixed in a future commit, but even then, it’s not clear if such an image would be very useful. Change-Id: Ib966760b31f75cf0e8892428b6a8c6dba5ec5f2e --- diff --git a/mkosi.build b/mkosi.build new file mode 100755 index 00000000..60307a12 --- /dev/null +++ b/mkosi.build @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +cd -- "$SRCDIR" + +# doc/scripts/genchangelog # mkosi doesn’t copy .git + +dpkg-buildpackage -b -us -uc + +mkdir -- "$DESTDIR/srv/" +cp -v ../*.deb -- "$DESTDIR/srv/" diff --git a/mkosi.default b/mkosi.default new file mode 100644 index 00000000..41d849ab --- /dev/null +++ b/mkosi.default @@ -0,0 +1,11 @@ +[Distribution] +Distribution=debian +Release=stretch + +[Output] +Format=directory + +[Packages] +Packages=default-jre-headless libpostgresql-jdbc-java libdnsjava-java debconf init-system-helpers +BuildPackages=debhelper dh-systemd default-jdk-headless build-essential ant wget +Cache=/var/cache/apt/archives diff --git a/mkosi.postinst b/mkosi.postinst new file mode 100755 index 00000000..c7548ece --- /dev/null +++ b/mkosi.postinst @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ "$1" = "final" ]; then + # disabled for now; the postinst scripts can’t run in the built image + #dpkg --install /*.deb + : # `if` bodies can’t be empty +fi