From 280529ec122a4f129ef9981943b4417c327b548a Mon Sep 17 00:00:00 2001
From: Marta Vila Fernandes <ana.marta.lisboa.vila.fernandes@cern.ch>
Date: Thu, 30 Mar 2023 17:12:23 +0200
Subject: [PATCH 1/5]  update bootstrapping notes to alma9

---
 docs/koji/bootstrapping.md | 472 +++++++++++++++++--------------------
 1 file changed, 222 insertions(+), 250 deletions(-)

diff --git a/docs/koji/bootstrapping.md b/docs/koji/bootstrapping.md
index e0fe6a1..f46433c 100644
--- a/docs/koji/bootstrapping.md
+++ b/docs/koji/bootstrapping.md
@@ -1,41 +1,33 @@
 # Bootstrapping a new distro
 
 This document aims to describe how to create the Koji tag structure for a new
-distro, following the schema we use for CentOS 8. It is based on Koji tag inheritance
+distro, following the schema we use for Alma 9. It is based on Koji tag inheritance
 in order and the final structure looks like this:
 
-* mytag8-build
-    * centos8-cern
-        * cern8-stable
-            * buildsys8-stable
-                * centos8-defaults
+* mytag9al-build
+    * alma9-cern
+        * cern9al-stable
+            * buildsys9al-stable
+                * alma9-defaults
 
