newer end-products version

This commit is contained in:
lukas 2021-11-28 18:15:06 +01:00
parent 0313011cf4
commit 7277fe262c
3 changed files with 47 additions and 40 deletions

View File

@ -41,7 +41,19 @@ part / --fstype="ext4" --grow --label=root
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
grub2-mkconfig -o /boot/grub2/grub.cfg # Unsure it is actually useful
%end
%post --nochroot --logfile=/mnt/sysimage/opt/base-desktop-gnome-virtual-machine-manager.log
# Create a file to autostart virt-manager
cat > /mnt/sysimage/etc/xdg/autostart/virt-manager.desktop << EOF
[Desktop Entry]
Type=Application
Name=Virtual Machine Manager
Exec=virt-manager
EOF
%end
@ -114,24 +126,10 @@ echo "options kvm_amd nested=1" >> /etc/modprobe.d/kvm.conf # Add support for ne
%end
%post --logfile=/root/bha.log
grub2-mkconfig -o /boot/grub2/grub.cfg # Update grub otherwise the system won't boot properly
%end
%post --nochroot --logfile=/mnt/sysimage/root/dha.log
%post --nochroot --logfile=/mnt/sysimage/opt/base-initial-setup-gnome.log
truncate -s 0 /mnt/sysimage/usr/share/gnome-initial-setup/vendor.conf # remove content of vendor.conf so that all options are made available
# Create a file to autostart virt-manager
cat > /mnt/sysimage/etc/xdg/autostart/virt-manager.desktop << EOF
[Desktop Entry]
Type=Application
Name=Virtual Machine Manager
Exec=virt-manager
EOF
## Append lines to existing vendor.conf file, so that options are skipped upon reboot
cat >> /mnt/sysimage/usr/share/gnome-initial-setup/vendor.conf<< EOF
[pages]
@ -160,6 +158,7 @@ libguestfs-tools
libvirt
libvirt-daemon-config-network
libvirt-daemon-kvm
mesa-dri-drivers
nano
neofetch
pciutils

View File

