From f6962b6cf11e70a6248dacb38710d0a42a3779e6 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Feb 12 2023 11:01:26 +0000 Subject: [PATCH 1/2] Initial KIWI descriptions --- diff --git a/CentOS-Stream-Hyperscale-Spin.kiwi b/CentOS-Stream-Hyperscale-Spin.kiwi new file mode 120000 index 0000000..2288558 --- /dev/null +++ b/CentOS-Stream-Hyperscale-Spin.kiwi @@ -0,0 +1 @@ +config.xml \ No newline at end of file diff --git a/README.md b/README.md index 2158e33..7e95f95 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,39 @@ This contains the KIWI descriptions for building the CentOS Hyperscale spin for CentOS Stream 9. +## Spin variants + +* Cloud (image type: `oem`, image profiles: `OpenStack`/`AWSEC2`/`Azure`/`GCE`) +* Workstation GNOME (image type: `iso`, image profiles: `GNOME-Live`) +* Workstation KDE (image type: `iso`, image profiles: `KDE-Live`) + +## Spin build quickstart + +### Podman + +The instructions below will use the `podman` command. Docker may work, but it's not tested or supported. + +First, pull down the container of the required environment (CentOS Stream 9). + +```bash +$ sudo podman pull quay.io/centoshyperscale/centos:stream9 +``` + +Assuming you're in the root directory of the Git checkout, set up the container: + +```bash +$ sudo podman run --privileged --rm -it -v $PWD:/code:z -w /code quay.io/centoshyperscale/centos:stream9 /bin/bash +``` + +Once in the container environment, set up your development environment and run the image build (substitute `` and `` for the appropriate settings): + +```bash +# Install kiwi +[]$ dnf --assumeyes install kiwi +# Run the image build +[]$ kiwi-ng --type= --profile= --color-output system build --description ./ --target-dir ./outdir +``` + ## Licensing This is free software: you can redistribute it and/or modify diff --git a/components/boot.xml b/components/boot.xml new file mode 100644 index 0000000..508dd05 --- /dev/null +++ b/components/boot.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/components/desktop-environments.xml b/components/desktop-environments.xml new file mode 100644 index 0000000..7bf25a7 --- /dev/null +++ b/components/desktop-environments.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/liveinstall.xml b/components/liveinstall.xml new file mode 100644 index 0000000..8681fba --- /dev/null +++ b/components/liveinstall.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/users.xml b/components/users.xml new file mode 100644 index 0000000..e126074 --- /dev/null +++ b/components/users.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/config.sh b/config.sh new file mode 100755 index 0000000..ac535b5 --- /dev/null +++ b/config.sh @@ -0,0 +1,93 @@ +#!/bin/bash + +set -euxo pipefail + +#====================================== +# Functions... +#-------------------------------------- +test -f /.kconfig && . /.kconfig +test -f /.profile && . /.profile + +#====================================== +# Greeting... +#-------------------------------------- +echo "Configure image: [$kiwi_iname]-[$kiwi_profiles]..." + +#====================================== +# Turn on sticky vendors +#-------------------------------------- +echo "allow_vendor_change=False" >> /etc/dnf/dnf.conf + +#====================================== +# Set SELinux booleans +#-------------------------------------- +## Fixes KDE Plasma, see rhbz#2058657 +setsebool -P selinuxuser_execmod 1 + +#====================================== +# Clear machine specific configuration +#-------------------------------------- +## Force generic hostname +echo "localhost" > /etc/hostname +## Clear machine-id on pre generated images +truncate -s 0 /etc/machine-id + +#====================================== +# Configure grub correctly +#-------------------------------------- +## Works around issues with grub-bls +## See: https://github.com/OSInside/kiwi/issues/2198 +echo "GRUB_DEFAULT=saved" >> /etc/default/grub + +#====================================== +# Delete & lock the root user password +#-------------------------------------- +if [[ "$kiwi_profiles" == *"AWS"* ]] || [[ "$kiwi_profiles" == *"Azure"* ]] || [[ "$kiwi_profiles" == *"OpenStack"* ]] || [[ "$kiwi_profiles" == *"Live"* ]]; then + passwd -d root + passwd -l root +fi + +#====================================== +# Setup default services +#-------------------------------------- + +if [[ "$kiwi_profiles" == *"AWS"* ]] || [[ "$kiwi_profiles" == *"Azure"* ]] || [[ "$kiwi_profiles" == *"OpenStack"* ]]; then + ## Enable cloud-init + systemctl enable cloud-config.service cloud-final.service cloud-init.service cloud-init-local.service cloud-init.target +fi + +if [[ "$kiwi_profiles" == *"Azure"* ]]; then + ## Enable Azure service + systemctl enable waagent.service +fi + +if [[ "$kiwi_profiles" == *"Live"* ]]; then + ## Enable livesys services + systemctl enable livesys.service livesys-late.service + if [[ "$kiwi_profiles" == *"GNOME"* ]]; then + echo 'livesys_session="gnome"' > /etc/sysconfig/livesys + fi + if [[ "$kiwi_profiles" == *"KDE"* ]]; then + echo 'livesys_session="kde"' > /etc/sysconfig/livesys + fi +fi + +## Enable chrony +systemctl enable chronyd.service +## Enable oomd +systemctl enable systemd-oomd.service +## Enable resolved +systemctl enable systemd-resolved.service +## Enable persistent journal +mkdir -p /var/log/journal + +#====================================== +# Setup default target +#-------------------------------------- +if [[ "$kiwi_profiles" == *"GNOME"* ]] || [[ "$kiwi_profiles" == *"KDE"* ]]; then + systemctl set-default graphical.target +else + systemctl set-default multi-user.target +fi + +exit 0 diff --git a/config.xml b/config.xml new file mode 100644 index 0000000..521a9ab --- /dev/null +++ b/config.xml @@ -0,0 +1,42 @@ + + + + + CentOS Hyperscale SIG + sig-hyperscale@centosproject.org + CentOS Stream Hyperscale Spin + + + 9.0.0 + dnf + en_US + us + UTC + true + 9 + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/platforms/cloud.xml b/platforms/cloud.xml new file mode 100644 index 0000000..0f4db36 --- /dev/null +++ b/platforms/cloud.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + + false + + + + + + + 5 + + + + + + + false + + + + + + + 5 + + + + + + + false + + + + + + + 5 + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + diff --git a/platforms/vagrant.xml b/platforms/vagrant.xml new file mode 100644 index 0000000..d1973d5 --- /dev/null +++ b/platforms/vagrant.xml @@ -0,0 +1,37 @@ + + + + + + + + + + 5 + + + + + + + false + + + + + + + + + + + + + + + + + + + + diff --git a/platforms/workstation.xml b/platforms/workstation.xml new file mode 100644 index 0000000..1dec143 --- /dev/null +++ b/platforms/workstation.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/repositories/core.xml b/repositories/core.xml new file mode 100644 index 0000000..1c5d253 --- /dev/null +++ b/repositories/core.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/repositories/epel.xml b/repositories/epel.xml new file mode 100644 index 0000000..e831fd6 --- /dev/null +++ b/repositories/epel.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/repositories/hyperscale.xml b/repositories/hyperscale.xml new file mode 100644 index 0000000..d9f0c96 --- /dev/null +++ b/repositories/hyperscale.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + From 99660423228c042e750bcd65789786c3eb4d668d Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Feb 12 2023 11:01:26 +0000 Subject: [PATCH 2/2] Devolve environment groups to sets of regular groups --- diff --git a/components/desktop-environments.xml b/components/desktop-environments.xml index 7bf25a7..a801436 100644 --- a/components/desktop-environments.xml +++ b/components/desktop-environments.xml @@ -10,17 +10,27 @@ + + + + + + + + + + - - + + + - - + diff --git a/components/liveinstall.xml b/components/liveinstall.xml index 8681fba..8332eb1 100644 --- a/components/liveinstall.xml +++ b/components/liveinstall.xml @@ -23,7 +23,6 @@ -