forked from roots/phyllomeos
		
	latest changes
logs path set to /opt; fix script path; fix amd_iommut=pt; fix USB 3.0
This commit is contained in:
		| @@ -37,7 +37,7 @@ part /boot/efi --fstype="efi" --size=128 --fsoptions="umask=0077,shortname=winnt | ||||
| part /boot --fstype="ext4" --size=384 --label=boot | ||||
| part / --fstype="ext4" --grow --label=root | ||||
|  | ||||
| %post --logfile=/root/b.log | ||||
| %post --logfile=/opt/base.log | ||||
|  | ||||
| localectl set-keymap ch-fr # Set keymap to `ch-fr`. Alternatively, `us` can be picked. | ||||
| dnf update -y # Update the system  | ||||
| @@ -177,8 +177,7 @@ glib-compile-schemas /mnt/sysimage/usr/share/glib-2.0/schemas/ | ||||
|  | ||||
| %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 | ||||
| %post --nochroot --logfile=/mnt/sysimage/opt/base-hypervisor.log | ||||
|  | ||||
| # Load kernel modules by adding vfio, vfio_pci, vfio_iommu_type1, vfio_virqfd | ||||
| echo "vfio" > /mnt/sysimage/etc/modules-load.d/vfio.conf | ||||
| @@ -188,57 +187,27 @@ echo "vfio_virqfd" > /mnt/sysimage/etc/modules-load.d/vfio_virqfd.conf | ||||
|  | ||||
| mkdir /mnt/sysimage/var/lib/libvirt/iso # Create a directory to store iso images | ||||
|  | ||||
| wget https://boot.netboot.xyz/ipxe/netboot.xyz.iso -P /mnt/sysimage/var/lib/libvirt/iso/ # fetch netboot.xyz iso | ||||
| wget https://boot.netboot.xyz/ipxe/netboot.xyz.iso -P /mnt/sysimage/var/lib/libvirt/iso/ # fetch netboot.xyz iso and store it to the newly created iso directory | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post/create-user-vms.sh -P /mnt/sysimage/usr/sbin/ | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post-first-startup-scripts/create-user-vms.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/create-user-vms.sh | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post/virtualization-tweaks-root-needed.sh -P /mnt/sysimage/usr/sbin/ | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post-first-startup-scripts/create-system-vms.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/create-system-vms.sh | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post-first-startup-scripts/virtualization-tweaks-root-needed.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/virtualization-tweaks-root-needed.sh | ||||
|  | ||||
| # # Create new file /etc/systemd/system/postinstall.service using cat: | ||||
| # cat > /mnt/sysimage/etc/systemd/system/post-install.service<< EOF | ||||
| # [Unit] | ||||
| # Description=Post-installation configuration for Phyllome OS | ||||
| # After=gdm.service | ||||
| # Requires=gdm.service | ||||
| #  | ||||
| # [Service] | ||||
| # Type=oneshot | ||||
| # ExecStart=/bin/bash /usr/sbin/post-install.sh | ||||
| # RemainAfterExit=yes | ||||
| #  | ||||
| # [Install] | ||||
| # WantedBy=multi-user.target | ||||
| # EOF | ||||
| #  | ||||
| # systemctl enable /mnt/sysimage/etc/systemd/system/post-install.service # Enable systemd unit | ||||
|  | ||||
| # Add a network bridge. Still need to declare it to libvirt/virt-manager | ||||
| # nmcli con add ifname br0 type bridge con-name br0  | ||||
| # nmcli con add type bridge-slave ifname enp1s0 master br0 # to-do : generalize this command so that it could regardless of the name of the ethernet device | ||||
| # nmcli con up br0 | ||||
|  | ||||
| %end | ||||
|  | ||||
| %post --nochroot --logfile=/mnt/sysimage/root/bha.log | ||||
| %post --nochroot --logfile=/mnt/sysimage/opt/base-hypervisor-amdcpu.log | ||||
|  | ||||
| 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.  | ||||
| sed -i 's/\(quiet\)/\1 amd_iommu=on iommu=pt rd.driver.pre=vfio-pci/i' /mnt/sysimage/etc/default/grub # Load kernel modules in GRUB.  | ||||
|  | ||||
| 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 " --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. | ||||
| # dracut: Are you running from a git checkout? | ||||
| # dracut: Try passing -l as an argument to /mnt/sysimage/usr/bin/dracut | ||||
|  | ||||
| # The following part seems useless too. No need to regenerate grub | ||||
| # grub2-mkconfig -o /mnt/sysimage/boot/grub2/grub.cfg # Update grub. Does it fail ? /usr/sbin/grub2-probe: error: failed to get canonical path of `LiveOS_rootfs'. | ||||
| echo "options kvm_amd nested=1" >> /mnt/sysimage/etc/modprobe.d/kvm.conf # Add support for nested-virtualization | ||||
|  | ||||
| %end | ||||
|  | ||||
| @@ -271,6 +240,7 @@ gnome-shell | ||||
| gnome-terminal | ||||
| guestfs-tools | ||||
| libguestfs-tools | ||||
| libusb | ||||
| libvirt | ||||
| libvirt-daemon-config-network | ||||
| libvirt-daemon-kvm | ||||
| @@ -280,6 +250,7 @@ neofetch | ||||
| pciutils | ||||
| python3-libguestfs | ||||
| qemu-kvm | ||||
| usbutils | ||||
| virt-install | ||||
| virt-manager | ||||
| virt-top | ||||
|   | ||||
| @@ -37,7 +37,7 @@ part /boot/efi --fstype="efi" --size=128 --fsoptions="umask=0077,shortname=winnt | ||||
| part /boot --fstype="ext4" --size=384 --label=boot | ||||
| part / --fstype="ext4" --grow --label=root | ||||
|  | ||||
| %post --logfile=/root/b.log | ||||
| %post --logfile=/opt/base.log | ||||
|  | ||||
| localectl set-keymap ch-fr # Set keymap to `ch-fr`. Alternatively, `us` can be picked. | ||||
| dnf update -y # Update the system  | ||||
| @@ -177,8 +177,7 @@ glib-compile-schemas /mnt/sysimage/usr/share/glib-2.0/schemas/ | ||||
|  | ||||
| %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 | ||||
| %post --nochroot --logfile=/mnt/sysimage/opt/base-hypervisor.log | ||||
|  | ||||
| # Load kernel modules by adding vfio, vfio_pci, vfio_iommu_type1, vfio_virqfd | ||||
| echo "vfio" > /mnt/sysimage/etc/modules-load.d/vfio.conf | ||||
| @@ -188,65 +187,37 @@ echo "vfio_virqfd" > /mnt/sysimage/etc/modules-load.d/vfio_virqfd.conf | ||||
|  | ||||
| mkdir /mnt/sysimage/var/lib/libvirt/iso # Create a directory to store iso images | ||||
|  | ||||
| wget https://boot.netboot.xyz/ipxe/netboot.xyz.iso -P /mnt/sysimage/var/lib/libvirt/iso/ # fetch netboot.xyz iso | ||||
| wget https://boot.netboot.xyz/ipxe/netboot.xyz.iso -P /mnt/sysimage/var/lib/libvirt/iso/ # fetch netboot.xyz iso and store it to the newly created iso directory | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post/create-user-vms.sh -P /mnt/sysimage/usr/sbin/ | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post-first-startup-scripts/create-user-vms.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/create-user-vms.sh | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post/virtualization-tweaks-root-needed.sh -P /mnt/sysimage/usr/sbin/ | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post-first-startup-scripts/create-system-vms.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/create-system-vms.sh | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post-first-startup-scripts/virtualization-tweaks-root-needed.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/virtualization-tweaks-root-needed.sh | ||||
|  | ||||
| # # Create new file /etc/systemd/system/postinstall.service using cat: | ||||
| # cat > /mnt/sysimage/etc/systemd/system/post-install.service<< EOF | ||||
| # [Unit] | ||||
| # Description=Post-installation configuration for Phyllome OS | ||||
| # After=gdm.service | ||||
| # Requires=gdm.service | ||||
| #  | ||||
| # [Service] | ||||
| # Type=oneshot | ||||
| # ExecStart=/bin/bash /usr/sbin/post-install.sh | ||||
| # RemainAfterExit=yes | ||||
| #  | ||||
| # [Install] | ||||
| # WantedBy=multi-user.target | ||||
| # EOF | ||||
| #  | ||||
| # systemctl enable /mnt/sysimage/etc/systemd/system/post-install.service # Enable systemd unit | ||||
|  | ||||
| # Add a network bridge. Still need to declare it to libvirt/virt-manager | ||||
| # nmcli con add ifname br0 type bridge con-name br0  | ||||
| # nmcli con add type bridge-slave ifname enp1s0 master br0 # to-do : generalize this command so that it could regardless of the name of the ethernet device | ||||
| # nmcli con up br0 | ||||
|  | ||||
| %end | ||||
|  | ||||
| %post --nochroot --logfile=/mnt/sysimage/root/bhi.log | ||||
| %post --nochroot --logfile=/mnt/sysimage/opt/base-hypervisor-intelcpu.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. | ||||
|  | ||||
| # 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) | ||||
| sed -i 's/\(quiet\)/\1 intel_iommu=on iommu=pt rd.driver.pre=vfio-pci/i' /mnt/sysimage/etc/default/grub # Load kernel modules in GRUB. | ||||
|  | ||||
| echo "options kvm_intel nested=1" >> /mnt/sysimage/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 --force # Regenerate initramfs | ||||
| # Doesn't seem to work | ||||
| # dracut: Cannot find /usr/lib/dracut/dracut-init.sh. | ||||
| # dracut: Are you running from a git checkout? | ||||
| # dracut: Try passing -l as an argument to /mnt/sysimage/usr/bin/dracut | ||||
| %end | ||||
|  | ||||
| # The following part seems useless too. No need to regenerate grub | ||||
| # grub2-mkconfig -o /mnt/sysimage/boot/grub2/grub.cfg # Update grub. Does it fail ? /usr/sbin/grub2-probe: error: failed to get canonical path of `LiveOS_rootfs'. | ||||
| %post --nochroot --logfile=/mnt/sysimage/opt/base-hypervisor-intelgpu.log | ||||
|  | ||||
| sed -i 's/\(vfio-pci\)/\1 i915.enable_gvt=1/i' /mnt/sysimage/etc/default/grub # Load kernel modules in grub. | ||||
|  | ||||
| # Load extra kernel modules to enable vfio-mdev on selected hardware | ||||
| 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) | ||||
|  | ||||
| %end | ||||
|  | ||||
| @@ -279,6 +250,7 @@ gnome-shell | ||||
| gnome-terminal | ||||
| guestfs-tools | ||||
| libguestfs-tools | ||||
| libusb | ||||
| libvirt | ||||
| libvirt-daemon-config-network | ||||
| libvirt-daemon-kvm | ||||
| @@ -288,6 +260,7 @@ neofetch | ||||
| pciutils | ||||
| python3-libguestfs | ||||
| qemu-kvm | ||||
| usbutils | ||||
| virt-install | ||||
| virt-manager | ||||
| virt-top | ||||
|   | ||||
| @@ -37,7 +37,7 @@ part /boot/efi --fstype="efi" --size=128 --fsoptions="umask=0077,shortname=winnt | ||||
| part /boot --fstype="ext4" --size=384 --label=boot | ||||
| part / --fstype="ext4" --grow --label=root | ||||
|  | ||||
| %post --logfile=/root/b.log | ||||
| %post --logfile=/opt/base.log | ||||
|  | ||||
| localectl set-keymap ch-fr # Set keymap to `ch-fr`. Alternatively, `us` can be picked. | ||||
| dnf update -y # Update the system  | ||||
| @@ -45,53 +45,7 @@ grub2-mkconfig -o /boot/grub2/grub.cfg # Unsure it is actually useful | ||||
|  | ||||
| %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 | ||||
|  | ||||
| mkdir /mnt/sysimage/var/lib/libvirt/iso # Create a directory to store iso images | ||||
|  | ||||
| wget https://boot.netboot.xyz/ipxe/netboot.xyz.iso -P /mnt/sysimage/var/lib/libvirt/iso/ # fetch netboot.xyz iso | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post/configure-vmm-and-desktop.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/configure-vmm-and-desktop.sh | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post/create-live-vm.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/create-live-vm.sh | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post/virtualization-tweaks-root-needed.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/virtualization-tweaks-root-needed.sh | ||||
|  | ||||
| # # Create new file /etc/systemd/system/postinstall.service using cat: | ||||
| # cat > /mnt/sysimage/etc/systemd/system/post-install.service<< EOF | ||||
| # [Unit] | ||||
| # Description=Post-installation configuration for Phyllome OS | ||||
| # After=gdm.service | ||||
| # Requires=gdm.service | ||||
| #  | ||||
| # [Service] | ||||
| # Type=oneshot | ||||
| # ExecStart=/bin/bash /usr/sbin/post-install.sh | ||||
| # RemainAfterExit=yes | ||||
| #  | ||||
| # [Install] | ||||
| # WantedBy=multi-user.target | ||||
| # EOF | ||||
| #  | ||||
| # systemctl enable /mnt/sysimage/etc/systemd/system/post-install.service # Enable systemd unit | ||||
|  | ||||
| # Add a network bridge. Still need to declare it to libvirt/virt-manager | ||||
| # nmcli con add ifname br0 type bridge con-name br0  | ||||
| # nmcli con add type bridge-slave ifname enp1s0 master br0 # to-do : generalize this command so that it could regardless of the name of the ethernet device | ||||
| # nmcli con up br0 | ||||
|  | ||||
| %end | ||||
|  | ||||
| %post --nochroot --logfile=/mnt/sysimage/root/bha.log | ||||
|  | ||||
| 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.  | ||||
| %post --nochroot --logfile=/mnt/sysimage/opt/base-hypervisor.log | ||||
|  | ||||
| # Load kernel modules by adding vfio, vfio_pci, vfio_iommu_type1, vfio_virqfd | ||||
| echo "vfio" > /mnt/sysimage/etc/modules-load.d/vfio.conf | ||||
| @@ -99,18 +53,29 @@ 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 "options kvm_amd nested=1" >> /etc/modprobe.d/kvm.conf # Add support for nested-virtualization | ||||
| mkdir /mnt/sysimage/var/lib/libvirt/iso # Create a directory to store iso images | ||||
|  | ||||
| # The following part seems useless | ||||
| # 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. | ||||
| # dracut: Are you running from a git checkout? | ||||
| # dracut: Try passing -l as an argument to /mnt/sysimage/usr/bin/dracut | ||||
| wget https://boot.netboot.xyz/ipxe/netboot.xyz.iso -P /mnt/sysimage/var/lib/libvirt/iso/ # fetch netboot.xyz iso and store it to the newly created iso directory | ||||
|  | ||||
| # The following part seems useless too. No need to regenerate grub | ||||
| # grub2-mkconfig -o /mnt/sysimage/boot/grub2/grub.cfg # Update grub. Does it fail ? /usr/sbin/grub2-probe: error: failed to get canonical path of `LiveOS_rootfs'. | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post-first-startup-scripts/create-user-vms.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/create-user-vms.sh | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post-first-startup-scripts/create-system-vms.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/create-system-vms.sh | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post-first-startup-scripts/virtualization-tweaks-root-needed.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/virtualization-tweaks-root-needed.sh | ||||
|  | ||||
| %end | ||||
|  | ||||
| %post --nochroot --logfile=/mnt/sysimage/opt/base-hypervisor-amdcpu.log | ||||
|  | ||||
| sed -i 's/\(quiet\)/\1 amd_iommu=on iommu=pt rd.driver.pre=vfio-pci/i' /mnt/sysimage/etc/default/grub # Load kernel modules in GRUB.  | ||||
|  | ||||
| echo "options kvm_amd nested=1" >> /mnt/sysimage/etc/modprobe.d/kvm.conf # Add support for nested-virtualization | ||||
|  | ||||
| %end | ||||
|  | ||||
| @@ -125,6 +90,7 @@ generic-release-notes | ||||
| guestfs-tools | ||||
| initial-setup | ||||
| libguestfs-tools | ||||
| libusb | ||||
| libvirt | ||||
| libvirt-daemon-config-network | ||||
| libvirt-daemon-kvm | ||||
| @@ -133,6 +99,7 @@ neofetch | ||||
| pciutils | ||||
| python3-libguestfs | ||||
| qemu-kvm | ||||
| usbutils | ||||
| virt-install | ||||
| virt-top | ||||
| wget | ||||
|   | ||||
| @@ -37,7 +37,7 @@ part /boot/efi --fstype="efi" --size=128 --fsoptions="umask=0077,shortname=winnt | ||||
| part /boot --fstype="ext4" --size=384 --label=boot | ||||
| part / --fstype="ext4" --grow --label=root | ||||
|  | ||||
| %post --logfile=/root/b.log | ||||
| %post --logfile=/opt/base.log | ||||
|  | ||||
| localectl set-keymap ch-fr # Set keymap to `ch-fr`. Alternatively, `us` can be picked. | ||||
| dnf update -y # Update the system  | ||||
| @@ -45,74 +45,47 @@ grub2-mkconfig -o /boot/grub2/grub.cfg # Unsure it is actually useful | ||||
|  | ||||
| %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 | ||||
|  | ||||
| mkdir /mnt/sysimage/var/lib/libvirt/iso # Create a directory to store iso images | ||||
|  | ||||
| wget https://boot.netboot.xyz/ipxe/netboot.xyz.iso -P /mnt/sysimage/var/lib/libvirt/iso/ # fetch netboot.xyz iso | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post/configure-vmm-and-desktop.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/configure-vmm-and-desktop.sh | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post/create-live-vm.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/create-live-vm.sh | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post/virtualization-tweaks-root-needed.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/virtualization-tweaks-root-needed.sh | ||||
|  | ||||
| # # Create new file /etc/systemd/system/postinstall.service using cat: | ||||
| # cat > /mnt/sysimage/etc/systemd/system/post-install.service<< EOF | ||||
| # [Unit] | ||||
| # Description=Post-installation configuration for Phyllome OS | ||||
| # After=gdm.service | ||||
| # Requires=gdm.service | ||||
| #  | ||||
| # [Service] | ||||
| # Type=oneshot | ||||
| # ExecStart=/bin/bash /usr/sbin/post-install.sh | ||||
| # RemainAfterExit=yes | ||||
| #  | ||||
| # [Install] | ||||
| # WantedBy=multi-user.target | ||||
| # EOF | ||||
| #  | ||||
| # systemctl enable /mnt/sysimage/etc/systemd/system/post-install.service # Enable systemd unit | ||||
|  | ||||
| # Add a network bridge. Still need to declare it to libvirt/virt-manager | ||||
| # nmcli con add ifname br0 type bridge con-name br0  | ||||
| # nmcli con add type bridge-slave ifname enp1s0 master br0 # to-do : generalize this command so that it could regardless of the name of the ethernet device | ||||
| # nmcli con up br0 | ||||
|  | ||||
| %end | ||||
|  | ||||
| %post --nochroot --logfile=/mnt/sysimage/root/bhi.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. | ||||
| %post --nochroot --logfile=/mnt/sysimage/opt/base-hypervisor.log | ||||
|  | ||||
| # 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) | ||||
|  | ||||
| mkdir /mnt/sysimage/var/lib/libvirt/iso # Create a directory to store iso images | ||||
|  | ||||
| wget https://boot.netboot.xyz/ipxe/netboot.xyz.iso -P /mnt/sysimage/var/lib/libvirt/iso/ # fetch netboot.xyz iso and store it to the newly created iso directory | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post-first-startup-scripts/create-user-vms.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/create-user-vms.sh | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post-first-startup-scripts/create-system-vms.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/create-system-vms.sh | ||||
|  | ||||
| # fetch custom script and make it executable | ||||
| wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/post-first-startup-scripts/virtualization-tweaks-root-needed.sh -P /mnt/sysimage/usr/sbin/ | ||||
| chmod +x /mnt/sysimage/usr/sbin/virtualization-tweaks-root-needed.sh | ||||
|  | ||||
| %end | ||||
|  | ||||
| %post --nochroot --logfile=/mnt/sysimage/opt/base-hypervisor-intelcpu.log | ||||
|  | ||||
| sed -i 's/\(quiet\)/\1 intel_iommu=on iommu=pt rd.driver.pre=vfio-pci/i' /mnt/sysimage/etc/default/grub # Load kernel modules in GRUB. | ||||
|  | ||||
| echo "options kvm_intel nested=1" >> /mnt/sysimage/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 --force # Regenerate initramfs | ||||
| # Doesn't seem to work | ||||
| # dracut: Cannot find /usr/lib/dracut/dracut-init.sh. | ||||
| # dracut: Are you running from a git checkout? | ||||
| # dracut: Try passing -l as an argument to /mnt/sysimage/usr/bin/dracut | ||||
| %end | ||||
|  | ||||
| # The following part seems useless too. No need to regenerate grub | ||||
| # grub2-mkconfig -o /mnt/sysimage/boot/grub2/grub.cfg # Update grub. Does it fail ? /usr/sbin/grub2-probe: error: failed to get canonical path of `LiveOS_rootfs'. | ||||
| %post --nochroot --logfile=/mnt/sysimage/opt/base-hypervisor-intelgpu.log | ||||
|  | ||||
| sed -i 's/\(vfio-pci\)/\1 i915.enable_gvt=1/i' /mnt/sysimage/etc/default/grub # Load kernel modules in grub. | ||||
|  | ||||
| # Load extra kernel modules to enable vfio-mdev on selected hardware | ||||
| 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) | ||||
|  | ||||
| %end | ||||
|  | ||||
| @@ -127,6 +100,7 @@ generic-release-notes | ||||
| guestfs-tools | ||||
| initial-setup | ||||
| libguestfs-tools | ||||
| libusb | ||||
| libvirt | ||||
| libvirt-daemon-config-network | ||||
| libvirt-daemon-kvm | ||||
| @@ -135,6 +109,7 @@ neofetch | ||||
| pciutils | ||||
| python3-libguestfs | ||||
| qemu-kvm | ||||
| usbutils | ||||
| virt-install | ||||
| virt-top | ||||
| wget | ||||
|   | ||||
		Reference in New Issue
	
	Block a user