commit e2942d1e4ba472b26a176e3a119fcb9a19ea3c15 Author: Louis Abel Date: Thu Mar 28 23:18:15 2024 -0700 poc: init for r9 Working live image of XFCE. Cloud portions available but untested. Signed-off-by: Louis Abel diff --git a/README.md b/README.md new file mode 100644 index 0000000..d7a695b --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +## rocky-kiwi-descriptions + +Kiwi descriptions for Rocky Linux 9. + +`config.xml` is a symlink to `rocky.xml`. this way the symlink can just be +changed to deal with live images (as kiwi doesn't seem to support using the +--kiwi-file option for iso). + +### Can't you use the same config.xml? Why are you symlinking? + +Yes and the reason why we're symlinking is that "name" and "displayname" are +not flexible. They are only set/read at the very top level `` (at least +from testing at the time of this writing). As our images and volume names (at +least for live images) have a very specific format, and we want it to be easy +to rename them, we did it this way. + +Cloud, container, vagrant images can all use the first config, likely just fine. +The live images were the problematic ones, thus, symlinks with a default to the +`rocky.xml` config. + +### I found an issue... + +Please fork and make a PR! We're still learning how this tool works ourselves. + +### How to try it out + +You can actually do this in mock pretty easily. You could also probably get +this running in a podman container or otherwise. As of this writing, we +haven't tried it yet. Theory says it should work. + +Note that selinux must be set to permissive. + +#### Live Image Example + +The below makes an XFCE live image. + +``` +% mock -r rocky+epel-9-x86_64 --init +% mock -r rocky+epel-9-x86_64 --install kiwi-cli \ + dracut-kiwi-live \ + kiwi-systemdeps-{bootloaders,containers,core,disk-images,filesystems,image-validation,iso-media} \ + distribution-gpg-keys + +% sudo setenforce 0 +% mock -r rocky+epel-9-x86_64 --shell --enable-network --isolation=simple +% git clone https://git.resf.org/sig_core/rocky-kiwi-descriptions -b r9 +% cd rocky-kiwi-descriptions +% sed -i 's/ZZVOLVERZZ/9/g ; s/ZZVERZZ/9/g' $(find . -name "*.xml") +% ln -sf configs/live-xfce.xml config.xml +% kiwi-ng --debug --type="iso" \ + --profile="XFCE-Live" \ + --color-output system \ + build \ + --description="./" \ + --target-dir /builddir/lmc +``` diff --git a/cloud/cloud.xml b/cloud/cloud.xml new file mode 100644 index 0000000..df798e4 --- /dev/null +++ b/cloud/cloud.xml @@ -0,0 +1,257 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + 10 + + + + + + false + + + 10 + + + + + + + + + + false + + + 10 + + + + + + false + + + 10 + + + + + + + + + + false + + + 10 + + + + + + false + + + 10 + + + + + + + + + + + false + + + 10 + + + + + + false + + + 10 + + + + + + + + + + + false + + + 10 + + + + + + false + + + 10 + + + + + + + + + + + false + + + 10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/boot.xml b/components/boot.xml new file mode 100644 index 0000000..9dc4ae1 --- /dev/null +++ b/components/boot.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/live/common.xml b/components/live/common.xml new file mode 100644 index 0000000..c2c83b1 --- /dev/null +++ b/components/live/common.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/live/xfce.xml b/components/live/xfce.xml new file mode 100644 index 0000000..9b42a6c --- /dev/null +++ b/components/live/xfce.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/users.xml b/components/users.xml new file mode 100644 index 0000000..39e8188 --- /dev/null +++ b/components/users.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/config.sh b/config.sh new file mode 100644 index 0000000..0a78563 --- /dev/null +++ b/config.sh @@ -0,0 +1,632 @@ +#!/bin/bash + +set -euxo pipefail + +#====================================== +# Functions... +#-------------------------------------- +test -f /.kconfig && . /.kconfig +test -f /.profile && . /.profile + +#====================================== +# Greeting... +#-------------------------------------- +echo "Configure image: [$kiwi_iname]-[$kiwi_profiles]..." + +################################################################################ +# ALL OF OUR FUNCTIONS +function common_live_steps() { + # this isn't needed in our testing, but we'll put it here just in case + systemctl set-default graphical.target + systemctl enable livesys.service livesys-late.service + systemctl enable tmp.mount + cat >> /etc/fstab << EOF +vartmp /var/tmp tmpfs defaults 0 0 +EOF + rm -f /var/lib/rpm/__db* + majorver=$(rpm --eval '%{rhel}') + rpm --import "/etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-${majorver}" + rm -f /var/lib/rpm/__db* + /usr/bin/mandb + rm -f /core* + rm -f /boot/*-rescue* +} + +function live_gnome_steps() { + sed -i 's/^livesys_session=.*/livesys_session="gnome"/' /etc/sysconfig/livesys +} + +function live_kde_steps() { + sed -i 's/^livesys_session=.*/livesys_session="kde"/' /etc/sysconfig/livesys + cat > /root/.gtkrc-2.0 << EOF +include "/usr/share/themes/Adwaita/gtk-2.0/gtkrc" +include "/etc/gtk-2.0/gtkrc" +gtk-theme-name="Adwaita" +EOF + mkdir -p /root/.config/gtk-3.0 +cat > /root/.config/gtk-3.0/settings.ini << EOF +[Settings] +gtk-theme-name = Adwaita +EOF + + rm -f /usr/share/wallpapers/Fedora + ln -s rocky-abstract-2 /usr/share/wallpapers/Fedora + + systemctl enable --force sddm.service + + cat > /etc/sddm.conf.d/theme.conf < /etc/sysconfig/desktop < /etc/sysconfig/desktop < /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml < + + + + + + + + + + + + + + +XFCEEOF +} + +function epel_de_steps() { + dnf config-manager --set-enabled crb +} + +# live fixes if we need them +function live_fixes() { + sed -i "s/org.fedoraproject.AnacondaInstaller/anaconda/" /usr/share/applications/liveinst.desktop +} + +function common_cloud_steps() { + # This can be done via systemctl set-default, but sometimes it doesn't work. + # systemctl set-default multi-user.target + rm -f /etc/systemd/system/default.target + ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target + + # chrony should already be enabled, let's make sure + systemctl enable chronyd + # make a persistent journal + mkdir -p /var/log/journal + + dnf -C -y remove linux-firmware avahi\* + dnf -C -y remove firewalld --setopt="clean_requirements_on_remove=1" + sed -i '/^#NAutoVTs=.*/ a\ +NAutoVTs=0' /etc/systemd/logind.conf + truncate -s 0 /etc/resolv.conf + echo "virtual-guest" > /etc/tuned/active_profile + rm -f /etc/udev/rules.d/70* + ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules + cat > /etc/sysconfig/network << EOF +NETWORKING=yes +NOZEROCONF=yes +EOF + cat > /etc/hosts << EOF +127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 +::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 + +EOF + + echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot + + systemctl mask tmp.mount + + echo -e 'rocky\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers + sed -i '1i # Modified for cloud image' /etc/cloud/cloud.cfg + sed -i 's/name: cloud-user/name: rocky/g' /etc/cloud/cloud.cfg +} + +################################################################################ +# Azure +function azure_cloud_steps() { + echo 'azure' > /etc/dnf/vars/infra + cat << EOF | tee -a /etc/NetworkManager/conf.d/dhcp-timeout.conf +# Configure dhcp timeout to 300s by default +[connection] +ipv4.dhcp-timeout=300 +EOF + systemctl enable waagent + sed -i 's/Provisioning.UseCloudInit=n/Provisioning.UseCloudInit=y/g' /etc/waagent.conf + sed -i 's/Provisioning.Enabled=y/Provisioning.Enabled=n/g' /etc/waagent.conf + cat << EOF | tee -a /etc/udev/rules.d/68-azure-sriov-nm-unmanaged.rules +# Accelerated Networking on Azure exposes a new SRIOV interface to the VM. +# This interface is transparently bonded to the synthetic interface, +# so NetworkManager should just ignore any SRIOV interfaces. +SUBSYSTEM=="net", DRIVERS=="hv_pci", ACTION=="add", ENV{NM_UNMANAGED}="1" +EOF + + cat << EOF | tee -a /etc/udev/rules.d/98-hyperv-ptp.rules +## See: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/time-sync#check-for-ptp-clock-source +SUBSYSTEM=="ptp", ATTR{clock_name}=="hyperv", SYMLINK += "ptp_hyperv" +EOF + + cat << EOF | tee -a /etc/chrony.conf +# Setup hyperv PTP device as refclock +refclock PHC /dev/ptp_hyperv poll 3 dpoll -2 offset 0 stratum 2 +EOF + + cat << EOF | tee -a /etc/modprobe.d/azure-blacklist.conf +blacklist amdgpu +blacklist nouveau +blacklist radeon +EOF + + cat << EOF | tee /etc/cloud/cloud.cfg.d/10-azure-kvp.cfg +# Enable logging to the Hyper-V kvp in Azure +reporting: + logging: + type: log + telemetry: + type: hyperv +EOF + + cat << EOF | tee -a /etc/dracut.conf.d/80-azure.conf +add_drivers+=" hv_vmbus hv_netvsc hv_storvsc " +EOF + + dracut -f -v +} + +################################################################################ +# EC2 +function ec2_cloud_steps() { + echo 'ec2' > /etc/dnf/vars/infra + cat >> /etc/dhcp/dhclient.conf << EOF +timeout 300; +retry 60; +EOF + +sed -i -e 's/ rhgb quiet//' /boot/grub/grub.conf + cat > /etc/modprobe.d/blacklist-nouveau.conf << EOL +blacklist nouveau +EOL + + cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF +DEVICE="eth0" +ONBOOT="yes" +BOOTPROTO="dhcp" +TYPE="Ethernet" +USERCTL="no" +PEERDNS="yes" +IPV6INIT="no" +PERSISTENT_DHCLIENT="1" +EOF + + echo 'install_items+=" sgdisk "' > /etc/dracut.conf.d/sgdisk.conf + echo 'add_drivers+=" xen-netfront xen-blkfront "' > /etc/dracut.conf.d/xen.conf + KERNEL_VERSION=$(rpm -q kernel --qf '%{V}-%{R}.%{arch}\n') + dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION + + cat >> /etc/chrony.conf << EOF +# Amazon Time Sync Service +server 169.254.169.123 prefer iburst minpoll 4 maxpoll 4 +EOF +} + +################################################################################ +# Generic Cloud (genclo) +function genclo_cloud_steps() { + echo 'genclo' > /etc/dnf/vars/infra + cat >> /etc/dhcp/dhclient.conf << EOF +timeout 300; +retry 60; +EOF + + cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF +DEVICE="eth0" +ONBOOT="yes" +BOOTPROTO="dhcp" +BOOTPROTOV6="dhcp" +TYPE="Ethernet" +USERCTL="no" +PEERDNS="yes" +IPV6INIT="yes" +PERSISTENT_DHCLIENT="1" +EOF +} + +################################################################################ +# OCP +function ocp_cloud_steps() { + cat >> /etc/dhcp/dhclient.conf << EOF +timeout 300; +retry 60; +EOF + + cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF +DEVICE="eth0" +ONBOOT="yes" +BOOTPROTO="dhcp" +TYPE="Ethernet" +USERCTL="no" +PEERDNS="yes" +IPV6INIT="no" +PERSISTENT_DHCLIENT="1" +EOF + + # OCI - Import repo GPG key + cat < /tmp/key +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBGHncu8BEAC2dhocMZkdapnP9o/MvAnKOczaSpF4Cj9yqt49bxLPJCY57jz9 +2ZkJ5iGk6kpBt4rPTh18aAl30T+nPP8VMQjMhvHJKfZmBtaJJ5RpvvpK5mj1UgRJ +4DQX7gqAbT0s/uZZcouZsJzXo3c7GNMrim1C+ScfGG6BoB6GVBK74jFeJNMsxZ2Y +BwQhpE+KG+1zD94RZCySykJjNoKj+U4W5H2XdB/mNEc8icFqxjJGZ5BN0DA2Wqxn +mwELTO3Q2ne1y9+sPn2YKhRqyihuZYaUPR/Jpdki93mk61MdaoTTxFPZ8FWAYrAW +9KVdreT8K33SaTFFpmhbpndPEYesgCqDqiZG7Ywjgbf2nqSOzBr2ZX23PX7QUCvQ +ar58bNbWENLhC3B950TK+r23kkPa3GICE9WP5TftWJdbJMWRBX3YhdNooNGGCbeB +xM7B/UV9hSRx1S/US8HvDhJezZDuKrpPXrNWJTuW9Kty2WGwUkEDT2GBbcjx9ocJ +fqyNJKhaLoYKCVlsmhJUi4xCY0CDDapekWLZOzHB2zgT49uIjawV5ex6pA7oLaPI +hQGvTcCl7GFWOP/6feazzIpnsJ4V3B2DoLnAevpZlINo/bi3Hv/YmbvE6NyYzD6c +1y90pc0+Om1trLPCAZpaO1I369ZhLl6T/mCd92hrCG1y8K3PFiRIKpE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Lm9yZz6JAk4EEwEI +ADgWIQT/itE0RZcQbs6BO5GKOHK/MihGfAUCYTeY6wIbDwULCQgHAgYVCgkICwIE +FgIDAQIeAQIXgAAKCRCKOHK/MihGfFX/EACBPWv20+ttYu1A5WvtHJPzwbj0U4yF +3zTQpBglQ2UfkRpYdipTlT3Ih6j5h2VmgRPtINCc/ZE28adrWpBoeFIS2YAKOCLC +nZYtHl2nCoLq1U7FSttUGsZ/t8uGCBgnugTfnIYcmlP1jKKA6RJAclK89evDQX5n +R9ZD+Cq3CBMlttvSTCht0qQVlwycedH8iWyYgP/mF0W35BIn7NuuZwWhgR00n/VG +4nbKPOzTWbsP45awcmivdrS74P6mL84WfkghipdmcoyVb1B8ZP4Y/Ke0RXOnLhNe +CfrXXvuW+Pvg2RTfwRDtehGQPAgXbmLmz2ZkV69RGIr54HJv84NDbqZovRTMr7gL +9k3ciCzXCiYQgM8yAyGHV0KEhFSQ1HV7gMnt9UmxbxBE2pGU7vu3CwjYga5DpwU7 +w5wu1TmM5KgZtZvuWOTDnqDLf0cKoIbW8FeeCOn24elcj32bnQDuF9DPey1mqcvT +/yEo/Ushyz6CVYxN8DGgcy2M9JOsnmjDx02h6qgWGWDuKgb9jZrvRedpAQCeemEd +fhEs6ihqVxRFl16HxC4EVijybhAL76SsM2nbtIqW1apBQJQpXWtQwwdvgTVpdEtE +r4ArVJYX5LrswnWEQMOelugUG6S3ZjMfcyOa/O0364iY73vyVgaYK+2XtT2usMux +VL469Kj5m13T6w== +=Mjs/ +-----END PGP PUBLIC KEY BLOCK----- +EOF + + rpm --import /tmp/key + # remove these for debugging + sed -i -e 's/ rhgb quiet//' /boot/grub/grub.conf + + # enable resizing on copied AMIs + echo 'install_items+=" sgdisk "' > /etc/dracut.conf.d/sgdisk.conf + + # OCI - Need iscsi as a dracut module + echo 'add_dracutmodules+=" iscsi "' > /etc/dracut.conf.d/iscsi.conf + + # OCI - Virtio drivers + echo 'add_drivers+=" virtio virtio_blk virtio_net virtio_pci virtio_ring virtio_scsi virtio_console "' > /etc/dracut.conf.d/virtio.conf + + # OCI - YOLO + mkdir -p /usr/lib/dracut/modules.d/95oci + OCIDRACUT="H4sIAGtFHmMAA+2WWW/bOBCA/Vr+illZzQXoluPUhgMURYrmpS02fevuGpJIWYQVUiWpJoHr/15S +crLZZBs3QA8U5QfYosQ5NUNSrRRBTfMAi6xoVXDOcVsT6ePg2YgXNBh8C0LNeDTqrpq7124cpfF4 +nIzT8fhwEEaj+HA8gNE38b6FVqpMAAwE5+ohuW3zvyjtw/UnLMtr4lFZSOrlV00mpS+rR/rYUv84 +StJBlIx10ZNREscD/SRNkwGE3yXjO/zm9R/+EeSUBbJCQ/AOPNANQCYgK1LXniwEbdQUKMOEKU9l +ufT6eUbrqRby8kzSwuNlKYmaQDo1JrQhcjkBJWdHIC9mKUg9TIEoKGlN1FVDZtobGr7NVFFB11nm +3YLikNU1v4A8ozXwVgEtQVUEullM5RKKjGkZQTJ8BTmBkrcMo6Eg5QTeiCxvFxMYJmESxWGYImRc +wYLo8i7gOMDkY8Dauob4eCeCT5/Ah1uN7+mhbmx0+vrs5M93s10kZo67Mp6Hec2L5WTtIB1Oby3n +vIYQBPa76P1+XcDODrwHj4DjCgf+nprYGSDQlFwA69KgDNy93ooERpR5uD8FzDs5w3utv+qEnz6d +HKwdmIHTudE2TdgFZ4qyltwodGk2mZBk3snNO0dfTlh7vc722sQ9bcftInCMmiCqFQyiG+lN2HPC +ipm7J5WYC9LUWUH+VXMC/fsrLp39TgtzRuAe3RQpKr5JcAJnS9o0lC3AveXD930HjnfiR4lDl/7y +XC5uqUkjT7CZdgJ13gSdHbP+FcHebSNOr3VJFYSopGgXfWX1S21ZmgV109c3rYCuwzgxe6oJ+/Ts +xdkpbPR5oyhn15l+leR/kuw13L6BdeFAEgwehd3gn7fP372a+QdusBK9ilSYmniq9RTc1eU0MBKB +HnwI11P9n6x3/ycP3QsXme4E56VeoNr4g9GZt/az9zbLdrac//29p7f3tnn8wb9h2/dfchjd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9DSTogc2V0X2hvc3RuYW1lLCB1cGRhdGVfaG9zdG5hbWUs +IHVwZGF0ZV9ldGNfaG9zdHMgYXJlIGRpc2FibGVkCiMtIHNldF9ob3N0bmFtZQojLSB1cGRhdGVf +aG9zdG5hbWUKIy0gdXBkYXRlX2V0Y19ob3N0cwogLSByc3lzbG9nCiAtIHVzZXJzLWdyb3Vwcwog +LSBzc2gKCmNsb3VkX2NvbmZpZ19tb2R1bGVzOgogLSBtb3VudHMKIC0gbG9jYWxlCiAtIHNldC1w +YXNzd29yZHMKIyBPQ0k6IHJoX3N1YnNjcmlwdGlvbiBpcyBkaXNhYmxlZAojLSByaF9zdWJzY3Jp +cHRpb24KIC0geXVtLWFkZC1yZXBvCiAtIHBhY2thZ2UtdXBkYXRlLXVwZ3JhZGUtaW5zdGFsbAog +LSB0aW1lem9uZQogLSBudHAKIC0gcHVwcGV0CiAtIGNoZWYKIC0gc2FsdC1taW5pb24KIC0gbWNv +bGxlY3RpdmUKIC0gZGlzYWJsZS1lYzItbWV0YWRhdGEKIC0gcnVuY21kCgpjbG91ZF9maW5hbF9t +b2R1bGVzOgogLSByaWdodHNjYWxlX3VzZXJkYXRhCiAtIHNjcmlwdHMtcGVyLW9uY2UKIC0gc2Ny +aXB0cy1wZXItYm9vdAogLSBzY3JpcHRzLXBlci1pbnN0YW5jZQogLSBzY3JpcHRzLXVzZXIKIC0g +c3NoLWF1dGhrZXktZmluZ2VycHJpbnRzCiAtIGtleXMtdG8tY29uc29sZQogLSBwaG9uZS1ob21l +CiAtIGZpbmFsLW1lc3NhZ2UKIyBPQ0k6IHBvd2VyLXN0YXRlLWNoYW5nZSBpcyBkaXNhYmxlZAoj +LSBwb3dlci1zdGF0ZS1jaGFuZ2UKCg==" + + base64 -d <<<"$OCICLOUDCFG" >> /etc/cloud/cloud.cfg.d/99_oci.cfg + + # Remove system.devices because Oracle does things. + rm -fv /etc/lvm/devices/system.devices + + # Start OCId + systemctl enable ocid + + # Copyright (C) 2020 Oracle Corp., Inc. All rights reserved. + # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl + # + # /usr/lib/oci-linux-config/cloud/scripts/initramfs-mod/net.sh + # + + echo "$(date) - OCI initramfs network modification script started." + # Symlink network config files where cloud-init >= 19.4 expects them + DRACUT_CFG=/run/initramfs/state/etc/sysconfig/network-scripts + CI_DIR=/run + if [ -d $DRACUT_CFG ]; then + FILE_COUNT=`ls $DRACUT_CFG | wc -l` + if [ $FILE_COUNT -eq 0 ]; then + # Create dummy file if dracut did not create network device config + dummycfg=$CI_DIR/net-dummy.conf + echo "DEVICE=\"dummy\"" > $dummycfg + echo "BOOTPROTO=dhcp" >> $dummycfg + echo "$(date) - Creating dummy config $dummycfg." + else + for dcfg in $DRACUT_CFG/*; do + filename=${dcfg##*/} + devname=${filename##ifcfg-} + cicfg=$CI_DIR/net-$devname.conf + if [ ! -e $cicfg ]; then + echo "$(date) - Creating symlink from $dcfg to $cicfg." + ln -s $dcfg $cicfg + fi + done + fi + fi + echo "$(date) - OCI initramfs network modification script done." +} + +function cloud_cleanup_steps() { + truncate -c -s 0 /var/log/dnf.log + rm -rf /var/log/yum.log + rm -rf /var/lib/yum/* + rm -rf /root/install.log + rm -rf /root/install.log.syslog + rm -rf /root/anaconda-ks.cfg + rm -rf /var/log/anaconda* + + rm -f /var/lib/systemd/random-seed + + touch /var/log/cron + touch /var/log/boot.log + mkdir -p /var/cache/yum + + # Azure Only + if [[ "$kiwi_profiles" == *"Azure"* ]]; then + rm -f /var/log/waagent.log + cloud-init clean + waagent -force -deprovision+user + fi +} + +function azure_cleanup_steps() { + rm -f /var/log/waagent.log + cloud-init clean + waagent -force -deprovision+user +} +# +################################################################################ + +cat /dev/null > /etc/machine-id + +# Gets around grub-bls issue +echo "GRUB_DEFAULT=saved" >> /etc/default/grub + +# All cloud and live +if [[ "$kiwi_profiles" == *"Cloud"* ]] || [[ "$kiwi_profiles" == *"Live"* ]]; then + passwd -d root + passwd -l root +fi + +################################################################################ +# Just about all the cloud images should do these things. +if [[ "$kiwi_profiles" == *"Cloud"* ]]; then + common_cloud_steps +fi + +################################################################################ +# Azure specific settings +if [[ "$kiwi_profiles" == *"Azure"* ]]; then + azure_cloud_steps +fi + +################################################################################ +# EC2 specific settings +if [[ "$kiwi_profiles" == *"EC2"* ]]; then + ec2_cloud_steps +fi + +################################################################################ +# GenClo specific settings +if [[ "$kiwi_profiles" == *"GenericCloud"* ]]; then + genclo_cloud_steps +fi + +################################################################################ +# OCP specific settings +if [[ "$kiwi_profiles" == *"OCP"* ]]; then + ocp_cloud_steps +EOF + +fi + +# cloud clean up +if [[ "$kiwi_profiles" == *"Cloud"* ]]; then + echo "cleanup time" + cloud_cleanup_steps + + # Azure Only + if [[ "$kiwi_profiles" == *"Azure"* ]]; then + azure_cleanup_steps + fi + + rm -f ~/.bash_history + export HISTSIZE=0 +fi + +# Live Images Only +if [[ "$kiwi_profiles" == *"Live"* ]]; then + common_live_steps + if [[ "$kiwi_profiles" == *"Workstation"* ]]; then + live_gnome_steps + fi + if [[ "$kiwi_profiles" == *"KDE"* ]]; then + live_kde_steps + epel_de_steps + fi + if [[ "$kiwi_profiles" == *"Cinnamon"* ]]; then + live_cinnamon_steps + epel_de_steps + fi + if [[ "$kiwi_profiles" == *"MATE"* ]]; then + live_mate_steps + epel_de_steps + fi + if [[ "$kiwi_profiles" == *"XFCE"* ]]; then + live_xfce_steps + epel_de_steps + fi +fi diff --git a/config.xml b/config.xml new file mode 100644 index 0000000..a5535ab --- /dev/null +++ b/config.xml @@ -0,0 +1,31 @@ + + + + + Release Engineering (SIG/Core) + releng@rockylinux.org + Rocky Linux + + + 9 + dnf + en_US + us + UTC + 9 + + + + + + + + + + + + + + + + diff --git a/configs/live-xfce.xml b/configs/live-xfce.xml new file mode 100644 index 0000000..1b8380b --- /dev/null +++ b/configs/live-xfce.xml @@ -0,0 +1,28 @@ + + + + + Release Engineering (SIG/Core) + releng@rockylinux.org + Rocky Linux + + + 9 + dnf + en_US + us + UTC + 9 + + + + + + + + + + + + + diff --git a/configs/rocky.xml b/configs/rocky.xml new file mode 100644 index 0000000..21f8e7c --- /dev/null +++ b/configs/rocky.xml @@ -0,0 +1,30 @@ + + + + + Release Engineering (SIG/Core) + releng@rockylinux.org + Rocky Linux + + + 9 + dnf + en_US + us + UTC + 9 + + + + + + + + + + + + + + + diff --git a/container/container.xml b/container/container.xml new file mode 100644 index 0000000..d3d41ed --- /dev/null +++ b/container/container.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/grub.tmpl b/grub.tmpl new file mode 100644 index 0000000..d5c21eb --- /dev/null +++ b/grub.tmpl @@ -0,0 +1,46 @@ +# copied from a live built image, and modified to deal with non-uefi + +set default="${default_boot}" + +if [ "$$grub_platform" == "efi" ]; then + function load_video { + insmod efi_gop + insmod efi_uga + insmod video_bochs + insmod video_cirrus + insmod all_video + } + set basicgfx="nomodeset" +else + function load_video { + insmod all_video + } + set basicgfx="nomodeset vga=791" +fi + +load_video +set gfxpayload=keep +insmod gzio +insmod part_gpt +insmod ext2 + +terminal_input console +terminal_output ${terminal_output} +set timeout=${boot_timeout} + +search ${search_params} + +menuentry 'Start ${title}' --class fedora --class gnu-linux --class gnu --class os { + linux ($$root)${bootpath}/${kernel_file} ${boot_options} + initrd ($$root)${bootpath}/${initrd_file} +} +menuentry 'Test this media & start ${title}' --class fedora --class gnu-linux --class gnu --class os { + linux ($$root)${bootpath}/${kernel_file} ${boot_options} rd.live.check + initrd ($$root)${bootpath}/${initrd_file} +} +submenu "Troubleshooting -->" { + menuentry "Start ${title} in basic graphics mode" --class fedora --class gnu-linux --class gnu --class os { + linux ($$root)${bootpath}/${kernel_file} ${boot_options} $${basicgfx} + initrd ($$root)${bootpath}/${initrd_file} + } +} diff --git a/live/xfce.xml b/live/xfce.xml new file mode 100644 index 0000000..4f0cf8f --- /dev/null +++ b/live/xfce.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/repositories/core.xml b/repositories/core.xml new file mode 100644 index 0000000..ef62e30 --- /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..240fab7 --- /dev/null +++ b/repositories/epel.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/repositories/oracle.xml b/repositories/oracle.xml new file mode 100644 index 0000000..85544f7 --- /dev/null +++ b/repositories/oracle.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/repositories/sig-cloud-common.xml b/repositories/sig-cloud-common.xml new file mode 100644 index 0000000..9c5704a --- /dev/null +++ b/repositories/sig-cloud-common.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/root/etc/fstab.script b/root/etc/fstab.script new file mode 100644 index 0000000..3014007 --- /dev/null +++ b/root/etc/fstab.script @@ -0,0 +1,3 @@ +#!/bin/sh +# anaconda does this technically. +gawk -i inplace '$2 == "/boot/efi" { $4 = $4",umask=0077,shortname=winnt" } { print $0 }' /etc/fstab diff --git a/root/etc/sysconfig/kernel b/root/etc/sysconfig/kernel new file mode 100644 index 0000000..8da1970 --- /dev/null +++ b/root/etc/sysconfig/kernel @@ -0,0 +1,6 @@ +# UPDATEDEFAULT specifies if kernel-install should make +# new kernels the default +UPDATEDEFAULT=yes + +# DEFAULTKERNEL specifies the default kernel package type +DEFAULTKERNEL=kernel-core