rename files and make the

cdrom/iso requirement explicit
This commit is contained in:
lukas 2021-08-17 10:28:59 +02:00
parent 0df19cdaa0
commit d7a221b077
6 changed files with 84 additions and 157 deletions

View File

@ -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

View File

@ -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 <<FOE
Section "Device"
Identifier "Videocard0"
Driver "\$xdriver"
EndSection
FOE
fi
EOF
chmod 755 /etc/rc.d/init.d/livesys
/sbin/restorecon /etc/rc.d/init.d/livesys
/sbin/chkconfig --add livesys
chmod 755 /etc/rc.d/init.d/livesys-late
/sbin/restorecon /etc/rc.d/init.d/livesys-late
/sbin/chkconfig --add livesys-late
# enable tmpfs for /tmp
systemctl enable tmp.mount
@ -271,37 +214,9 @@ rpm -qa --qf '%{size}\t%{name}-%{version}-%{release}.%{arch}\n' |sort -rn
# Note that running rpm recreates the rpm db files which aren't needed or wanted
rm -f /var/lib/rpm/__db*
# go ahead and pre-make the man -k cache (#455968)
/usr/bin/mandb
# make sure there aren't core files lying around
rm -f /core*
# remove random seed, the newly installed instance should make it's own
rm -f /var/lib/systemd/random-seed
# convince readahead not to collect
# FIXME: for systemd
echo 'File created by kickstart. See systemd-update-done.service(8).' \
| tee /etc/.updated >/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/"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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