From d7a221b0776341dfcb6ba6b7fa86b1f24dffbc1f Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 17 Aug 2021 10:28:59 +0200 Subject: [PATCH] rename files and make the cdrom/iso requirement explicit --- leaves/{vdmd.cfg => ivdmd.cfg} | 12 +- leaves/{vmld.cfg => ivdmld.cfg} | 183 +++++++++---------------------- leaves/{vhamd.cfg => ivhamd.cfg} | 7 +- leaves/{vhimd.cfg => ivhimd.cfg} | 7 +- leaves/{vhmd.cfg => ivhmd.cfg} | 7 +- leaves/{vmd.cfg => ivmd.cfg} | 25 +++-- 6 files changed, 84 insertions(+), 157 deletions(-) rename leaves/{vdmd.cfg => ivdmd.cfg} (73%) rename leaves/{vmld.cfg => ivdmld.cfg} (58%) rename leaves/{vhamd.cfg => ivhamd.cfg} (79%) rename leaves/{vhimd.cfg => ivhimd.cfg} (84%) rename leaves/{vhmd.cfg => ivhmd.cfg} (90%) rename leaves/{vmd.cfg => ivmd.cfg} (71%) diff --git a/leaves/vdmd.cfg b/leaves/ivdmd.cfg similarity index 73% rename from leaves/vdmd.cfg rename to leaves/ivdmd.cfg index 3f6caac..a982dbc 100644 --- a/leaves/vdmd.cfg +++ b/leaves/ivdmd.cfg @@ -6,15 +6,18 @@ # /_/ /____/ # What ? This kickstart file bootstraps a minimal GNOME-based desktop-oriented virtual machine. -# 'v' for virtual machine, 'd' for desktop, 'm' for minimal, 'd' for development only. +# It requires the Fedora 34 server iso +# 'i' for iso-based, 'v' for virtual machine, 'd' for desktop, 'm' for minimal, 'd' for development only. # USAGE : Press the `tab` or 'e' key during POST and apend that after the 'quiet' string : -# inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vdmd.cfg +# inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/ivdmd.cfg +# Merge two kickstart files into one with the following command, provided by the pykickstart package +# ksflatten -v, --config vdmd.cfg -o flat-vdmd.cfg --version F34 # ATTENTION : this kickstart file will automatically DESTROY the main virtual disk 'vda' and all of its contents. # Bye bye! -%include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vmd.cfg # Include vmd.cfg, a minimal system based on Fedora 34. +%include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/ivmd.cfg # Include vmd.cfg, a minimal system based on Fedora 34. %post # Beginning of the post-installation section @@ -23,8 +26,7 @@ dnf install -y spice-vdagent # Try to install spice-vdagent after the installati dnf install -y dejavu-sans-mono-fonts # the gnome-shell package doesn't include much fonts by default, resulting in weird spacings in the gnome-terminal. dnf install -y elementary-wallpapers-gnome.noarch # Gorgeous wallpapers dnf install -y wpa_supplicant # WPA Supplicant for Linux. Not integrated by default in gnome-shell, but necessary to configure wireless networks through the Network Manager. -dnf install -y initial-setup-gui # Add the initial setup bits for the GUI dnf remove -y gnome-tour # We don't want GNOME-tour to open at launch so we delete it -systemctl set-default graphical.target # Set the desktop environment as the default booting target with systemd +systemctl set-default graphical.target # Set the desktop environment as the default booting target with systemd. Would this command do the trick ? (outside the post or package section) xconfig --startxonboot %end # End of the %post section \ No newline at end of file diff --git a/leaves/vmld.cfg b/leaves/ivdmld.cfg similarity index 58% rename from leaves/vmld.cfg rename to leaves/ivdmld.cfg index 1a904e1..4123861 100644 --- a/leaves/vmld.cfg +++ b/leaves/ivdmld.cfg @@ -7,24 +7,25 @@ # /_/ /____/ # What ? This kickstart file bootstraps a minimal live system based on Fedora 34. It expects a virtual disk. -# 'v' for virtual machine, 'm' for minimal, 'l' for live, 'd' for development only. +# It requires the Fedora 34 server iso +# 'i' for iso-based, 'v' for virtual machine, 'd' for desktop, 'm' for minimal, 'l' for live, 'd' for development only. # USAGE : Press the `tab` or 'e' key during POST and apend that after the 'quiet' string : -# inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vmd.cfg +# inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/ivmld.cfg # ATTENTION : this kickstart file will automatically DESTROY the main virtual disk 'vda' and all of its contents. # Bye bye! -############################# -# Add GPL licence somewhere## -############################# +############################## +# Add GPL licence somewhere ## +############################## # This file is directly inspired by the GPL-licence work of the maintainers of the official kickstart files for the RPM family of operating systems : # Adam Miller, Bastien Nocera, Bruno Wolff III, Bryan Kearney, Chitlesh Goorah, Christoph Wickert, Colin Walters, Fabian Affolter, Igor Pires Soares, # Jens Petersen, Jeremy Katz, Jeroen van Meeuwen, Jesse Keating, Luya Tshimbalanga, Matthias Clasen, Pedro Silva, Rahul Sundaram, Sebastian Dziallas, # Sebastian Vahl, wart -%include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vmd.cfg # Includes vmd.cfg, a minimal system based on Fedora 34 +%include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/ivdmd.cfg # Includes vdmd.cfg, a minimal GNOME-based desktop-oriented virtual machine. %packages # Beginning of the packages section @@ -45,9 +46,48 @@ chkconfig # no longer in @core but needed for livesys script policycoreutils # needed to create a livemedia selinux-policy-targeted # needed to create a livemedia -%end # End of the packages section +%end %post + +# FIXME: it'd be better to get this installed from a package +cat > /etc/rc.d/init.d/livesys << EOF +#!/bin/bash +# +# live: Init script for live image +# +# chkconfig: 345 00 99 +# description: Init script for live image. +### BEGIN INIT INFO +# X-Start-Before: display-manager chronyd +### END INIT INFO + +. /etc/init.d/functions + +if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ]; then + exit 0 +fi + +if [ -e /.liveimg-configured ] ; then + configdone=1 +fi + +exists() { + which \$1 >/dev/null 2>&1 || return + \$* +} + +livedir="LiveOS" +for arg in \`cat /proc/cmdline\` ; do + if [ "\${arg##rd.live.dir=}" != "\${arg}" ]; then + livedir=\${arg##rd.live.dir=} + continue + fi + if [ "\${arg##live_dir=}" != "\${arg}" ]; then + livedir=\${arg##live_dir=} + fi +done + # FIXME: it'd be better to get this installed from a package cat > /etc/rc.d/init.d/livesys << EOF #!/bin/bash @@ -91,91 +131,14 @@ if ! strstr "\`cat /proc/cmdline\`" noswap && [ -f /run/initramfs/live/\${livedi action "Enabling swap file" swapon /run/initramfs/live/\${livedir}/swap.img fi -mountPersistentHome() { - # support label/uuid - if [ "\${homedev##LABEL=}" != "\${homedev}" -o "\${homedev##UUID=}" != "\${homedev}" ]; then - homedev=\`/sbin/blkid -o device -t "\$homedev"\` - fi - - # if we're given a file rather than a blockdev, loopback it - if [ "\${homedev##mtd}" != "\${homedev}" ]; then - # mtd devs don't have a block device but get magic-mounted with -t jffs2 - mountopts="-t jffs2" - elif [ ! -b "\$homedev" ]; then - loopdev=\`losetup -f\` - if [ "\${homedev##/run/initramfs/live}" != "\${homedev}" ]; then - action "Remounting live store r/w" mount -o remount,rw /run/initramfs/live - fi - losetup \$loopdev \$homedev - homedev=\$loopdev - fi - - # and finally do the mount - mount \$mountopts \$homedev /home - # if we have /home under what's passed for persistent home, then - # we should make that the real /home. useful for mtd device on olpc - if [ -d /home/home ]; then mount --bind /home/home /home ; fi - [ -x /sbin/restorecon ] && /sbin/restorecon /home - if [ -d /home/liveuser ]; then USERADDARGS="-M" ; fi -} - -findPersistentHome() { - for arg in \`cat /proc/cmdline\` ; do - if [ "\${arg##persistenthome=}" != "\${arg}" ]; then - homedev=\${arg##persistenthome=} - fi - done -} - -if strstr "\`cat /proc/cmdline\`" persistenthome= ; then - findPersistentHome -elif [ -e /run/initramfs/live/\${livedir}/home.img ]; then - homedev=/run/initramfs/live/\${livedir}/home.img -fi - -# if we have a persistent /home, then we want to go ahead and mount it -if ! strstr "\`cat /proc/cmdline\`" nopersistenthome && [ -n "\$homedev" ] ; then - action "Mounting persistent /home" mountPersistentHome -fi - -if [ -n "\$configdone" ]; then - exit 0 -fi - -# Add liveuser user with no passwd +# add liveuser user with no passwd action "Adding live user" useradd \$USERADDARGS -c "Live System User" liveuser passwd -d liveuser > /dev/null usermod -aG wheel liveuser > /dev/null -# Remove root password lock -passwd -d root > /dev/null - -# Turn off firstboot for livecd boots -systemctl --no-reload disable firstboot-text.service 2> /dev/null || : -systemctl --no-reload disable firstboot-graphical.service 2> /dev/null || : -systemctl stop firstboot-text.service 2> /dev/null || : -systemctl stop firstboot-graphical.service 2> /dev/null || : - -# Don't use prelink on a running live image +# don't use prelink on a running live image sed -i 's/PRELINKING=yes/PRELINKING=no/' /etc/sysconfig/prelink &>/dev/null || : -# Turn off mdmonitor by default -systemctl --no-reload disable mdmonitor.service 2> /dev/null || : -systemctl --no-reload disable mdmonitor-takeover.service 2> /dev/null || : -systemctl stop mdmonitor.service 2> /dev/null || : -systemctl stop mdmonitor-takeover.service 2> /dev/null || : - -# Don't start cron/at as they tend to spawn things which are -# disk intensive that are painful on a live image -systemctl --no-reload disable crond.service 2> /dev/null || : -systemctl --no-reload disable atd.service 2> /dev/null || : -systemctl stop crond.service 2> /dev/null || : -systemctl stop atd.service 2> /dev/null || : - -# Turn off abrtd on a live image -systemctl --no-reload disable abrtd.service 2> /dev/null || : -systemctl stop abrtd.service 2> /dev/null || : - # Don't sync the system clock when running live (RHBZ #1018162) sed -i 's/rtcsync//' /etc/chrony.conf @@ -234,26 +197,6 @@ if strstr "\`cat /proc/cmdline\`" textinst ; then /usr/sbin/liveinst --text \$ks fi -# configure X, allowing user to override xdriver -if [ -n "\$xdriver" ]; then - cat > /etc/X11/xorg.conf.d/00-xdriver.conf </var/.updated - -# Drop the rescue kernel and initramfs, we don't need them on the live media itself. -# See bug 1317709 -rm -f /boot/*-rescue* - -# Disable network service here, as doing it in the services line -# fails due to RHBZ #1369794 -/sbin/chkconfig network off - -# Remove machine-id on pre generated images -rm -f /etc/machine-id -touch /etc/machine-id - %end %post --nochroot - # For livecd-creator builds only (lorax/livemedia-creator handles this directly) if [ -n "$LIVE_ROOT" ]; then cp "$INSTALL_ROOT"/usr/share/licenses/*-release-common/* "$LIVE_ROOT/" diff --git a/leaves/vhamd.cfg b/leaves/ivhamd.cfg similarity index 79% rename from leaves/vhamd.cfg rename to leaves/ivhamd.cfg index 700909e..f3f548b 100644 --- a/leaves/vhamd.cfg +++ b/leaves/ivhamd.cfg @@ -6,15 +6,16 @@ # /_/ /____/ # What ? This Kickstart file bootstraps a minimal headless guest hypervisor optimized for AMD CPUs. -# 'v' for virtual machine, 'h' for hypervisor', 'a' for amd, 'm' for minimal, 'd' for development only. +# It requires the Fedora 34 server iso +# 'i' for iso-based, 'v' for virtual machine, 'h' for hypervisor', 'a' for amd, 'm' for minimal, 'd' for development only. # USAGE : Press the `tab` or 'e' key during POST and apend that after the 'quiet' string : -# inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vhamd.cfg +# inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/ivhamd.cfg # ATTENTION : this kickstart file will automatically DESTROY the main virtual disk 'vda' and all of its contents. # Bye bye! -%include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vhmd.cfg # Includes vhmd.cfg, a guest hypervisor. +%include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/ivhmd.cfg # Includes vhmd.cfg, a guest hypervisor. %post # Beginning of %post section diff --git a/leaves/vhimd.cfg b/leaves/ivhimd.cfg similarity index 84% rename from leaves/vhimd.cfg rename to leaves/ivhimd.cfg index c73a16e..704d8a4 100644 --- a/leaves/vhimd.cfg +++ b/leaves/ivhimd.cfg @@ -6,15 +6,16 @@ # /_/ /____/ # What ? This Kickstart file bootstraps a minimal headless guest hypervisor optimized for Intel CPUs and Intel Graphics. -# 'v' for virtual machine, 'h' for hypervisor', 'i' for intel, 'm' for minimal, 'd' for development only. +# It requires the Fedora 34 server iso +# 'i' for iso-based, 'v' for virtual machine, 'h' for hypervisor', 'i' for intel, 'm' for minimal, 'd' for development only. # USAGE : Press the `tab` or 'e' key during POST and apend that after the 'quiet' string : -# inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vhimd.cfg +# inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/ivhimd.cfg # ATTENTION : this kickstart file will automatically DESTROY the main virtual disk 'vda' and all of its contents. # Bye bye! -%include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vhmd.cfg # Includes vhmd.cfg, a guest hypervisor. +%include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/ivhmd.cfg # Includes vhmd.cfg, a guest hypervisor. %post # Beginning of %post section diff --git a/leaves/vhmd.cfg b/leaves/ivhmd.cfg similarity index 90% rename from leaves/vhmd.cfg rename to leaves/ivhmd.cfg index cee34f4..886cfd6 100644 --- a/leaves/vhmd.cfg +++ b/leaves/ivhmd.cfg @@ -6,15 +6,16 @@ # /_/ /____/ # What ? This kickstart file provides the base configuration for a guest hypervisor. -# 'v' for virtual machine, 'h' for hypervisor', 'm' for minimal, 'd' for development only. +# It requires the Fedora 34 server iso +# 'i' for iso-based, 'v' for virtual machine, 'h' for hypervisor', 'm' for minimal, 'd' for development only. # USAGE : Press the `tab` or 'e' key during POST and apend that after the 'quiet' string : -# inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vhmd.cfg +# inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/ivhmd.cfg # ATTENTION : this kickstart file will automatically DESTROY the main virtual disk 'vda' and all of its contents. # Bye bye! -%include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vmd.cfg # Includes vmd.cfg, a minimal system based on Fedora 34 +%include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/ivmd.cfg # Includes vmd.cfg, a minimal system based on Fedora 34 %post # Beginning of %post section diff --git a/leaves/vmd.cfg b/leaves/ivmd.cfg similarity index 71% rename from leaves/vmd.cfg rename to leaves/ivmd.cfg index 33852b5..4f1ff6c 100644 --- a/leaves/vmd.cfg +++ b/leaves/ivmd.cfg @@ -6,10 +6,11 @@ # /_/ /____/ # What ? This kickstart file bootstraps a minimal virtual machine based on Fedora 34 server. -# 'v' for virtual machine, 'm' for minimal, 'd' for development only. +# It requires the Fedora 34 server iso +# 'i' for iso-based, 'v' for virtual machine, 'm' for minimal, 'd' for development only. # USAGE : Press the `tab` or 'e' key during POST and apend that after the 'quiet' string : -# inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vmd.cfg +# inst.ks=https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/ivmd.cfg # ATTENTION : this kickstart file will automatically DESTROY the main virtual disk 'vda' and all of its contents. # Bye bye! @@ -17,17 +18,19 @@ cdrom # Configure the cdrom as the installation method text # Perform installation in text mode -# keyboard --xlayouts='ch (fr)' # set keyboard layouts for Romandie # Unnecessary if using inital-setup -# lang en_US.UTF-8 # Set system language to American English # Unnecessary if using inital-setup -# timezone Europe/Paris --utc # Set System timezone to Paris # Unnecessary if using inital-setup +keyboard --xlayouts='ch (fr)' # set keyboard layouts for Romandie # Unnecessary if using inital-setup +lang en_US.UTF-8 # Set system language to American English # Unnecessary if using inital-setup +timezone Europe/Paris --utc # Set System timezone to Paris # Unnecessary if using inital-setup # Set dummy encrypted root password and activate the root account rootpw --iscrypted $6$2rA58L/SQu5.xMTb$u8.zqBWE5bK1/N983qDpJEp41yg66GwQ3YVTpsRghVhNiZypWyo2Zq2Qwr2tCM3bt50mKMIgHzbPdtSq9ErPz. # Create "test" user account # Unnecessary if using inital-setup -# user --name=test --password=$6$wlB.n8fvumAXv3xn$clVIswjLUjb7MZoJ2JHi1zk1zmx5ViQuzbVkLYf70SDan5hdqI0tUkc89nHE8pVnHStO4mcl3c1Tk0WJvCet1. --iscrypted --gecos="test" +user --name=test --password=$6$wlB.n8fvumAXv3xn$clVIswjLUjb7MZoJ2JHi1zk1zmx5ViQuzbVkLYf70SDan5hdqI0tUkc89nHE8pVnHStO4mcl3c1Tk0WJvCet1. --iscrypted --gecos="test" firewall --enabled # Make sure the firewall is enabled -network --onboot=yes --bootproto=dhcp --hostname=vmd # Configure network interfaces and set hostname +# network --onboot=yes --bootproto=dhcp --hostname=vmd # Configure network interfaces and set hostname +services --enabled=NetworkManager,ModemManager --disabled=sshd +network --bootproto=dhcp --device=link --activate ignoredisk --only-use=vda # Only use disk labelled as vda zerombr # WARNING : Dangerous command ! Will clear the Master Boot Record @@ -38,23 +41,27 @@ part / --fstype="ext4" --ondisk=vda --grow --label=root # The remaining space wi bootloader --timeout=1 # Set the Grub bootloader timeout to 1 reboot # Reboot the system after the installation is successfully completed -firstboot --enable --reconfig # Initial Setup will start after the first reboot +# firstboot --enable --reconfig # Initial Setup will start after the first reboot %packages # Beginning of the packages section + @core # minimal installation @guest-agents # qemu-guest agent pciutils # Pciutils provides lspci commandline tool and is not installed by default -initial-setup # Install the initial setup package. For the GUI version, use initial-setup-gui instead. +# initial-setup # Install the initial setup package. For the GUI version, use initial-setup-gui instead. # -fedora-release # Fedora release-notes # -fedora-release-common # Fedora release files # -fedora-release-identity-basic # ??? # generic-release # generic-release-common # generic-release-notes + %end # End of the packages section %post # Beginning of the post-installation section + localectl set-keymap ch-fr # Set keymap to `ch-fr`. Alternatively, `us` can be picked. dnf update -y # Update the system grub2-mkconfig -o /boot/grub2/grub.cfg # Update grub otherwise the system won't boot properly + %end # End of the %post section \ No newline at end of file