diff options
Diffstat (limited to 'mkosi.images/system')
6 files changed, 42 insertions, 4 deletions
diff --git a/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.conf index 942db4cb96..9c7d09d656 100644 --- a/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.conf +++ b/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.conf @@ -4,6 +4,11 @@ Distribution=arch [Content] +Environment= + GIT_URL=https://gitlab.archlinux.org/archlinux/packaging/packages/systemd.git + GIT_BRANCH=main + GIT_COMMIT=dc6c099e0785753c1c88b4adcbcbfc209a8d12e3 + VolatilePackages= systemd systemd-libs diff --git a/mkosi.images/system/mkosi.conf.d/10-centos/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-centos/mkosi.conf index 15f888168d..395a22b56a 100644 --- a/mkosi.images/system/mkosi.conf.d/10-centos/mkosi.conf +++ b/mkosi.images/system/mkosi.conf.d/10-centos/mkosi.conf @@ -4,6 +4,11 @@ Distribution=centos [Content] +Environment= + GIT_URL=https://git.centos.org/rpms/systemd.git + GIT_BRANCH=c9s-sig-hyperscale + GIT_COMMIT=8cf2aed0181920611421384f7374720db269d6c7 + Packages= kernel-modules # For squashfs rpmautospec-rpm-macros diff --git a/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.conf index 7e870ace87..047dbc1dc3 100644 --- a/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.conf +++ b/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.conf @@ -5,6 +5,11 @@ Distribution=|debian Distribution=|ubuntu [Content] +Environment= + GIT_URL=https://salsa.debian.org/systemd-team/systemd.git + GIT_BRANCH=debian/master + GIT_COMMIT=18201fa98d74172fa1a17242326e3275995cde13 + VolatilePackages= libnss-myhostname libnss-mymachines diff --git a/mkosi.images/system/mkosi.conf.d/10-fedora/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-fedora/mkosi.conf index 3acec1092c..7b122e3c69 100644 --- a/mkosi.images/system/mkosi.conf.d/10-fedora/mkosi.conf +++ b/mkosi.images/system/mkosi.conf.d/10-fedora/mkosi.conf @@ -4,6 +4,11 @@ Distribution=fedora [Content] +Environment= + GIT_URL=https://src.fedoraproject.org/rpms/systemd.git + GIT_BRANCH=rawhide + GIT_COMMIT=74810c5bc4fe7d872e54c253447ffd61bbc8839f + Packages= btrfs-progs compsize diff --git a/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.conf index b3172bfc14..90844d4db4 100644 --- a/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.conf +++ b/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.conf @@ -7,6 +7,11 @@ Distribution=opensuse InitrdInclude=initrd/ [Content] +Environment= + GIT_URL=https://src.opensuse.org/rpm/systemd + GIT_BRANCH=factory + GIT_COMMIT=28c9bef337dd47c88adc1d948cedfdc79c788e2955f17a534bd76da6419722dd + VolatilePackages= systemd systemd-boot diff --git a/mkosi.images/system/mkosi.sync b/mkosi.images/system/mkosi.sync index 3e42a09b2c..a4f0ab94ec 100755 --- a/mkosi.images/system/mkosi.sync +++ b/mkosi.images/system/mkosi.sync @@ -2,8 +2,21 @@ # SPDX-License-Identifier: LGPL-2.1-or-later set -e -if [ -z "$(ls --almost-all "pkg/$DISTRIBUTION")" ] || [ -f "pkg/$DISTRIBUTION/.git" ]; then - PKG_SUBDIR="$(realpath "pkg/$DISTRIBUTION" --relative-to "$PWD")" - git submodule sync "$PKG_SUBDIR" - git submodule update --init "$PKG_SUBDIR" +if ((NO_SYNC)); then + exit 0 fi + +PKG_SUBDIR="$(realpath --canonicalize-missing "pkg/$DISTRIBUTION" --relative-to "$PWD")" + +if [[ -d "$PKG_SUBDIR/.git" ]] && [[ "$(git -C "$PKG_SUBDIR" rev-parse HEAD)" == "$GIT_COMMIT" ]]; then + exit 0 +fi + +if [[ ! -e "$PKG_SUBDIR" ]] || [[ -z "$(ls --almost-all "$PKG_SUBDIR")" ]]; then + git clone "$GIT_URL" --branch "$GIT_BRANCH" "$PKG_SUBDIR" +else + git -C "$PKG_SUBDIR" remote set-url origin "$GIT_URL" + git -C "$PKG_SUBDIR" fetch origin "$GIT_BRANCH" +fi + +git -C "$PKG_SUBDIR" -c advice.detachedHead=false checkout "$GIT_COMMIT" |