From 5ca779f01c74127bbe61bccf72706a43902b18d8 Mon Sep 17 00:00:00 2001 From: Radek Vykydal Date: Tue, 27 Feb 2024 12:31:47 +0100 Subject: [PATCH] Add RHEL 10 platform support For RHEL 10 adds: - default repositories - platform ks fragments --- fragments/platform/rhel10/payload/default_packages.ks | 3 +++ fragments/platform/rhel10/payload/ostreecontainer.ks | 1 + fragments/platform/rhel10/payload/unified_packages.ks | 7 +++++++ fragments/platform/rhel10/repos/default.ks | 3 +++ fragments/platform/rhel10/repos/unified-nfs.ks | 2 ++ fragments/platform/rhel10/repos/unified.ks | 3 +++ fragments/platform/rhel10/section-data/hello-world.ks | 3 +++ fragments/platform/rhel10/section-data/server-dvd-link.ks | 7 +++++++ fragments/platform/rhel10/section-data/unified-iso.ks | 3 +++ fragments/platform/rhel10/timezone/ntp_disabled.ks | 5 +++++ fragments/platform/rhel10/timezone/ntp_enabled.ks | 5 +++++ fragments/platform/rhel10/validation/unified.ks | 6 ++++++ scripts/defaults-rhel10.sh | 6 ++++++ 13 files changed, 54 insertions(+) create mode 100644 fragments/platform/rhel10/payload/default_packages.ks create mode 100644 fragments/platform/rhel10/payload/ostreecontainer.ks create mode 100644 fragments/platform/rhel10/payload/unified_packages.ks create mode 100644 fragments/platform/rhel10/repos/default.ks create mode 100644 fragments/platform/rhel10/repos/unified-nfs.ks create mode 100644 fragments/platform/rhel10/repos/unified.ks create mode 100644 fragments/platform/rhel10/section-data/hello-world.ks create mode 100644 fragments/platform/rhel10/section-data/server-dvd-link.ks create mode 100644 fragments/platform/rhel10/section-data/unified-iso.ks create mode 100644 fragments/platform/rhel10/timezone/ntp_disabled.ks create mode 100644 fragments/platform/rhel10/timezone/ntp_enabled.ks create mode 100644 fragments/platform/rhel10/validation/unified.ks create mode 100644 scripts/defaults-rhel10.sh diff --git a/fragments/platform/rhel10/payload/default_packages.ks b/fragments/platform/rhel10/payload/default_packages.ks new file mode 100644 index 00000000..8f7f3599 --- /dev/null +++ b/fragments/platform/rhel10/payload/default_packages.ks @@ -0,0 +1,3 @@ +# Default RHEL10 packages section (empty) +%packages +%end diff --git a/fragments/platform/rhel10/payload/ostreecontainer.ks b/fragments/platform/rhel10/payload/ostreecontainer.ks new file mode 100644 index 00000000..3869cff0 --- /dev/null +++ b/fragments/platform/rhel10/payload/ostreecontainer.ks @@ -0,0 +1 @@ +ostreecontainer --no-signature-verification --transport=registry --url=quay.io/centos-bootc/centos-bootc:stream10 diff --git a/fragments/platform/rhel10/payload/unified_packages.ks b/fragments/platform/rhel10/payload/unified_packages.ks new file mode 100644 index 00000000..be6b85e4 --- /dev/null +++ b/fragments/platform/rhel10/payload/unified_packages.ks @@ -0,0 +1,7 @@ +# RHEL 10 packages section from unified DVD. +# The unified DVD should contain under one link both BaseOS and AppStream so install AppStream specific package. + +%packages +# Anaconda package is part of the AppStream repository. It is not contained in the BaseOS. +anaconda +%end diff --git a/fragments/platform/rhel10/repos/default.ks b/fragments/platform/rhel10/repos/default.ks new file mode 100644 index 00000000..4b28c8fa --- /dev/null +++ b/fragments/platform/rhel10/repos/default.ks @@ -0,0 +1,3 @@ +# Default RHEL10 repositories - BeseOS + AppStream or unified repo can be used +url --url @KSTEST_URL@ +repo --name=appstream --baseurl @KSTEST_MODULAR_URL@ diff --git a/fragments/platform/rhel10/repos/unified-nfs.ks b/fragments/platform/rhel10/repos/unified-nfs.ks new file mode 100644 index 00000000..925587d4 --- /dev/null +++ b/fragments/platform/rhel10/repos/unified-nfs.ks @@ -0,0 +1,2 @@ +# Unified ISO for RHEL-10 served on NFS server +nfs --server NFS_SERVER --dir NFS_DIR diff --git a/fragments/platform/rhel10/repos/unified.ks b/fragments/platform/rhel10/repos/unified.ks new file mode 100644 index 00000000..821a98d4 --- /dev/null +++ b/fragments/platform/rhel10/repos/unified.ks @@ -0,0 +1,3 @@ +# Unified ISO for RHEL 10 served on http server +# BaseOS and AppStream repositories should be loaded automatically from the unified repo +url RHEL10_UNIFIED_REPO_URL_GOES_HERE diff --git a/fragments/platform/rhel10/section-data/hello-world.ks b/fragments/platform/rhel10/section-data/hello-world.ks new file mode 100644 index 00000000..8055a22a --- /dev/null +++ b/fragments/platform/rhel10/section-data/hello-world.ks @@ -0,0 +1,3 @@ +# Create a variable in the %pre section with a link to the archived repository of Hello Word. +# The curl tool will download this archive and unpack it in the system. +ADDON_SOURCE="https://github.com/rhinstaller/hello-world-anaconda-addon/archive/master.tar.gz" diff --git a/fragments/platform/rhel10/section-data/server-dvd-link.ks b/fragments/platform/rhel10/section-data/server-dvd-link.ks new file mode 100644 index 00000000..5fdbeaf8 --- /dev/null +++ b/fragments/platform/rhel10/section-data/server-dvd-link.ks @@ -0,0 +1,7 @@ +# Create a variable in the pre/post section with link to a RHEL DVD. +# The curl tool will download this ISO and it will be processed later in the section. +_LINK= +ISO_LOCATION="$(curl -L $_LINK | grep -Po "RHEL-10.*?-x86_64-dvd1.iso" | head -n 1)" +ISO_LOCATION="${_LINK}/${ISO_LOCATION}" + +echo $ISO_LOCATION diff --git a/fragments/platform/rhel10/section-data/unified-iso.ks b/fragments/platform/rhel10/section-data/unified-iso.ks new file mode 100644 index 00000000..65d372b1 --- /dev/null +++ b/fragments/platform/rhel10/section-data/unified-iso.ks @@ -0,0 +1,3 @@ +# Create a variable in the pre/post section with link to a RHEL-10 unified ISO +# The curl tool will download this ISO and it will be processed later in the section. +ISO_LOCATION= diff --git a/fragments/platform/rhel10/timezone/ntp_disabled.ks b/fragments/platform/rhel10/timezone/ntp_disabled.ks new file mode 100644 index 00000000..72ea7736 --- /dev/null +++ b/fragments/platform/rhel10/timezone/ntp_disabled.ks @@ -0,0 +1,5 @@ +# Set up the timezone. +timezone --utc Europe/Prague + +# Disable NTP. +timesource --ntp-disable diff --git a/fragments/platform/rhel10/timezone/ntp_enabled.ks b/fragments/platform/rhel10/timezone/ntp_enabled.ks new file mode 100644 index 00000000..a1115ebd --- /dev/null +++ b/fragments/platform/rhel10/timezone/ntp_enabled.ks @@ -0,0 +1,5 @@ +# Set up the timezone. +timezone --utc Europe/Prague + +# Enable NTP. +timesource --ntp-server ntp.cesnet.cz diff --git a/fragments/platform/rhel10/validation/unified.ks b/fragments/platform/rhel10/validation/unified.ks new file mode 100644 index 00000000..84bde765 --- /dev/null +++ b/fragments/platform/rhel10/validation/unified.ks @@ -0,0 +1,6 @@ +# Validate installed packages on RHEL 10 system. + +# Check that the anaconda package was correctly installed. +if ! rpm -q anaconda ; then + echo '*** anaconda package was not installed!' >> /root/RESULT +fi diff --git a/scripts/defaults-rhel10.sh b/scripts/defaults-rhel10.sh new file mode 100644 index 00000000..fea6a0be --- /dev/null +++ b/scripts/defaults-rhel10.sh @@ -0,0 +1,6 @@ +# Default settings for testing RHEL 10. This requires being inside the Red Hat VPN. + +source network-device-names.cfg +export KSTEST_URL='http://download.eng.bos.redhat.com/rhel-10/nightly/RHEL-10/latest-RHEL-10.0.0/compose/BaseOS/x86_64/os/' +export KSTEST_MODULAR_URL='http://download.eng.bos.redhat.com/rhel-10/nightly/RHEL-10/latest-RHEL-10.0.0/compose/AppStream/x86_64/os/' +export KSTEST_FTP_URL='ftp://ftp.tu-chemnitz.de/pub/linux/fedora/linux/development/rawhide/Everything/$basearch/os/'