mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-06-15 22:38:25 +00:00
Update 1.2.2.2 beta
This commit is contained in:
@@ -479,6 +479,34 @@ _proxmenux_vfio_bind_remove_bdfs() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Returns the BDF of a PCI bridge sharing the IOMMU group of $1, if any.
|
||||||
|
# The kernel refuses to bind vfio-pci to root ports, so when a GPU shares
|
||||||
|
# its IOMMU group with the upstream root port the VFIO setup silently
|
||||||
|
# does nothing — the GPU keeps its native driver and the host can also
|
||||||
|
# end up with a stuck boot if other devices behind the bridge were
|
||||||
|
# expected to come up under the original driver. Detecting this lets
|
||||||
|
# callers warn the operator and bail out before writing host config.
|
||||||
|
_proxmenux_vfio_bind_group_bridge() {
|
||||||
|
local target="$1"
|
||||||
|
[[ "$target" != 0000:* ]] && target="0000:${target}"
|
||||||
|
local group_link
|
||||||
|
group_link=$(readlink "/sys/bus/pci/devices/${target}/iommu_group" 2>/dev/null) || return 1
|
||||||
|
local group_num
|
||||||
|
group_num=$(basename "$group_link")
|
||||||
|
local member bdf cls
|
||||||
|
for member in "/sys/kernel/iommu_groups/${group_num}/devices/"*; do
|
||||||
|
bdf=$(basename "$member")
|
||||||
|
[[ "$bdf" == "$target" ]] && continue
|
||||||
|
cls=$(cat "$member/class" 2>/dev/null)
|
||||||
|
# PCI bridge class is 0x0604xx (Normal bridge 0x060400, Subtractive 0x060401).
|
||||||
|
if [[ "$cls" == 0x0604* ]]; then
|
||||||
|
echo "$bdf"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
_proxmenux_vfio_bind_purge_vendor() {
|
_proxmenux_vfio_bind_purge_vendor() {
|
||||||
# Removes every BDF from the binder state whose PCI vendor matches $1
|
# Removes every BDF from the binder state whose PCI vendor matches $1
|
||||||
# (hex, e.g. "10de" for NVIDIA, "1002" for AMD, "8086" for Intel).
|
# (hex, e.g. "10de" for NVIDIA, "1002" for AMD, "8086" for Intel).
|
||||||
|
|||||||
@@ -2197,6 +2197,9 @@ _configure_nvidia_kvm_hide() {
|
|||||||
update_initramfs_host() {
|
update_initramfs_host() {
|
||||||
msg_info "$(translate 'Updating initramfs (this may take a minute)...')"
|
msg_info "$(translate 'Updating initramfs (this may take a minute)...')"
|
||||||
update-initramfs -u -k all >>"$LOG_FILE" 2>&1
|
update-initramfs -u -k all >>"$LOG_FILE" 2>&1
|
||||||
|
# Copy the freshly-built initramfs to the EFI System Partition.
|
||||||
|
# Without this the bootloader keeps using the previous initramfs.
|
||||||
|
proxmox-boot-tool refresh >>"$LOG_FILE" 2>&1 || true
|
||||||
msg_ok "$(translate 'initramfs updated')" | tee -a "$screen_capture"
|
msg_ok "$(translate 'initramfs updated')" | tee -a "$screen_capture"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user