From c27c1e42e081b7f21e38d4a0ac1a42e47bcdff5d Mon Sep 17 00:00:00 2001 From: Bruno Pajdek Date: Fri, 29 Nov 2024 16:52:04 +0000 Subject: [PATCH] Move mkosi confs to flags build.sh unnecessarily generates some temporary configs for mkosi. Instead, pass flags to mkosi to configure it without polluting. The distro being arch is already defined in mkosi.conf. --- build.sh | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/build.sh b/build.sh index 21ac66a..cadcfd2 100755 --- a/build.sh +++ b/build.sh @@ -1,13 +1,12 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL # SPDX-FileCopyrightText: 2023 Harald Sitter +# SPDX-FileCopyrightText: 2024 Bruno Pajdek # Build image using mkosi, well, somewhat. mkosi is actually a bit too inflexible for our purposes so we generate a OS # tree using mkosi and then construct shipable raw images (for installation) and tarballs (for systemd-sysupdate) # ourselves. -# TODO port to ruby or python or something. it's getting too long for sh - set -ex NAME=kde-linux @@ -23,25 +22,16 @@ IMG=$OUTPUT.raw export SYSTEMD_LOG_LEVEL=debug -cat <<- EOF > mkosi.conf.d/00-environment.conf -[Content] -@Environment=CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA:-unknownSHA} -@Environment=CI_COMMIT_SHA=${CI_COMMIT_SHA:-unknownSHA} -@Environment=CI_PIPELINE_URL=${CI_PIPELINE_URL:-htts://invent.kde.org} -EOF - -cat <<- EOF > mkosi.conf.d/00-outputdirectory.conf -[Output] -OutputDirectory=${PWD} -EOF - # Make sure permissions are sound ./permission-fix.py mkosi \ - --distribution arch \ - --image-id "$NAME" \ - --image-version "$VERSION" \ + --environment="CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA:-unknownSHA}" \ + --environment="CI_COMMIT_SHA=${CI_COMMIT_SHA:-unknownSHA}" \ + --environment="CI_PIPELINE_URL=${CI_PIPELINE_URL:-https://invent.kde.org}" \ + --image-id="$NAME" \ + --image-version="$VERSION" \ + --output-directory=. "$@" # NOTE: /efi must be empty so auto mounting can happen. As such we put our templates in a different directory