@ -45,6 +45,18 @@ grub2-mkconfig -o /boot/grub2/grub.cfg # Unsure it is actually useful
%end
%post --nochroot --logfile=/mnt/sysimage/opt/base-desktop-gnome-virtual-machine-manager.log
# Create a file to autostart virt-manager
cat > /mnt/sysimage/etc/xdg/autostart/virt-manager.desktop << EOF
[Desktop Entry]
Type=Application
Name=Virtual Machine Manager
Exec=virt-manager
EOF
%end
%post --nochroot --logfile=/mnt/sysimage/root/bh.log
# %post --log=/root/bh.log # Beginning of %post section. Those commands are executed outside the chroot environment. Logging is enabled to help with post-installation troubleshooting
@ -89,22 +101,20 @@ chmod +x /mnt/sysimage/usr/sbin/virtualization-tweaks-root-needed.sh
%end
%post --nochroot --logfile=/mnt/sysimage/root/bhi.log
%post --nochroot --logfile=/mnt/sysimage/root/bha.log
sed -i 's/\(quiet\)/\1 intel_iommu=on iommu=pt rd.driver.pre=vfio-pci i915.enable_gvt=1/i' /mnt/sysimage/etc/default/grub # Load kernel modules in grub.
sed -i 's/\(quiet\)/\1 amd_iommu=on amd_iommu=pt rd.driver.pre=vfio-pci/i' /mnt/sysimage/etc/default/grub # Load kernel modules in GRUB.
# Load kernel modules by adding vfio, vfio_pci, vfio_iommu_type1, vfio_virqfd
echo "vfio" > /mnt/sysimage/etc/modules-load.d/vfio.conf
echo "vfio-pci" > /mnt/sysimage/etc/modules-load.d/vfio-pci.conf
echo "vfio_iommu_type1" > /mnt/sysimage/etc/modules-load.d/vfio_iommu_type1.conf
echo "vfio_virqfd" > /mnt/sysimage/etc/modules-load.d/vfio_virqfd.conf
echo "kvmgt" > /mnt/sysimage/etc/modules-load.d/kvmgt.conf # Load specific kernel modules kvmgt and vfio-mdev, for Intel (tm) GVT-g and Nvidia (tm)
echo "vfio-mdev" > /mnt/sysimage/etc/modules-load.d/vfio-mdev.conf # Load specific kernel modules kvmgt and vfio-mdev, for Intel (tm) GVT-g and Nvidia (tm)
echo "options kvm_intel nested=1" >> /mnt/sysimage/etc/modprobe.d/kvm.conf # Add support for nested-virtualization
echo "options kvm_amd nested=1" >> /etc/modprobe.d/kvm.conf # Add support for nested-virtualization
# The following part seems useless
# dracut --add-drivers " vfio vfio-pci vfio_iommu_type1 vfio_virqfd vfio-mdev kvmgt " --force # Instruct dracut to load the vfio drivers
# dracut --add-drivers " vfio vfio-pci vfio_iommu_type1 vfio_virqfd " --force # Instruct dracut to load the vfio drivers
# dracut --force # Regenerate initramfs
# Doesn't seem to work
# dracut: Cannot find /usr/lib/dracut/dracut-init.sh.
@ -116,18 +126,10 @@ echo "options kvm_intel nested=1" >> /mnt/sysimage/etc/modprobe.d/kvm.conf # Add
%end
%post --nochroot --logfile=/mnt/sysimage/root/dhi.log
%post --nochroot --logfile=/mnt/sysimage/opt/base-initial-setup-gnome.log
truncate -s 0 /mnt/sysimage/usr/share/gnome-initial-setup/vendor.conf # remove content of vendor.conf so that all options are made available
# Create a file to autostart virt-manager
cat > /mnt/sysimage/etc/xdg/autostart/virt-manager.desktop << EOF
[Desktop Entry]
Type=Application
Name=Virtual Machine Manager
Exec=virt-manager
EOF
## Append lines to existing vendor.conf file, so that options are skipped upon reboot
cat >> /mnt/sysimage/usr/share/gnome-initial-setup/vendor.conf<< EOF
[pages]
@ -156,6 +158,7 @@ libguestfs-tools
libvirt
libvirt-daemon-config-network
libvirt-daemon-kvm
mesa-dri-drivers
nano
neofetch
pciutils

View File

@ -45,6 +45,18 @@ grub2-mkconfig -o /boot/grub2/grub.cfg # Unsure it is actually useful
%end
%post --nochroot --logfile=/mnt/sysimage/opt/base-desktop-gnome-virtual-machine-manager.log
# Create a file to autostart virt-manager
cat > /mnt/sysimage/etc/xdg/autostart/virt-manager.desktop << EOF
[Desktop Entry]
Type=Application
Name=Virtual Machine Manager
Exec=virt-manager
EOF
%end
%post --nochroot --logfile=/mnt/sysimage/root/bh.log
# %post --log=/root/bh.log # Beginning of %post section. Those commands are executed outside the chroot environment. Logging is enabled to help with post-installation troubleshooting
@ -89,18 +101,10 @@ chmod +x /mnt/sysimage/usr/sbin/virtualization-tweaks-root-needed.sh
%end
%post --nochroot --logfile=/mnt/sysimage/root/dh.log
%post --nochroot --logfile=/mnt/sysimage/opt/base-initial-setup-gnome.log
truncate -s 0 /mnt/sysimage/usr/share/gnome-initial-setup/vendor.conf # remove content of vendor.conf so that all options are made available
# Create a file to autostart virt-manager
cat > /mnt/sysimage/etc/xdg/autostart/virt-manager.desktop << EOF
[Desktop Entry]
Type=Application
Name=Virtual Machine Manager
Exec=virt-manager
EOF
## Append lines to existing vendor.conf file, so that options are skipped upon reboot
cat >> /mnt/sysimage/usr/share/gnome-initial-setup/vendor.conf<< EOF
[pages]
@ -129,6 +133,7 @@ libguestfs-tools
libvirt
libvirt-daemon-config-network
libvirt-daemon-kvm
mesa-dri-drivers
nano
neofetch
pciutils