Skip to content
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
18 changes: 17 additions & 1 deletion docs/rhel4edge_iso.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ auth_file_path = "/etc/osbuild-worker/pull-secret.json"
EOF
```

> **NOTE** <br>
> 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
Expand Down Expand Up @@ -220,12 +231,17 @@ sudo virsh net-autostart isolated
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** <br>
> 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
Expand Down
43 changes: 43 additions & 0 deletions hack/osbuild2copr.sh
Original file line number Diff line number Diff line change
@@ -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") <copr | appstream>"
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'