Because that's a lot more work including agreeing to microsoft's terms and including third parties.Hi @shodan ,why not post this script on github and provide a link?
Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
You can attach a file to a post (the "Attach files" button below the composing window).I wish to paste a command script
Unfortunately, it is 17579 characters so it is over the limit of 16384 characters.
init_colors(){ if [ -t 1 ] && [ -z "${NO_COLOR:-}" ]; then RED=$(printf '\033[31m'); GREEN=$(printf '\033[32m'); CYAN=$(printf '\033[36m'); BOLD=$(printf '\033[1m'); RESET=$(printf '\033[0m'); else RED=; GREEN=; CYAN=; BOLD=; RESET=; fi; }; info(){ printf '%s[INFO]%s %s\n' "$CYAN" "$RESET" "$*"; }; pass(){ printf '%s[PASS]%s %s\n' "$GREEN" "$RESET" "$*"; }; fail(){ printf '%s[FAIL]%s %s\n' "$RED" "$RESET" "$*" >&2; }; require_root(){ if [ "$(id -u)" -eq 0 ]; then pass "Running as root"; return 0; else fail "This installer must be run as root"; return 1; fi; }; create_iommu_passthrough_service(){ if printf '%s\n' '[Unit]' 'Description=Set IOMMU mode for next boot - Pass-Through' '' '[Service]' Type=oneshot SyslogIdentifier=iommu-passthrough 'ExecStart=/bin/sh -c '"'"'find_tty(){ tty=; i=0; while [ "$$i" -lt 10 ] && [ -z "$$tty" ]; do for p in /proc/[0-9]*; do case "$$(readlink "$$p/exe" 2>/dev/null)" in */systemctl) c=$$(tr "\0" " " <"$$p/cmdline" 2>/dev/null); case "$$c" in *iommu-passthrough*) t=$$(readlink "$$p/fd/1" 2>/dev/null); case "$$t" in /dev/pts/*|/dev/tty*) tty=$$t; break;; esac;; esac;; esac; done; i=$$((i+1)); [ -n "$$tty" ] || sleep 0.05; done; }; emit(){ printf "%%s\n" "$$1"; [ -n "$$tty" ] && [ -w "$$tty" ] && printf "%%b\n" "$${2:-$$1}" >"$$tty"; }; clean_args(){ out=; for x in $$1; do case "$$x" in iommu=pt|iommu.strict=*|iommu.passthrough=*) :;; *) out="$${out:+$$out }$$x";; esac; done; printf "%%s" "$$out"; }; find_tty; C=$$(printf "\033[1;36m"); Y=$$(printf "\033[1;33m"); R=$$(printf "\033[1;31m"); Z=$$(printf "\033[0m"); M=$$(printf "\033[1;32m"); mode="iommu=pt"; name="Pass-Through"; [ "$$(id -u)" -eq 0 ] || { emit "ERROR: run as root" "$${R}ERROR:$${Z} run as root"; exit 1; }; src=; if [ -f /etc/kernel/cmdline ] && [ -s /etc/kernel/proxmox-boot-uuids ]; then old=$$(cat /etc/kernel/cmdline) || exit 1; clean=$$(clean_args "$$old"); printf "%%s\n" "$${clean:+$$clean }$$mode" >/etc/kernel/cmdline || { emit "ERROR: could not update /etc/kernel/cmdline" "$${R}ERROR:$${Z} could not update /etc/kernel/cmdline"; exit 1; }; command -v proxmox-boot-tool >/dev/null 2>&1 || { emit "ERROR: proxmox-boot-tool not found" "$${R}ERROR:$${Z} proxmox-boot-tool not found"; exit 1; }; proxmox-boot-tool refresh || exit 1; src=/etc/kernel/cmdline; elif [ -f /etc/default/grub ] && command -v update-grub >/dev/null 2>&1; then tmp=$$(mktemp) || exit 1; found=0; : >"$$tmp" || exit 1; while IFS= read -r line || [ -n "$$line" ]; do trim=$${line#"$${line%%%%[![:space:]]*}"}; case "$$trim" in GRUB_CMDLINE_LINUX_DEFAULT=*) val=$${trim#*=}; val=$$(printf "%%s" "$$val" | sed "s/^\"//;s/\"$$//"); clean=$$(clean_args "$$val"); printf "GRUB_CMDLINE_LINUX_DEFAULT=\"%%s\"\n" "$${clean:+$$clean }$$mode" >>"$$tmp"; found=1;; GRUB_CMDLINE_LINUX=*) val=$${trim#*=}; val=$$(printf "%%s" "$$val" | sed "s/^\"//;s/\"$$//"); clean=$$(clean_args "$$val"); printf "GRUB_CMDLINE_LINUX=\"%%s\"\n" "$$clean" >>"$$tmp";; *) printf "%%s\n" "$$line" >>"$$tmp";; esac; done </etc/default/grub; [ "$$found" -eq 1 ] || printf "GRUB_CMDLINE_LINUX_DEFAULT=\"%%s\"\n" "$$mode" >>"$$tmp"; cat "$$tmp" >/etc/default/grub; r=$$?; rm -f "$$tmp"; [ "$$r" -eq 0 ] || { emit "ERROR: could not update /etc/default/grub" "$${R}ERROR:$${Z} could not update /etc/default/grub"; exit "$$r"; }; update-grub || exit 1; src=/etc/default/grub; else emit "ERROR: no supported Proxmox boot configuration found" "$${R}ERROR:$${Z} no supported Proxmox boot configuration found"; exit 1; fi; emit "Next boot configured: $$name" "$${C}Next boot configured:$${Z} $${M}$$name$${Z}"; emit "Boot config: $$src" "$${C}Boot config:$${Z} $$src"; emit "Reboot required for the change to take effect." "$${Y}Reboot required for the change to take effect.$${Z}"; emit "Status: systemctl start iommu-status" "$${C}Status:$${Z} systemctl start iommu-status"'"'"'' StandardOutput=journal StandardError=journal >'/etc/systemd/system/iommu-passthrough.service'; then pass 'Created iommu-passthrough.service'; else fail 'Failed to create iommu-passthrough.service'; return 1; fi; }; create_iommu_translated_lazy_service(){ if printf '%s\n' '[Unit]' 'Description=Set IOMMU mode for next boot - Translated - Lazy' '' '[Service]' Type=oneshot SyslogIdentifier=iommu-translated-lazy 'ExecStart=/bin/sh -c '"'"'find_tty(){ tty=; i=0; while [ "$$i" -lt 10 ] && [ -z "$$tty" ]; do for p in /proc/[0-9]*; do case "$$(readlink "$$p/exe" 2>/dev/null)" in */systemctl) c=$$(tr "\0" " " <"$$p/cmdline" 2>/dev/null); case "$$c" in *iommu-translated-lazy*) t=$$(readlink "$$p/fd/1" 2>/dev/null); case "$$t" in /dev/pts/*|/dev/tty*) tty=$$t; break;; esac;; esac;; esac; done; i=$$((i+1)); [ -n "$$tty" ] || sleep 0.05; done; }; emit(){ printf "%%s\n" "$$1"; [ -n "$$tty" ] && [ -w "$$tty" ] && printf "%%b\n" "$${2:-$$1}" >"$$tty"; }; clean_args(){ out=; for x in $$1; do case "$$x" in iommu=pt|iommu.strict=*|iommu.passthrough=*) :;; *) out="$${out:+$$out }$$x";; esac; done; printf "%%s" "$$out"; }; find_tty; C=$$(printf "\033[1;36m"); Y=$$(printf "\033[1;33m"); R=$$(printf "\033[1;31m"); Z=$$(printf "\033[0m"); M=$$(printf "\033[1;33m"); mode="iommu.strict=0"; name="Translated - Lazy"; [ "$$(id -u)" -eq 0 ] || { emit "ERROR: run as root" "$${R}ERROR:$${Z} run as root"; exit 1; }; src=; if [ -f /etc/kernel/cmdline ] && [ -s /etc/kernel/proxmox-boot-uuids ]; then old=$$(cat /etc/kernel/cmdline) || exit 1; clean=$$(clean_args "$$old"); printf "%%s\n" "$${clean:+$$clean }$$mode" >/etc/kernel/cmdline || { emit "ERROR: could not update /etc/kernel/cmdline" "$${R}ERROR:$${Z} could not update /etc/kernel/cmdline"; exit 1; }; command -v proxmox-boot-tool >/dev/null 2>&1 || { emit "ERROR: proxmox-boot-tool not found" "$${R}ERROR:$${Z} proxmox-boot-tool not found"; exit 1; }; proxmox-boot-tool refresh || exit 1; src=/etc/kernel/cmdline; elif [ -f /etc/default/grub ] && command -v update-grub >/dev/null 2>&1; then tmp=$$(mktemp) || exit 1; found=0; : >"$$tmp" || exit 1; while IFS= read -r line || [ -n "$$line" ]; do trim=$${line#"$${line%%%%[![:space:]]*}"}; case "$$trim" in GRUB_CMDLINE_LINUX_DEFAULT=*) val=$${trim#*=}; val=$$(printf "%%s" "$$val" | sed "s/^\"//;s/\"$$//"); clean=$$(clean_args "$$val"); printf "GRUB_CMDLINE_LINUX_DEFAULT=\"%%s\"\n" "$${clean:+$$clean }$$mode" >>"$$tmp"; found=1;; GRUB_CMDLINE_LINUX=*) val=$${trim#*=}; val=$$(printf "%%s" "$$val" | sed "s/^\"//;s/\"$$//"); clean=$$(clean_args "$$val"); printf "GRUB_CMDLINE_LINUX=\"%%s\"\n" "$$clean" >>"$$tmp";; *) printf "%%s\n" "$$line" >>"$$tmp";; esac; done </etc/default/grub; [ "$$found" -eq 1 ] || printf "GRUB_CMDLINE_LINUX_DEFAULT=\"%%s\"\n" "$$mode" >>"$$tmp"; cat "$$tmp" >/etc/default/grub; r=$$?; rm -f "$$tmp"; [ "$$r" -eq 0 ] || { emit "ERROR: could not update /etc/default/grub" "$${R}ERROR:$${Z} could not update /etc/default/grub"; exit "$$r"; }; update-grub || exit 1; src=/etc/default/grub; else emit "ERROR: no supported Proxmox boot configuration found" "$${R}ERROR:$${Z} no supported Proxmox boot configuration found"; exit 1; fi; emit "Next boot configured: $$name" "$${C}Next boot configured:$${Z} $${M}$$name$${Z}"; emit "Boot config: $$src" "$${C}Boot config:$${Z} $$src"; emit "Reboot required for the change to take effect." "$${Y}Reboot required for the change to take effect.$${Z}"; emit "Status: systemctl start iommu-status" "$${C}Status:$${Z} systemctl start iommu-status"'"'"'' StandardOutput=journal StandardError=journal >'/etc/systemd/system/iommu-translated-lazy.service'; then pass 'Created iommu-translated-lazy.service'; else fail 'Failed to create iommu-translated-lazy.service'; return 1; fi; }; create_iommu_translated_strict_service(){ if printf '%s\n' '[Unit]' 'Description=Set IOMMU mode for next boot - Translated - Strict' '' '[Service]' Type=oneshot SyslogIdentifier=iommu-translated-strict 'ExecStart=/bin/sh -c '"'"'find_tty(){ tty=; i=0; while [ "$$i" -lt 10 ] && [ -z "$$tty" ]; do for p in /proc/[0-9]*; do case "$$(readlink "$$p/exe" 2>/dev/null)" in */systemctl) c=$$(tr "\0" " " <"$$p/cmdline" 2>/dev/null); case "$$c" in *iommu-translated-strict*) t=$$(readlink "$$p/fd/1" 2>/dev/null); case "$$t" in /dev/pts/*|/dev/tty*) tty=$$t; break;; esac;; esac;; esac; done; i=$$((i+1)); [ -n "$$tty" ] || sleep 0.05; done; }; emit(){ printf "%%s\n" "$$1"; [ -n "$$tty" ] && [ -w "$$tty" ] && printf "%%b\n" "$${2:-$$1}" >"$$tty"; }; clean_args(){ out=; for x in $$1; do case "$$x" in iommu=pt|iommu.strict=*|iommu.passthrough=*) :;; *) out="$${out:+$$out }$$x";; esac; done; printf "%%s" "$$out"; }; find_tty; C=$$(printf "\033[1;36m"); Y=$$(printf "\033[1;33m"); R=$$(printf "\033[1;31m"); Z=$$(printf "\033[0m"); M=$$(printf "\033[1;31m"); mode="iommu.strict=1"; name="Translated - Strict"; [ "$$(id -u)" -eq 0 ] || { emit "ERROR: run as root" "$${R}ERROR:$${Z} run as root"; exit 1; }; src=; if [ -f /etc/kernel/cmdline ] && [ -s /etc/kernel/proxmox-boot-uuids ]; then old=$$(cat /etc/kernel/cmdline) || exit 1; clean=$$(clean_args "$$old"); printf "%%s\n" "$${clean:+$$clean }$$mode" >/etc/kernel/cmdline || { emit "ERROR: could not update /etc/kernel/cmdline" "$${R}ERROR:$${Z} could not update /etc/kernel/cmdline"; exit 1; }; command -v proxmox-boot-tool >/dev/null 2>&1 || { emit "ERROR: proxmox-boot-tool not found" "$${R}ERROR:$${Z} proxmox-boot-tool not found"; exit 1; }; proxmox-boot-tool refresh || exit 1; src=/etc/kernel/cmdline; elif [ -f /etc/default/grub ] && command -v update-grub >/dev/null 2>&1; then tmp=$$(mktemp) || exit 1; found=0; : >"$$tmp" || exit 1; while IFS= read -r line || [ -n "$$line" ]; do trim=$${line#"$${line%%%%[![:space:]]*}"}; case "$$trim" in GRUB_CMDLINE_LINUX_DEFAULT=*) val=$${trim#*=}; val=$$(printf "%%s" "$$val" | sed "s/^\"//;s/\"$$//"); clean=$$(clean_args "$$val"); printf "GRUB_CMDLINE_LINUX_DEFAULT=\"%%s\"\n" "$${clean:+$$clean }$$mode" >>"$$tmp"; found=1;; GRUB_CMDLINE_LINUX=*) val=$${trim#*=}; val=$$(printf "%%s" "$$val" | sed "s/^\"//;s/\"$$//"); clean=$$(clean_args "$$val"); printf "GRUB_CMDLINE_LINUX=\"%%s\"\n" "$$clean" >>"$$tmp";; *) printf "%%s\n" "$$line" >>"$$tmp";; esac; done </etc/default/grub; [ "$$found" -eq 1 ] || printf "GRUB_CMDLINE_LINUX_DEFAULT=\"%%s\"\n" "$$mode" >>"$$tmp"; cat "$$tmp" >/etc/default/grub; r=$$?; rm -f "$$tmp"; [ "$$r" -eq 0 ] || { emit "ERROR: could not update /etc/default/grub" "$${R}ERROR:$${Z} could not update /etc/default/grub"; exit "$$r"; }; update-grub || exit 1; src=/etc/default/grub; else emit "ERROR: no supported Proxmox boot configuration found" "$${R}ERROR:$${Z} no supported Proxmox boot configuration found"; exit 1; fi; emit "Next boot configured: $$name" "$${C}Next boot configured:$${Z} $${M}$$name$${Z}"; emit "Boot config: $$src" "$${C}Boot config:$${Z} $$src"; emit "Reboot required for the change to take effect." "$${Y}Reboot required for the change to take effect.$${Z}"; emit "Status: systemctl start iommu-status" "$${C}Status:$${Z} systemctl start iommu-status"'"'"'' StandardOutput=journal StandardError=journal >'/etc/systemd/system/iommu-translated-strict.service'; then pass 'Created iommu-translated-strict.service'; else fail 'Failed to create iommu-translated-strict.service'; return 1; fi; }; set_iommu_to_lazy_tlb_translation(){ systemctl reset-failed iommu-translated-lazy >/dev/null 2>&1 || :; systemctl start iommu-translated-lazy; }; set_iommu_to_strict_tlb_translation(){ systemctl reset-failed iommu-translated-strict >/dev/null 2>&1 || :; systemctl start iommu-translated-strict; }; set_iommu_to_passthrough(){ systemctl reset-failed iommu-passthrough >/dev/null 2>&1 || :; systemctl start iommu-passthrough; }; get_iommu_passthrough_mode(){ systemctl reset-failed iommu-status >/dev/null 2>&1 || :; systemctl start iommu-status; };
install_iommu_service_units
#set_iommu_to_lazy_tlb_translation
#set_iommu_to_strict_tlb_translation
set_iommu_to_passthrough
get_iommu_passthrough_mode
Which is why it really wouldn't change much if it were enabled anyway.You seem to be fairly alone in that desire.
You expect people to cut-and-paste completely unreadable code just on your say-so? Any sane person should say "no thanks" to that garbage.And yes, minified oneliners are made like that to be used, not read.
You can paste it to an ai for analysis ;-)You expect people to cut-and-paste completely unreadable code just on your say-so? Any sane person should say "no thanks" to that garbage.
What are the chances it will respond with - "thats my code dude!"You can paste it to an ai for analysis ;-)
We use essential cookies to make this site work, and optional cookies to enhance your experience.