Skip to content

Commit 708cc11

Browse files
committed
Update to work with latest COSA
- bump the commit hash we are locked on - move to Fedora 40 as the base for the host to run the steps on - add podman to the list of things to install - it's required for some skopeo infra and just easier to install it - add a few parameters to the input json fed to runvm-osbuild
1 parent 80a19bb commit 708cc11

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,23 @@ You will want to push this image to a registry so that it can be used as an
6666
First, we need to convert the image to an OCI archive:
6767

6868
```
69-
# from local storage
69+
# to pull from local storage
7070
skopeo copy containers-storage:quay.io/myorg/myrepo:mytag oci-archive:my-custom-rhcos.ociarchive
71-
# from a registry
71+
# OR to pull from a registry
7272
skopeo copy --authfile /path/to/pull-secret docker://registry.com/org/repo:latest oci-archive:./my-custom-rhcos.ociarchive
7373
```
7474

7575
You can now take that ociarchive and create a disk image for a
7676
platform (i.e. `qemu`, `metal` or `gcp`). First you need an
7777
environment to run OSBuild in. Right now this needs to be a
78-
fully up to date Fedora 39 machine with SELinux in permissive
78+
fully up to date Fedora 40 machine with SELinux in permissive
7979
mode and some software installed:
8080

8181
```
8282
sudo dnf update -y
8383
sudo setenforce 0
8484
sudo sed -i -e 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
85-
sudo dnf install -y osbuild osbuild-tools osbuild-ostree jq xfsprogs e2fsprogs
85+
sudo dnf install -y --enablerepo=updates-testing osbuild osbuild-tools osbuild-ostree podman jq xfsprogs e2fsprogs
8686
```
8787

8888
Now you should be able to generate an image with something like:

custom-coreos-disk-images.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/bash
22
set -x -euo pipefail
33

4-
# Run this script on a fully up to date Fedora 39 VM with SELinux
4+
# Run this script on a fully up to date Fedora 40 VM with SELinux
55
# in permissive mode and the following tools installed:
6-
# sudo dnf install --enablerepo=updates-testing -y osbuild osbuild-tools osbuild-ostree jq xfsprogs e2fsprogs
6+
# sudo dnf install -y --enablerepo=updates-testing osbuild osbuild-tools osbuild-ostree podman jq xfsprogs e2fsprogs
77
#
88
# Invocation of the script would look something like this:
99
#
@@ -59,12 +59,12 @@ main() {
5959

6060
# Freeze on specific version for now to increase stability.
6161
#gitreporef="main"
62-
gitreporef="74395f97327e0927a82707ca6f59f93b169c4286"
62+
gitreporef="3a76784b37fe073718a7f9d9d67441d9d8b34c10"
6363
gitrepotld="https://raw.githubusercontent.com/coreos/coreos-assembler/${gitreporef}/"
6464
pushd ./tmp
6565
curl -LO --fail "${gitrepotld}/src/runvm-osbuild"
6666
chmod +x runvm-osbuild
67-
for manifest in "coreos.osbuild.${ARCH}.mpp.yaml" platform.{applehv,hyperv,qemu,gcp}.ipp.yaml; do
67+
for manifest in "coreos.osbuild.${ARCH}.mpp.yaml" platform.{applehv,gcp,hyperv,metal,qemu}.ipp.yaml; do
6868
curl -LO --fail "${gitrepotld}/src/osbuild-manifests/${manifest}"
6969
done
7070
popd
@@ -94,6 +94,11 @@ main() {
9494
esac
9595
outfile="./$(basename $OCIARCHIVE).${ARCH}.${platform}.${suffix}"
9696

97+
# - rootfs size is only used on s390x secex so we pass "" here
98+
# - extra-kargs from image.yaml/image.json is currently empty
99+
# on RHCOS but we may want to start picking it up from inside
100+
# the container image (/usr/share/coreos-assembler/image.json)
101+
# in the future. https://github.com/openshift/os/blob/master/image.yaml
97102
cat > tmp/diskvars.json << EOF
98103
{
99104
"osname": "rhcos",
@@ -102,7 +107,9 @@ main() {
102107
"image-type": "${platform}",
103108
"container-imgref": "${imgref}",
104109
"metal-image-size": "3072",
105-
"cloud-image-size": "16384"
110+
"cloud-image-size": "16384",
111+
"rootfs-size": "0",
112+
"extra-kargs-string": ""
106113
}
107114
EOF
108115
./tmp/runvm-osbuild \

0 commit comments

Comments
 (0)