|
|
|
@ -21,7 +21,7 @@ sudo dnf install -y osbuild-composer composer-cli cockpit-composer |
|
|
|
sudo systemctl enable --now osbuild-composer.socket |
|
|
|
sudo systemctl enable --now cockpit.socket |
|
|
|
sudo systemctl restart osbuild-composer |
|
|
|
sudo usermod -a -G weldr nmasse |
|
|
|
sudo usermod -a -G weldr "$(id -un)" |
|
|
|
``` |
|
|
|
|
|
|
|
Check that **os-composer** is working. |
|
|
|
@ -89,8 +89,15 @@ ls -l $HOME/rpmbuild/RPMS/x86_64/ |
|
|
|
|
|
|
|
## Repository Creation |
|
|
|
|
|
|
|
Customize the desired location of the RPM repository: |
|
|
|
|
|
|
|
```sh |
|
|
|
REPO_LOCATION="/opt/custom-rpms/" |
|
|
|
``` |
|
|
|
|
|
|
|
Create the custom RPM repository: |
|
|
|
|
|
|
|
```sh |
|
|
|
export REPO_LOCATION="/opt/custom-rpms/" |
|
|
|
sudo dnf install -y createrepo |
|
|
|
sudo mkdir -p "$REPO_LOCATION" |
|
|
|
sudo cp $HOME/rpmbuild/RPMS/x86_64/* "$REPO_LOCATION" |
|
|
|
@ -105,19 +112,26 @@ EOF |
|
|
|
sudo dnf info google-chrome-stable |
|
|
|
``` |
|
|
|
|
|
|
|
## os-builer configuration |
|
|
|
## Blueprint preparation |
|
|
|
|
|
|
|
Customize the **kiosk** and **admin** user password if desired. |
|
|
|
|
|
|
|
```sh |
|
|
|
KIOSK_PASSWORD="$(openssl rand -base64 9)" |
|
|
|
echo "Kiosk password is '$KIOSK_PASSWORD'" |
|
|
|
ADMIN_PASSWORD="$(openssl rand -base64 9)" |
|
|
|
echo "Admin password is '$ADMIN_PASSWORD'" |
|
|
|
``` |
|
|
|
|
|
|
|
Prepare the os-builder blueprint. |
|
|
|
|
|
|
|
```sh |
|
|
|
sudo subscription-manager repos --enable rhocp-4.14-for-rhel-9-$(uname -m)-rpms --enable fast-datapath-for-rhel-9-$(uname -m)-rpms |
|
|
|
sudo dnf info microshift |
|
|
|
sudo dnf install -y mkpasswd podman |
|
|
|
cd "$GIT_REPO_CLONE/imagebuilder" |
|
|
|
KIOSK_PASSWORD="$(openssl rand -base64 9)" |
|
|
|
KIOSK_PASSWORD_HASH="$(mkpasswd -m bcrypt "$KIOSK_PASSWORD")" |
|
|
|
echo "Kiosk password is '$KIOSK_PASSWORD'" |
|
|
|
ADMIN_PASSWORD="$(openssl rand -base64 9)" |
|
|
|
ADMIN_PASSWORD_HASH="$(mkpasswd -m bcrypt "$ADMIN_PASSWORD")" |
|
|
|
echo "Admin password is '$ADMIN_PASSWORD'" |
|
|
|
sed -i.orig1 "s|__KIOSK_PASSWORD__|$KIOSK_PASSWORD_HASH|" kiosk.toml |
|
|
|
sed -i.orig2 "s|__ADMIN_PASSWORD__|$ADMIN_PASSWORD_HASH|" kiosk.toml |
|
|
|
ADMIN_SSH_PUBLIC_KEY="$(ssh-add -L | head -n 1)" |
|
|
|
@ -190,5 +204,35 @@ EOF |
|
|
|
BUILDID=$(composer-cli compose start-ostree --url http://localhost:8085/repo/ --ref "rhel/9/$(uname -m)/edge" microshift-installer edge-installer | awk '{print $2}') |
|
|
|
composer-cli compose status |
|
|
|
composer-cli compose image "${BUILDID}" |
|
|
|
``` |
|
|
|
|
|
|
|
## Prepare the Kickstart script |
|
|
|
|
|
|
|
Customize the **root** user password if desired. |
|
|
|
|
|
|
|
```sh |
|
|
|
ROOT_PASSWORD="$(openssl rand -base64 9)" |
|
|
|
echo "Root password is '$ROOT_PASSWORD'" |
|
|
|
``` |
|
|
|
|
|
|
|
[Generate a registry token](https://access.redhat.com/terms-based-registry/) and set the `MICROSHIFT_PULL_SECRET` variable. |
|
|
|
|
|
|
|
```sh |
|
|
|
MICROSHIFT_PULL_SECRET="1.2.3" # Generated by https://access.redhat.com/terms-based-registry/ |
|
|
|
``` |
|
|
|
|
|
|
|
Prepare the Kickstart script. |
|
|
|
|
|
|
|
```sh |
|
|
|
cd "$GIT_REPO_CLONE/imagebuilder" |
|
|
|
__ROOT_PASSWORD_HASH__="$(mkpasswd -m bcrypt "$ROOT_PASSWORD")" |
|
|
|
sed -i.orig1 "s|__MICROSHIFT_PULL_SECRET__|$MICROSHIFT_PULL_SECRET|" kiosk.ks |
|
|
|
sed -i.orig2 "s|__ROOT_PASSWORD_HASH__|$__ROOT_PASSWORD_HASH__|" kiosk.ks |
|
|
|
``` |
|
|
|
|
|
|
|
## Inject the Kickstart in the ISO |
|
|
|
|
|
|
|
```sh |
|
|
|
sudo dnf install -y lorax |
|
|
|
mkksiso kiosk.ks "${BUILDID}-installer.iso" kiosk.iso |
|
|
|
``` |
|
|
|
|