Skip to content

Introduce fedora eln image and ISO for anaconda #5585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions image-trigger
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ REFRESH = {
"fedora-38": {},
"fedora-39": {},
"fedora-coreos": {},
"fedora-eln": {},
"fedora-eln-boot": {},
"fedora-rawhide": {},
"fedora-rawhide-boot": {},
"fedora-rawhide-anaconda-payload": {"refresh-days": 30},
Expand Down
1 change: 1 addition & 0 deletions images/fedora-eln
1 change: 1 addition & 0 deletions images/fedora-eln-boot
29 changes: 29 additions & 0 deletions images/scripts/fedora-eln-boot.bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
#
# Copyright (C) 2023 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.

set -eux

OUTPUT="$1"

# Read the boot.iso file name from the MD5SUM file
URL=https://odcs.fedoraproject.org/composes/production/latest-Fedora-ELN/compose/BaseOS/x86_64/iso/
ISO=$(curl -L -s $URL | grep -o '"Fedora-ELN.*boot.iso"' | tr -d '"')
[ -n "$ISO" ]

curl -L "$URL$ISO" -o "$OUTPUT"
26 changes: 26 additions & 0 deletions images/scripts/fedora-eln.bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
#
# Copyright (C) 2023 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.

set -eux

URL='https://odcs.fedoraproject.org/composes/production/latest-Fedora-ELN/compose/BaseOS/x86_64/images'
IMAGE=$(curl -L -s "$URL" | grep -o 'Fedora-ELN-Guest-[^"]*qcow2' | tr -d '"' | tail -n1)
[ -n "$IMAGE" ]

exec $(dirname $0)/lib/cloudimage.bootstrap "$1" "$URL/$IMAGE"
1 change: 1 addition & 0 deletions images/scripts/fedora-eln.setup
76 changes: 48 additions & 28 deletions images/scripts/fedora.setup
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,7 @@ echo foobar | passwd --stdin root
# them to not spontaneously change from one test run to the next when
# the distribution repository is updated.
#
COCKPIT_DEPS="\
criu-libs \
device-mapper-multipath \
glibc-langpack-de \
glibc-langpack-pt \
glib-networking \
grubby \
json-glib \
kexec-tools \
libssh \
COCKPIT_MACHINES_DEPS="
libvirt-daemon-config-network \
libvirt-daemon-driver-qemu \
libvirt-daemon-driver-network \
Expand All @@ -40,19 +31,38 @@ libvirt-daemon-driver-interface \
libvirt-daemon-driver-storage-disk \
libvirt-client \
libvirt-dbus \
qemu-block-curl \
qemu-audio-spice \
qemu-char-spice \
qemu-device-usb-host \
qemu-device-usb-redirect \
qemu-kvm-core \
virt-install \
"
COCKPIT_STORAGE_DEPS="
device-mapper-multipath \
udisks2 \
udisks2-btrfs \
udisks2-lvm2 \
udisks2-iscsi \
"

COCKPIT_DEPS="\
criu-libs \
glibc-langpack-de \
glibc-langpack-pt \
glib-networking \
grubby \
json-glib \
kexec-tools \
libssh \
NetworkManager-team \
openssl \
PackageKit \
pcp \
pcp-libs \
python3-pip \
python3-tracer \
qemu-block-curl \
qemu-audio-spice \
qemu-char-spice \
qemu-device-usb-host \
qemu-device-usb-redirect \
qemu-kvm-core \
realmd \
selinux-policy-targeted \
setroubleshoot-server \
Expand All @@ -61,11 +71,6 @@ sscg \
system-logos \
subscription-manager \
tuned \
virt-install \
udisks2 \
udisks2-btrfs \
udisks2-lvm2 \
udisks2-iscsi \
"

# We also install the packages necessary to join a FreeIPA domain so
Expand Down Expand Up @@ -161,8 +166,14 @@ fi
# man-db cache update is a CPU/memory hog
rpm -e --verbose man-db

# fedora-eln image is just used for building/fetching the anaconda-webui RPM dependencies
# no need to install all dependencies there
ALL_DEPS="$COCKPIT_DEPS"
if [ "fedora-eln" != "$IMAGE" ]; then
ALL_DEPS="$COCKPIT_MACHINES_DEPS $COCKPIT_STORAGE_DEPS $COCKPIT_DEPS $IPA_CLIENT_PACKAGES $TEST_PACKAGES $ABRT_PACKAGES"
fi
dnf $DNF_OPTS -y upgrade
dnf $DNF_OPTS -y install $TEST_PACKAGES $COCKPIT_DEPS $IPA_CLIENT_PACKAGES $ABRT_PACKAGES
dnf $DNF_OPTS -y install $ALL_DEPS

mkdir -p /var/lib/package-sets/clevis
dnf $DNF_OPTS download --destdir=/var/lib/package-sets/clevis $PACKAGE_SET_CLEVIS
Expand Down Expand Up @@ -190,22 +201,31 @@ fi

# don't use a bootstrap chroot to save time and space; everything is offline, and we always just do exactly one build
echo "config_opts['use_bootstrap'] = False" >>/etc/mock/site-defaults.cfg
su builder -c "/usr/bin/mock --no-bootstrap-chroot --verbose -i $(/var/lib/testvm/build-deps.sh "${ID} ${VERSION_ID}")"
su builder -c "/usr/bin/mock --no-bootstrap-chroot --verbose -i $(/var/lib/testvm/build-deps.sh "${ID} ${VERSION_ID} ${VARIANT_ID}")"

# we need to ensure that mock's selinux-policy is older than the host:
# disabling the updates repository will surely get us a very old version
mkdir /tmp/selinux-policy-rpms
selinux_pkgs="selinux-policy selinux-policy-devel selinux-policy-targeted"
dnf download --destdir /tmp/selinux-policy-rpms --repo=fedora $selinux_pkgs
if [ "${VARIANT_ID}" != "eln" ]; then
dnf download --destdir /tmp/selinux-policy-rpms --repo=fedora $selinux_pkgs
else
dnf download --destdir /tmp/selinux-policy-rpms $selinux_pkgs
fi
su builder -c "/usr/bin/mock --install /tmp/selinux-policy-rpms/*.rpm"
# host system gets the versions with fedora-updates enabled
dnf install -y $selinux_pkgs

# for containers.install and cockpit's container/* tests
podman build --tag cockpit/base --build-arg VERSION=${VERSION_ID} /var/tmp/cockpit-base
# eln image fails on running podman with:
# error running container: did not get container start message from parent: EOF
# fedora-eln is not used in podman tests, so we can just skip this section
if [ "$VARIANT_ID" != "eln" ]; then
# for containers.install and cockpit's container/* tests
podman build --tag cockpit/base --build-arg VERSION=${VERSION_ID} /var/tmp/cockpit-base

# for c-podman tests
/var/lib/testvm/podman-images.setup
# for c-podman tests
/var/lib/testvm/podman-images.setup
fi

ln -sf ../selinux/config /etc/sysconfig/selinux
printf "SELINUX=enforcing\nSELINUXTYPE=targeted\n" > /etc/selinux/config
Expand Down
5 changes: 4 additions & 1 deletion images/scripts/lib/build-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ set -o pipefail
GET="curl --silent --show-error --fail"
COCKPIT_GIT="https://raw.githubusercontent.com/cockpit-project/cockpit"
OS_VER="$1"
# Remove variant information from OS_VER (e.g. fedora 40 eln -> fedora 40)
OS_VER_NO_VARIANT="$(echo $OS_VER | cut -d' ' -f 1,2)"

# most images use cockpit.spec from main branch, but there's a RHEL 7 stable branch with a completely different layout
case "$OS_VER" in
Expand All @@ -23,7 +25,7 @@ case "$OS_VER" in
;;
esac

echo "$spec" | rpmspec -D "$OS_VER" -D 'version 0' -D 'enable_old_bridge 0' --buildrequires --query /dev/stdin | sed 's/.*/"&"/' | tr '\n' ' '
echo "$spec" | rpmspec -D "$OS_VER_NO_VARIANT" -D 'version 0' -D 'enable_old_bridge 0' --buildrequires --query /dev/stdin | sed 's/.*/"&"/' | tr '\n' ' '

# some extra build dependencies:
# - libappstream-glib for validating appstream metadata in starter-kit and derivatives
Expand All @@ -47,6 +49,7 @@ esac
# pull nodejs-devel on Fedora for compliance with the guidelines on using nodejs modules:
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Node.js/#_buildrequires
case "$OS_VER" in
fedora*eln) ;;
fedora*) EXTRA_DEPS="$EXTRA_DEPS nodejs-devel" ;;
*) ;;
esac
Expand Down
3 changes: 3 additions & 0 deletions lib/testmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ def contexts(image, *scenarios: Iterable[str], repo: Optional[str] = None):
'main': [
'fedora-rawhide-boot',
],
'_manual': [
'fedora-eln-boot',
],
},
}

Expand Down