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
7 changes: 3 additions & 4 deletions docs/rhel4edge_iso.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ To test MicroShift in a setup similar to the production environment, it is neces

## Build RHEL for Edge Installer ISO
Log into the development virtual machine with the `microshift` user credentials.
> The development machine configuration guidelines can be found in the [MicroShift Development Environment.x](./devenv_setup.md) document.
> The development machine configuration guidelines can be found in the [MicroShift Development Environment](./devenv_setup.md) document.

Follow the instructions in the [RPM Packages](./devenv_setup.md#rpm-packages) section to create MicroShift RPM packages.

Expand Down Expand Up @@ -134,7 +134,7 @@ EOF

> **NOTE** <br>
> Embedding container images in the generated ISO requires the functionality from the latest version of the `rpm-ostree` package.
> This functionality will be available in the future releases of the RHEL 8 operating system.
> This functionality will be available in the future releases of the RHEL 8 and 9 operating systems.

To install the necessary functionality, run the following command to upgrade your system with the up-to-date `rpm-ostree` software from the `copr` repository.
```bash
Expand Down Expand Up @@ -168,7 +168,6 @@ sudo scp microshift@microshift-dev:/home/microshift/microshift/_output/image-bui
Run the following commands to create a virtual machine using the installer image.
```bash
VMNAME="microshift-edge"
VERSION=$(grep "^var Base =" ~/microshift/pkg/release/release.go | cut -d\" -f 2)
sudo -b bash -c " \
cd /var/lib/libvirt/images/ && \
virt-install \
Expand All @@ -179,7 +178,7 @@ virt-install \
--network network=default,model=virtio \
--os-type generic \
--events on_reboot=restart \
--cdrom ./microshift-installer-${VERSION}.$(uname -i).iso \
--cdrom ./microshift-installer-*.$(uname -i).iso \
"
```

Expand Down
Empty file modified scripts/devenv-builder/configure-vm.sh
100644 → 100755
Empty file.
12 changes: 7 additions & 5 deletions scripts/image-builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SCRIPTDIR=${ROOTDIR}/scripts/image-builder
IMGNAME=microshift
IMAGE_VERSION=$(jq -r '.release.base' assets/release/release-$(uname -i).json)
BUILD_ARCH=$(uname -i)
OSVERSION=$(awk -F: '{print $5}' /etc/system-release-cpe)
OSTREE_SERVER_NAME=127.0.0.1:8080
LVM_SYSROOT_SIZE_MIN=10240
LVM_SYSROOT_SIZE=${LVM_SYSROOT_SIZE_MIN}
Expand Down Expand Up @@ -119,10 +120,10 @@ build_image() {
sudo podman run -d --name=${parent_blueprint}-server -p 8080:8080 localhost/${parent_blueprint}:${parent_version}

title "Building ${image_type} for ${blueprint} v${version}, parent ${parent_blueprint} v${parent_version}"
buildid=$(sudo composer-cli compose start-ostree --ref rhel/8/${BUILD_ARCH}/edge --url http://localhost:8080/repo/ ${blueprint} ${image_type} | awk '{print $2}')
buildid=$(sudo composer-cli compose start-ostree --ref rhel/${OSVERSION}/${BUILD_ARCH}/edge --url http://localhost:8080/repo/ ${blueprint} ${image_type} | awk '{print $2}')
else
title "Building ${image_type} for ${blueprint} v${version}"
buildid=$(sudo composer-cli compose start-ostree --ref rhel/8/${BUILD_ARCH}/edge ${blueprint} ${image_type} | awk '{print $2}')
buildid=$(sudo composer-cli compose start-ostree --ref rhel/${OSVERSION}/${BUILD_ARCH}/edge ${blueprint} ${image_type} | awk '{print $2}')
fi

waitfor_image ${buildid}
Expand Down Expand Up @@ -240,10 +241,10 @@ createrepo microshift-local >/dev/null

# Download openshift local RPM packages (noarch for python and selinux packages)
rm -rf openshift-local 2>/dev/null || true
OCP_REPO_NAME=rhocp-4.12-for-rhel-8-${BUILD_ARCH}-rpms
OCP_REPO_NAME=rhocp-4.12-for-rhel-${OSVERSION}-${BUILD_ARCH}-rpms
reposync -n -a ${BUILD_ARCH} -a noarch --download-path openshift-local \
--repo=${OCP_REPO_NAME} \
--repo=fast-datapath-for-rhel-8-${BUILD_ARCH}-rpms >/dev/null
--repo=fast-datapath-for-rhel-${OSVERSION}-${BUILD_ARCH}-rpms >/dev/null

# Remove 'coreos' packages to avoid conflicts
find openshift-local -name \*coreos\* -exec rm -f {} \;
Expand Down Expand Up @@ -305,7 +306,7 @@ fi

# Add container images
if ${EMBED_CONTAINERS} ; then
# TODO: This should be removed when RHEL 8.x stream gets an up-to-date package
# TODO: This should be removed when RHEL 8/9 streams gets an up-to-date package
# Include up-to-date ostree packages in the image builder to support whiteouts
repo_name=ostree-copr
cat ${SCRIPTDIR}/config/${repo_name}.toml | sed "s;REPLACE_ARCH_VALUE;${BUILD_ARCH};g" > ${repo_name}.toml
Expand Down Expand Up @@ -337,6 +338,7 @@ cat "${SCRIPTDIR}/config/kickstart.ks.template" \
| sed "s;REPLACE_OSTREE_SERVER_NAME;${OSTREE_SERVER_NAME};g" \
| sed "s;REPLACE_OCP_PULL_SECRET_CONTENTS;$(cat $OCP_PULL_SECRET_FILE | jq -c);g" \
| sed "s;REPLACE_REDHAT_AUTHORIZED_KEYS_CONTENTS;${AUTHORIZED_KEYS};g" \
| sed "s;REPLACE_OSVERSION;${OSVERSION};g" \
| sed "s;REPLACE_BUILD_ARCH;${BUILD_ARCH};g" \
> kickstart.ks

Expand Down
2 changes: 1 addition & 1 deletion scripts/image-builder/config/kickstart.ks.template
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ volgroup rhel pv.01
logvol / --vgname=rhel --fstype=xfs --size=REPLACE_LVM_SYSROOT_SIZE --name=root

# Configure ostree
ostreesetup --nogpg --osname=rhel --remote=edge --url=file:///run/install/repo/ostree/repo --ref=rhel/8/REPLACE_BUILD_ARCH/edge
ostreesetup --nogpg --osname=rhel --remote=edge --url=file:///run/install/repo/ostree/repo --ref=rhel/REPLACE_OSVERSION/REPLACE_BUILD_ARCH/edge

%post --log=/var/log/anaconda/post-install.log --erroronfail

Expand Down
4 changes: 3 additions & 1 deletion scripts/image-builder/configure.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set -exo pipefail

OSVERSION=$(awk -F: '{print $5}' /etc/system-release-cpe)

sudo dnf install -y git osbuild-composer composer-cli ostree rpm-ostree \
cockpit-composer cockpit-machines bash-completion podman genisoimage \
createrepo yum-utils selinux-policy-devel jq wget lorax rpm-build
Expand All @@ -9,7 +11,7 @@ sudo systemctl enable cockpit.socket --now
sudo firewall-cmd --add-service=cockpit --permanent

# The mock utility comes from the EPEL repository
sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-${OSVERSION}.noarch.rpm
sudo dnf install -y mock
sudo usermod -a -G mock $(whoami)

Expand Down