From 7602ae1a44e6ea2b75b75c07fda3e7562b812738 Mon Sep 17 00:00:00 2001 From: nazunalika Date: Thu, 19 May 2022 00:46:16 -0700 Subject: [PATCH] begin ISO magic --- iso/common | 50 ++++++++ iso/common_8 | 4 + iso/common_9 | 4 + live/common | 34 ++++++ sync/common_8 | 5 +- sync/common_9 | 174 ++++++++++++++++++++++++++++ sync/symlink-images-and-checksum.sh | 25 ++++ 7 files changed, 294 insertions(+), 2 deletions(-) create mode 100644 iso/common create mode 100644 iso/common_8 create mode 100644 iso/common_9 create mode 100644 live/common create mode 100644 sync/common_9 create mode 100644 sync/symlink-images-and-checksum.sh diff --git a/iso/common b/iso/common new file mode 100644 index 0000000..55cab71 --- /dev/null +++ b/iso/common @@ -0,0 +1,50 @@ +# To be sourced by scripts to use + +# Variables that can be overriden should be noted with optional context. It is +# expected that these values are here in this file (per variable or per set): +# +# * Allowed +# * Allowed with caveats +# * Not Allowed +# * Required + +# Set the Rocky Linux version. +# Override: Required +if [ -z "$RLVER" ]; then + echo "RLVER is not defined." + exit 2 +fi + +# Architecture of the system - Overriding this would be a mistake. Lorax and +# other runroot-like operations should occur on their respective architectures. +# Override: Not Allowed +ARCH="$(uname -p)" + +# Source Major common +# Override: Not Allowed +test -f "$(dirname "$0")/common_${RLVER}" && source "$(dirname "$0")/common_${RLVER}" +if [ "$?" -ne 0 ]; then + echo "Could not source common_${RLVER}" + exit 1 +fi + +DATE_STAMP="$(date +%Y%m%d)" +COMPOSE_ROOT="/mnt/compose/${RLVER}" +COMPOSE_ISO_WORKDIR="${COMPOSE_ROOT}/work/${ARCH}/${DATE_STAMP}" + +# ISO Functions +function build_graft_points() { + echo "" +} + +function build_lorax_source_list() { + echo "" +} + +function build_lorax() { + echo "" +} + +function build_extra_iso() { + echo "" +} diff --git a/iso/common_8 b/iso/common_8 new file mode 100644 index 0000000..b0a0012 --- /dev/null +++ b/iso/common_8 @@ -0,0 +1,4 @@ +# To be sourced by scripts to use + +# These are the architectures supported for 8 +ARCHES=(x86_64 aarch64) diff --git a/iso/common_9 b/iso/common_9 new file mode 100644 index 0000000..d0cba4f --- /dev/null +++ b/iso/common_9 @@ -0,0 +1,4 @@ +# To be sourced by scripts to use + +# These are the architectures supported for 9 +ARCHES=(x86_64 aarch64 ppc64le s390x) diff --git a/live/common b/live/common new file mode 100644 index 0000000..7382a3f --- /dev/null +++ b/live/common @@ -0,0 +1,34 @@ +# To be sourced by scripts that build live images + +# Variables that can be overriden should be noted with optional context. It is +# expected that these values are here in this file (per variable or per set): +# +# * Allowed +# * Allowed with caveats +# * Not Allowed +# * Required + +# Temporary probably. This makes it so if RLVER=... is called before the script +# it will set the version for the variables to call up. This was easier than +# creating duplicates of a bunch of stuff. Default version is 8. + +# Override: Required +if [ -z "$RLVER" ]; then + echo "RLVER is not defined." + exit 2 +fi + +# Set git branch name scheme +# Override: Allowed with caveats +GIT_BRANCH="r${RLVER}" + +# Source Major common +# Override: Not Allowed +test -f "$(dirname "$0")/common_${RLVER}" && source "$(dirname "$0")/common_${RLVER}" +if [ "$?" -ne 0 ]; then + echo "Could not source common_${RLVER}" + exit 1 +fi + +# Used to iterate over types of live images +VARIANTS=(XFCE KDE Workstation Workstation-Lite) diff --git a/sync/common_8 b/sync/common_8 index 2a8fe96..b26db53 100644 --- a/sync/common_8 +++ b/sync/common_8 @@ -7,7 +7,7 @@ MAJOR="${REVISION:0:1}" MINOR="${REVISION:2:1}" # comment or blank if needed -APPEND_TO_DIR="-RC1" +APPEND_TO_DIR="-RC2" STAGING_ROOT="/mnt/repos-staging" PRODUCTION_ROOT="/mnt/repos-production" @@ -20,13 +20,14 @@ RELEASE_DIR="${CATEGORY_STUB}/${REVISION}${APPEND_TO_DIR}" # cases where repos will not be available by normal means. It's just for # consistency. NONMODS_REPOS=( - Extras + extras Devel plus rockyrpi ) # These repos were originally separate from the main compose and need symlinks +declare -A LINK_REPOS LINK_REPOS=( [NFV]="nfv" ) diff --git a/sync/common_9 b/sync/common_9 new file mode 100644 index 0000000..a0e2262 --- /dev/null +++ b/sync/common_9 @@ -0,0 +1,174 @@ +# To be sourced by scripts to use + +# Revision must always start with a major number +REVISION=9.0 + +ARCHES=(x86_64 aarch64 ppc64le s390x) + +MAJOR="${REVISION:0:1}" +MINOR="${REVISION:2:1}" + +# comment or blank if needed +APPEND_TO_DIR="-RC1" + +STAGING_ROOT="/mnt/repos-staging" +PRODUCTION_ROOT="/mnt/repos-production" + +# relative to ${ENV}_ROOT +CATEGORY_STUB="mirror/pub/rocky" +RELEASE_DIR="${CATEGORY_STUB}/${REVISION}${APPEND_TO_DIR}" + +# Set all repos that have no comps/groups associated with them. This is even in +# cases where repos will not be available by normal means. It's just for +# consistency. +NONMODS_REPOS=( + extras + Devel + plus + rockyrpi +) + +# These repos were originally separate from the main compose and need symlinks +declare -A LINK_REPOS +LINK_REPOS=( + [NFV]="nfv" +) + +# These repos have comps/groups, except for debuginfo and sources +MODS_REPOS=( + BaseOS + AppStream + HighAvailability + ResilientStorage + CRB + RT + NFV + SAP + SAPHANA +) + +ALL_REPOS=( + "${NONMODS_REPOS[@]}" + "${MODS_REPOS[@]}" +) + +NONSIG_COMPOSE=( + Rocky + Extras + Rocky-devel + Plus + rockyrpi +) + +declare -A SIG_COMPOSE +SIG_COMPOSE=( + [kernel]="kernel/kernel" + [kmod]="kernel/kmod" +) + +# These repos have modules +MODS=( + AppStream + PowerTools +) + +# functions +# Note, EL8 and EL9 may not be the same, do not put in 'common' +function treeinfoSaver() { + BaseOSArch="${1}" + TREEINFO_VAR="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo" + PRISTINE_TREE="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo-pristine" + /bin/cp "${TREEINFO_VAR}" "${PRISTINE_TREE}" +} + +function treeinfoFixer() { + BaseOSArch="${1}" + TREEINFO_VAR="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo" + PRISTINE_TREE="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo-pristine" + test -f "${PRISTINE_TREE}" + pris_retval=$? + if [ "$pris_retval" -eq 0 ]; then + /bin/cp "${PRISTINE_TREE}" "${TREEINFO_VAR}" + else + echo "WARNING: We do not have a pristine treeinfo to copy from" + fi +} + +# Note, EL8 and EL9 may not be the same, do not put in 'common' +function treeinfoModder() { + BaseOSArch="${1}" + TREEINFO_VAR="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo" + PRISTINE_TREE="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo-pristine" + test -f "${TREEINFO_VAR}" + treeinfo_retval=$? + test -x /usr/bin/python3 + python_retval=$? + # There is an awk way to do this, but it was easier to implement python and + # cat heredoc together. It felt cleaner. This was a trick I had used in a + # previous life when I had to admin Solaris systems, and I needed a way to + # add a solaris 10 system into FreeIPA (it was not fun, let me tell you). But + # the take away is I learned something kind of on the fly and well, it worked. + # Emails should have stamps. + if [ "$treeinfo_retval" -eq 0 ] && [ "$python_retval" -eq 0 ]; then + cat <