Skip to content

Instantly share code, notes, and snippets.

@jcpowermac
Created March 3, 2022 19:45
Show Gist options
  • Save jcpowermac/57ad71d30accbc5cb9e3825d319da461 to your computer and use it in GitHub Desktop.
Save jcpowermac/57ad71d30accbc5cb9e3825d319da461 to your computer and use it in GitHub Desktop.
okd build fcos
#!/bin/bash
set +x
source ./cosa.sh
FCOS_BUILD="fcos-build"
OKD_VERSION="4.10"
MCOIMAGE="registry.ci.openshift.org/origin/${OKD_VERSION}:machine-config-operator"
ARTIMAGE="registry.ci.openshift.org/origin/${OKD_VERSION}:artifacts"
OKD_REPO="./okd-repo"
OVERLAY_EXTENSIONS="./overlay/extensions"
mkdir -p ${FCOS_BUILD}
cd ${FCOS_BUILD}
mkdir -p ${OKD_REPO}
mkdir -p ${OVERLAY_EXTENSIONS}
podman pull ${MCOIMAGE}
podman pull ${ARTIMAGE}
mcoid=$(podman create ${MCOIMAGE})
artid=$(podman create ${ARTIMAGE})
mcopath=$(podman mount $mcoid)
artpath=$(podman mount $artid)
cp -rvf ${artpath}/srv/repo/*.rpm ${OKD_REPO}
cosa init --force --branch 4.10-feb26 https://github.com/openshift/okd-machine-os
mkdir -p ./src/config/overlay.d/99okd/usr/libexec/
cp -rvf ${mcopath}/usr/bin/machine-config-daemon ./src/config/overlay.d/99okd/usr/libexec/machine-config-daemon
podman unmount --all
podman rm -f ${mcoid}
podman rm -f ${artid}
# Create repo for OKD RPMs
pushd ${OKD_REPO}
createrepo_c .
popd
cosa fetch
cosa build
# Create repo for OS Extensions
pushd ${OVERLAY_EXTENSIONS}
createrepo_c .
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment