3.9. Deploying an image mode for RHEL systems by using FDO
You can deploy an image mode for a RHEL system by using FIDO Device Onboarding (FDO) to deliver configuration to this system. Use a Kickstart file to configure various parts of the installation process, such as setting up users, customizing partitioning, and adding an SSH key. You can include the Kickstart file in an ISO build to configure any part of the installation process, except the deployment of the base image.
If you use an ISO with a bootc container base image, bootc-image-builder automatically installs ostreecontainer, the command to install the container image. You can still configure anything, except the ostreecontainer command.
Prerequisites
- You have Podman installed on your host machine.
-
You have root access to run the
bootc-image-buildertool and run the containers in--privilegedmode. - You have FDO server infrastructure deployed.
Procedure
Create a Containerfile, for example:
FROM registry.redhat.io/rhel10/rhel-bootc:latest RUN dnf install -y fdo-init fdo-client RUN systemctl enable fdo-client-linuxapp.serviceCreate your Kickstart file. The following Kickstart file is an example of a fully unattended Kickstart file configuration that contains user creation and partition instructions.
[customizations.installer.kickstart] contents = """ text --non-interactive zerombr clearpart --all --initlabel --disklabel=gpt autopart --noswap --type=lvm user --name=test --groups=wheel --plaintext --password=test sshkey --username=test "ssh-ed25519 AAA..." network --bootproto=dhcp --device=link --activate --onboot=on poweroff %post export MANUFACTURING_SERVER_URL="http://192.168……" export DIUN_PUB_KEY_INSECURE="true" /usr/libexec/fdo/fdo-manufacturing-client %end """In the export <MANUFACTURING_SERVER_URL> field, replace the manufacturing server URL with your own manufacturing server URL.
-
Save the Kickstart configuration in the
.tomlformat to inject the Kickstart content. For example,config.toml. Create the following folder:
$ mkdir $(pwd)/output"Run
bootc-image-builder, and include the Kickstart file configuration that you want to add to the ISO build. Thebootc-image-builderautomatically adds theostreecontainercommand that installs the container image.$ sudo podman run \ --rm \ -it \ --privileged \ --pull=newer \ --security-opt label=type:unconfined_t \ -v /var/lib/containers/storage:/var/lib/containers/storage \ -v $(pwd)/config.toml:/config.toml \ -v $(pwd)/output:/output \ registry.redhat.io/rhel10/bootc-image-builder:latest \ --type iso \ --config /config.toml \ quay.io/<namespace>/<image>:<tag>You can find the resulting
.isoimage in the output folder.