-([see example here](https://koji.cern.ch/taginfo?tagID=1182))
+([see example here](https://koji.cern.ch/taginfo?tagID=1981))
 
 
+The following commands were executed from aiadm.
+
 ## Define external repos
 
-The repo structure described here is based on the one created by [stream8_snapshots](https://gitlab.cern.ch/linuxsupport/cronjobs/stream8_snapshots/).
+The repo structure described here is based on the one created by [alma_snapshots](https://gitlab.cern.ch/linuxsupport/cronjobs/alma_snapshots).
 
 ```bash
-[aiadm10] ~ > koji add-external-repo cs8-baseos 'http://linuxsoft.cern.ch/cern/centos/s8/BaseOS/$arch/os/'
-Created external repo 405
-[aiadm10] ~ > koji add-external-repo cs8-appstream 'http://linuxsoft.cern.ch/cern/centos/s8/AppStream/$arch/os/'
-Created external repo 406
-[aiadm10] ~ > koji add-external-repo cs8-powertools 'http://linuxsoft.cern.ch/cern/centos/s8/PowerTools/$arch/os/'
-Created external repo 407
-[aiadm10] ~ > koji add-external-repo cs8-testing-baseos 'http://linuxsoft.cern.ch/cern/centos/s8-testing/BaseOS/$arch/os/'
-Created external repo 408
-[aiadm10] ~ > koji add-external-repo cs8-testing-appstream 'http://linuxsoft.cern.ch/cern/centos/s8-testing/AppStream/$arch/os/'
-Created external repo 409
-[aiadm10] ~ > koji add-external-repo cs8-testing-powertools 'http://linuxsoft.cern.ch/cern/centos/s8-testing/PowerTools/$arch/os/'
-Created external repo 410
-[aiadm10] ~ > koji add-external-repo cs8-latest-baseos 'http://linuxsoft.cern.ch/cern/centos/.s8-latest/BaseOS/$arch/os/'
-Created external repo 411
-[aiadm10] ~ > koji add-external-repo cs8-latest-appstream 'http://linuxsoft.cern.ch/cern/centos/.s8-latest/AppStream/$arch/os/'
-Created external repo 412
-[aiadm10] ~ > koji add-external-repo cs8-latest-powertools 'http://linuxsoft.cern.ch/cern/centos/.s8-latest/PowerTools/$arch/os/'
-Created external repo 413
+	koji add-external-repo alma9-baseos 'https://linuxsoft.cern.ch/cern/alma/9/BaseOS/$arch/os/'
+	koji add-external-repo alma9-appstream 'https://linuxsoft.cern.ch/cern/alma/9/AppStream/$arch/os/'
+	koji add-external-repo alma9-crb 'http://linuxsoft.cern.ch/cern/alma/9/CRB/$arch/os/'
+
+
+	koji add-external-repo alma9-testing-baseos 'https://linuxsoft.cern.ch/cern/alma/9-testing/BaseOS/$arch/os/'
+	koji add-external-repo alma9-testing-appstream 'https://linuxsoft.cern.ch/cern/alma/9-testing/AppStream/$arch/os/'
+	koji add-external-repo alma9-testing-crb 'http://linuxsoft.cern.ch/cern/alma/9-testing/CRB/$arch/os/'
 ```
 
 ## Create the base tag
@@ -43,17 +35,16 @@ Created external repo 413
 This is the tag that all others from this distro will inherit from.
 
 ```bash
-[aiadm10] ~ > koji add-tag centos8s-defaults --arches="x86_64 aarch64"
-[aiadm10] ~ > koji add-external-repo -t centos8s-defaults cs8-baseos -p 30 --mode bare
-Added external repo cs8-baseos to tag centos8s-defaults (priority 30)
-[aiadm10] ~ > koji add-external-repo -t centos8s-defaults cs8-appstream -p 40 --mode bare
-Added external repo cs8-appstream to tag centos8s-defaults (priority 40)
-[aiadm10] ~ > koji add-external-repo -t centos8s-defaults cs8-powertools -p 50 --mode bare
-Added external repo cs8-powertools to tag centos8s-defaults (priority 50)
-[aiadm10] ~ > koji add-group centos8s-defaults build
-[aiadm10] ~ > koji add-group centos8s-defaults srpm-build
-[aiadm10] ~ > koji add-group-pkg centos8s-defaults build bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info kernel-rpm-macros krb5-libs make patch python-rpm-macros python3-rpm-macros redhat-rpm-config rpm-build sed shadow-utils system-release tar unzip util-linux which xz
-[aiadm10] ~ > koji add-group-pkg centos8s-defaults srpm-build bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info kernel-rpm-macros krb5-libs make patch python-rpm-macros python3-rpm-macros redhat-rpm-config rpm-build sed shadow-utils system-release tar unzip util-linux which xz
+	koji add-tag alma9-defaults --arches="x86_64 aarch64"
+
+	koji add-external-repo -t alma9-defaults alma9-baseos -p 30 --mode bare
+	koji add-external-repo -t alma9-defaults alma9-appstream -p 40 --mode bare
+	koji add-external-repo -t alma9-defaults alma9-crb -p 50 --mode bare
+
+	koji add-group alma9-defaults build
+	koji add-group alma9-defaults srpm-build
+	koji add-group-pkg alma9-defaults build bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info kernel-rpm-macros krb5-libs make patch python-rpm-macros python3-rpm-macros redhat-rpm-config rpm-build sed shadow-utils system-release tar unzip util-linux which xz
+	koji add-group-pkg alma9-defaults srpm-build bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info kernel-rpm-macros krb5-libs make patch python-rpm-macros python3-rpm-macros redhat-rpm-config rpm-build sed shadow-utils system-release tar unzip util-linux which xz
 ```
 
 
@@ -65,40 +56,35 @@ dist tags our RPMs will be using.
 Notice that the buildsys tag inherits from the base tag we just created.
 
 ```bash
-[aiadm10] ~/lxdist-build/bin/tags (master) > cp buildsys8.sh buildsys8s.sh
-[aiadm10] ~/lxdist-build/bin/tags (master) > vim buildsys8s.sh
-[aiadm10] ~/lxdist-build/bin/tags (master) > cat buildsys8s.sh
-#!/bin/bash
+  $ cd bin/tags/
+	$ cat buildsys9al.sh 
+	#!/bin/bash
 
-TAG="buildsys8s"
-ARCHES="x86_64 aarch64"
-PERMS="admin"
+	TAG="buildsys9al"
+	ARCHES="x86_64 aarch64"
+	PERMS="admin"
 
 
-### You probably don't need to change anything below this
-PARENT="centos8s-defaults"
-PROFILE="koji" # change it for the test instance
-KOJI="/usr/bin/koji -p $PROFILE"
+	### You probably don't need to change anything below this
+	PARENT="alma9-defaults"
+	PROFILE="koji" # change it for the test instance
+	KOJI="/usr/bin/koji -p $PROFILE"
 
-$KOJI remove-tag $TAG-build
+	$KOJI remove-tag $TAG-build
 
-$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-build
-$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-testing
-$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-qa
-$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-stable
+	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-build
+	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-testing
+	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-qa
+	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-stable
 
-$KOJI edit-tag $TAG-testing --perm="$PERMS"
-$KOJI edit-tag $TAG-qa      --perm="$PERMS"
-$KOJI edit-tag $TAG-stable  --perm="$PERMS"
+	$KOJI edit-tag $TAG-testing --perm="$PERMS"
+	$KOJI edit-tag $TAG-qa      --perm="$PERMS"
+	$KOJI edit-tag $TAG-stable  --perm="$PERMS"
 
-$KOJI add-target $TAG $TAG-build $TAG-testing
-```
+	$KOJI add-target $TAG $TAG-build $TAG-testing
 
-Now run the script to create the tag:
-
-```bash
-[aiadm10] ~/lxdist-build/bin/tags (master) > bash buildsys8s.sh
-Tag buildsys8s-build does not exist
+	$ ./buildsys9al.sh 
+	No such tag: buildsys9al-build
 ```
 
 ## Create tag for EPEL
@@ -114,22 +100,20 @@ version for the distro you're adding. You can probably use the previous version
 for now. Good luck!
 
 ```bash
-[aiadm10] ~ > koji add-external-repo epel8s 'http://linuxsoft.cern.ch/epel/8/Everything/$arch/'
-Created external repo 417
-[aiadm10] ~ > koji add-external-repo epel-next8s 'http://linuxsoft.cern.ch/epel/next/8/Everything/$arch/'
-Created external repo 418
-[aiadm10] ~/lxdist-build/bin/tags (master) > cat epel8s.sh
-#!/bin/bash
 
-TAG="epel8s"
 
-koji add-tag --arches "x86_64 aarch64" $TAG
-koji add-external-repo --tag=$TAG epel-next8s -p 59 --mode=bare
-koji add-external-repo --tag=$TAG epel8s -p 60 --mode=bare
+koji add-external-repo epel9 'https://linuxsoft.cern.ch/epel/9/Everything/$arch/'
+koji add-external-repo epel-next9 'https://linuxsoft.cern.ch/epel/next/9/Everything/$arch/'
+
+$ cat epel9.sh 
+	#!/bin/bash
+
+	TAG="epel9"
+
+	koji add-tag --arches "x86_64 aarch64" $TAG
+	koji add-external-repo --tag=$TAG epel9 -p 60 --mode=bare
 
-[aiadm10] ~/lxdist-build/bin/tags (master) > ./epel8s.sh
-Added external repo epel-next8s to tag epel8s (priority 59)
-Added external repo epel8s to tag epel8s (priority 60)
+$ ./epel9.sh 
 ```
 
 ## Create the cern tag
@@ -139,60 +123,58 @@ This is the tag where we'll build all our core RPMs, such as `centos-release`, e
 This tag inherits from the buildsys tag we just created.
 
 ```bash
-[aiadm10] ~/lxdist-build/bin/tags (master) > cp cern8.sh cern8s.sh
-[aiadm10] ~/lxdist-build/bin/tags (master) > vim cern8s.sh
-[aiadm10] ~/lxdist-build/bin/tags (master) > cat cern8s.sh
-#!/bin/bash
-
-TAG="cern8s"
-ARCHES="x86_64 aarch64"
-PERMS="admin"
-EPEL=1
-TESTING=1
-DISTTAG="el8s.cern"
-
-### You probably don't need to change anything below this
-PARENT="buildsys8s-stable"
-PROFILE="koji" # change it for the test instance
-KOJI="/usr/bin/koji -p $PROFILE"
-
-$KOJI remove-tag $TAG-build
-
-$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-build
-$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-testing
-$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-qa
-$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-stable
-
-if [[ $DISTTAG != "" ]]; then
-  $KOJI add-group-pkg $TAG-build build buildsys-macros-$DISTTAG
-  $KOJI add-group-pkg $TAG-build srpm-build buildsys-macros-$DISTTAG
-fi
-
-if [[ $EPEL -eq 1 ]]; then
-  $KOJI add-tag-inheritance --priority 10 ${TAG}-build epel8s
-fi
-
-if [[ $TESTING -eq 1 ]]; then
-  $KOJI add-external-repo -t $TAG-build cs8-testing-baseos -p 25 --mode=bare
-  $KOJI add-external-repo -t $TAG-build cs8-testing-appstream -p 35 --mode=bare
-  $KOJI add-external-repo -t $TAG-build cs8-testing-powertools -p 45 --mode=bare
-fi
-
-$KOJI edit-tag $TAG-testing --perm="$PERMS"
-$KOJI edit-tag $TAG-qa      --perm="$PERMS"
-$KOJI edit-tag $TAG-stable  --perm="$PERMS"
-
-$KOJI add-target $TAG $TAG-build $TAG-testing
+$ cat cern9al.sh 
+	#!/bin/bash
+
+	TAG="cern9al"
+	ARCHES="x86_64 aarch64"
+	PERMS="admin"
+	EPEL=1
+	TESTING=1
+	DISTTAG="al9.cern"
+
+	### You probably don't need to change anything below this
+	PARENT="buildsys9al-stable"
+	PROFILE="koji" # change it for the test instance
+	KOJI="/usr/bin/koji -p $PROFILE"
+
+	$KOJI remove-tag $TAG-build
+
+	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-build
+	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-testing
+	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-qa
+	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-stable
+
+	if [[ $DISTTAG != "" ]]; then
+	  $KOJI add-group-pkg $TAG-build build buildsys-macros-$DISTTAG
+	  $KOJI add-group-pkg $TAG-build srpm-build buildsys-macros-$DISTTAG
+	fi
+
+	if [[ $EPEL -eq 1 ]]; then
+	  $KOJI add-tag-inheritance --priority 10 ${TAG}-build epel9
+	fi
+
+	if [[ $TESTING -eq 1 ]]; then
+	  $KOJI add-external-repo -t $TAG-build alma9-testing-baseos -p 25 --mode=bare
+	  $KOJI add-external-repo -t $TAG-build alma9-testing-appstream -p 35 --mode=bare
+	  $KOJI add-external-repo -t $TAG-build alma9-testing-crb -p 45 --mode=bare
+	fi
+
+	$KOJI edit-tag $TAG-testing --perm="$PERMS"
+	$KOJI edit-tag $TAG-qa      --perm="$PERMS"
+	$KOJI edit-tag $TAG-stable  --perm="$PERMS"
+
+	$KOJI add-target $TAG $TAG-build $TAG-testing
 ```
 
 Now run the script to create the tag:
 
 ```bash
-[aiadm10] ~/lxdist-build/bin/tags (master) > bash cern8s.sh
-Tag cern8s-build does not exist
-Added external repo cs8-testing-baseos to tag cern8s-build (priority 25)
-Added external repo cs8-testing-appstream to tag cern8s-build (priority 35)
-Added external repo cs8-testing-powertools to tag cern8s-build (priority 45)
+	$ ./cern9al.sh 
+	No such tag: cern9al-build
+	Added external repo alma9-testing-baseos to tag cern9al-build (priority 25)
+	Added external repo alma9-testing-appstream to tag cern9al-build (priority 35)
+	Added external repo alma9-testing-crb to tag cern9al-build (priority 45)
 ```
 
 The `cern` tag is special because it includes a [comps.xml](https://gitlab.cern.ch/linuxsupport/comps.xml)
@@ -203,10 +185,10 @@ done in the snapshotting scripts will fail.
 Now you need to add the CERN tag as an external repo (as it's used by the
 [image builds tag](#create-tag-for-image-builds) that you'll create in a little while.
 However, the repos don't exist yet because no package has been tagged, so
-[Mash](https://gitlab.cern.ch/linuxsupport/cronjobs/mash) hasn't run yet, and
-also the [snapshotting](https://gitlab.cern.ch/linuxsupport/cronjobs/stream8_snapshots/) script hasn't picked it up yet.
+[Koji dist-repo](https://gitlab.cern.ch/linuxsupport/cronjobs/koji-distrepo) hasn't run yet, and
+also the [snapshotting](https://gitlab.cern.ch/linuxsupport/cronjobs/alma_snapshots) script hasn't picked it up yet.
 
-You can wait a day for the Mash Scheduler job to run, or you can run it manually.
+You can wait a day for the Koji dist-repo Scheduler job to run, or you can run it manually.
 Once that's happened, you can wait until the next morning for the snapshotting script
 to do it's magic, or you can once again run it manually. You might have to force
 production to point to the new snapshot, otherwise the prod repo will still be missing/broken.
@@ -214,12 +196,8 @@ production to point to the new snapshot, otherwise the prod repo will still be m
 Once all that is done, you can finally add the CERN tag as an external repo:
 
 ```bash
-[aiadm10] ~ > koji add-external-repo cs8-cern 'http://linuxsoft.cern.ch/cern/centos/s8/CERN/$arch/'
-Created external repo 414
-[aiadm10] ~ > koji add-external-repo cs8-testing-cern 'http://linuxsoft.cern.ch/cern/centos/s8-testing/CERN/$arch/'
-Created external repo 415
-[aiadm10] ~ > koji add-external-repo cs8-latest-cern 'http://linuxsoft.cern.ch/cern/centos/.s8-latest/CERN/$arch/'
-Created external repo 416
+	koji add-external-repo alma9-cern 'http://linuxsoft.cern.ch/cern/alma/9/CERN/$arch/'
+	koji add-external-repo alma9-testing-cern 'http://linuxsoft.cern.ch/cern/alma/9-testing/CERN/$arch/'
 ```
 
 ## Create base for user tags
@@ -227,78 +205,70 @@ Created external repo 416
 Now we start to bring it all together with a tag that user tags will inherit from:
 
 ```bash
-koji add-tag --arches "x86_64 aarch64" --parent cern8s-stable centos8s-cern
-koji add-group-pkg centos8s-cern srpm-build cern-koji-addons
-koji add-group-pkg centos8s-cern build cern-koji-addons
+	koji add-tag --arches "x86_64 aarch64" --parent cern9al-stable alma9-cern
+	koji add-group-pkg alma9-cern srpm-build cern-koji-addons
+	koji add-group-pkg alma9-cern build cern-koji-addons
 ```
 
 ## Create script to create user tags
 
-Make a copy of [createtag8.sh](https://gitlab.cern.ch/linuxsupport/lxdist-build/-/blob/991695e7/bin/tags/createtag8.sh)
+Make a copy of [createtag9al.sh](https://gitlab.cern.ch/linuxsupport/lxdist-build/-/blob/master/bin/tags/createtag9al.sh)
 (or whatever the latest version is) for your new distro and adapt as needed:
 
 ```bash
-[aiadm10] ~/lxdist-build/bin/tags (master) > cp createtag8.sh createtag8s.sh
-[aiadm10] ~/lxdist-build/bin/tags (master) > vim createtag8s.sh
-[aiadm10] ~/lxdist-build/bin/tags (master) > cat createtag8s.sh
-# This script is to be executed from within the other *8s.sh scripts
-if [[ "${TAG: -2}" != "8s" ]]; then
-  echo "Error: The tag name must end with an 8s (ie. 'mytag8s')"
-  exit 1
-fi
-
-ARCHES="${ARCHES:-x86_64}"
-PERMS="${PERMS:-}"
-TESTING="${TESTING:-0}"
-CR="${CR:-0}"
-EPEL="${EPEL:-0}"
-CLOUD="${CLOUD:-}"
-DISTTAG="${DISTTAG:-}"
-
-PARENT="${PARENT:-centos8s-cern}"
-PROFILE="${PROFILE:-koji}" # change it for the test instance
-KOJI="${KOJI:-/usr/bin/koji -p $PROFILE}"
-
-$KOJI remove-tag ${TAG}-build
-
-$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" ${TAG}-build
-$KOJI add-tag --arches "$ARCHES" ${TAG}-testing
-$KOJI add-tag --arches "$ARCHES" ${TAG}-qa
-$KOJI add-tag --arches "$ARCHES" ${TAG}-stable
-
-if [[ $DISTTAG != "" ]]; then
-  $KOJI add-group-pkg ${TAG}-build build buildsys-macros-${DISTTAG}
-  $KOJI add-group-pkg ${TAG}-build srpm-build buildsys-macros-${DISTTAG}
-fi
-
-if [[ $EPEL -eq 1 ]]; then
-  $KOJI add-tag-inheritance --priority 10 ${TAG}-build epel8s
-fi
-
-if [[ $CR -eq 1 ]]; then
-  $KOJI add-external-repo -t ${TAG}-build cs8-cr -p 29 --mode=bare
-fi
-
-if [[ $TESTING -eq 1 ]]; then
-  if [[ $CR -eq 1 ]]; then
-    $KOJI add-external-repo -t ${TAG}-build cs8-testing-cr -p 24 --mode=bare
-  fi
-  $KOJI add-external-repo -t ${TAG}-build cs8-testing-baseos -p 25 --mode=bare
-  $KOJI add-external-repo -t ${TAG}-build cs8-testing-appstream -p 35 --mode=bare
-  $KOJI add-external-repo -t ${TAG}-build cs8-testing-powertools -p 45 --mode=bare
-fi
-
-if [[ $CLOUD != "" ]]; then
-  $KOJI add-external-repo -t ${TAG}-build cs8-openstack-${CLOUD} -p 15 --mode=bare
-  $KOJI add-external-repo -t ${TAG}-build cs8-openstack-${CLOUD}-builddep -p 20 --mode=bare
-fi
-
-$KOJI edit-tag ${TAG}-testing --perm="$PERMS"
-$KOJI edit-tag ${TAG}-qa      --perm="$PERMS"
-$KOJI edit-tag ${TAG}-stable  --perm="$PERMS"
+$ cat createtag9al.sh 
+	# This script is to be executed from within the other *9al.sh scripts
+	if [[ "${TAG: -3}" != "9al" ]]; then
+	  echo "Error: The tag name must end with a 9al (ie. 'mytag9al')"
+	  exit 1
+	fi
+
+	ARCHES="${ARCHES:-x86_64 aarch64}"
+	PERMS="${PERMS:-}"
+	TESTING="${TESTING:-0}"
+	EPEL="${EPEL:-0}"
+	CLOUD="${CLOUD:-}"
+	DISTTAG="${DISTTAG:-al9.cern}"
+
+	PARENT="${PARENT:-alma9-cern}"
+	PROFILE="${PROFILE:-koji}" # change it for the test instance
+	KOJI="${KOJI:-/usr/bin/koji -p $PROFILE}"
+
+	$KOJI remove-tag ${TAG}-build
+
+	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" ${TAG}-build
+	$KOJI add-tag --arches "$ARCHES" ${TAG}-testing
+	$KOJI add-tag --arches "$ARCHES" ${TAG}-qa
+	$KOJI add-tag --arches "$ARCHES" ${TAG}-stable
+
+	if [[ $DISTTAG != "" ]]; then
+	  $KOJI add-group-pkg ${TAG}-build build buildsys-macros-${DISTTAG}
+	  $KOJI add-group-pkg ${TAG}-build srpm-build buildsys-macros-${DISTTAG}
+	fi
+
+	if [[ $EPEL -eq 1 ]]; then
+	  $KOJI add-tag-inheritance --priority 10 ${TAG}-build epel9
+	fi
+
+	if [[ $TESTING -eq 1 ]]; then
+	  $KOJI add-external-repo -t ${TAG}-build alma9-testing-baseos -p 25 --mode=bare
+	  $KOJI add-external-repo -t ${TAG}-build alma9-testing-appstream -p 35 --mode=bare
+	  $KOJI add-external-repo -t ${TAG}-build alma9-testing-crb -p 45 --mode=bare
+	fi
+
+	if [[ $CLOUD != "" ]]; then
+	  $KOJI add-external-repo -t ${TAG}-build alma9-openstack-${CLOUD} -p 15 --mode=bare
+	  $KOJI add-external-repo -t ${TAG}-build alma9-openstack-${CLOUD}-builddep -p 20 --mode=bare
+	  $KOJI add-external-repo -t ${TAG}-build alma9-openstack-${CLOUD}-deps -p 25 --mode=bare
+	fi
+
+	$KOJI edit-tag ${TAG}-testing --perm="$PERMS"
+	$KOJI edit-tag ${TAG}-qa      --perm="$PERMS"
+	$KOJI edit-tag ${TAG}-stable  --perm="$PERMS"
+
+	$KOJI add-tag-inheritance --priority 5 ${TAG}-build ${TAG}-testing
+	$KOJI add-target ${TAG} ${TAG}-build ${TAG}-testing
 
-$KOJI add-tag-inheritance --priority 1 ${TAG}-build ${TAG}-testing
-$KOJI add-target ${TAG} ${TAG}-build ${TAG}-testing
 ```
 
 
@@ -309,37 +279,47 @@ We need a tag for the openafs kernel modules, we can create it using the
 script we created [previously](#create-script-to-create-user-tags).
 
 ```bash
-[aiadm10] ~/lxdist-build/bin/tags (master) > cp openafs8.sh openafs8s.sh
-[aiadm10] ~/lxdist-build/bin/tags (master) > vim openafs8s.sh
-[aiadm10] ~/lxdist-build/bin/tags (master) > cat openafs8s.sh
-#!/bin/bash
-
-TAG="openafs8s"
-ARCHES="x86_64 aarch64"
-#PERMS=""
-TESTING=1
-#EPEL=0
-DISTTAG="el8s.cern"
-
-### You probably don't need to change anything below this
-source createtag8s.sh
-
-$KOJI add-external-repo -t ${TAG}-build cs8-latest-baseos -p 20 --mode=bare
-[aiadm10] ~/lxdist-build/bin/tags (master) > bash openafs8s.sh
-Tag openafs8s-build does not exist
-Added external repo cs8-testing-baseos to tag openafs8s-build (priority 25)
-Added external repo cs8-testing-appstream to tag openafs8s-build (priority 35)
-Added external repo cs8-testing-powertools to tag openafs8s-build (priority 45)
-Added external repo cs8-latest-baseos to tag openafs8s-build (priority 20)
+$ cat openafs9al.sh 
+	#!/bin/bash
+
+	TAG="openafs9al"
+	#ARCHES="x86_64 aarch64"
+	#PERMS=""
+	TESTING=1
+	#EPEL=0
+	DISTTAG="al9.cern"
+
+	### You probably don't need to change anything below this
+	source createtag9al.sh
+
+	$KOJI add-external-repo -t ${TAG}-build alma9-baseos -p 20 --mode=bare
+	$KOJI add-external-repo -t ${TAG}-build alma9-appstream -p 30 --mode=bare
+	# As we may need dependencies apart from the 'latest' build,
+	# we add -stable to ensure that we have everything
+	$KOJI add-tag-inheritance --priority 3 ${TAG}-build ${TAG}-stable
+	# However, as kmod-openafs is built from the 'openafs' package, it's often the
+	# case that koji only sees the latest kmod package. We we may expect to see
+	# other packages that are also built from 'openafs' (such as openafs-devel)
+	# We can override the default koji behaviour to show all packages, which avoids
+	# this unfortunate confusion
+	$KOJI edit-tag ${TAG}-build -x repo_include_all=True
+
+$ ./openafs9al.sh 
+	No such tag: openafs9al-build
+	Added external repo alma9-testing-baseos to tag openafs9al-build (priority 25)
+	Added external repo alma9-testing-appstream to tag openafs9al-build (priority 35)
+	Added external repo alma9-testing-crb to tag openafs9al-build (priority 45)
+	Added external repo alma9-baseos to tag openafs9al-build (priority 20)
+	Added external repo alma9-appstream to tag openafs9al-build (priority 30)
 ```
 
 Now we can go ahead and add the openafs package to that tag, or we can do it later:
 
 ```bash
-[aiadm10] ~ > for i in testing qa stable; do koji add-pkg --owner=kojici openafs8s-$i openafs; done
-Adding 1 packages to tag openafs8s-testing
-Adding 1 packages to tag openafs8s-qa
-Adding 1 packages to tag openafs8s-stable
+$ for i in testing qa stable; do koji add-pkg --owner=kojici openafs9al-$i openafs; done
+	Adding 1 packages to tag openafs9al-testing
+	Adding 1 packages to tag openafs9al-qa
+	Adding 1 packages to tag openafs9al-stable
 ```
 
 ## Create tag for image builds
@@ -392,43 +372,35 @@ We need a tag for testing `rpmci`, we can create it using the
 script we created [previously](#create-script-to-create-user-tags).
 
 ```bash
-[aiadm10] ~/lxdist-build/bin/tags (master) > cp mytag8.sh mytag8.sh
-[aiadm10] ~/lxdist-build/bin/tags (master) > vim mytag8s.sh
-[aiadm10] ~/lxdist-build/bin/tags (master) > cat mytag8s.sh
-#!/bin/bash
-
-TAG="mytag8s"
-#ARCHES="x86_64 aarch64"
-#PERMS=""
-#TESTING=0
-#EPEL=0
-#DISTTAG=""
-
-### You probably don't need to change anything below this
-source createtag8s.sh
-[aiadm10] ~/lxdist-build/bin/tags (master) > bash mytag8s.sh
-Tag mytag8s-build does not exist
-Added external repo cs8-testing-baseos to tag mytag8s-build (priority 25)
-Added external repo cs8-testing-appstream to tag mytag8s-build (priority 35)
-Added external repo cs8-testing-powertools to tag mytag8s-build (priority 45)
-Added external repo cs8-latest-baseos to tag mytag8s-build (priority 20)
+$ cat mytag9al.sh 
+	#!/bin/bash
+
+	TAG="mytag9al"
+	#ARCHES="x86_64 aarch64"
+	#PERMS=""
+	#TESTING=0
+	#EPEL=0
+	#DISTTAG=""
+
+	### You probably don't need to change anything below this
+	source createtag9al.sh
 ```
 
 Now we can go ahead and add the myrpm package to that tag, or we can do it later:
 
 ```bash
-[aiadm10] ~ > for i in testing qa stable; do koji add-pkg --owner=kojici mytag8s-$i myrpm; done
-Adding 1 packages to tag mytag8s-testing
-Adding 1 packages to tag mytag8s-qa
-Adding 1 packages to tag mytag8s-stable
+$ for i in testing qa stable; do koji add-pkg --owner=kojici mytag9al-$i myrpm; done
+	Adding 1 packages to tag mytag9al-testing
+	Adding 1 packages to tag mytag9al-qa
+	Adding 1 packages to tag mytag9al-stable
 ```
 
 ## Commit your changes
 Don't forget to commit the files you've created so far:
 
 ```bash
-[aiadm10] ~/lxdist-build/bin/tags (master) > git add createtag8s.sh buildsys8s.sh cern8s.sh epel8s.sh openafs8s.sh image8s.sh mytag8s.sh
-[aiadm10] ~/lxdist-build/bin/tags (master) > git commit createtag8s.sh buildsys8s.sh cern8s.sh epel8s.sh openafs8s.sh image8s.sh mytag8s.sh -m "Added CentOS Stream 8 scripts"
+[aiadm10] ~/lxdist-build/bin/tags (master) > git add createtag9al.sh buildsys9al.sh cern9al.sh epel9al.sh openafs9al.sh image9al.sh mytag9al.sh
+[aiadm10] ~/lxdist-build/bin/tags (master) > git commit createtag9al.sh buildsys9al.sh cern9al.sh epel9al.sh openafs9al.sh image9al.sh mytag9al.sh -m "Added Alma9 scripts"
 [aiadm10] ~/lxdist-build/bin/tags (master) > git push origin master
 ```
 
-- 
GitLab


From 7d92b7a4b46c1d228ce409068f84d73f3cba42c0 Mon Sep 17 00:00:00 2001
From: Marta Vila Fernandes <ana.marta.lisboa.vila.fernandes@cern.ch>
Date: Mon, 3 Apr 2023 15:44:48 +0200
Subject: [PATCH 2/5] add latest, fix identation, fix url

---
 docs/koji/bootstrapping.md | 54 ++++++++++++++++++++------------------
 1 file changed, 29 insertions(+), 25 deletions(-)

diff --git a/docs/koji/bootstrapping.md b/docs/koji/bootstrapping.md
index f46433c..7950e3a 100644
--- a/docs/koji/bootstrapping.md
+++ b/docs/koji/bootstrapping.md
@@ -20,14 +20,18 @@ The following commands were executed from aiadm.
 The repo structure described here is based on the one created by [alma_snapshots](https://gitlab.cern.ch/linuxsupport/cronjobs/alma_snapshots).
 
 ```bash
-	koji add-external-repo alma9-baseos 'https://linuxsoft.cern.ch/cern/alma/9/BaseOS/$arch/os/'
-	koji add-external-repo alma9-appstream 'https://linuxsoft.cern.ch/cern/alma/9/AppStream/$arch/os/'
-	koji add-external-repo alma9-crb 'http://linuxsoft.cern.ch/cern/alma/9/CRB/$arch/os/'
+koji add-external-repo alma9-baseos 'https://linuxsoft.cern.ch/cern/alma/9/BaseOS/$arch/os/'
+koji add-external-repo alma9-appstream 'https://linuxsoft.cern.ch/cern/alma/9/AppStream/$arch/os/'
+koji add-external-repo alma9-crb 'http://linuxsoft.cern.ch/cern/alma/9/CRB/$arch/os/'
 
 
-	koji add-external-repo alma9-testing-baseos 'https://linuxsoft.cern.ch/cern/alma/9-testing/BaseOS/$arch/os/'
-	koji add-external-repo alma9-testing-appstream 'https://linuxsoft.cern.ch/cern/alma/9-testing/AppStream/$arch/os/'
-	koji add-external-repo alma9-testing-crb 'http://linuxsoft.cern.ch/cern/alma/9-testing/CRB/$arch/os/'
+koji add-external-repo alma9-testing-baseos 'https://linuxsoft.cern.ch/cern/alma/9-testing/BaseOS/$arch/os/'
+koji add-external-repo alma9-testing-appstream 'https://linuxsoft.cern.ch/cern/alma/9-testing/AppStream/$arch/os/'
+koji add-external-repo alma9-testing-crb 'http://linuxsoft.cern.ch/cern/alma/9-testing/CRB/$arch/os/'
+
+koji add-external-repo alma9-latest-baseos 'https://linuxsoft.cern.ch/cern/alma/.9-latest/BaseOS/$arch/os/'
+koji add-external-repo alma9-latest-appstream 'https://linuxsoft.cern.ch/cern/alma/.9-latest/AppStream/$arch/os/'
+koji add-external-repo alma9-latest-crb 'http://linuxsoft.cern.ch/cern/alma/.9-latest/CRB/$arch/os/'
 ```
 
 ## Create the base tag
@@ -35,16 +39,16 @@ The repo structure described here is based on the one created by [alma_snapshots
 This is the tag that all others from this distro will inherit from.
 
 ```bash
-	koji add-tag alma9-defaults --arches="x86_64 aarch64"
+koji add-tag alma9-defaults --arches="x86_64 aarch64"
 
-	koji add-external-repo -t alma9-defaults alma9-baseos -p 30 --mode bare
-	koji add-external-repo -t alma9-defaults alma9-appstream -p 40 --mode bare
-	koji add-external-repo -t alma9-defaults alma9-crb -p 50 --mode bare
+koji add-external-repo -t alma9-defaults alma9-baseos -p 30 --mode bare
+koji add-external-repo -t alma9-defaults alma9-appstream -p 40 --mode bare
+koji add-external-repo -t alma9-defaults alma9-crb -p 50 --mode bare
 
-	koji add-group alma9-defaults build
-	koji add-group alma9-defaults srpm-build
-	koji add-group-pkg alma9-defaults build bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info kernel-rpm-macros krb5-libs make patch python-rpm-macros python3-rpm-macros redhat-rpm-config rpm-build sed shadow-utils system-release tar unzip util-linux which xz
-	koji add-group-pkg alma9-defaults srpm-build bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info kernel-rpm-macros krb5-libs make patch python-rpm-macros python3-rpm-macros redhat-rpm-config rpm-build sed shadow-utils system-release tar unzip util-linux which xz
+koji add-group alma9-defaults build
+koji add-group alma9-defaults srpm-build
+koji add-group-pkg alma9-defaults build bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info kernel-rpm-macros krb5-libs make patch python-rpm-macros python3-rpm-macros redhat-rpm-config rpm-build sed shadow-utils system-release tar unzip util-linux which xz
+koji add-group-pkg alma9-defaults srpm-build bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info kernel-rpm-macros krb5-libs make patch python-rpm-macros python3-rpm-macros redhat-rpm-config rpm-build sed shadow-utils system-release tar unzip util-linux which xz
 ```
 
 
@@ -56,8 +60,8 @@ dist tags our RPMs will be using.
 Notice that the buildsys tag inherits from the base tag we just created.
 
 ```bash
-  $ cd bin/tags/
-	$ cat buildsys9al.sh 
+$ cd bin/tags/
+$ cat buildsys9al.sh 
 	#!/bin/bash
 
 	TAG="buildsys9al"
@@ -83,7 +87,7 @@ Notice that the buildsys tag inherits from the base tag we just created.
 
 	$KOJI add-target $TAG $TAG-build $TAG-testing
 
-	$ ./buildsys9al.sh 
+$ ./buildsys9al.sh 
 	No such tag: buildsys9al-build
 ```
 
@@ -103,7 +107,6 @@ for now. Good luck!
 
 
 koji add-external-repo epel9 'https://linuxsoft.cern.ch/epel/9/Everything/$arch/'
-koji add-external-repo epel-next9 'https://linuxsoft.cern.ch/epel/next/9/Everything/$arch/'
 
 $ cat epel9.sh 
 	#!/bin/bash
@@ -170,7 +173,7 @@ $ cat cern9al.sh
 Now run the script to create the tag:
 
 ```bash
-	$ ./cern9al.sh 
+$ ./cern9al.sh 
 	No such tag: cern9al-build
 	Added external repo alma9-testing-baseos to tag cern9al-build (priority 25)
 	Added external repo alma9-testing-appstream to tag cern9al-build (priority 35)
@@ -196,8 +199,9 @@ production to point to the new snapshot, otherwise the prod repo will still be m
 Once all that is done, you can finally add the CERN tag as an external repo:
 
 ```bash
-	koji add-external-repo alma9-cern 'http://linuxsoft.cern.ch/cern/alma/9/CERN/$arch/'
-	koji add-external-repo alma9-testing-cern 'http://linuxsoft.cern.ch/cern/alma/9-testing/CERN/$arch/'
+koji add-external-repo alma9-cern 'http://linuxsoft.cern.ch/cern/alma/9/CERN/$arch/'
+koji add-external-repo alma9-testing-cern 'http://linuxsoft.cern.ch/cern/alma/9-testing/CERN/$arch/'
+koji add-external-repo alma9-latest-cern 'http://linuxsoft.cern.ch/cern/alma/.9-latest/CERN/$arch/'
 ```
 
 ## Create base for user tags
@@ -205,14 +209,14 @@ Once all that is done, you can finally add the CERN tag as an external repo:
 Now we start to bring it all together with a tag that user tags will inherit from:
 
 ```bash
-	koji add-tag --arches "x86_64 aarch64" --parent cern9al-stable alma9-cern
-	koji add-group-pkg alma9-cern srpm-build cern-koji-addons
-	koji add-group-pkg alma9-cern build cern-koji-addons
+koji add-tag --arches "x86_64 aarch64" --parent cern9al-stable alma9-cern
+koji add-group-pkg alma9-cern srpm-build cern-koji-addons
+koji add-group-pkg alma9-cern build cern-koji-addons
 ```
 
 ## Create script to create user tags
 
-Make a copy of [createtag9al.sh](https://gitlab.cern.ch/linuxsupport/lxdist-build/-/blob/master/bin/tags/createtag9al.sh)
+Make a copy of [createtag9al.sh](https://gitlab.cern.ch/linuxsupport/lxdist-build/-/blob/dae233dd6c49a31e7486dc5ede41d4b77b649b4f/bin/tags/createtag9al.sh)
 (or whatever the latest version is) for your new distro and adapt as needed:
 
 ```bash
-- 
GitLab


From a6011f1a85191c0733c967d5e2edfc5ba0ab51ae Mon Sep 17 00:00:00 2001
From: Marta Vila Fernandes <ana.marta.lisboa.vila.fernandes@cern.ch>
Date: Wed, 5 Apr 2023 13:15:09 +0200
Subject: [PATCH 3/5] fix identation

---
 docs/koji/bootstrapping.md | 326 ++++++++++++++++++-------------------
 1 file changed, 163 insertions(+), 163 deletions(-)

diff --git a/docs/koji/bootstrapping.md b/docs/koji/bootstrapping.md
index 7950e3a..380448e 100644
--- a/docs/koji/bootstrapping.md
+++ b/docs/koji/bootstrapping.md
@@ -62,33 +62,33 @@ Notice that the buildsys tag inherits from the base tag we just created.
 ```bash
 $ cd bin/tags/
 $ cat buildsys9al.sh 
-	#!/bin/bash
+#!/bin/bash
 
-	TAG="buildsys9al"
-	ARCHES="x86_64 aarch64"
-	PERMS="admin"
+TAG="buildsys9al"
+ARCHES="x86_64 aarch64"
+PERMS="admin"
 
 
-	### You probably don't need to change anything below this
-	PARENT="alma9-defaults"
-	PROFILE="koji" # change it for the test instance
-	KOJI="/usr/bin/koji -p $PROFILE"
+### You probably don't need to change anything below this
+PARENT="alma9-defaults"
+PROFILE="koji" # change it for the test instance
+KOJI="/usr/bin/koji -p $PROFILE"
 
-	$KOJI remove-tag $TAG-build
+$KOJI remove-tag $TAG-build
 
-	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-build
-	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-testing
-	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-qa
-	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-stable
+$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-build
+$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-testing
+$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-qa
+$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-stable
 
-	$KOJI edit-tag $TAG-testing --perm="$PERMS"
-	$KOJI edit-tag $TAG-qa      --perm="$PERMS"
-	$KOJI edit-tag $TAG-stable  --perm="$PERMS"
+$KOJI edit-tag $TAG-testing --perm="$PERMS"
+$KOJI edit-tag $TAG-qa      --perm="$PERMS"
+$KOJI edit-tag $TAG-stable  --perm="$PERMS"
 
-	$KOJI add-target $TAG $TAG-build $TAG-testing
+$KOJI add-target $TAG $TAG-build $TAG-testing
 
 $ ./buildsys9al.sh 
-	No such tag: buildsys9al-build
+No such tag: buildsys9al-build
 ```
 
 ## Create tag for EPEL
@@ -109,12 +109,12 @@ for now. Good luck!
 koji add-external-repo epel9 'https://linuxsoft.cern.ch/epel/9/Everything/$arch/'
 
 $ cat epel9.sh 
-	#!/bin/bash
+#!/bin/bash
 
-	TAG="epel9"
+TAG="epel9"
 
-	koji add-tag --arches "x86_64 aarch64" $TAG
-	koji add-external-repo --tag=$TAG epel9 -p 60 --mode=bare
+koji add-tag --arches "x86_64 aarch64" $TAG
+koji add-external-repo --tag=$TAG epel9 -p 60 --mode=bare
 
 $ ./epel9.sh 
 ```
@@ -127,57 +127,57 @@ This tag inherits from the buildsys tag we just created.
 
 ```bash
 $ cat cern9al.sh 
-	#!/bin/bash
-
-	TAG="cern9al"
-	ARCHES="x86_64 aarch64"
-	PERMS="admin"
-	EPEL=1
-	TESTING=1
-	DISTTAG="al9.cern"
-
-	### You probably don't need to change anything below this
-	PARENT="buildsys9al-stable"
-	PROFILE="koji" # change it for the test instance
-	KOJI="/usr/bin/koji -p $PROFILE"
-
-	$KOJI remove-tag $TAG-build
-
-	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-build
-	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-testing
-	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-qa
-	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-stable
-
-	if [[ $DISTTAG != "" ]]; then
-	  $KOJI add-group-pkg $TAG-build build buildsys-macros-$DISTTAG
-	  $KOJI add-group-pkg $TAG-build srpm-build buildsys-macros-$DISTTAG
-	fi
-
-	if [[ $EPEL -eq 1 ]]; then
-	  $KOJI add-tag-inheritance --priority 10 ${TAG}-build epel9
-	fi
-
-	if [[ $TESTING -eq 1 ]]; then
-	  $KOJI add-external-repo -t $TAG-build alma9-testing-baseos -p 25 --mode=bare
-	  $KOJI add-external-repo -t $TAG-build alma9-testing-appstream -p 35 --mode=bare
-	  $KOJI add-external-repo -t $TAG-build alma9-testing-crb -p 45 --mode=bare
-	fi
-
-	$KOJI edit-tag $TAG-testing --perm="$PERMS"
-	$KOJI edit-tag $TAG-qa      --perm="$PERMS"
-	$KOJI edit-tag $TAG-stable  --perm="$PERMS"
-
-	$KOJI add-target $TAG $TAG-build $TAG-testing
+#!/bin/bash
+
+TAG="cern9al"
+ARCHES="x86_64 aarch64"
+PERMS="admin"
+EPEL=1
+TESTING=1
+DISTTAG="al9.cern"
+
+### You probably don't need to change anything below this
+PARENT="buildsys9al-stable"
+PROFILE="koji" # change it for the test instance
+KOJI="/usr/bin/koji -p $PROFILE"
+
+$KOJI remove-tag $TAG-build
+
+$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-build
+$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-testing
+$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-qa
+$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-stable
+
+if [[ $DISTTAG != "" ]]; then
+$KOJI add-group-pkg $TAG-build build buildsys-macros-$DISTTAG
+$KOJI add-group-pkg $TAG-build srpm-build buildsys-macros-$DISTTAG
+fi
+
+if [[ $EPEL -eq 1 ]]; then
+$KOJI add-tag-inheritance --priority 10 ${TAG}-build epel9
+fi
+
+if [[ $TESTING -eq 1 ]]; then
+$KOJI add-external-repo -t $TAG-build alma9-testing-baseos -p 25 --mode=bare
+$KOJI add-external-repo -t $TAG-build alma9-testing-appstream -p 35 --mode=bare
+$KOJI add-external-repo -t $TAG-build alma9-testing-crb -p 45 --mode=bare
+fi
+
+$KOJI edit-tag $TAG-testing --perm="$PERMS"
+$KOJI edit-tag $TAG-qa      --perm="$PERMS"
+$KOJI edit-tag $TAG-stable  --perm="$PERMS"
+
+$KOJI add-target $TAG $TAG-build $TAG-testing
 ```
 
 Now run the script to create the tag:
 
 ```bash
 $ ./cern9al.sh 
-	No such tag: cern9al-build
-	Added external repo alma9-testing-baseos to tag cern9al-build (priority 25)
-	Added external repo alma9-testing-appstream to tag cern9al-build (priority 35)
-	Added external repo alma9-testing-crb to tag cern9al-build (priority 45)
+No such tag: cern9al-build
+Added external repo alma9-testing-baseos to tag cern9al-build (priority 25)
+Added external repo alma9-testing-appstream to tag cern9al-build (priority 35)
+Added external repo alma9-testing-crb to tag cern9al-build (priority 45)
 ```
 
 The `cern` tag is special because it includes a [comps.xml](https://gitlab.cern.ch/linuxsupport/comps.xml)
@@ -216,62 +216,62 @@ koji add-group-pkg alma9-cern build cern-koji-addons
 
 ## Create script to create user tags
 
-Make a copy of [createtag9al.sh](https://gitlab.cern.ch/linuxsupport/lxdist-build/-/blob/dae233dd6c49a31e7486dc5ede41d4b77b649b4f/bin/tags/createtag9al.sh)
+Make a copy of [createtag9al.sh](https://gitlab.cern.ch/linuxsupport/lxdist-build/-/blob/master/bin/tags/createtag9al.sh)
 (or whatever the latest version is) for your new distro and adapt as needed:
 
 ```bash
 $ cat createtag9al.sh 
-	# This script is to be executed from within the other *9al.sh scripts
-	if [[ "${TAG: -3}" != "9al" ]]; then
-	  echo "Error: The tag name must end with a 9al (ie. 'mytag9al')"
-	  exit 1
-	fi
-
-	ARCHES="${ARCHES:-x86_64 aarch64}"
-	PERMS="${PERMS:-}"
-	TESTING="${TESTING:-0}"
-	EPEL="${EPEL:-0}"
-	CLOUD="${CLOUD:-}"
-	DISTTAG="${DISTTAG:-al9.cern}"
-
-	PARENT="${PARENT:-alma9-cern}"
-	PROFILE="${PROFILE:-koji}" # change it for the test instance
-	KOJI="${KOJI:-/usr/bin/koji -p $PROFILE}"
-
-	$KOJI remove-tag ${TAG}-build
-
-	$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" ${TAG}-build
-	$KOJI add-tag --arches "$ARCHES" ${TAG}-testing
-	$KOJI add-tag --arches "$ARCHES" ${TAG}-qa
-	$KOJI add-tag --arches "$ARCHES" ${TAG}-stable
-
-	if [[ $DISTTAG != "" ]]; then
-	  $KOJI add-group-pkg ${TAG}-build build buildsys-macros-${DISTTAG}
-	  $KOJI add-group-pkg ${TAG}-build srpm-build buildsys-macros-${DISTTAG}
-	fi
-
-	if [[ $EPEL -eq 1 ]]; then
-	  $KOJI add-tag-inheritance --priority 10 ${TAG}-build epel9
-	fi
-
-	if [[ $TESTING -eq 1 ]]; then
-	  $KOJI add-external-repo -t ${TAG}-build alma9-testing-baseos -p 25 --mode=bare
-	  $KOJI add-external-repo -t ${TAG}-build alma9-testing-appstream -p 35 --mode=bare
-	  $KOJI add-external-repo -t ${TAG}-build alma9-testing-crb -p 45 --mode=bare
-	fi
-
-	if [[ $CLOUD != "" ]]; then
-	  $KOJI add-external-repo -t ${TAG}-build alma9-openstack-${CLOUD} -p 15 --mode=bare
-	  $KOJI add-external-repo -t ${TAG}-build alma9-openstack-${CLOUD}-builddep -p 20 --mode=bare
-	  $KOJI add-external-repo -t ${TAG}-build alma9-openstack-${CLOUD}-deps -p 25 --mode=bare
-	fi
-
-	$KOJI edit-tag ${TAG}-testing --perm="$PERMS"
-	$KOJI edit-tag ${TAG}-qa      --perm="$PERMS"
-	$KOJI edit-tag ${TAG}-stable  --perm="$PERMS"
-
-	$KOJI add-tag-inheritance --priority 5 ${TAG}-build ${TAG}-testing
-	$KOJI add-target ${TAG} ${TAG}-build ${TAG}-testing
+# This script is to be executed from within the other *9al.sh scripts
+if [[ "${TAG: -3}" != "9al" ]]; then
+echo "Error: The tag name must end with a 9al (ie. 'mytag9al')"
+exit 1
+fi
+
+ARCHES="${ARCHES:-x86_64 aarch64}"
+PERMS="${PERMS:-}"
+TESTING="${TESTING:-0}"
+EPEL="${EPEL:-0}"
+CLOUD="${CLOUD:-}"
+DISTTAG="${DISTTAG:-al9.cern}"
+
+PARENT="${PARENT:-alma9-cern}"
+PROFILE="${PROFILE:-koji}" # change it for the test instance
+KOJI="${KOJI:-/usr/bin/koji -p $PROFILE}"
+
+$KOJI remove-tag ${TAG}-build
+
+$KOJI add-tag --arches "$ARCHES" --parent="$PARENT" ${TAG}-build
+$KOJI add-tag --arches "$ARCHES" ${TAG}-testing
+$KOJI add-tag --arches "$ARCHES" ${TAG}-qa
+$KOJI add-tag --arches "$ARCHES" ${TAG}-stable
+
+if [[ $DISTTAG != "" ]]; then
+$KOJI add-group-pkg ${TAG}-build build buildsys-macros-${DISTTAG}
+$KOJI add-group-pkg ${TAG}-build srpm-build buildsys-macros-${DISTTAG}
+fi
+
+if [[ $EPEL -eq 1 ]]; then
+$KOJI add-tag-inheritance --priority 10 ${TAG}-build epel9
+fi
+
+if [[ $TESTING -eq 1 ]]; then
+$KOJI add-external-repo -t ${TAG}-build alma9-testing-baseos -p 25 --mode=bare
+$KOJI add-external-repo -t ${TAG}-build alma9-testing-appstream -p 35 --mode=bare
+$KOJI add-external-repo -t ${TAG}-build alma9-testing-crb -p 45 --mode=bare
+fi
+
+if [[ $CLOUD != "" ]]; then
+$KOJI add-external-repo -t ${TAG}-build alma9-openstack-${CLOUD} -p 15 --mode=bare
+$KOJI add-external-repo -t ${TAG}-build alma9-openstack-${CLOUD}-builddep -p 20 --mode=bare
+$KOJI add-external-repo -t ${TAG}-build alma9-openstack-${CLOUD}-deps -p 25 --mode=bare
+fi
+
+$KOJI edit-tag ${TAG}-testing --perm="$PERMS"
+$KOJI edit-tag ${TAG}-qa      --perm="$PERMS"
+$KOJI edit-tag ${TAG}-stable  --perm="$PERMS"
+
+$KOJI add-tag-inheritance --priority 5 ${TAG}-build ${TAG}-testing
+$KOJI add-target ${TAG} ${TAG}-build ${TAG}-testing
 
 ```
 
@@ -284,46 +284,46 @@ script we created [previously](#create-script-to-create-user-tags).
 
 ```bash
 $ cat openafs9al.sh 
-	#!/bin/bash
-
-	TAG="openafs9al"
-	#ARCHES="x86_64 aarch64"
-	#PERMS=""
-	TESTING=1
-	#EPEL=0
-	DISTTAG="al9.cern"
-
-	### You probably don't need to change anything below this
-	source createtag9al.sh
-
-	$KOJI add-external-repo -t ${TAG}-build alma9-baseos -p 20 --mode=bare
-	$KOJI add-external-repo -t ${TAG}-build alma9-appstream -p 30 --mode=bare
-	# As we may need dependencies apart from the 'latest' build,
-	# we add -stable to ensure that we have everything
-	$KOJI add-tag-inheritance --priority 3 ${TAG}-build ${TAG}-stable
-	# However, as kmod-openafs is built from the 'openafs' package, it's often the
-	# case that koji only sees the latest kmod package. We we may expect to see
-	# other packages that are also built from 'openafs' (such as openafs-devel)
-	# We can override the default koji behaviour to show all packages, which avoids
-	# this unfortunate confusion
-	$KOJI edit-tag ${TAG}-build -x repo_include_all=True
+#!/bin/bash
+
+TAG="openafs9al"
+#ARCHES="x86_64 aarch64"
+#PERMS=""
+TESTING=1
+#EPEL=0
+DISTTAG="al9.cern"
+
+### You probably don't need to change anything below this
+source createtag9al.sh
+
+$KOJI add-external-repo -t ${TAG}-build alma9-baseos -p 20 --mode=bare
+$KOJI add-external-repo -t ${TAG}-build alma9-appstream -p 30 --mode=bare
+# As we may need dependencies apart from the 'latest' build,
+# we add -stable to ensure that we have everything
+$KOJI add-tag-inheritance --priority 3 ${TAG}-build ${TAG}-stable
+# However, as kmod-openafs is built from the 'openafs' package, it's often the
+# case that koji only sees the latest kmod package. We we may expect to see
+# other packages that are also built from 'openafs' (such as openafs-devel)
+# We can override the default koji behaviour to show all packages, which avoids
+# this unfortunate confusion
+$KOJI edit-tag ${TAG}-build -x repo_include_all=True
 
 $ ./openafs9al.sh 
-	No such tag: openafs9al-build
-	Added external repo alma9-testing-baseos to tag openafs9al-build (priority 25)
-	Added external repo alma9-testing-appstream to tag openafs9al-build (priority 35)
-	Added external repo alma9-testing-crb to tag openafs9al-build (priority 45)
-	Added external repo alma9-baseos to tag openafs9al-build (priority 20)
-	Added external repo alma9-appstream to tag openafs9al-build (priority 30)
+No such tag: openafs9al-build
+Added external repo alma9-testing-baseos to tag openafs9al-build (priority 25)
+Added external repo alma9-testing-appstream to tag openafs9al-build (priority 35)
+Added external repo alma9-testing-crb to tag openafs9al-build (priority 45)
+Added external repo alma9-baseos to tag openafs9al-build (priority 20)
+Added external repo alma9-appstream to tag openafs9al-build (priority 30)
 ```
 
 Now we can go ahead and add the openafs package to that tag, or we can do it later:
 
 ```bash
 $ for i in testing qa stable; do koji add-pkg --owner=kojici openafs9al-$i openafs; done
-	Adding 1 packages to tag openafs9al-testing
-	Adding 1 packages to tag openafs9al-qa
-	Adding 1 packages to tag openafs9al-stable
+Adding 1 packages to tag openafs9al-testing
+Adding 1 packages to tag openafs9al-qa
+Adding 1 packages to tag openafs9al-stable
 ```
 
 ## Create tag for image builds
@@ -377,26 +377,26 @@ script we created [previously](#create-script-to-create-user-tags).
 
 ```bash
 $ cat mytag9al.sh 
-	#!/bin/bash
+#!/bin/bash
 
-	TAG="mytag9al"
-	#ARCHES="x86_64 aarch64"
-	#PERMS=""
-	#TESTING=0
-	#EPEL=0
-	#DISTTAG=""
+TAG="mytag9al"
+#ARCHES="x86_64 aarch64"
+#PERMS=""
+#TESTING=0
+#EPEL=0
+#DISTTAG=""
 
-	### You probably don't need to change anything below this
-	source createtag9al.sh
+### You probably don't need to change anything below this
+source createtag9al.sh
 ```
 
 Now we can go ahead and add the myrpm package to that tag, or we can do it later:
 
 ```bash
 $ for i in testing qa stable; do koji add-pkg --owner=kojici mytag9al-$i myrpm; done
-	Adding 1 packages to tag mytag9al-testing
-	Adding 1 packages to tag mytag9al-qa
-	Adding 1 packages to tag mytag9al-stable
+Adding 1 packages to tag mytag9al-testing
+Adding 1 packages to tag mytag9al-qa
+Adding 1 packages to tag mytag9al-stable
 ```
 
 ## Commit your changes
-- 
GitLab


From 98d2c76adec10aec29cdbb1904e490b39ec2722e Mon Sep 17 00:00:00 2001
From: Marta Vila Fernandes <ana.marta.lisboa.vila.fernandes@cern.ch>
Date: Wed, 5 Apr 2023 16:28:56 +0200
Subject: [PATCH 4/5]  fix ident

---
 docs/koji/bootstrapping.md | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/docs/koji/bootstrapping.md b/docs/koji/bootstrapping.md
index 380448e..c92868a 100644
--- a/docs/koji/bootstrapping.md
+++ b/docs/koji/bootstrapping.md
@@ -149,18 +149,18 @@ $KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-qa
 $KOJI add-tag --arches "$ARCHES" --parent="$PARENT" $TAG-stable
 
 if [[ $DISTTAG != "" ]]; then
-$KOJI add-group-pkg $TAG-build build buildsys-macros-$DISTTAG
-$KOJI add-group-pkg $TAG-build srpm-build buildsys-macros-$DISTTAG
+  $KOJI add-group-pkg $TAG-build build buildsys-macros-$DISTTAG
+  $KOJI add-group-pkg $TAG-build srpm-build buildsys-macros-$DISTTAG
 fi
 
 if [[ $EPEL -eq 1 ]]; then
-$KOJI add-tag-inheritance --priority 10 ${TAG}-build epel9
+  $KOJI add-tag-inheritance --priority 10 ${TAG}-build epel9
 fi
 
 if [[ $TESTING -eq 1 ]]; then
-$KOJI add-external-repo -t $TAG-build alma9-testing-baseos -p 25 --mode=bare
-$KOJI add-external-repo -t $TAG-build alma9-testing-appstream -p 35 --mode=bare
-$KOJI add-external-repo -t $TAG-build alma9-testing-crb -p 45 --mode=bare
+  $KOJI add-external-repo -t $TAG-build alma9-testing-baseos -p 25 --mode=bare
+  $KOJI add-external-repo -t $TAG-build alma9-testing-appstream -p 35 --mode=bare
+  $KOJI add-external-repo -t $TAG-build alma9-testing-crb -p 45 --mode=bare
 fi
 
 $KOJI edit-tag $TAG-testing --perm="$PERMS"
@@ -223,8 +223,8 @@ Make a copy of [createtag9al.sh](https://gitlab.cern.ch/linuxsupport/lxdist-buil
 $ cat createtag9al.sh 
 # This script is to be executed from within the other *9al.sh scripts
 if [[ "${TAG: -3}" != "9al" ]]; then
-echo "Error: The tag name must end with a 9al (ie. 'mytag9al')"
-exit 1
+  echo "Error: The tag name must end with a 9al (ie. 'mytag9al')"
+  exit 1
 fi
 
 ARCHES="${ARCHES:-x86_64 aarch64}"
@@ -246,24 +246,24 @@ $KOJI add-tag --arches "$ARCHES" ${TAG}-qa
 $KOJI add-tag --arches "$ARCHES" ${TAG}-stable
 
 if [[ $DISTTAG != "" ]]; then
-$KOJI add-group-pkg ${TAG}-build build buildsys-macros-${DISTTAG}
-$KOJI add-group-pkg ${TAG}-build srpm-build buildsys-macros-${DISTTAG}
+  $KOJI add-group-pkg ${TAG}-build build buildsys-macros-${DISTTAG}
+  $KOJI add-group-pkg ${TAG}-build srpm-build buildsys-macros-${DISTTAG}
 fi
 
 if [[ $EPEL -eq 1 ]]; then
-$KOJI add-tag-inheritance --priority 10 ${TAG}-build epel9
+  $KOJI add-tag-inheritance --priority 10 ${TAG}-build epel9
 fi
 
 if [[ $TESTING -eq 1 ]]; then
-$KOJI add-external-repo -t ${TAG}-build alma9-testing-baseos -p 25 --mode=bare
-$KOJI add-external-repo -t ${TAG}-build alma9-testing-appstream -p 35 --mode=bare
-$KOJI add-external-repo -t ${TAG}-build alma9-testing-crb -p 45 --mode=bare
+  $KOJI add-external-repo -t ${TAG}-build alma9-testing-baseos -p 25 --mode=bare
+  $KOJI add-external-repo -t ${TAG}-build alma9-testing-appstream -p 35 --mode=bare
+  $KOJI add-external-repo -t ${TAG}-build alma9-testing-crb -p 45 --mode=bare
 fi
 
 if [[ $CLOUD != "" ]]; then
-$KOJI add-external-repo -t ${TAG}-build alma9-openstack-${CLOUD} -p 15 --mode=bare
-$KOJI add-external-repo -t ${TAG}-build alma9-openstack-${CLOUD}-builddep -p 20 --mode=bare
-$KOJI add-external-repo -t ${TAG}-build alma9-openstack-${CLOUD}-deps -p 25 --mode=bare
+  $KOJI add-external-repo -t ${TAG}-build alma9-openstack-${CLOUD} -p 15 --mode=bare
+  $KOJI add-external-repo -t ${TAG}-build alma9-openstack-${CLOUD}-builddep -p 20 --mode=bare
+  $KOJI add-external-repo -t ${TAG}-build alma9-openstack-${CLOUD}-deps -p 25 --mode=bare
 fi
 
 $KOJI edit-tag ${TAG}-testing --perm="$PERMS"
-- 
GitLab


From a201cb488dda5809bd95bb79d111f4a4ecc9abd4 Mon Sep 17 00:00:00 2001
From: Alex Iribarren <alex.iribarren@cern.ch>
Date: Wed, 5 Apr 2023 16:43:27 +0200
Subject: [PATCH 5/5] Cosmetics

---
 docs/koji/bootstrapping.md | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/docs/koji/bootstrapping.md b/docs/koji/bootstrapping.md
index c92868a..21e2784 100644
--- a/docs/koji/bootstrapping.md
+++ b/docs/koji/bootstrapping.md
@@ -24,7 +24,6 @@ koji add-external-repo alma9-baseos 'https://linuxsoft.cern.ch/cern/alma/9/BaseO
 koji add-external-repo alma9-appstream 'https://linuxsoft.cern.ch/cern/alma/9/AppStream/$arch/os/'
 koji add-external-repo alma9-crb 'http://linuxsoft.cern.ch/cern/alma/9/CRB/$arch/os/'
 
-
 koji add-external-repo alma9-testing-baseos 'https://linuxsoft.cern.ch/cern/alma/9-testing/BaseOS/$arch/os/'
 koji add-external-repo alma9-testing-appstream 'https://linuxsoft.cern.ch/cern/alma/9-testing/AppStream/$arch/os/'
 koji add-external-repo alma9-testing-crb 'http://linuxsoft.cern.ch/cern/alma/9-testing/CRB/$arch/os/'
@@ -104,8 +103,6 @@ version for the distro you're adding. You can probably use the previous version
 for now. Good luck!
 
 ```bash
-
-
 koji add-external-repo epel9 'https://linuxsoft.cern.ch/epel/9/Everything/$arch/'
 
 $ cat epel9.sh 
-- 
GitLab