@@ -31,21 +31,73 @@ case "${ID}-${VERSION_ID}" in
3131 base_image_url=" quay.io/centos-bootc/centos-bootc:stream${VERSION_ID} "
3232 boot_args=" uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no"
3333 ;;
34+ rhel-10* )
35+ os_variant=" rhel10-unknown"
36+ base_image_url=" ${BOOTC_BASE_IMAGE:- registry.redhat.io/ rhel10/ rhel-bootc: ${VERSION_ID} } "
37+ boot_args=" uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no"
38+ ;;
3439 * )
3540 log_error " Unsupported distro: ${ID} -${VERSION_ID} "
3641 exit 1
3742 ;;
3843esac
3944
4045build_bootc_container () {
41- tee Containerfile > /dev/null << EOF
46+ # For any RHEL host, generate a repo file pointing at the nightly compose so
47+ # that the container image can reach RHEL packages. The file is generated at
48+ # runtime (rather than kept as a static template) so it works for any RHEL
49+ # minor version (10.2, 10.3, …) without code changes.
50+ local rhel_repo_file=" "
51+ if [[ " ${ID} " == " rhel" ]] && [ -n " ${DOWNLOAD_NODE:- } " ]; then
52+ local major_ver=" ${VERSION_ID%% .* } " # e.g. "10" from "10.2"
53+ rhel_repo_file=" files/rhel-${VERSION_ID} .repo"
54+ mkdir -p files
55+ cat > " ${rhel_repo_file} " << EOF
56+ [RHEL-${VERSION_ID} -NIGHTLY-BaseOS]
57+ name=baseos
58+ baseurl=http://${DOWNLOAD_NODE} /rhel-${major_ver} /nightly/RHEL-${major_ver} /latest-RHEL-${VERSION_ID} /compose/BaseOS/\$ basearch/os
59+ enabled=1
60+ # Nightly compose builds are not GPG-signed; gpgcheck=0 is intentional.
61+ gpgcheck=0
62+ [RHEL-${VERSION_ID} -NIGHTLY-AppStream]
63+ name=appstream
64+ baseurl=http://${DOWNLOAD_NODE} /rhel-${major_ver} /nightly/RHEL-${major_ver} /latest-RHEL-${VERSION_ID} /compose/AppStream/\$ basearch/os/
65+ enabled=1
66+ # Nightly compose builds are not GPG-signed; gpgcheck=0 is intentional.
67+ gpgcheck=0
68+ EOF
69+ fi
70+
71+ if [ -n " ${CLIENT_RPM_URL:- } " ]; then
72+ # Install go-fdo-client from a specific brew build base path.
73+ # CLIENT_RPM_URL should point to the version/release directory of the package in brew.
74+ local url
75+ url=$( parse_brew_url " ${CLIENT_RPM_URL} " )
76+ tee Containerfile > /dev/null << EOF
77+ FROM ${base_image_url}
78+ # --nogpgcheck and sslverify=false are intentional: internal brew servers
79+ # use self-signed certificates and builds may not be GPG-signed.
80+ RUN dnf install -y --nogpgcheck --setopt=sslverify=false \
81+ "${url} /${_brew_arch} /go-fdo-client-${_brew_ver} -${_brew_rel} .${_brew_arch} .rpm"
82+ EOF
83+ else
84+ tee Containerfile > /dev/null << EOF
4285FROM ${base_image_url}
4386RUN dnf=\$ (readlink \$ (command -v dnf)); [ "\$ {dnf}" = "dnf5" ] || dnf=dnf ; \
4487 rpm -q --whatprovides \$ {dnf}'-command(copr)' &> /dev/null || \$ {dnf} install -y \$ {dnf}'-command(copr)'; \
4588 \$ {dnf} copr enable -y '@fedora-iot/fedora-iot'; \
4689 \$ {dnf} install -y go-fdo-client; \
4790 \$ {dnf} copr disable -y @fedora-iot/fedora-iot
4891EOF
92+ fi
93+
94+ # Append the RHEL repo file into the container image when it was generated.
95+ if [ -n " ${rhel_repo_file} " ]; then
96+ tee -a Containerfile > /dev/null << EOF
97+ COPY ${rhel_repo_file} /etc/yum.repos.d/rhel-${VERSION_ID} .repo
98+ EOF
99+ fi
100+
49101 podman build --retry=5 --retry-delay=10s -t " fdo-bootc:latest" -f Containerfile .
50102}
51103
@@ -99,19 +151,33 @@ echo "admin ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/admin' "${new_ks_file}"
99151}
100152
101153install_server () {
102- if [ ! -v " PACKIT_COPR_RPMS" ]; then
154+ if [ -v " PACKIT_COPR_RPMS" ]; then
155+ echo " - Expected RPMs: ${PACKIT_COPR_RPMS} "
156+ elif [ -n " ${SERVER_RPM_URL:- } " ]; then
157+ # Install from a specific brew build base path.
158+ # SERVER_RPM_URL should point to the version/release directory of the package in brew.
159+ local url
160+ url=$( parse_brew_url " ${SERVER_RPM_URL} " )
161+ # --nogpgcheck and sslverify=false are intentional: internal brew servers
162+ # use self-signed certificates and builds may not be GPG-signed.
163+ sudo dnf install -y --nogpgcheck --setopt=sslverify=false \
164+ " ${url} /${_brew_arch} /go-fdo-server-${_brew_ver} -${_brew_rel} .${_brew_arch} .rpm" \
165+ " ${url} /noarch/go-fdo-server-manufacturer-${_brew_ver} -${_brew_rel} .noarch.rpm" \
166+ " ${url} /noarch/go-fdo-server-owner-${_brew_ver} -${_brew_rel} .noarch.rpm" \
167+ " ${url} /noarch/go-fdo-server-rendezvous-${_brew_ver} -${_brew_rel} .noarch.rpm"
168+ else
103169 sudo dnf install -y golang make
104170 commit=" $( git rev-parse --short HEAD) "
105171 rpm -q go-fdo-server | grep -q " go-fdo-server.*git${commit} .*" || {
106172 make rpm
107173 sudo dnf install -y rpmbuild/rpms/{noarch," $( uname -m) " }/* git" ${commit} " * .rpm
108174 }
109- else
110- echo " - Expected RPMs: ${PACKIT_COPR_RPMS} "
111175 fi
112- # Make sure the RPMS are installed
113176 installed_rpms=$( rpm -q --qf " %{nvr}.%{arch} " go-fdo-server{,-{manufacturer,owner,rendezvous}})
114- echo " - Installed RPMs: ${installed_rpms} "
177+ log_info " Installed Go FDO Server RPMs:"
178+ for i in ${installed_rpms} ; do
179+ echo " ⚙ $i "
180+ done
115181}
116182
117183install_client () {
0 commit comments