From f4ed5d5b0a3d339deff98d3bccc65b608c5cb78c Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Sat, 13 Apr 2024 17:37:08 -0700 Subject: [PATCH] allow peridot repos to be used --- live-build.sh | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/live-build.sh b/live-build.sh index 7c0fd49..16b7082 100755 --- a/live-build.sh +++ b/live-build.sh @@ -16,12 +16,13 @@ usage: $SCRNAME [OPTIONS] Options: -o, --output-dir DIR -l, --live-image NAME + -p, --peridot ID # optional. will use peridot repos. -d, --debug # optional " -OPTS=$(getopt -a -n live-build -o l:,o:,d,h \ - -l live-image:,output-dir:,debug,help -- "$@") +OPTS=$(getopt -a -n live-build -o l:,o:,p:,d,h \ + -l live-image:,output-dir:,peridot:,debug,help -- "$@") function is_in_path() { builtin type -P "${1}" @@ -36,6 +37,7 @@ while :; do case "$1" in -l | --live-image) LIVE="$2" ; shift 2 ;; -o | --output-dir) OUTPUTDIR="$2" ; shift 2 ;; + -p | --peridot) PERIDOTID="$2" ; shift 2 ;; -d | --debug) DEBUG="--debug" ; shift ;; -h | --help) usage ;; --) shift ; break ;; @@ -64,6 +66,19 @@ if [ "$ret_val" -ne "0" ]; then exit 32 fi +function switch_repo_to_peridot() { + ID="$1" + # https://yumrepofs.build.resf.org/v1/projects/${ID}/repo/ + pushd repositories || { echo "not found"; exit 1; } + sed -i "s;ZZ_INTERNAL_BaseOS_REPO_URL_ZZ;https://yumrepofs.build.resf.org/v1/projects/${ID}/repo/BaseOS/\$basearch;g" core-peridot.xml + sed -i "s;ZZ_INTERNAL_AppStream_REPO_URL_ZZ;https://yumrepofs.build.resf.org/v1/projects/${ID}/repo/AppStream/\$basearch;g" core-peridot.xml + sed -i "s;ZZ_INTERNAL_CRB_REPO_URL_ZZ;https://yumrepofs.build.resf.org/v1/projects/${ID}/repo/CRB/\$basearch;g" core-peridot.xml + sed -i "s;ZZ_INTERNAL_extras_REPO_URL_ZZ;https://yumrepofs.build.resf.org/v1/projects/${ID}/repo/extras/\$basearch;g" core-peridot.xml + rm core.xml + ln -s core-peridot.xml core.xml + popd +} + function main() { /bin/rm config.xml if [ ! -f "configs/rocky-live-${LIVE,,}.xml" ]; then @@ -71,6 +86,11 @@ function main() { exit 42 fi ln -s "configs/rocky-live-${LIVE,,}.xml" config.xml + + if [ -n "$PERIDOTID" ]; then + switch_repo_to_peridot "${PERIDOTID}" + fi + kiwi-ng "$DEBUG" --type="iso" --profile="$LIVE-Live" --color-output system build --description="$SCRDIR" --target-dir "$OUTPUTDIR" }