Add the new recipe for a live

system and the initial-setup
This commit is contained in:
lukas 2021-08-12 20:52:58 +02:00
parent 7f08dbb6fa
commit bbdb2ea293
6 changed files with 58 additions and 27 deletions

View File

@ -14,7 +14,7 @@
# 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 as a base
%include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vmd.cfg # Include vmd.cfg, a minimal system based on Fedora 34.
%post # Beginning of the post-installation section

View File

@ -5,8 +5,8 @@
# / .___/_/ /_/\__, /_/_/\____/_/ /_/ /_/\___/ \____//____/
# /_/ /____/
# What ? This Kickstart file bootstrapsa a minimal headless guest hypervisor optimized for AMD CPUs.
# 'v' for virtual machine, 'h' for hypervisor', 'a' for amd, 'd' for desktop, 'm' for minimal, 'd' for development only.
# 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.
# 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
@ -14,14 +14,12 @@
# 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 vemdhd.cfg, a minimal desktop-oriented nested-host ks file
%include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vhmd.cfg # Includes vhmd.cfg, a guest hypervisor.
%post # Beginning of %post section
# Load kernel modules in grub.
# sed -i 's/\(quiet\)/\1 amd_iommu=on amd_iommu=pt rd.driver.pre=vfio-pci/i' /etc/default/grub
# dracut --force # Regenerate initramfs
# grub2-mkconfig -o /boot/grub2/grub.cfg # Update grub
sed -i 's/\(quiet\)/\1 amd_iommu=on amd_iommu=pt rd.driver.pre=vfio-pci/i' /etc/default/grub # Load kernel modules in grub.
dracut --force # Regenerate initramfs
grub2-mkconfig -o /boot/grub2/grub.cfg # Update grub
%end # End of the %post section

View File

@ -14,16 +14,16 @@
# 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 dhd.cfg, a minimal desktop-oriented nested-host ks file
%include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vhmd.cfg # Includes vhmd.cfg, a guest hypervisor.
%post # Beginning of %post section
# Load kernel modules in grub. Add `intel_iommu=on intel_iommu=pt` for Intel processors,
# sed -i 's/\(quiet\)/\1 intel_iommu=on iommu=pt rd.driver.pre=vfio-pci i915.enable_gvt=1/i' /etc/default/grub
# echo "kvmgt" > /etc/modules-load.d/kvmgt.conf # Load specific kernel modules kvmgt and vfio-mdev, for Intel GVT-g and Nvidia
# echo "vfio-mdev" > /etc/modules-load.d/vfio-mdev.conf # Load specific kernel modules kvmgt and vfio-mdev, for Intel GVT-g and Nvidia
sed -i 's/\(quiet\)/\1 intel_iommu=on iommu=pt rd.driver.pre=vfio-pci i915.enable_gvt=1/i' /etc/default/grub # Load kernel modules in grub.
echo "kvmgt" > /etc/modules-load.d/kvmgt.conf # Load specific kernel modules kvmgt and vfio-mdev, for Intel GVT-g and Nvidia
echo "vfio-mdev" > /etc/modules-load.d/vfio-mdev.conf # Load specific kernel modules kvmgt and vfio-mdev, for Intel GVT-g and Nvidia
# dracut --force # Regenerate initramfs
# grub2-mkconfig -o /boot/grub2/grub.cfg # Update grub
dracut --add-drivers "vfio-mdev kvmgt" --force # Instruct dracut to load the vfio drivers:
dracut --force # Regenerate initramfs
grub2-mkconfig -o /boot/grub2/grub.cfg # Update grub
%end # End of the %post section

View File

@ -11,16 +11,19 @@
# 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
%include https://git.phyllo.me/home/kickstart/raw/branch/master/leaves/vmd.cfg # Includes vemdd.cfg, the minimal GNOME-based desktop-oriented virtual machine ks file.
# 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
%post # Beginning of %post section
dnf install -y qemu-kvm libvirt libvirt-daemon-config-network libvirt-daemon-kvm # Install minimal tools dedicated to virtualization.
dnf install -y virt-install virt-top libguestfs-tools python3-libguestfs guestfs-tools # Complementary tools useful for interacting with virtual machines.
usermod -a -G libvirt test ## make user "test" part of the existing libvirt group to allow it to interact with the nested-hypervisor.
# usermod -a -G libvirt test # Make user "test" part of the existing libvirt group to allow it to interact with the guest-hypervisor. # It won't work with initial-setup
Load kernel modules by adding vfio, vfio_pci, vfio_iommu_type1, vfio_virqfd
# Load kernel modules by adding vfio, vfio_pci, vfio_iommu_type1, vfio_virqfd
echo "vfio" > /etc/modules-load.d/vfio.conf
echo "vfio-pci" > /etc/modules-load.d/vfio-pci.conf
echo "vfio_iommu_type1" > /etc/modules-load.d/vfio_iommu_type1.conf

View File

@ -15,16 +15,16 @@
# Bye bye!
cdrom # Configure the cdrom as the installation method
text # Perform Installation in text mode
text # Perform installation in text mode
keyboard --xlayouts='ch (fr)' # set keyboard layouts for Romandie
lang en_US.UTF-8 # Set system language to American English
timezone Europe/Paris --utc # Set System timezone to Paris
# 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
user --name=test --password=$6$wlB.n8fvumAXv3xn$clVIswjLUjb7MZoJ2JHi1zk1zmx5ViQuzbVkLYf70SDan5hdqI0tUkc89nHE8pVnHStO4mcl3c1Tk0WJvCet1. --iscrypted --gecos="test"
# Create "test" user account # Unnecessary if using inital-setup
# 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
@ -35,12 +35,16 @@ clearpart --all --initlabel --drives=vda # Partition clearing information. This
part /boot/efi --fstype="efi" --ondisk=vda --size=128 --fsoptions="umask=0077,shortname=winnt" --label=efi # Will create an efi partitition of 128 MiB (vda1)
part /boot --fstype="ext4" --ondisk=vda --size=384 --label=boot # Create a boot partition of 384 MiB using the ext4 filesystem (vda2).
part / --fstype="ext4" --ondisk=vda --grow --label=root # The remaining space will be used for root (vda3).
bootloader --timeout=1 # Set the bootloader timeout to 1
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
%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.
# -fedora-release # Fedora release-notes
# -fedora-release-common # Fedora release files
# -fedora-release-identity-basic # ???
@ -54,5 +58,4 @@ pciutils # Pciutils provides lspci commandline tool and is not installed by defa
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
# firstboot --reconfig kickstart # To launch the initial setup after the first boot
%end # End of the %post section

27
leaves/vmld.cfg Normal file
View File

@ -0,0 +1,27 @@
# __ ____ ____ _____
# ____ / /_ __ __/ / /___ ____ ___ ___ / __ \/ ___/
# / __ \/ __ \/ / / / / / __ \/ __ `__ \/ _ \ / / / /\__ \
# / /_/ / / / / /_/ / / / /_/ / / / / / / __/ / /_/ /___/ /
# / .___/_/ /_/\__, /_/_/\____/_/ /_/ /_/\___/ \____//____/
# /_/ /____/
# 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.
# 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
# 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
%packages # Beginning of the packages section
policycoreutils # needed to create a livemedia
dracut-live # needed to create a livemedia
selinux-policy-targeted # needed to create a livemedia
%end # End of the packages section