From daf7ebe2dfcb2bccbc228b710be3451191eedd5c Mon Sep 17 00:00:00 2001 From: Haowen Liu Date: Fri, 19 Aug 2022 12:21:30 -0700 Subject: [PATCH] Add rockylinux/9 --- contrib/crontab | 3 ++- images/rockylinux/9/functions | 1 + images/rockylinux/9/genimg | 3 +++ images/rockylinux/build.yml | 2 +- images/rockylinux/genimg | 17 ++++++++++++++++- images/rockylinux/latest | 2 +- 6 files changed, 24 insertions(+), 4 deletions(-) create mode 120000 images/rockylinux/9/functions create mode 100755 images/rockylinux/9/genimg diff --git a/contrib/crontab b/contrib/crontab index 7dfaee4..950207d 100644 --- a/contrib/crontab +++ b/contrib/crontab @@ -15,12 +15,13 @@ 0 19 * * 2 chronic /usr/local/bin/submit_image_build -n "Weekly scheduled build image refresh" fedora/latest 30 19 * * 2 chronic /usr/local/bin/submit_image_build -n "Weekly scheduled build image refresh" -a amd64 debian/testing 0 19 * * 3 chronic /usr/local/bin/submit_image_build -n "Weekly scheduled build image refresh" -a amd64 freebsd/12.x -30 19 * * 3 chronic /usr/local/bin/submit_image_build -n "Weekly scheduled build image refresh" -a amd64 rockylinux +30 19 * * 3 chronic /usr/local/bin/submit_image_build -n "Weekly scheduled build image refresh" -a amd64 rockylinux/8 0 19 * * 4 chronic /usr/local/bin/submit_image_build -n "Weekly scheduled build image refresh" -a amd64 ubuntu/lts 30 19 * * 4 chronic /usr/local/bin/submit_image_build -n "Weekly scheduled build image refresh" alpine/latest 0 19 * * 5 chronic /usr/local/bin/submit_image_build -n "Weekly scheduled build image refresh" -a amd64 freebsd/13.x 30 19 * * 5 chronic /usr/local/bin/submit_image_build -n "Weekly scheduled build image refresh" -a amd64 ubuntu/impish 0 19 * * 6 chronic /usr/local/bin/submit_image_build -n "Weekly scheduled build image refresh" -a amd64 openbsd/latest +30 19 * * 6 chronic /usr/local/bin/submit_image_build -n "Weekly scheduled build image refresh" -a amd64 rockylinux/9 # Monthly 0 18 1 * * chronic /usr/local/bin/submit_image_build -n "Monthly scheduled build image refresh" -a amd64 ubuntu/oldlts diff --git a/images/rockylinux/9/functions b/images/rockylinux/9/functions new file mode 120000 index 0000000..c0b5bcc --- /dev/null +++ b/images/rockylinux/9/functions @@ -0,0 +1 @@ +../functions \ No newline at end of file diff --git a/images/rockylinux/9/genimg b/images/rockylinux/9/genimg new file mode 100755 index 0000000..348e349 --- /dev/null +++ b/images/rockylinux/9/genimg @@ -0,0 +1,3 @@ +#!/bin/sh +export release=9 +exec ../genimg "$*" diff --git a/images/rockylinux/build.yml b/images/rockylinux/build.yml index 49f4e28..ff25e80 100644 --- a/images/rockylinux/build.yml +++ b/images/rockylinux/build.yml @@ -1,4 +1,4 @@ -image: rockylinux/latest +image: rockylinux/8 packages: - e2fsprogs - qemu-kvm diff --git a/images/rockylinux/genimg b/images/rockylinux/genimg index 8c12e4d..6004394 100755 --- a/images/rockylinux/genimg +++ b/images/rockylinux/genimg @@ -59,13 +59,19 @@ mount ${NBD_DEVICE}p3 /mnt mkdir /mnt/boot mount ${NBD_DEVICE}p1 /mnt/boot +ln -sr /etc/pki/rpm-gpg/RPM-GPG-KEY-{rockyofficial,Rocky-$(rpm -E %rhel)} +curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 https://dl.rockylinux.org/pub/rocky/RPM-GPG-KEY-Rocky-9 +sed \ + -e 's|gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial|gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-$releasever|' \ + -i /etc/yum.repos.d/Rocky-*.repo +dnf update dnf -y -q \ --releasever="$release" \ --installroot=/mnt \ --disablerepo='*' \ --enablerepo=appstream \ --enablerepo=baseos\ - --enablerepo=extras \ + --enablerepo=extras \ --setopt=install_weak_deps=False install\ bash basesystem systemd passwd dnf rocky-release NetworkManager @@ -86,6 +92,15 @@ echo 'nameserver 8.8.4.4' >>/mnt/etc/resolv.conf run_root systemd-machine-id-setup +# Rebuild package DB for RL9 +if [[ $release = "9" ]] +then +run_root rpmdb --rebuilddb --define '"_db_backend sqlite"' +fi + +# Enable EPEL +run_root dnf -y -q install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$release.noarch.rpm + # Delay installing systemd-udev becuase it accesses /dev/urandom. run_root dnf -y -q install git mercurial openssh-server sudo systemd-udev chrony run_root dnf -y -q groupinstall '"Development Tools"' diff --git a/images/rockylinux/latest b/images/rockylinux/latest index 301160a..f11c82a 120000 --- a/images/rockylinux/latest +++ b/images/rockylinux/latest @@ -1 +1 @@ -8 \ No newline at end of file +9 \ No newline at end of file -- 2.38.5