From 2d35d8e272b4d5725c686be5d2b4436a55fe8141 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sat, 11 Jan 2025 12:40:33 -0500 Subject: Update libvirt configs, laptop theme --- hosts/denpa/cgit/custom.css | 4 + hosts/iroha/grub_config | 77 +++++++ hosts/iroha/libvirt/hooks/arcade.conf | 7 +- hosts/iroha/libvirt/hooks/cpuset.conf | 4 +- hosts/iroha/libvirt/hooks/cpuset_release_common.sh | 1 + .../arcade/prepare/begin/cpuset_prepare_common.sh | 1 - .../qemu.d/arcade/prepare/begin/port_forward.sh | 14 -- .../arcade/release/end/cpuset_release_common.sh | 1 - .../hooks/qemu.d/arcade/release/end/port_close.sh | 14 -- .../hooks/qemu.d/corpa/prepare/begin/bind_vfio.sh | 16 ++ .../hooks/qemu.d/corpa/release/end/unbind_vfio.sh | 16 ++ hosts/iroha/libvirt/qemu/arcade.xml | 90 ++++---- hosts/iroha/libvirt/qemu/corpa-nogpu.xml | 237 +++++++++++++++++++++ hosts/iroha/libvirt/qemu/corpa.xml | 119 +++++------ hosts/iroha/libvirt/qemu/soy.xml | 7 - hosts/iroha/libvirt/qemu/xp.xml | 11 +- hosts/moyo/grub_config | 77 +++++++ hosts/moyo/libvirt/qemu/denpa.xml | 4 +- hosts/sofue/configuration.nix | 5 +- hosts/sofue/programs.nix | 3 +- hosts/yashinoki/configuration.nix | 23 +- 21 files changed, 558 insertions(+), 173 deletions(-) create mode 100644 hosts/iroha/grub_config delete mode 120000 hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/cpuset_prepare_common.sh delete mode 100755 hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/port_forward.sh delete mode 120000 hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/cpuset_release_common.sh delete mode 100755 hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/port_close.sh create mode 100755 hosts/iroha/libvirt/hooks/qemu.d/corpa/prepare/begin/bind_vfio.sh create mode 100755 hosts/iroha/libvirt/hooks/qemu.d/corpa/release/end/unbind_vfio.sh create mode 100644 hosts/iroha/libvirt/qemu/corpa-nogpu.xml create mode 100644 hosts/moyo/grub_config (limited to 'hosts') diff --git a/hosts/denpa/cgit/custom.css b/hosts/denpa/cgit/custom.css index 29a2080..2bcabe9 100644 --- a/hosts/denpa/cgit/custom.css +++ b/hosts/denpa/cgit/custom.css @@ -82,6 +82,10 @@ a:hover { color: rgb(var(--highlight1)) !important; } +ul { + padding-left: 2rem; +} + code { background-color: var(--color1); } diff --git a/hosts/iroha/grub_config b/hosts/iroha/grub_config new file mode 100644 index 0000000..dced1d3 --- /dev/null +++ b/hosts/iroha/grub_config @@ -0,0 +1,77 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 +# +# To populate all changes in this file you need to regenerate your +# grub configuration file afterwards: +# 'grub-mkconfig -o /boot/grub/grub.cfg' +# +# See the grub info page for documentation on possible variables and +# their associated values. + +GRUB_DISTRIBUTOR="Gentoo" + +# Default menu entry +#GRUB_DEFAULT=0 + +# Boot the default entry this many seconds after the menu is displayed +#GRUB_TIMEOUT=5 +#GRUB_TIMEOUT_STYLE=menu + +# Append parameters to the linux kernel command line +GRUB_CMDLINE_LINUX="quiet text rd.lvm.vg=iroha-vg0" +# +# Examples: +# +# Boot with network interface renaming disabled +# GRUB_CMDLINE_LINUX="net.ifnames=0" +# +# Boot with systemd instead of sysvinit (openrc) +# GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd" + +# Append parameters to the linux kernel command line for non-recovery entries +# default_hugepagesz=1G hugepagesz=1G hugepages=48 +GRUB_CMDLINE_LINUX_DEFAULT="nowatchdog nmi_watchdog=0 amd_pstate=guided amd_iommu=on iommu=pt kvm.ignore_msrs=1 kvm.report_ignored_msrs=0 pcie_no_flr=1022:149c acpi_enforce_resources=lax amdgpu.ppfeaturemask=0xffffffff i915.force_probe=!56a0 xe.force_probe=56a0 psi=1 mitigations=off" + +# Uncomment to disable graphical terminal (grub-pc only) +#GRUB_TERMINAL=console + +# The resolution used on graphical terminal. +# Note that you can use only modes which your graphic card supports via VBE. +# You can see them in real GRUB with the command `vbeinfo'. +#GRUB_GFXMODE=640x480 + +# Set to 'text' to force the Linux kernel to boot in normal text +# mode, 'keep' to preserve the graphics mode set using +# 'GRUB_GFXMODE', 'WIDTHxHEIGHT'['xDEPTH'] to set a particular +# graphics mode, or a sequence of these separated by commas or +# semicolons to try several modes in sequence. +#GRUB_GFXPAYLOAD_LINUX= + +# Path to theme spec txt file. +# The starfield is by default provided with use truetype. +# NOTE: when enabling custom theme, ensure you have required font/etc. +#GRUB_THEME="/boot/grub/themes/starfield/theme.txt" + +# Background image used on graphical terminal. +# Can be in various bitmap formats. +#GRUB_BACKGROUND="/boot/grub/mybackground.png" + +# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel +#GRUB_DISABLE_LINUX_UUID=true + +# Comment if you don't want GRUB to pass "root=PARTUUID=xxx" parameter to kernel +GRUB_DISABLE_LINUX_PARTUUID=false + +# Uncomment to disable generation of recovery mode menu entries +#GRUB_DISABLE_RECOVERY=true + +# Uncomment to disable generation of the submenu and put all choices on +# the top-level menu. +# Besides the visual affect of no sub menu, this makes navigation of the +# menu easier for a user who can't see the screen. +#GRUB_DISABLE_SUBMENU=y + +# Uncomment to play a tone when the main menu is displayed. +# This is useful, for example, to allow users who can't see the screen +# to know when they can make a choice on the menu. +#GRUB_INIT_TUNE="60 800 1" diff --git a/hosts/iroha/libvirt/hooks/arcade.conf b/hosts/iroha/libvirt/hooks/arcade.conf index 4282629..acbc430 100644 --- a/hosts/iroha/libvirt/hooks/arcade.conf +++ b/hosts/iroha/libvirt/hooks/arcade.conf @@ -1,4 +1,3 @@ -VIRSH_GPU_VIDEO=pci_0000_0f_00_0 -VIRSH_GPU_AUDIO=pci_0000_0f_00_1 -VIRSH_USB=pci_0000_03_00_0 -VIRSH_NVME=pci_0000_0e_00_0 +VIRSH_GPU_VIDEO=pci_0000_10_00_0 +VIRSH_GPU_AUDIO=pci_0000_10_00_1 +VIRSH_USB=pci_0000_12_00_3 diff --git a/hosts/iroha/libvirt/hooks/cpuset.conf b/hosts/iroha/libvirt/hooks/cpuset.conf index d208294..74cb68b 100644 --- a/hosts/iroha/libvirt/hooks/cpuset.conf +++ b/hosts/iroha/libvirt/hooks/cpuset.conf @@ -1,6 +1,6 @@ TOTAL_CORES='0-23' # 3900X: 12-core, 24-thread cpu -HOST_CORES='0-4,12-16' -VIRT_CORES0='5-11,17-23' +HOST_CORES='6-11,18-23' +VIRT_CORES0='0-5,12-17' MEMNODES='0' CPUSET_REFCOUNT=/tmp/cpuset-ref diff --git a/hosts/iroha/libvirt/hooks/cpuset_release_common.sh b/hosts/iroha/libvirt/hooks/cpuset_release_common.sh index 624fa5b..d30a3d6 100755 --- a/hosts/iroha/libvirt/hooks/cpuset_release_common.sh +++ b/hosts/iroha/libvirt/hooks/cpuset_release_common.sh @@ -25,6 +25,7 @@ fi for i in blkio cpu cpuacct cpuset devices freezer memory net_cls perf_event; do rmdir ${CGROUP}/$i/machine/${PARTNAME0}.partition + rmdir ${CGROUP}/$i/machine/${PARTNAME1}.partition done /bin/echo ${TOTAL_CORES} > ${CPUSET}/machine/cpuset.cpus diff --git a/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/cpuset_prepare_common.sh b/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/cpuset_prepare_common.sh deleted file mode 120000 index fb5a2ab..0000000 --- a/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/cpuset_prepare_common.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../cpuset_prepare_common.sh \ No newline at end of file diff --git a/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/port_forward.sh b/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/port_forward.sh deleted file mode 100755 index 7d5d484..0000000 --- a/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/port_forward.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /usr/bin/env bash - -# kdeconnect -iptables -t nat -C PREROUTING -p tcp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 || \ -iptables -t nat -A PREROUTING -p tcp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 -iptables -t nat -C PREROUTING -p udp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 || \ -iptables -t nat -A PREROUTING -p udp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 - -iptables -C FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT || \ -iptables -I FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT diff --git a/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/cpuset_release_common.sh b/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/cpuset_release_common.sh deleted file mode 120000 index d823a60..0000000 --- a/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/cpuset_release_common.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../cpuset_release_common.sh \ No newline at end of file diff --git a/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/port_close.sh b/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/port_close.sh deleted file mode 100755 index 0d58fa7..0000000 --- a/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/port_close.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /usr/bin/env bash - -# kdeconnect (remove) -iptables -t nat -C PREROUTING -p tcp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 || \ -iptables -t nat -D PREROUTING -p tcp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 -iptables -t nat -C PREROUTING -p udp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 || \ -iptables -t nat -D PREROUTING -p udp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 - -iptables -C FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT || \ -iptables -D FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT diff --git a/hosts/iroha/libvirt/hooks/qemu.d/corpa/prepare/begin/bind_vfio.sh b/hosts/iroha/libvirt/hooks/qemu.d/corpa/prepare/begin/bind_vfio.sh new file mode 100755 index 0000000..3c602c5 --- /dev/null +++ b/hosts/iroha/libvirt/hooks/qemu.d/corpa/prepare/begin/bind_vfio.sh @@ -0,0 +1,16 @@ +#! /usr/bin/env bash + +source "/etc/libvirt/hooks/arcade.conf" + +modprobe -r nvidia-drm +modprobe -r nvidia-modeset +modprobe -r nvidia-uvm +modprobe -r nvidia + +modprobe vfio +modprobe vfio_iommu_type1 +modprobe vfio_pci + +virsh nodedev-detach $VIRSH_GPU_VIDEO +virsh nodedev-detach $VIRSH_GPU_AUDIO +virsh nodedev-detach $VIRSH_USB diff --git a/hosts/iroha/libvirt/hooks/qemu.d/corpa/release/end/unbind_vfio.sh b/hosts/iroha/libvirt/hooks/qemu.d/corpa/release/end/unbind_vfio.sh new file mode 100755 index 0000000..e3b1234 --- /dev/null +++ b/hosts/iroha/libvirt/hooks/qemu.d/corpa/release/end/unbind_vfio.sh @@ -0,0 +1,16 @@ +#! /usr/bin/env bash + +source "/etc/libvirt/hooks/arcade.conf" + +virsh nodedev-reattach $VIRSH_GPU_VIDEO +virsh nodedev-reattach $VIRSH_GPU_AUDIO +virsh nodedev-reattach $VIRSH_USB + +modprobe -r vfio_pci +modprobe -r vfio_iommu_type1 +modprobe -r vfio + +modprobe nvidia-drm +modprobe nvidia-modeset +modprobe nvidia-uvm +modprobe nvidia diff --git a/hosts/iroha/libvirt/qemu/arcade.xml b/hosts/iroha/libvirt/qemu/arcade.xml index 79e9216..5280dc9 100644 --- a/hosts/iroha/libvirt/qemu/arcade.xml +++ b/hosts/iroha/libvirt/qemu/arcade.xml @@ -7,7 +7,7 @@ or other application using the libvirt API. arcade - 0ccf2904-b393-41b0-98a6-3c8722efdc94 + ddc28570-735e-0000-0000-000000000000 @@ -15,10 +15,8 @@ or other application using the libvirt API. 16777216 16777216 - - - - 6 + 12 + 1 @@ -26,36 +24,43 @@ or other application using the libvirt API. + + + + + + + + + + + + + + + + + + + + + - hvm + hvm - /usr/share/edk2-ovmf/OVMF_CODE.fd - /var/lib/libvirt/qemu/nvram/arcade_VARS.fd + /usr/share/edk2-ovmf/OVMF_CODE.fd + /var/lib/libvirt/qemu/nvram/arcade_VARS.fd - - - - - - - - - - - - - - - - + + @@ -64,20 +69,21 @@ or other application using the libvirt API. - - + + + - - + + destroy @@ -89,6 +95,14 @@ or other application using the libvirt API. /usr/bin/qemu-system-x86_64 + + + + + WD_BLACK_SN770_1TB_230423802979_1 + +
+ @@ -172,15 +186,12 @@ or other application using the libvirt API.
- -
-
- + - +
@@ -192,26 +203,19 @@ or other application using the libvirt API.