diff --git a/docs/rhel4edge_iso.md b/docs/rhel4edge_iso.md index 6b502fac2d..890cee4535 100644 --- a/docs/rhel4edge_iso.md +++ b/docs/rhel4edge_iso.md @@ -132,6 +132,17 @@ auth_file_path = "/etc/osbuild-worker/pull-secret.json" EOF ``` +> **NOTE**
+> Embedding container images in the generated ISO requires the functionality from the latest version of the `osbuild` and `osbuild-composer` packages. +> This functionality will be available in the future releases of the RHEL 9 operating system. + +To install the necessary functionality, run the following command to upgrade your system with the up-to-date software from the `copr` repository. +```bash +~/microshift/hack/osbuild2copr.sh copr +``` + +> If necessary, rerun the `hack/osbuild2copr.sh` script with the `appstream` argument to revert to the standard `osbuild` and `osbuild-composer` packages. + Proceed by running the build script with the `-embed_containers` argument to include the dependent container images into the generated ISO. ```bash ~/microshift/scripts/image-builder/build.sh -pull_secret_file ~/.pull-secret.json -embed_containers @@ -221,12 +232,17 @@ rm -f $NETCONFIG_FILE Follow the instruction in the [Install MicroShift for Edge](#install-microshift-for-edge) section to install a new virtual machine using the `isolated` network configuration. > When running the `virt-install` command, specify the `--network network=isolated,model=virtio` option to select the `isolated` network configuration. -After the virtual machine is created, log into the system and verify that the Internet is not accessible. +After the virtual machine is created, log into the system using the Virtual Machine Manager console and verify that the Internet is not accessible. ```bash $ curl -I redhat.com curl: (6) Could not resolve host: redhat.com ``` +> **NOTE**
+> It may be more convenient to connect to the virtual machine using its serial console. +> * Run the `sudo systemctl enable --now serial-getty@ttyS0.service` command on the virtual machine to enable the serial console service. +> * Run the `sudo virsh console microshift-edge` command on the hypervisor to connect to the serial console. + Make sure that `CRI-O` has access to all the container images required by MicroShift. ```bash $ sudo crictl images diff --git a/hack/osbuild2copr.sh b/hack/osbuild2copr.sh new file mode 100755 index 0000000000..302698d978 --- /dev/null +++ b/hack/osbuild2copr.sh @@ -0,0 +1,43 @@ +#!/bin/bash +set -e + +ROOTDIR=$(dirname "$0") + +COPR_MODE= +case "$1" in +copr) + COPR_MODE=enable + ;; +appstream) + COPR_MODE=disable + ;; +*) + echo "Usage: $(basename "$0") " + exit 1 + ;; +esac + +echo "Removing the existing 'osbuild' packages..." +LIST2REMOVE=$(rpm -qa | grep -E '^osbuild' || true) +# shellcheck disable=SC2086 +# The list need not be quoted to allow multiple package removal +[ -n "${LIST2REMOVE}" ] && sudo dnf remove -y ${LIST2REMOVE} + +# Clean-up the old osbuild jobs, state and copr packages to avoid incompatibilities between versions +sudo rm -rf /var/lib/osbuild-composer || true +sudo rm -rf /var/cache/{osbuild-composer,osbuild-worker} || true +sudo rm -f /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:*osbuild* || true + +sudo dnf copr -y "${COPR_MODE}" @osbuild/osbuild "epel-9-$(uname -i)" +sudo dnf copr -y "${COPR_MODE}" @osbuild/osbuild-composer "epel-9-$(uname -i)" + +# Uncomment the following to use the packages from PRs before their merge +# sudo dnf copr -y "${COPR_MODE}" packit/osbuild-osbuild-1252 "epel-9-$(uname -i)" +# sudo dnf copr -y "${COPR_MODE}" packit/osbuild-osbuild-composer-3398 "epel-9-$(uname -i)" + +echo "Installing new 'osbuild' packages..." +"${ROOTDIR}/../scripts/image-builder/configure.sh" +"${ROOTDIR}/../scripts/image-builder/cleanup.sh" -full + +echo "Querying the installed 'osbuild' packages..." +rpm -qa | grep -E '^osbuild'