From 1351cb5945b2fd2801db823e3102f4f019248cac Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 27 Oct 2026 20:35:19 -0700 Subject: [PATCH 001/244] Mac app: Intel Xe graphics through WhateverXe on supported GPUs Tiger Lake, Alder Lake and Raptor Lake Xe graphics on macOS 15.8+ and 26.7+. Setup adds WhateverXe (BSD-3, pinned) after Lilu, its AMFIPass build, the boot arguments it needs and SIP 0x803, turns WhateverGreen off, and installs WhateverXe Graphics from its author's GitHub after the next start. Off puts back exactly what on changed. The start-once boot entry also writes -wexoff. --- NOTICE.md | 2 + mac/Resources/NullMothSafe.efi | Bin 27648 -> 29184 bytes mac/Resources/app.js | 2 + mac/Resources/index.html | 4 + mac/Resources/nullmoth-setup.sh | 142 +++++++++++++++++++- mac/Sources/main.swift | 17 ++- mac/efi-safe/src/main.rs | 26 +++- mac/tools/test_gpu_test.py | 2 +- mac/tools/test_setup_readonly_efi.py | 3 +- mac/tools/test_xe_whateverxe.py | 193 +++++++++++++++++++++++++++ 10 files changed, 378 insertions(+), 13 deletions(-) create mode 100644 mac/tools/test_xe_whateverxe.py diff --git a/NOTICE.md b/NOTICE.md index 61082ecd..48fe94d8 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -50,6 +50,8 @@ makes to their output lives in `p1401/` and is recorded per build as a named rul | BluetoothWCN7850 (Qualcomm WCN7850 Bluetooth), by razvanccr | Release `v1.0.0` | **MIT**. Pinned. Added for the USB IDs it matches. | | XhciNudge and KernReserveLow (AMD laptop USB fixes), by MonkaKokosowa | Releases `1.0` | **MIT**. Pinned. Opt-in, for AMD xHCI 1022:161D/161E/15D6/15D7. | | LegionCbmrFix, LegionI2CArrowLake, LegionITEKbdFix, LegionCpuPower, by watchthelight | Releases `1.0.0`, `1.1.0`, `1.0.0`, `0.3.3` | **BSD-3-Clause** (CbmrFix), **ISC** (the others). Pinned. CbmrFix and CpuPower are opt-in. | +| WhateverXe (Intel Xe graphics, Mac app, opt-in), by b00t0x | Release `0.6.1` | **BSD-3-Clause**. Pinned by sha256 in `mac/Resources/nullmoth-setup.sh`; only offered for the Intel GPU IDs it supports. | +| WhateverXe Graphics, its AMFIPass build and its uninstall script, by b00t0x | Release `v0.3.2` and commit `b4d3889` of WhateverXe-Graphics | Downloaded on the user's Mac from the author's GitHub only, each pinned by sha256. Never mirrored or redistributed by NullMoth: the package holds Apple's Intel graphics drivers as adapted by its author. | ### The download mirror diff --git a/mac/Resources/NullMothSafe.efi b/mac/Resources/NullMothSafe.efi index 5f504ef936449ea1c8ef3fb6e201b04b29a6be12..61cfe54edfa83f4d6fcb3406214500588855de1a 100755 GIT binary patch delta 9266 zcmcgyd3+Q__U~>pkO1Q(z~mx<0F#SA4$cYTmj_vdC|kFbaKFuDe1*#wo@@9UlrV%UFw{rPmN>Ra!< zdhgY%S5-aP)WUE22fuaG(8!0ctl$Dq8#j#WE8NR*g#h9-@YJ^L?vO*Mr*Gi67&cRw z!8Y;1<6|X2p?HZj2=5(F9LH6pu3fUwzL4XdjzUKT-e|lf>_a}0U&+3}-$&WKLiD{P zn5)4n;9XreUig}K{%jb>iE?(ZDCdWY9^DzO87X@7eP?o<^2$JTd-TbuH#`h3MFwyr z7`2Q~m7`EetU59GxOI+o_Ut*OV%1l1V)du?CnfouB%ij)pNsOxq9-UUH^ZNOBPi>y z_ON_Uzbw(;Wb>aEGn*V&eNMBKdCSpXl>aEoH*Ip8@{7qFSKVm0**t~*e9u4-ACvg+ zZ1TB+hYoy6$3?kGNf$ZJ&=+jWMEQc~nHem3a!eIA z87?yJDA_S7)6i;W9 zn^n!vHBx}OX#h})rJ0`*{y1SIH2t{Q9h=OC#Y%) z4BbP*-7Zx-(eq4TaBC!CEnFHpWosxkR9oH8YqrTVp&bw3n`qh>s;+HP_T9^-^)ka+ zM2ARmA!1&Ok5J9~Jv9UJm3Q^*jb7p9B(ee1gZR;?|CpQ6sMJQ1Ml*upO@r$|A8L>) z9B0{*B+Af`B*`vKk<(h2%3giLUSa)Et2<(ISL6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XN^rqxk{x8!L8vevCDTSsCO+3%}O`s&9tcm|7j zXh=cV|5oXGor2PL1IluaE0~=*`$%eg;jY3mgD7T(=VxY&r=#v+92tMZkx{&UN$G>* z;*%yVS(04(;DqH9QYNG%Cyrmcd})2env*&@o%nWp{eU%h`Z(z1$gi!aZKyrG^UTgG zJN5bCAGmTrIdJoU<>1PLYY%QXc=4d` zp?!xg9=dW!ImE5yxJ<|rYR}aAy&m{_`0E>Xal6;zeA6x|?+!hPwPc6?+=?2zxi|ZQon};@XwE=i+_;AN$0DJOBUy diff --git a/mac/Resources/app.js b/mac/Resources/app.js index b87fdbfe..6ad65cee 100644 --- a/mac/Resources/app.js +++ b/mac/Resources/app.js @@ -194,6 +194,8 @@ $("blon").onclick = () => post({ act: "backlight", on: true, efi: efi() }); $("bloff").onclick = () => post({ act: "backlight", on: false, efi: efi() }); $("gpuon").onclick = () => post({ act: "gputest", on: true, efi: efi() }); $("gpuoff").onclick = () => post({ act: "gputest", on: false, efi: efi() }); +$("xeon").onclick = () => post({ act: "xe", on: true, efi: efi() }); +$("xeoff").onclick = () => post({ act: "xe", on: false, efi: efi() }); $("teston").onclick = () => post({ act: "tester", on: true }); $("testoff").onclick = () => post({ act: "tester", on: false }); $("earlyon").onclick = () => post({ act: "early", on: true }); diff --git a/mac/Resources/index.html b/mac/Resources/index.html index 119ef811..a4fcc2f0 100644 --- a/mac/Resources/index.html +++ b/mac/Resources/index.html @@ -88,6 +88,10 @@

Tools

Test program. While the test driver is on, 1401 sends a short report after every restart: the driver's kernel messages, any crash, and which GPU and build you have (names and serial numbers removed). Leave at any time.

+

Microphone and camera

With the driver installed, macOS does not ask before an app uses the microphone or camera, so apps such as Discord get silence and never appear under Privacy & Security. Pick the app here to allow it the microphone, camera and screen recording.

diff --git a/mac/Resources/nullmoth-setup.sh b/mac/Resources/nullmoth-setup.sh index 73b14adc..508914a9 100755 --- a/mac/Resources/nullmoth-setup.sh +++ b/mac/Resources/nullmoth-setup.sh @@ -49,7 +49,7 @@ while [ $# -gt 0 ]; do case "$1" in --pkg) PKG=$2; shift;; --sha) SHA=$2; shift;; --config) CFG=$2; shift;; --efi) EFI=$2; shift;; --tool) TOOL=$2; shift;; --usbmap) USBMAP=$2; shift;; --app) APPBIN=$2; shift;; --dry) DRY=1;; --remove) REMOVE=1;; --verbose) VERB=$2; shift;; --update) UPD=$2; shift;; --collect-logs) COLLECT=$2; shift;; --efi-read) EFIREAD=$2; shift;; - --knob) KNOBS+=("$2"); shift;; --profile) PROFILE=$2; shift;; --gpu-test) GPUTEST=$2; shift;; --backlight) BACKLIGHT=$2; shift;; + --knob) KNOBS+=("$2"); shift;; --profile) PROFILE=$2; shift;; --gpu-test) GPUTEST=$2; shift;; --backlight) BACKLIGHT=$2; shift;; --xe) XE=$2; shift;; *) echo "STOP unknown option $1"; echo "RESULT stop"; exit 2;; esac; shift; done step() { echo "STEP $*"; }; ok() { echo "OK $*"; }; note() { echo "NOTE $*"; } KT="" @@ -119,6 +119,7 @@ kurl() { case $1 in AMFIPass.kext) echo "https://github.com/dortania/OpenCore-Legacy-Patcher/raw/main/payloads/Kexts/Acidanthera/AMFIPass-v1.4.1-RELEASE.zip 07b266145906db41f4b13a7938fbb173ea28888cc1fa65f84417f8820adc961e";; USBToolBox.kext) echo "https://github.com/USBToolBox/kext/releases/download/1.2.0/USBToolBox-1.2.0-RELEASE.zip c315a3a5acfd496dd97d0d19b4fbd1d487103d2fd541c5651583d4c9cebcfe07";; RestrictEvents.kext) echo "https://github.com/dortania/build-repo/releases/download/RestrictEvents-9265e78/RestrictEvents-1.1.7-RELEASE.zip e5a8c15adeba9251be2709899214fe7fd847f6d38fca6c09adb65e9b2af64f0a";; + WhateverXe.kext) echo "https://github.com/b00t0x/WhateverXe/releases/download/0.6.1/WhateverXe-0.6.1-RELEASE.zip 46c8cd684461db7f84a971e7479770c423f73d52d45addfb48242176b9eb04fc";; esac; } # Downloads $1 into $KT/$1.x (checked against its SHA-256) before anything is changed; stops on any failure. $2 = where it goes. fetch_kext() { @@ -963,6 +964,145 @@ if [ -n "${BACKLIGHT:-}" ]; then ok "built-in screen brightness $BACKLIGHT - takes effect at the next restart"; cleanup; echo "RESULT ok"; exit 0 fi +if [ -n "${XE:-}" ]; then + # Intel Xe graphics through WhateverXe (b00t0x, BSD-3), for the Tiger Lake, Alder Lake and Raptor Lake GPUs it accepts. + # WhateverXe needs two things from its author that NullMoth does not redistribute: the WhateverXe Graphics package + # (Apple's Intel graphics drivers, adapted and re-signed) and the AMFIPass build signed for it. Both are downloaded + # here, on this Mac, from the author's own GitHub at pinned versions, each checked against its SHA-256; there is no + # mirror for them. WhateverXe's own rules apply: Lilu first, WhateverGreen off, SIP at least 0x803, and the package + # installed only after a start with WhateverXe loaded. So "on" runs twice: the first adds the kexts to OpenCore and + # asks for a restart, the second installs the graphics package. "Off" undoes exactly what "on" recorded. + case "$XE" in on|off) ;; *) stop "--xe takes on or off";; esac + XS=$ST/xe-state; KX="$(dirname "$C")/Kexts"; XG=b4d3889206a609e29e991a833d8d91c2d110a661 + XPKG_URL=https://github.com/b00t0x/WhateverXe-Graphics/releases/download/v0.3.2/WhateverXe-Graphics-0.3.2.pkg + XPKG_SHA=7ac6c7149248c483efbd93555294d587a93d81392421f3af8a4f5b1b5fcc0101 + XAMFI_URL=https://github.com/b00t0x/WhateverXe-Graphics/raw/$XG/extras/AMFIPass-v1.4.1-Mod-RELEASE.zip + XAMFI_SHA=71f41de42e355d2a83e6f093ef34a5b24d0a9c9a9085830b2317f1b874f56250 + XUNI_URL=https://raw.githubusercontent.com/b00t0x/WhateverXe-Graphics/$XG/uninstall.sh + XUNI_SHA=aad40b6bd2a25b72584f7343a06bb532feab33b3611ac70b1a22731946acbc8b + kix() { local i=0 p; while p=$(get Kernel.Add.$i.BundlePath); do [ "$p" = "$1" ] && { echo $i; return; }; i=$((i+1)); done; } + upstream() { # $1 url, $2 sha256, $3 file: the author's GitHub only, never a mirror + [ -n "$KT" ] || KT=$(mktemp -d) || stop "could not create a download folder" + curl -fsSL --connect-timeout 20 --max-time 900 --retry 2 --retry-delay 3 -o "$KT/$3" "$1" \ + || stop "$3 could not be downloaded from its author ($1). Check the internet connection and try again" + [ "$(shasum -a 256 "$KT/$3" | awk '{print $1}')" = "$2" ] || stop "$3 did not match its SHA-256; nothing was changed. Try again"; } + xe_pkg_in() { pkgutil --pkgs 2>/dev/null | grep -q '^org\.b00t0x\.WhateverXe\.'; } + ent() { printf '{"Arch":"x86_64","BundlePath":"%s","Comment":"%s","Enabled":true,"ExecutablePath":"Contents/MacOS/%s","MaxKernel":"","MinKernel":"","PlistPath":"Contents/Info.plist"}' "$1" "$2" "${1%.kext}"; } + if [ "$XE" = on ]; then + [ "$(sysctl -n machdep.cpu.vendor 2>/dev/null)" = GenuineIntel ] || stop "Intel Xe graphics needs an Intel processor" + # the processor GPU at 00:02.0 (class 03): the IDs WhateverXe 0.6.1 selects a backend for (docs/device-selection.md) + XID=$(ioreg -r -c IOPCIDevice -l -w0 | LC_ALL=C awk -F'<|>' '/\+-o /{if (c=="03" && v=="8086") print d; c=""; v=""; d=""} + /"vendor-id" =/{v=substr($2,3,2) substr($2,1,2)} /"device-id" =/{d=toupper(substr($2,3,2) substr($2,1,2))} /"class-code" =/{c=substr($2,5,2)} + END{if (c=="03" && v=="8086") print d}' | head -1) + [ -n "$XID" ] || stop "macOS does not see the Intel GPU (it may be switched off in OpenCore with disable-gpu or -wegnoigpu)" + case " 9A40 9A49 9A60 9A68 9A70 9A78 46D0 46D1 46D2 46D3 46D4 46A3 46A6 46A8 46AA 46B3 46C3 A7A0 A7A1 A7A8 A7A9 A7AA A7AB A7AC A7AD 4680 4682 4688 468A 468B 4690 4692 4693 A780 A781 A782 A783 A788 A789 A78A A78B " in + *" $XID "*) ;; *) stop "this Intel GPU (8086:$XID) is not one WhateverXe supports (Tiger Lake, Alder Lake and Raptor Lake Xe graphics)";; esac + # WhateverXe 0.6.1 runs on Sequoia 15.8 and later and on Tahoe 26.7 and later + XV=$(sw_vers -productVersion); XM=${XV%%.*}; XN=${XV#*.}; XN=${XN%%.*} + { [ "$XM" = 15 ] && [ "$XN" -ge 8 ]; } || { [ "$XM" = 26 ] && [ "$XN" -ge 7 ]; } || stop "WhateverXe needs macOS 15.8 or later, or 26.7 or later (this Mac has $XV)" + # one Intel GPU driver at a time: the AMD/Intel test driver (NMXGPU) takes the same GPU + for a in $(get NVRAM.Add.$B.boot-args) $(nvram boot-args 2>/dev/null | cut -f2-); do + [ "$a" = -nmxintel ] && stop "the AMD / Intel test driver is on for this Intel GPU - turn it off first"; done + if kmutil showloaded --list-only 2>/dev/null | grep -q 'org\.b00t0x\.WhateverXe '; then + # second run: WhateverXe is loaded, so the graphics package goes in now + step "Installing WhateverXe Graphics (from its author, SHA-256 checked)" + upstream "$XPKG_URL" "$XPKG_SHA" WhateverXe-Graphics.pkg + installer -pkg "$KT/WhateverXe-Graphics.pkg" -target / > "$ST/xe-installer.log" 2>&1 || stop "the WhateverXe Graphics installer failed (log: $ST/xe-installer.log)" + xe_pkg_in || stop "the WhateverXe Graphics package did not record its install (log: $ST/xe-installer.log)" + ok "Intel Xe graphics installed - restart to use it"; cleanup; echo "RESULT ok"; exit 0 + fi + [ -f "$XS" ] && { ok "WhateverXe is already in OpenCore's config - restart, then turn Intel Xe graphics on again to install its graphics package"; cleanup; echo "RESULT ok"; exit 0; } + step "Adding WhateverXe to OpenCore" + fetch_kext WhateverXe.kext "$KX" + upstream "$XAMFI_URL" "$XAMFI_SHA" AMFIPass-Mod.zip + ditto -x -k "$KT/AMFIPass-Mod.zip" "$KT/amfi.x" && [ -f "$KT/amfi.x/AMFIPass.kext/Contents/Info.plist" ] || stop "AMFIPass (WhateverXe build) could not be unpacked; nothing was changed" + li=$(kix Lilu.kext); [ -n "$li" ] && [ -d "$KX/Lilu.kext" ] || stop "WhateverXe needs Lilu, and this OpenCore config has none" + BKC="$C.nullmoth-xe-$(date +%Y%m%d-%H%M%S)"; cp -p "$C" "$BKC" || stop "could not back up $C$(ro_why "$C")"; ok "backed up the config to $BKC" + rec="BKC=$BKC"; fail=0 + plutil -replace Kernel.Add.$li.Enabled -bool true "$C" || fail=1 + # WhateverXe straight after Lilu; AMFIPass after it (a Lilu plugin too). An AMFIPass already there is kept aside and + # comes back with "off": WhateverXe's graphics stack is signed for the modified build only. + [ -d "$KX/WhateverXe.kext" ] && rm -rf "$KX/WhateverXe.kext" + ditto "$KT/WhateverXe.kext.x/WhateverXe.kext" "$KX/WhateverXe.kext" || fail=1 + [ -n "$(kix WhateverXe.kext)" ] || plutil -insert Kernel.Add.$((li + 1)) -json "$(ent WhateverXe.kext 'Intel Xe graphics (WhateverXe)')" "$C" || fail=1 + echo "CHANGE Kernel -> Add: WhateverXe.kext (after Lilu)" + if [ -d "$KX/AMFIPass.kext" ]; then + mv "$KX/AMFIPass.kext" "$KX/AMFIPass.kext.nullmoth-xe" || fail=1; rec="$rec +AMFI_KEPT=1" + echo "CHANGE Kexts: AMFIPass.kext -> the WhateverXe build (yours kept as AMFIPass.kext.nullmoth-xe)" + fi + ditto "$KT/amfi.x/AMFIPass.kext" "$KX/AMFIPass.kext" || fail=1 + ai=$(kix AMFIPass.kext) + if [ -n "$ai" ]; then + [ "$(get Kernel.Add.$ai.Enabled)" = true ] || { plutil -replace Kernel.Add.$ai.Enabled -bool true "$C" || fail=1; rec="$rec +AMFI_ENABLED=1"; } + else + plutil -insert Kernel.Add.$(( $(kix WhateverXe.kext) + 1 )) -json "$(ent AMFIPass.kext 'AMFIPass (WhateverXe build)')" "$C" || fail=1; rec="$rec +AMFI_ADDED=1" + echo "CHANGE Kernel -> Add: AMFIPass.kext" + fi + wi=$(kix WhateverGreen.kext) + if [ -n "$wi" ] && [ "$(get Kernel.Add.$wi.Enabled)" = true ]; then + plutil -replace Kernel.Add.$wi.Enabled -bool false "$C" || fail=1; rec="$rec +WEG_OFF=1" + echo "CHANGE Kernel -> Add: WhateverGreen.kext off (WhateverXe replaces it; it comes back with off)" + fi + # WhateverXe's required boot arguments (its README): only the ones not already there are added, and only those go with "off" + xa=" $(get NVRAM.Add.$B.boot-args) " + for a in -allow3d -disablegfxfirmware; do case "$xa" in *" $a "*) ;; *) xa="$xa$a "; rec="$rec\nARG=$a"; echo "CHANGE boot-args: add $a (WhateverXe needs it)";; esac; done + xa=$(echo $xa) + if has NVRAM.Add.$B.boot-args; then plutil -replace NVRAM.Add.$B.boot-args -string "$xa" "$C" || fail=1 + else plutil -insert NVRAM.Add.$B.boot-args -string "$xa" "$C" || fail=1; fi + cur=$(csr_of); want=$(( cur | 0x803 )) + if [ "$want" != "$cur" ]; then + if has NVRAM.Add.$B.csr-active-config; then plutil -replace NVRAM.Add.$B.csr-active-config -data "$(csr_data $want)" "$C" || fail=1 + else plutil -insert NVRAM.Add.$B.csr-active-config -data "$(csr_data $want)" "$C" || fail=1; fi + rec="$rec +CSR_OLD=$cur +CSR_NEW=$want"; echo "CHANGE csr-active-config $(printf '0x%04X' $cur) -> $(printf '0x%04X' $want) (WhateverXe needs at least 0x803)" + fi + if [ $fail = 1 ] || ! plutil -lint "$C" >/dev/null; then + cp -p "$BKC" "$C"; rm -rf "$KX/WhateverXe.kext" + [ -d "$KX/AMFIPass.kext.nullmoth-xe" ] && { rm -rf "$KX/AMFIPass.kext"; mv "$KX/AMFIPass.kext.nullmoth-xe" "$KX/AMFIPass.kext"; } + case "$rec" in *AMFI_ADDED=1*) rm -rf "$KX/AMFIPass.kext";; esac + stop "editing the config failed - the original is restored" + fi + mkdir -p "$ST" && printf '%b\n' "$rec" > "$XS" || stop "could not record the change in $XS" + ok "WhateverXe added to OpenCore - restart (pick macOS in OpenCore as usual), then turn Intel Xe graphics on again to install its graphics package" + cleanup; echo "RESULT ok"; exit 0 + fi + # off + [ -f "$XS" ] || xe_pkg_in || stop "Intel Xe graphics is not on" + if xe_pkg_in; then + step "Removing WhateverXe Graphics (its author's uninstall script, SHA-256 checked)" + upstream "$XUNI_URL" "$XUNI_SHA" xe-uninstall.sh + /bin/bash "$KT/xe-uninstall.sh" > "$ST/xe-uninstall.log" 2>&1 || stop "WhateverXe Graphics removal failed (log: $ST/xe-uninstall.log)" + ok "WhateverXe Graphics removed" + fi + if [ -f "$XS" ]; then + BKC=""; AMFI_KEPT=""; AMFI_ADDED=""; AMFI_ENABLED=""; WEG_OFF=""; CSR_OLD=""; CSR_NEW=""; XARGS="" + # one key=value per line; only these keys are read, never evaluated + while IFS= read -r l; do case "$l" in + BKC=*) BKC=${l#BKC=};; AMFI_KEPT=1) AMFI_KEPT=1;; AMFI_ADDED=1) AMFI_ADDED=1;; AMFI_ENABLED=1) AMFI_ENABLED=1;; + WEG_OFF=1) WEG_OFF=1;; CSR_OLD=[0-9]*) CSR_OLD=${l#CSR_OLD=};; CSR_NEW=[0-9]*) CSR_NEW=${l#CSR_NEW=};; + ARG=-allow3d|ARG=-disablegfxfirmware) XARGS="$XARGS ${l#ARG=}";; esac; done < "$XS" + BKO="$C.nullmoth-xeoff-$(date +%Y%m%d-%H%M%S)"; cp -p "$C" "$BKO" || stop "could not back up $C$(ro_why "$C")"; fail=0 + i=$(kix WhateverXe.kext); [ -n "$i" ] && { plutil -remove Kernel.Add.$i "$C" || fail=1; }; rm -rf "$KX/WhateverXe.kext" + i=$(kix AMFIPass.kext) + if [ "$AMFI_ADDED" = 1 ]; then [ -n "$i" ] && { plutil -remove Kernel.Add.$i "$C" || fail=1; }; rm -rf "$KX/AMFIPass.kext" + elif [ "$AMFI_KEPT" = 1 ] && [ -d "$KX/AMFIPass.kext.nullmoth-xe" ]; then rm -rf "$KX/AMFIPass.kext"; mv "$KX/AMFIPass.kext.nullmoth-xe" "$KX/AMFIPass.kext" || fail=1 + [ "$AMFI_ENABLED" = 1 ] && [ -n "$i" ] && { plutil -replace Kernel.Add.$i.Enabled -bool false "$C" || fail=1; }; fi + i=$(kix WhateverGreen.kext); [ "$WEG_OFF" = 1 ] && [ -n "$i" ] && { plutil -replace Kernel.Add.$i.Enabled -bool true "$C" || fail=1; } + if [ -n "$XARGS" ]; then xa=""; for a in $(get NVRAM.Add.$B.boot-args); do case " $XARGS " in *" $a "*) ;; *) xa="$xa $a";; esac; done + plutil -replace NVRAM.Add.$B.boot-args -string "${xa# }" "$C" || fail=1; fi + # SIP goes back only when nothing else changed it since + [ -n "$CSR_NEW" ] && [ "$(csr_of)" = "$CSR_NEW" ] && { plutil -replace NVRAM.Add.$B.csr-active-config -data "$(csr_data "$CSR_OLD")" "$C" || fail=1; } + if [ $fail = 1 ] || ! plutil -lint "$C" >/dev/null; then cp -p "$BKO" "$C"; stop "editing the config failed - it is as it was (backup: $BKO)"; fi + rm -f "$XS"; ok "WhateverXe taken out of OpenCore (backup: $BKO)" + fi + ok "Intel Xe graphics off - restart to finish"; cleanup; echo "RESULT ok"; exit 0 +fi + if [ -n "${GPUTEST:-}" ]; then # The app's "AMD / Intel GPU driver (test)": NMXGPU (amdgpu, i915 and xe for macOS) for the AMD and Intel GPUs this Mac # has, opt-in per vendor with nmxamd=1 / nmxintel=1. On: the GPU firmware from linux-firmware at the commit the diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index 700262bf..f5828d18 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -9,10 +9,10 @@ import WebKit import UniformTypeIdentifiers struct Package { - static let version = "2.6.2" - static let name = "nullmoth-nvidia-2.6.2.tar.gz" - static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.2/nullmoth-nvidia-2.6.2.tar.gz")! - static let sha256 = "ce896ae6a870ad340b52e2d8df9accf7daa003943eb53304a85d238f7a13da11" + static let version = "2.6.3" + static let name = "nullmoth-nvidia-2.6.3.tar.gz" + static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.3/nullmoth-nvidia-2.6.3.tar.gz")! + static let sha256 = "52d15834489dd3973a1923bad408886992858868a240024af1f0ffcc1dfbc6ef" } // The AMD/Intel GPU and NPU driver (test): its own product and package, pinned like the NVIDIA driver's. An empty pin // means no build of it is published yet. @@ -521,6 +521,8 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe case "early": if let on = b["on"] as? Bool { UpdateChannel.set(on: on) } send("early", ["on": UpdateChannel.isOn]) + // Intel Xe graphics through WhateverXe (setup --xe): setup downloads WhateverXe and its author's parts itself + case "xe": run(mode: "verbose", pkg: "", efi: b["efi"] as? String ?? "auto", extra: ["--xe", (b["on"] as? Bool ?? false) ? "on" : "off"]) case "gputest": let on = b["on"] as? Bool ?? false, efi = b["efi"] as? String ?? "auto" let extra = ["--gpu-test", on ? "on" : "off", "--tool", Bundle.main.resourceURL!.appendingPathComponent("NullMothSafe.efi").path] @@ -549,6 +551,10 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe let words = Set(listing.split(whereSeparator: { $0.isWhitespace }).map(String.init)) return expected.intersection(words).count } + // the Intel GPUs WhateverXe 0.6.1 selects a backend for (its docs/device-selection.md); setup checks the same list + static let xeIds: Set = ["9A40", "9A49", "9A60", "9A68", "9A70", "9A78", "46D0", "46D1", "46D2", "46D3", "46D4", + "46A3", "46A6", "46A8", "46AA", "46B3", "46C3", "A7A0", "A7A1", "A7A8", "A7A9", "A7AA", "A7AB", "A7AC", "A7AD", + "4680", "4682", "4688", "468A", "468B", "4690", "4692", "4693", "A780", "A781", "A782", "A783", "A788", "A789", "A78A", "A78B"] static func scanMac(_ table: [String: Any]) -> [String: Any] { let ids = table["ids"] as? [String: String] ?? [:], tested = table["tested"] as? [String] ?? [] let gpus: [[String: Any]] = pciDisplays().map { g in @@ -556,6 +562,7 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe var r = g r["name"] = nv ? (ids[dev] ?? "NVIDIA \(dev)") : ((g["model"] as? String).flatMap { $0.isEmpty ? nil : $0 } ?? "\(g["vendor"]!):\(dev)") r["supported"] = nv && ids[dev] != nil; r["tested"] = nv && tested.contains(dev) + r["xe"] = g["vendor"] as? String == "8086" && App.xeIds.contains(dev.uppercased()) return r } let os = ProcessInfo.processInfo.operatingSystemVersion @@ -586,7 +593,7 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe cls >> 16 != 0x04, let d = u32(s, "device-id") else { return nil } return String(format: "10DE:%04X", d & 0xffff) } - return ["macos": "\(os.majorVersion).\(os.minorVersion).\(os.patchVersion)", "major": os.majorVersion, "arch": arch, + return ["macos": "\(os.majorVersion).\(os.minorVersion).\(os.patchVersion)", "major": os.majorVersion, "minor": os.minorVersion, "arch": arch, "gpus": gpus, "opencore": oc, "kexts": kexts, "files": files, "metal": metal.names, "metalSource": metal.source, "packages": findPackages(), "version": Package.version, "installedDriverVersion": recordedDriverVersion(), "safemode": safe, "record": fm.fileExists(atPath: "/Library/NullMoth/state"), "crashes": driverCrashes().map(\.lastPathComponent), diff --git a/mac/efi-safe/src/main.rs b/mac/efi-safe/src/main.rs index f9aa7d6b..39f8ef91 100644 --- a/mac/efi-safe/src/main.rs +++ b/mac/efi-safe/src/main.rs @@ -11,9 +11,16 @@ use uefi::{cstr16, guid, print, println, Char16}; const APPLE_BOOT: VariableVendor = VariableVendor(guid!("7c436110-ab2a-4bbb-a880-fe41995c9f82")); const SAFE: &[u8] = b"-nvoff"; +// "once" also starts this one time without WhateverXe (Lilu's off switch for it), so a Mac whose Intel Xe graphics +// leaves the screen dark gets a desktop back the same way; on a Mac without WhateverXe the word does nothing. +const XE_OFF: &[u8] = b"-wexoff"; + +fn has_word(args: &[u8], word: &[u8]) -> bool { + args.split(|&b| b == b' ' || b == 0).any(|w| w == word) +} fn has_safe(args: &[u8]) -> bool { - args.split(|&b| b == b' ' || b == 0).any(|w| w == SAFE) + has_word(args, SAFE) } fn fail(msg: &str, st: Status) -> Status { @@ -100,14 +107,23 @@ fn main() -> Status { Err(e) if e.status() == Status::NOT_FOUND => Vec::new(), Err(e) => return fail("could not read boot-args", e.status()), }; - if has_safe(¤t) { + let mut words: Vec<&[u8]> = Vec::new(); + if !has_safe(¤t) { + words.push(SAFE); + } + if once && !has_word(¤t, XE_OFF) { + words.push(XE_OFF); + } + if words.is_empty() { println!("NullMoth: the next macOS start already has the NVIDIA driver off."); } else { let mut next = current.clone(); - if !next.is_empty() { - next.push(b' '); + for w in words { + if !next.is_empty() { + next.push(b' '); + } + next.extend_from_slice(w); } - next.extend_from_slice(SAFE); let attrs = VariableAttributes::NON_VOLATILE | VariableAttributes::BOOTSERVICE_ACCESS | VariableAttributes::RUNTIME_ACCESS; if let Err(e) = runtime::set_variable(name, &APPLE_BOOT, attrs, &next) { return fail("could not write boot-args", e.status()); diff --git a/mac/tools/test_gpu_test.py b/mac/tools/test_gpu_test.py index f9815908..6d440c2e 100644 --- a/mac/tools/test_gpu_test.py +++ b/mac/tools/test_gpu_test.py @@ -32,7 +32,7 @@ def arm(name, ok, detail=""): "LICENSES/LICENSE.intel_vpu" in paths and "LICENSES/LICENSE.amdnpu" in paths) # the awk setup runs over ioreg: each device's vendor and class are paired even when class-code comes first -awk = re.search(r"LC_ALL=C awk -F'<\|>' '(.*?)' \| sort -u\)", SETUP.read_text(), re.S).group(1).replace("\n ", " ") +awk = re.search(r"VENDORS=\$\(ioreg -r -c IOPCIDevice -l -w0 \| LC_ALL=C awk -F'<\|>' '(.*?)' \| sort -u\)", SETUP.read_text(), re.S).group(1).replace("\n ", " ") sample = """+-o PXSX@0 | "class-code" = <00000300> | "vendor-id" = <02100000> diff --git a/mac/tools/test_setup_readonly_efi.py b/mac/tools/test_setup_readonly_efi.py index 1bfb2d6a..bd59e241 100644 --- a/mac/tools/test_setup_readonly_efi.py +++ b/mac/tools/test_setup_readonly_efi.py @@ -45,6 +45,7 @@ def run(flags, mp="/Volumes/EFI"): out.strip()[-160:]) out = run('msdos, local, nodev, nosuid, noowners') check('negative control: a writable partition adds nothing', out.strip() == '[could not back up X]', out.strip()) -check('every backup stop carries the reason', src.count('stop "could not back up $C$(ro_why "$C")"') == 6 +check('every backup stop carries the reason', src.count('could not back up $C') >= 6 + and src.count('could not back up $C') == src.count('stop "could not back up $C$(ro_why "$C")"') and 'stop "could not back up $C"' not in src) sys.exit(1 if fails else 0) diff --git a/mac/tools/test_xe_whateverxe.py b/mac/tools/test_xe_whateverxe.py new file mode 100644 index 00000000..8706ce8d --- /dev/null +++ b/mac/tools/test_xe_whateverxe.py @@ -0,0 +1,193 @@ +#!/usr/bin/env python3 +"""Intel Xe graphics through WhateverXe (setup --xe): runs the setup's real block on fake OpenCore configs with stubbed +system tools. On adds WhateverXe after Lilu, the WhateverXe AMFIPass build, WhateverGreen off and SIP >= 0x803; off puts +the config back exactly; an unsupported GPU, an old macOS, the NMX Intel test driver or a bad download change nothing.""" +import base64 +import hashlib +import os +import pathlib +import plistlib +import subprocess +import tempfile +import unittest +import zipfile + +SETUP = pathlib.Path(__file__).resolve().parents[1] / "Resources/nullmoth-setup.sh" +START, END = 'if [ -n "${XE:-}" ]; then', 'if [ -n "${GPUTEST:-}" ]; then' +HS, HE = "# Kexts the driver's OpenCore setup needs", "booted_part() {" +GUID = "7C436110-AB2A-4BBB-A880-FE41995C9F82" +PINS = {"WhateverXe.kext": "46c8cd684461db7f84a971e7479770c423f73d52d45addfb48242176b9eb04fc", + "AMFIPass-Mod.zip": "71f41de42e355d2a83e6f093ef34a5b24d0a9c9a9085830b2317f1b874f56250", + "WhateverXe-Graphics.pkg": "7ac6c7149248c483efbd93555294d587a93d81392421f3af8a4f5b1b5fcc0101"} +PKG = b"pkg\n" + + +def kext(name, enabled=True): + return {"Arch": "Any", "BundlePath": name, "Enabled": enabled, "ExecutablePath": f"Contents/MacOS/{name[:-5]}", + "PlistPath": "Contents/Info.plist", "Comment": "", "MaxKernel": "", "MinKernel": ""} + + +def zipped(t, name, top): + z = os.path.join(t, name) + with zipfile.ZipFile(z, "w") as f: + f.writestr(f"{top}/Contents/Info.plist", "") + with open(z, "rb") as f: + return z, hashlib.sha256(f.read()).hexdigest() + + +def stub(b, name, body): + p = os.path.join(b, name) + with open(p, "w") as f: + f.write("#!/bin/bash\n" + body + "\n") + os.chmod(p, 0o755) + + +def run(mode, kexts, folders=("Lilu.kext",), dev="9A49", ver="15.8.1", bootargs="", csr=0x0, + loaded="", good=True, t=None, cfg_extra=None): + s = SETUP.read_text() + for a in (START, END, HS, HE): + assert s.count(a) == 1, f"anchor moved in nullmoth-setup.sh: {a}" + t = t or tempfile.mkdtemp() + oc = os.path.join(t, "EFI/OC") + cfg = os.path.join(oc, "config.plist") + if not os.path.exists(cfg): + for f in folders: + os.makedirs(os.path.join(oc, "Kexts", f, "Contents"), exist_ok=True) + with open(os.path.join(oc, "Kexts", f, "Contents/Info.plist"), "w") as fh: + fh.write("" + f + "") + nv = {"boot-args": bootargs} + if csr is not None: + nv["csr-active-config"] = csr.to_bytes(4, "little") + c = {"Kernel": {"Add": kexts}, "NVRAM": {"Add": {GUID: nv}}} + c.update(cfg_extra or {}) + os.makedirs(oc, exist_ok=True) + with open(cfg, "wb") as fh: + plistlib.dump(c, fh) + wz, wsha = zipped(t, "wex.zip", "WhateverXe.kext") + az, asha = zipped(t, "amfi.zip", "AMFIPass.kext") + b = os.path.join(t, "bin"); os.makedirs(b, exist_ok=True) + stub(b, "curl", f'out=""; url=""; while [ $# -gt 0 ]; do case "$1" in -o) out=$2; shift;; http*) url=$1;; esac; shift; done\n' + f'case "$url" in *WhateverXe-0.6.1*) cp "{wz}" "$out";; *AMFIPass*) cp "{az}" "$out";; ' + f'*.pkg) echo pkg > "$out";; *) exit 22;; esac') + stub(b, "sysctl", 'echo GenuineIntel') + d = dev.lower() + stub(b, "ioreg", f'echo "+-o IGPU"; echo \' "vendor-id" = <86800000>\'; echo \' "device-id" = <{d[2:]}{d[:2]}0000>\'; ' + f'echo \' "class-code" = <00000300>\'') + stub(b, "sw_vers", f'echo {ver}') + stub(b, "kmutil", f'echo "{loaded}"') + stub(b, "nvram", f'printf "boot-args\\t{bootargs}\\n"') + stub(b, "installer", f'echo installed > "{t}/installed"') + stub(b, "pkgutil", f'[ -f "{t}/installed" ] && echo org.b00t0x.WhateverXe.Common; true') + block = 'KT=""\n' + s[s.index(HS):s.index(HE)] + s[s.index(START):s.index(END)] + fake = {"WhateverXe.kext": wsha, "AMFIPass-Mod.zip": asha, "WhateverXe-Graphics.pkg": hashlib.sha256(PKG).hexdigest()} + for k, real in PINS.items(): + block = block.replace(real, fake[k] if good else "0" * 64) + st = os.path.join(t, "state"); os.makedirs(st, exist_ok=True) + script = (f'C="{cfg}"; B={GUID}; ST="{st}"; XE={mode}\n' + 'has() { plutil -extract "$1" raw -o - "$C" >/dev/null 2>&1; }\n' + 'get() { plutil -extract "$1" raw -o - "$C" 2>/dev/null; }\n' + 'step() { echo "STEP $*"; }; ok() { echo "OK $*"; }; note() { echo "NOTE $*"; }; ro_why() { :; }\n' + 'cleanup() { :; }; stop() { echo "STOP $*"; exit 3; }\n' + + s[s.index("csr_of() {"):s.index("\n", s.index("csr_data() {"))] + "\n" + + block) + env = dict(os.environ, PATH=b + ":" + os.environ["PATH"]) + r = subprocess.run(["/bin/bash", "-c", script], capture_output=True, text=True, timeout=60, env=env) + with open(cfg, "rb") as fh: + c = plistlib.load(fh) + return r.returncode, r.stdout + r.stderr, c, t + + +def names(c): + return [(k["BundlePath"], k["Enabled"]) for k in c["Kernel"]["Add"]] + + +def csr(c): + return int.from_bytes(c["NVRAM"]["Add"][GUID]["csr-active-config"], "little") + + +BASE = [kext("Lilu.kext"), kext("VirtualSMC.kext"), kext("WhateverGreen.kext")] + + +class Xe(unittest.TestCase): + def test_on_adds_whateverxe_after_lilu_and_turns_whatevergreen_off(self): + rc, out, c, _ = run("on", list(BASE), folders=("Lilu.kext", "VirtualSMC.kext", "WhateverGreen.kext"), csr=0x0) + self.assertEqual(rc, 0, out) + self.assertEqual(names(c), [("Lilu.kext", True), ("WhateverXe.kext", True), ("AMFIPass.kext", True), + ("VirtualSMC.kext", True), ("WhateverGreen.kext", False)], out) + self.assertEqual(csr(c) & 0x803, 0x803, out) + self.assertEqual(c["NVRAM"]["Add"][GUID]["boot-args"].split(), ["-allow3d", "-disablegfxfirmware"], out) + self.assertIn("restart", out) + + def test_off_removes_only_the_boot_arguments_it_added(self): + rc, out, c, t = run("on", list(BASE), folders=("Lilu.kext",), bootargs="keepsyms=1 -allow3d", csr=0x0A43) + self.assertEqual(rc, 0, out) + self.assertEqual(c["NVRAM"]["Add"][GUID]["boot-args"].split(), ["keepsyms=1", "-allow3d", "-disablegfxfirmware"], out) + rc, out, c, _ = run("off", None, t=t) + self.assertEqual(rc, 0, out) + self.assertEqual(c["NVRAM"]["Add"][GUID]["boot-args"].split(), ["keepsyms=1", "-allow3d"], out) + + def test_off_puts_the_config_back_exactly(self): + before = list(BASE) + rc, out, c, t = run("on", before, folders=("Lilu.kext", "VirtualSMC.kext", "WhateverGreen.kext"), csr=0x0A43) + self.assertEqual(rc, 0, out) + rc, out, c, _ = run("off", None, t=t) + self.assertEqual(rc, 0, out) + self.assertEqual(names(c), [(k["BundlePath"], k["Enabled"]) for k in before], out) + self.assertEqual(csr(c), 0x0A43, out) + self.assertFalse(os.path.exists(os.path.join(t, "EFI/OC/Kexts/WhateverXe.kext")), out) + self.assertFalse(os.path.exists(os.path.join(t, "EFI/OC/Kexts/AMFIPass.kext")), out) + + def test_an_existing_amfipass_is_kept_aside_and_comes_back(self): + start = [kext("Lilu.kext"), kext("AMFIPass.kext")] + rc, out, c, t = run("on", start, folders=("Lilu.kext", "AMFIPass.kext"), csr=0x0A43) + self.assertEqual(rc, 0, out) + self.assertIn("AMFIPass.kext.nullmoth-xe", out) + rc, out, c, _ = run("off", None, t=t) + self.assertEqual(rc, 0, out) + self.assertEqual(names(c), [("Lilu.kext", True), ("AMFIPass.kext", True)], out) + with open(os.path.join(t, "EFI/OC/Kexts/AMFIPass.kext/Contents/Info.plist")) as fh: + info = fh.read() + self.assertIn("AMFIPass.kext", info, "the user's own AMFIPass must be the one back in place") + + def test_sip_set_higher_by_the_nvidia_driver_is_left_alone(self): + rc, out, c, _ = run("on", list(BASE), folders=("Lilu.kext",), csr=0x0A43) + self.assertEqual(rc, 0, out) + self.assertEqual(csr(c), 0x0A43, out) + self.assertNotIn("csr-active-config", out) + + def test_second_run_with_whateverxe_loaded_installs_the_graphics_package(self): + rc, out, c, t = run("on", list(BASE), folders=("Lilu.kext",), loaded="org.b00t0x.WhateverXe (0.6.1) X") + self.assertEqual(rc, 0, out) + self.assertTrue(os.path.exists(os.path.join(t, "installed")), out) + self.assertNotIn(("WhateverXe.kext", True), names(c), "the package step does not touch the config") + + # negative controls: each must stop with the config untouched + def assert_untouched(self, **kw): + rc, out, c, _ = run("on", list(BASE), folders=("Lilu.kext",), **kw) + self.assertEqual(rc, 3, out) + self.assertEqual(names(c), [(k["BundlePath"], k["Enabled"]) for k in BASE], out) + return out + + def test_unsupported_intel_gpu_is_refused(self): + self.assertIn("not one WhateverXe supports", self.assert_untouched(dev="3E92")) + + def test_old_macos_is_refused(self): + self.assertIn("15.8 or later", self.assert_untouched(ver="15.7.4")) + + def test_tahoe_before_26_7_is_refused(self): + self.assertIn("26.7 or later", self.assert_untouched(ver="26.6.2")) + + def test_the_nmx_intel_test_driver_blocks_it(self): + self.assertIn("turn it off first", self.assert_untouched(bootargs="-nmxintel keepsyms=1")) + + def test_a_download_with_the_wrong_hash_changes_nothing(self): + self.assertIn("SHA-256", self.assert_untouched(good=False)) + + def test_no_lilu_is_refused(self): + rc, out, c, _ = run("on", [kext("VirtualSMC.kext")], folders=()) + self.assertEqual(rc, 3, out) + self.assertIn("needs Lilu", out) + + +if __name__ == "__main__": + unittest.main() From 1792b45a6be9dc582a0f5e7b62eb60947932f604 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 27 Oct 2026 20:42:31 -0700 Subject: [PATCH 002/244] Mac app 2.6.3: version and the driver's uninstaller --- mac/Resources/nullmoth-uninstall.sh | 1 + mac/build.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mac/Resources/nullmoth-uninstall.sh b/mac/Resources/nullmoth-uninstall.sh index e1b46bde..06c3df72 100755 --- a/mac/Resources/nullmoth-uninstall.sh +++ b/mac/Resources/nullmoth-uninstall.sh @@ -96,6 +96,7 @@ launchctl bootout system/com.nullmoth.bootguard 2>/dev/null || true rm -f /Library/LaunchDaemons/com.nullmoth.bootguard.plist /Library/NullMoth/bootguard.sh || die "cannot remove the boot-guard job" nvram -d 7C436110-AB2A-4BBB-A880-FE41995C9F82:nullmoth-nv-starts 2>/dev/null || true nvram -d 7C436110-AB2A-4BBB-A880-FE41995C9F82:nullmoth-nv-ok 2>/dev/null || true +nvram -d 7C436110-AB2A-4BBB-A880-FE41995C9F82:nullmoth-backlight 2>/dev/null || true if [ "$REMOVE_KC" = 1 ]; then rm -f "$KC" "$KC.nullmoth-install-new" "$KC.nullmoth-update-new" "$KC.nullmoth-remove-new" || die "cannot remove the auxiliary collection" elif [ "$CANDIDATE" = "$NEWKC" ]; then diff --git a/mac/build.sh b/mac/build.sh index 5d475d24..a94464f7 100644 --- a/mac/build.sh +++ b/mac/build.sh @@ -66,8 +66,8 @@ cat > "$APP/Contents/Info.plist" <CFBundleName1401 CFBundleDisplayName1401 CFBundlePackageTypeAPPL -CFBundleShortVersionString2.6.2 -CFBundleVersion121 +CFBundleShortVersionString2.6.3 +CFBundleVersion122 LSMinimumSystemVersion15.0 NSHumanReadableCopyright© 2026 NullMoth Systems NSHighResolutionCapable From dd73558242164b09eca4470774828ece9227905a Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 27 Oct 2026 20:42:48 -0700 Subject: [PATCH 003/244] Changelog 2.6.3 --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a21654d..7a3039c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,16 @@ Each release also bundles the NVIDIA driver and Mac app of the same version; see the [driver changelog](https://github.com/nullmoth/nvidia-macos-driver/blob/main/CHANGELOG.md). +## 2.6.3 +- Mac app: Intel Xe graphics for Tiger Lake, Alder Lake and Raptor Lake on macOS 15.8 or 26.7 and later, through b00t0x's WhateverXe (thanks b00t0x). It shows only on the Intel GPUs WhateverXe supports, downloads its parts from the author's GitHub with every file checked, and **Turn it off** puts the config back as it was. +- Mac app: **Allow an app...** under Microphone and camera lets an app such as Discord use the microphone, camera and screen recording. With the driver installed macOS never asks, so those apps got silence. The method follows tccplus by Jeremy Legendre. +- Mac app: when the driver is parked by "Start once without NVIDIA driver" or -nvoff, a **Turn the driver on** button removes only that switch. +- Mac app: the AMD / Intel test driver checks SIP before it downloads anything, and skips a firmware mirror that refuses the download. +- Mac app: Macs using itlwm for Wi-Fi are told to install HeliPort, the app itlwm joins networks through. +- The boot picker's "Start once without NVIDIA driver" also starts that one time without WhateverXe. +- MediaTek RZ616 Bluetooth works: its USB ID gets the firmware entry of its family (#336). +- Bundles NVIDIA driver 2.6.3. + ## 2.6.2 - When the stick does not start macOS, 1401 for Windows now says what to change, in numbered steps, before it offers to send the logs. It reads the stick's logs, the line you type for where the screen stopped, and this PC's scan, and covers: no room in memory to start (EB.MM.AKM), Secure Boot blocking OpenCore's drivers, a stick missing HfsPlus.efi, the Windows entry chosen instead of 1401, a freeze at EXITBS:START (with the settings for your CPU: VT-d on Intel, IOMMU on AMD), a stop at PCI configuration, a black screen with only a cursor after the install, a kernel panic, the prohibited sign, no macOS entry in the menu, an installer that shows no disk (AHCI, VMD) and "waiting for root device". - EFI builds work on Windows accounts whose names are not in English: OpenCore's validator could not read the config from such a folder, and every build there stopped with "ocvalidate issues=0" (115 builds). From 368e823dfa2dae3991c3a838e8454f3fd8ed11d1 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 27 Oct 2026 20:47:25 -0700 Subject: [PATCH 004/244] Mac app: the boot tool is built with its build paths left out --- mac/Resources/NullMothSafe.efi | Bin 29184 -> 29184 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/mac/Resources/NullMothSafe.efi b/mac/Resources/NullMothSafe.efi index 61cfe54edfa83f4d6fcb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3})91iFcUxHv9n@gN#leuf)P4rdv(Ts#iF3f) z<0IJ>I`o;*&@{;OaI`&x#(wLu30{J|9*zMllJ=L3wOk0Mle3~T|J*3tHMs8~RZD0t z%|_9>ab%y;Xv|Zd(3BE-8ySCqa8E}sI;>V2zhYb`YI` zEj4~-G~OAF{cdAJO{JLESS*Pr!Q+|fSC6&ana#+M-MG$R4l?G z;fwqRdS(QYTVUzsPYywZSE@rQE{94RIiT0z&4*Xd_J0l0)6Uj21kQT}k(XSbS0f=s z++Lq9LdqfA&x2hY2-SWetXm*-`YFg081VBTcfi5liJXEE{~JUPB*2#Zg|iDdL)h3^ z+>M!UOjuVhu6^zimQ+F3{4a@yvtM9O$Tu)EEZZ?fK{s+-r%L-&rG2e;e@^efQeR9W zP66k`(#R%mQuq`?u5+FdU$cH!@kGL-?ni7|)%9>7twb4;QTX8qzEWSV& z{=n7`iiT(LZ=OQLAou8%ep~=KcpM#4zSWNAaaCXY6JM!#;l!$zyuud*IX&NT7L9Ob z2*b;$1s7bnU>pQ+1_kMbrmy`#NI^7!&`1TA^Inn{e4~^Hwc69&sQ*Nu=1-bdC3wiNT z@P%d!u~51>9+<$GPX0Z zeT?`j>_=li9fiX&Td*aFxuIyhm%-YA63ga^qA(@`xX z-}hJA`h1V^XqF0Zlxdm3kq@LGa6G>t*iax9d@m0BE{DAZHp#Lz4+`j9@H>dX4UP$3*A3Rm>Q(h! zjrvCCrp~6`CfSLB6J00En)fufHFq|5H9MbDok~2lJuG8J8d+8DvF^m$M zu-dj-@o~%Jvg1YdgY{(%dm5S=+8VkW1{$1oVY)KiPTfIWldeVAsT;7;4eFT2qQ;uW Q?#8mFCJe+KEXpJQ2TR=Zvj6}9 From 0dd49f15e0446866f20194d56b2fc3c141001f90 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 27 Oct 2026 21:02:46 -0700 Subject: [PATCH 005/244] 1401 2.6.3: bundles driver and Mac app 2.6.3 --- mac/Sources/main.swift | 2 +- mac/build.sh | 2 +- p1401/nullmoth.py | 6 +++--- windows/App/App.csproj | 2 +- windows/App/app.manifest | 2 +- windows/release-inputs.json | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index f5828d18..3a37a159 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -12,7 +12,7 @@ struct Package { static let version = "2.6.3" static let name = "nullmoth-nvidia-2.6.3.tar.gz" static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.3/nullmoth-nvidia-2.6.3.tar.gz")! - static let sha256 = "52d15834489dd3973a1923bad408886992858868a240024af1f0ffcc1dfbc6ef" + static let sha256 = "5fca1043e4855142128df8ab22b0c52747a6e8a8d6a346fe73a17e68f2519988" } // The AMD/Intel GPU and NPU driver (test): its own product and package, pinned like the NVIDIA driver's. An empty pin // means no build of it is published yet. diff --git a/mac/build.sh b/mac/build.sh index a94464f7..e23a2ca9 100644 --- a/mac/build.sh +++ b/mac/build.sh @@ -67,7 +67,7 @@ cat > "$APP/Contents/Info.plist" <CFBundleDisplayName1401 CFBundlePackageTypeAPPL CFBundleShortVersionString2.6.3 -CFBundleVersion122 +CFBundleVersion124 LSMinimumSystemVersion15.0 NSHumanReadableCopyright© 2026 NullMoth Systems NSHighResolutionCapable diff --git a/p1401/nullmoth.py b/p1401/nullmoth.py index bc8cf970..7af5dfac 100644 --- a/p1401/nullmoth.py +++ b/p1401/nullmoth.py @@ -29,9 +29,9 @@ BOOT_ARGS = ("nvfb=1", "nvaccel=1", "nvfbheads=4", "-nvkmsnosmooth", "amfi_get_out_of_my_way=0x1", "amfi=0x80", "ipc_control_port_options=0") # Package published with the driver; the stick carries it so the Mac companion can install it offline. -PACKAGE = {"name": "nullmoth-nvidia-2.6.2.tar.gz", - "url": "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.2/nullmoth-nvidia-2.6.2.tar.gz", - "sha256": "ce896ae6a870ad340b52e2d8df9accf7daa003943eb53304a85d238f7a13da11"} +PACKAGE = {"name": "nullmoth-nvidia-2.6.3.tar.gz", + "url": "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.3/nullmoth-nvidia-2.6.3.tar.gz", + "sha256": "5fca1043e4855142128df8ab22b0c52747a6e8a8d6a346fe73a17e68f2519988"} with open(os.path.join(HERE, "nvidia_gsp_ids.json")) as _fh: TABLE = json.load(_fh) diff --git a/windows/App/App.csproj b/windows/App/App.csproj index 5d95f9e0..1ab62487 100644 --- a/windows/App/App.csproj +++ b/windows/App/App.csproj @@ -8,7 +8,7 @@ AnyCPU false app.manifest - 2.6.2 + 2.6.3 NullMoth Systems NullMoth Systems © 2026 NullMoth Systems diff --git a/windows/App/app.manifest b/windows/App/app.manifest index ad0ac9ba..aba2e52d 100644 --- a/windows/App/app.manifest +++ b/windows/App/app.manifest @@ -1,6 +1,6 @@ - + diff --git a/windows/release-inputs.json b/windows/release-inputs.json index aed91511..1a7a5592 100644 --- a/windows/release-inputs.json +++ b/windows/release-inputs.json @@ -1,9 +1,9 @@ { "baseline_url": "https://github.com/nullmoth/1401/releases/download/v1.14.3/1401-Windows-1.14.3.zip", "baseline_sha256": "e287bf4b09805dbf697f915fa6867a15a422764c46b8733dfd9f46bc0e6043b6", - "driver_release": "v2.6.2", - "mac_asset": "1401-Mac-2.6.2.zip", - "mac_sha256": "72a99f0859b5c0c89f580c71052c04f0b4ea627d68457fd18d61d3a555449428", + "driver_release": "v2.6.3", + "mac_asset": "1401-Mac-2.6.3.zip", + "mac_sha256": "0968beedfb8d4f0a3de20617b9c2fbb60bdaec4aed54448176f45ced34ded9a0", "opencore_url": "https://github.com/acidanthera/OpenCorePkg/releases/download/1.0.8/OpenCore-1.0.8-RELEASE.zip", "opencore_sha256": "2011e8b7216ecb2645d97ea710df965947edd406846e92050b9bc4190be6d27b", "fixture_slug": "optiplex-5050-micro", From 12c3549f02556109aa0cf2ef6638ae17da494543 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 27 Oct 2026 21:23:43 -0700 Subject: [PATCH 006/244] Mac tests: log deadline timings hold under a full parallel run --- mac/tools/test_log_query_deadline.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mac/tools/test_log_query_deadline.py b/mac/tools/test_log_query_deadline.py index b70cbccb..478f78f2 100644 --- a/mac/tools/test_log_query_deadline.py +++ b/mac/tools/test_log_query_deadline.py @@ -5,7 +5,10 @@ is left of the run, and one that starts after the deadline is skipped and says so; the files already written stay whole. Exercises the production lshow/bounded helpers against an owned stalling command.""" from pathlib import Path -import os, shlex, subprocess, sys, tempfile, time, unittest +import os, re, shlex, subprocess, sys, tempfile, time, unittest +# Timings are checked against what they prove, not to the second: the suite runs these beside ~100 other tests, so a +# shell can start a second late ("after 1 s" for a 2 s deadline). A helper that ignored the deadline would run to the +# stub's 30 s stall and hit the 8 s subprocess timeout, so every bound below still fails it. ROOT = Path(__file__).resolve().parents[1] @@ -34,21 +37,21 @@ def test_a_query_is_cut_at_the_runs_deadline_not_its_own_cap(self): run, elapsed = self.run_helper('lshow 30 fixture; echo STATUS=$?', deadline_in=2) self.assertEqual(run.returncode, 0, run.stderr) self.assertIn('retained evidence', run.stdout) - self.assertIn('log query stopped after 2 s', run.stdout) + self.assertRegex(run.stdout, r'log query stopped after [12] s') self.assertIn('STATUS=143', run.stdout) - self.assertLess(elapsed, 5) + self.assertLess(elapsed, 7) def test_a_query_after_the_deadline_is_skipped_and_says_so(self): run, elapsed = self.run_helper('lshow 30 fixture; echo STATUS=$?', deadline_in=-1) self.assertIn('log query skipped: the collection', run.stdout) self.assertNotIn('retained evidence', run.stdout) self.assertIn('STATUS=124', run.stdout) - self.assertLess(elapsed, 2) + self.assertLess(elapsed, 5) def test_a_query_well_inside_the_deadline_keeps_its_own_cap(self): run, elapsed = self.run_helper('lshow 1 fixture; echo STATUS=$?', deadline_in=300) self.assertIn('log query stopped after 1 s', run.stdout) - self.assertLess(elapsed, 4) + self.assertLess(elapsed, 7) def test_without_a_deadline_the_helper_behaves_as_before(self): run, _ = self.run_helper('unset COLLECT_DEADLINE; lshow 1 fixture; echo STATUS=$?', deadline_in=-100, stall=False) @@ -58,8 +61,8 @@ def test_without_a_deadline_the_helper_behaves_as_before(self): def test_bounded_wraps_any_command_the_same_way(self): run, elapsed = self.run_helper('bounded 30 "$QUERY" extra; echo STATUS=$?', deadline_in=2) self.assertIn('retained evidence', run.stdout) - self.assertIn('stopped after 2 s', run.stdout) - self.assertLess(elapsed, 5) + self.assertRegex(run.stdout, r'stopped after [12] s') + self.assertLess(elapsed, 7) run, _ = self.run_helper('bounded 5 "$QUERY"; echo STATUS=$?', deadline_in=-1) self.assertIn('skipped: the collection', run.stdout) self.assertIn('STATUS=124', run.stdout) From aac78ab2e6b8b5546f95314973cf764b8b37e546 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 27 Oct 2026 22:55:03 -0700 Subject: [PATCH 007/244] Mac app: the AMD test driver leaves GPUs Apple's own drivers run --- mac/Resources/nullmoth-setup.sh | 13 ++++++ mac/tools/test_gpu_test_apple_amd.py | 60 ++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 mac/tools/test_gpu_test_apple_amd.py diff --git a/mac/Resources/nullmoth-setup.sh b/mac/Resources/nullmoth-setup.sh index 508914a9..eae47718 100755 --- a/mac/Resources/nullmoth-setup.sh +++ b/mac/Resources/nullmoth-setup.sh @@ -1160,6 +1160,19 @@ if [ -n "${GPUTEST:-}" ]; then IGOFF=$(echo $IGOFF | tr ' ' '\n' | sort -u | tr '\n' ' '); IGOFF=${IGOFF% } if [ -n "$IGOFF" ]; then VENDORS="$VENDORS $IGV"; WANT="$WANT $IGW"; note "the $IGN GPU is switched off in OpenCore ($IGOFF): it is turned back on for the test driver"; fi fi + # An AMD GPU that Apple's own drivers on this Mac list (RX 400/500, Vega, RX 5000/6000 cards Apple shipped) already + # runs with Metal; the test driver took such cards anyway and stopped them at attach (RX 580 and RX 6800/6900 Macs, + # 10-22 to 10-27). Apple's lists are read from this Mac's kexts, so they match its macOS. Other AMD GPUs keep it. + if [ "$GPUTEST" = on ] && echo " $WANT " | grep -q " -nmxamd "; then + AMDIDS=$(ioreg -r -c IOPCIDevice -l -w0 | LC_ALL=C awk -F'<|>' '/\+-o /{if (c=="03" && v=="1002") print d; c=""; v=""; d=""} + /"vendor-id" =/{v=substr($2,3,2) substr($2,1,2)} /"device-id" =/{d=toupper(substr($2,3,2) substr($2,1,2))} /"class-code" =/{c=substr($2,5,2)} + END{if (c=="03" && v=="1002") print d}' | sort -u) + APPLEIDS=$(for k in /System/Library/Extensions/AMD*Controller.kext /System/Library/Extensions/AMDRadeonX*.kext; do + [ -f "$k/Contents/Info.plist" ] && plutil -p "$k/Contents/Info.plist" 2>/dev/null; done | grep -oE '0x[0-9A-Fa-f]{4}1002' | cut -c3-6 | tr a-f A-F | sort -u) + OURS=""; for d in $AMDIDS; do echo "$APPLEIDS" | grep -qx "$d" && note "AMD GPU 1002:$d runs on Apple's own driver: the test driver leaves it alone" || OURS="$OURS $d"; done + if [ -n "$AMDIDS" ] && [ -z "$OURS" ]; then WANT=$(echo " $WANT " | sed 's/ -nmxamd / /'); WANT=$(echo $WANT) + [ -n "$WANT" ] || stop "this Mac's AMD GPU already runs on Apple's own driver, with Metal; the test driver is only for GPUs macOS has no driver for. Nothing was changed"; fi + fi if [ "$GPUTEST" = on ]; then [ -n "$WANT" ] || stop "this Mac has no AMD or Intel GPU for this driver (none is on macOS's PCI list, and no disable-gpu on ${IGPU:-the processor GPU} in OpenCore to undo)" # /Library/GPUBundles is SIP-restricted (rootless.conf: KernelExtensionManagement), so the Vulkan drivers cannot be diff --git a/mac/tools/test_gpu_test_apple_amd.py b/mac/tools/test_gpu_test_apple_amd.py new file mode 100644 index 00000000..95c78ff7 --- /dev/null +++ b/mac/tools/test_gpu_test_apple_amd.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 +"""The AMD/Intel test driver leaves AMD GPUs that Apple's own drivers list (they already run with Metal) and still +takes the ones macOS has no driver for. Runs the setup's real block with a stubbed ioreg and kexts made in a temp dir.""" +import os, pathlib, plistlib, subprocess, tempfile, unittest + +SETUP = pathlib.Path(__file__).resolve().parents[1] / "Resources/nullmoth-setup.sh" +START = " # An AMD GPU that Apple's own drivers on this Mac list" +END = ' if [ "$GPUTEST" = on ]; then\n [ -n "$WANT" ] || stop' + + +def run(gpus, want): + s = SETUP.read_text() + assert s.count(START) == 1 and s.count(END) == 1, "anchors moved in nullmoth-setup.sh" + t = tempfile.mkdtemp() + ext = os.path.join(t, "Extensions") + for name, ids in (("AMD9500Controller", "0x67DF1002 0x67EF1002"), ("AMDRadeonX6000", "0x73BF1002 0x73A51002")): + os.makedirs(os.path.join(ext, name + ".kext", "Contents")) + with open(os.path.join(ext, name + ".kext", "Contents", "Info.plist"), "wb") as f: + plistlib.dump({"IOKitPersonalities": {name: {"IOPCIMatch": ids}}}, f) + lines = [] + for vendor, dev in gpus: # ioreg prints both ids little-endian + lines += ["+-o GFX", f' "vendor-id" = <{vendor[2:]}{vendor[:2]}0000>', f' "device-id" = <{dev[2:].lower()}{dev[:2].lower()}0000>', + ' "class-code" = <00000300>'] + b = os.path.join(t, "bin"); os.makedirs(b) + with open(os.path.join(b, "ioreg"), "w") as f: + f.write("#!/bin/bash\ncat <<'EOF'\n" + "\n".join(lines) + "\nEOF\n") + os.chmod(os.path.join(b, "ioreg"), 0o755) + block = s[s.index(START):s.index(END)].replace("/System/Library/Extensions", ext) + script = (f'GPUTEST=on; WANT="{want}"\nnote() {{ echo "NOTE $*"; }}; stop() {{ echo "STOP $*"; exit 3; }}\n' + + block + '\necho "WANT=[$WANT]"\n') + r = subprocess.run(["/bin/bash", "-c", script], capture_output=True, text=True, timeout=30, + env=dict(os.environ, PATH=b + ":" + os.environ["PATH"])) + return r.returncode, r.stdout + r.stderr + + +class AppleAmd(unittest.TestCase): + def test_an_rx580_alone_is_left_to_apple_and_says_why(self): + rc, out = run([("1002", "67DF")], "-nmxamd") + self.assertEqual(rc, 3, out) + self.assertIn("already runs on Apple's own driver", out) + + def test_an_rx7600_macos_has_no_driver_for_still_gets_the_test_driver(self): + rc, out = run([("1002", "7480")], "-nmxamd") + self.assertEqual(rc, 0, out) + self.assertIn("WANT=[-nmxamd]", out) + + def test_apple_amd_plus_intel_goes_ahead_for_intel_only(self): + rc, out = run([("1002", "73BF"), ("8086", "9A49")], "-nmxamd -nmxintel") + self.assertEqual(rc, 0, out) + self.assertIn("WANT=[-nmxintel]", out) + self.assertIn("1002:73BF runs on Apple's own driver", out) + + def test_an_unsupported_amd_igpu_beside_an_apple_card_keeps_the_amd_driver(self): + rc, out = run([("1002", "67DF"), ("1002", "164E")], "-nmxamd") + self.assertEqual(rc, 0, out) + self.assertIn("WANT=[-nmxamd]", out) + + +if __name__ == "__main__": + unittest.main() From 72d2408ed7caee38807b839deaf848c5cfe731b0 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Wed, 28 Oct 2026 16:49:42 -0700 Subject: [PATCH 008/244] Strix Point laptops are offered the USB lag fix (#121) --- p1401/community.py | 5 ++++- tests/test_community.py | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/p1401/community.py b/p1401/community.py index 6d693ca1..4df40659 100644 --- a/p1401/community.py +++ b/p1401/community.py @@ -69,7 +69,10 @@ }, { # AMD laptops whose xHCI controllers have one MSI vector: input lags seconds behind without it "name": "XhciNudge", "repo": "MonkaKokosowa/XhciNudge", "section": "USB Controllers", "experimental": True, - "ids": ["1022-161D", "1022-161E", "1022-15D6", "1022-15D7"], + # Strix Point (Ryzen AI 300) xHCI: a Razer Blade 14 on a Ryzen AI 9 365 shows the same lag (1401 #121). The kext + # nudges only controllers in D0 with MSI on and never writes them, so a controller that does not need it only + # takes one extra interrupt per interval. + "ids": ["1022-161D", "1022-161E", "1022-15D6", "1022-15D7", "1022-151A", "1022-151B", "1022-151E", "1022-151F"], "builds": { v: ("https://github.com/MonkaKokosowa/XhciNudge/releases/download/1.0/XhciNudge-1.0.0.zip", 8304, "271659aec947aa2d01300eadb514b138909e6322305163ddcab653403251bd1f") for v in (SEQUOIA, TAHOE) diff --git a/tests/test_community.py b/tests/test_community.py index 0e7b9ddc..ef371f48 100644 --- a/tests/test_community.py +++ b/tests/test_community.py @@ -77,6 +77,11 @@ def test_the_amd_usb_fixes_come_together_for_single_vector_controllers(self): self.assertEqual(names(add), ["KernReserveLow.efi", "XhciNudge"]) self.assertEqual(community.chosen(machine(USB_Controllers=["8086-A0ED"]), SEQUOIA, True)[0], []) + def test_strix_point_usb_gets_the_nudge_but_not_the_ram_reserve(self): + add, _ = community.chosen(machine(USB_Controllers=["1022-151E"]), TAHOE, experimental=True) + self.assertEqual(names(add), ["XhciNudge"]) + self.assertEqual(community.chosen(machine(USB_Controllers=["1022-151E"]), TAHOE, False)[0], []) + class Pins(unittest.TestCase): def test_every_pinned_file_is_licensed_for_1401_and_admitted(self): From a6b2044eab45af9817a82875da83856cd586701a Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Wed, 28 Oct 2026 16:53:25 -0700 Subject: [PATCH 009/244] Mac setup: turn IntelBTPatcher off after its own panic --- mac/Resources/nullmoth-setup.sh | 12 +++++ mac/tools/test_btpatcher_panic_off.py | 67 +++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 mac/tools/test_btpatcher_panic_off.py diff --git a/mac/Resources/nullmoth-setup.sh b/mac/Resources/nullmoth-setup.sh index eae47718..3e0b81f9 100755 --- a/mac/Resources/nullmoth-setup.sh +++ b/mac/Resources/nullmoth-setup.sh @@ -1540,6 +1540,18 @@ for k in "${FETCH[@]+"${FETCH[@]}"}"; do fetch_kext $k "$KX"; done lp=$(kpos Lilu.kext); ap=$(kpos AMFIPass.kext) [ -n "$ap" ] && [ -n "$lp" ] && [ "$ap" -lt "$lp" ] && stop "AMFIPass.kext loads before Lilu.kext in Kernel -> Add; move it below Lilu in the config, then try again" NEEDAMFIPASS=$(( ${#ADDK[@]} + ${#FETCH[@]} )) +# IntelBTPatcher can panic bluetoothd at every start ("IOGMD: not wired for the IODMACommand" with the kext in the +# backtrace; upstream OpenIntelWireless/IntelBluetoothFirmware #486). Uploads 10-22..10-28: 24 such panics from 7 Tahoe +# laptops, one restarting 10 times in 20 minutes. The kext only adds Bluetooth LE fixes; IntelBluetoothFirmware still +# loads the firmware without it, so a Mac whose own saved panic names it gets it switched off. +PANICDIR="${PANICDIR:-/Library/Logs/DiagnosticReports}" +btpatcher_panicked() { local f; for f in "$PANICDIR"/*.panic "$PANICDIR"/Retired/*.panic; do + [ -f "$f" ] && grep -qF 'IOGMD: not wired' "$f" && grep -qF 'com.zxystd.IntelBTPatcher(' "$f" && return 0; done; return 1; } +bp=$(kpos IntelBTPatcher.kext) +if [ -n "$bp" ] && [ "$(get Kernel.Add.$bp.Enabled)" = true ] && btpatcher_panicked; then + EDITS+=("Kernel.Add.$bp.Enabled|-bool|false") + echo "CHANGE Kernel -> Add: turn IntelBTPatcher.kext off (this Mac's saved panic shows it crashing Bluetooth at start)" +fi # Tahoe preparation: macOS 26 refuses Mac models it dropped ("This version of Mac OS X is not supported on this platform"). # Every desktop 1401 built before 1.14 is iMacPro1,1, one of them, so the update stopped there on every such PC (10-12, the # the test machine). Desktops take MacPro7,1, which runs macOS 15 and 26, with RestrictEvents (its memory and PCI slot pages), diff --git a/mac/tools/test_btpatcher_panic_off.py b/mac/tools/test_btpatcher_panic_off.py new file mode 100644 index 00000000..fd289581 --- /dev/null +++ b/mac/tools/test_btpatcher_panic_off.py @@ -0,0 +1,67 @@ +"""Setup switches IntelBTPatcher.kext off only when this Mac's own saved panic shows it crashing bluetoothd. + +Uploads 10-22..10-28: 24 "IOGMD: not wired for the IODMACommand" panics from 7 Tahoe laptops, IntelBTPatcher in every +backtrace (upstream OpenIntelWireless/IntelBluetoothFirmware #486). A panic from another kext, or the kext only in the +loaded-kext list, must leave the config alone. +""" +import pathlib +import plistlib +import subprocess +import tempfile +import unittest + +ROOT = pathlib.Path(__file__).resolve().parents[1] +source = (ROOT / "Resources/nullmoth-setup.sh").read_text() +start = source.index("# IntelBTPatcher can panic bluetoothd") +end = source.index("# Tahoe preparation:", start) +BLOCK = source[start:end] + +HARNESS = r''' +set -u +C="$1"; EDITS=() +get() { plutil -extract "$1" raw -o - "$C" 2>/dev/null; } +kpos() { local i=0 p; while p=$(get Kernel.Add.$i.BundlePath); do [ "$p" = "$1" ] && { echo $i; return; }; i=$((i+1)); done; } +''' + BLOCK + r''' +printf 'EDIT %s\n' "${EDITS[@]+"${EDITS[@]}"}" +''' + +BT = ('panic(cpu 2 caller 0xffffff80054dea7e): IOGMD: not wired for the IODMACommand @IOMemoryDescriptor.cpp:3537\\n' + 'Backtrace (CPU 2)\\n Kernel Extensions in backtrace:\\n' + ' com.apple.iokit.IOUSBHostFamily(1.2)[x]@0x1->0x2\\n com.zxystd.IntelBTPatcher(2.4)[x]@0x3->0x4\\n') +LISTED_ONLY = ('panic(cpu 0 caller 0x1): IOGMD: not wired for the IODMACommand\\nKernel Extensions in backtrace:\\n' + ' com.apple.iokit.IOUSBHostFamily(1.2)\\nloaded kexts:\\ncom.zxystd.!IBTPatcher\\t2.4.0\\n') + + +def run(panic_text, enabled=True): + with tempfile.TemporaryDirectory() as d: + cfg = pathlib.Path(d, "config.plist") + kexts = [{"BundlePath": "Lilu.kext", "Enabled": True}, + {"BundlePath": "IntelBTPatcher.kext", "Enabled": enabled}] + cfg.write_bytes(plistlib.dumps({"Kernel": {"Add": kexts}})) + pd = pathlib.Path(d, "reports"); pd.mkdir() + if panic_text is not None: + pd.joinpath("Kernel-2026-10-28-153524.panic").write_text('{"bug_type":"210"}\n{"macOSPanicString":"%s"}' % panic_text) + r = subprocess.run(["/bin/bash", "-c", HARNESS, "h", str(cfg)], capture_output=True, text=True, + env={"PATH": "/usr/bin:/bin", "PANICDIR": str(pd)}) + return r.returncode, r.stdout + + +class BTPatcherPanic(unittest.TestCase): + def test_its_own_panic_turns_it_off(self): + rc, out = run(BT) + self.assertEqual(rc, 0, out) + self.assertIn("EDIT Kernel.Add.1.Enabled|-bool|false", out) + self.assertIn("CHANGE Kernel -> Add: turn IntelBTPatcher.kext off", out) + + def test_no_panic_changes_nothing(self): + self.assertNotIn("Kernel.Add.1", run(None)[1]) + + def test_a_panic_where_it_is_only_loaded_changes_nothing(self): + self.assertNotIn("Kernel.Add.1", run(LISTED_ONLY)[1]) + + def test_already_off_is_left_alone(self): + self.assertNotIn("Kernel.Add.1", run(BT, enabled=False)[1]) + + +if __name__ == "__main__": + unittest.main() From 25f6697e1a973f57dda8c63d6109bfcb720e4504 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Wed, 28 Oct 2026 16:55:31 -0700 Subject: [PATCH 010/244] Stick writer: a stick's boot partition is not the PC's boot disk --- p1401/usbwriter.py | 12 ++++++++---- tests/test_wmi_disk_fallback.py | 13 ++++++++++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/p1401/usbwriter.py b/p1401/usbwriter.py index bdaa6a91..38a39fad 100644 --- a/p1401/usbwriter.py +++ b/p1401/usbwriter.py @@ -168,11 +168,16 @@ def _wmi_disks(): (22 PCs): Get-Disk and MSFT_Disk listed 0 disks while Win32_DiskDrive listed 2-4; on 8 of them the Storage Management Provider service (smphost) did not exist at all, which no repair brings back. Index is the PhysicalDrive number the storage cmdlets and diskpart use. The boot and system disks are found through the partitions Windows boots from and - runs from, so eligible() refuses them exactly as it does a Get-Disk listing.""" + runs from, so eligible() refuses them exactly as it does a Get-Disk listing. + Win32_DiskPartition.BootPartition marks a disk's active (MBR) or EFI system (GPT) partition, which every bootable + stick has, a stick 1401 wrote before included. Counted on USB disks it refused the picked stick as "the disk the + computer booted from": 2.6.3 uploads, 28 of the 29 writes that took this route. It is counted on the other disks + only; a USB disk Windows runs from is still refused through the system drive ($sys).""" out = _ps("""$ErrorActionPreference = 'SilentlyContinue' $sysd = $env:SystemDrive $sys = @(Get-WmiObject -Query "ASSOCIATORS OF {Win32_LogicalDisk.DeviceID='$sysd'} WHERE AssocClass=Win32_LogicalDiskToPartition" | ForEach-Object { $_.DiskIndex }) -$boot = @(Get-WmiObject -Class Win32_DiskPartition | Where-Object { $_.BootPartition } | ForEach-Object { $_.DiskIndex }) +$usbd = @(Get-WmiObject -Class Win32_DiskDrive | Where-Object { $_.InterfaceType -eq 'USB' -or ($_.PNPDeviceID + '') -like 'USBSTOR\\*' } | ForEach-Object { $_.Index }) +$boot = @(Get-WmiObject -Class Win32_DiskPartition | Where-Object { $_.BootPartition -and ($usbd -notcontains $_.DiskIndex) } | ForEach-Object { $_.DiskIndex }) @(Get-WmiObject -Class Win32_DiskDrive | ForEach-Object { [pscustomobject]@{ Index = $_.Index; Model = $_.Model; SerialNumber = $_.SerialNumber; PNPDeviceID = $_.PNPDeviceID; InterfaceType = $_.InterfaceType; MediaType = $_.MediaType; Size = [int64]$_.Size; @@ -344,11 +349,10 @@ def wmi_check_script(disk, erase_os=False): $d = $d[0] $sysd = $env:SystemDrive $sys = @(Get-WmiObject -Query "ASSOCIATORS OF {{Win32_LogicalDisk.DeviceID='$sysd'}} WHERE AssocClass=Win32_LogicalDiskToPartition" | ForEach-Object {{ $_.DiskIndex }}) -$boot = @(Get-WmiObject -Class Win32_DiskPartition | Where-Object {{ $_.BootPartition }} | ForEach-Object {{ $_.DiskIndex }}) $usb = ($d.InterfaceType -eq 'USB') -or (($d.PNPDeviceID + '') -like 'USBSTOR\\*') if ([int64]$d.Size -ne {size} -or ($d.Model + '').Trim() -ne {_q(disk.get('FriendlyName'))} -or ($d.SerialNumber + '').Trim() -ne {_q((disk.get('SerialNumber') or '').strip())} -or -not $usb -or - ($sys -contains {n}) -or ($boot -contains {n})) {{ + ($sys -contains {n})) {{ throw '1401: disk {n} is not the USB stick you picked any more. Nothing was erased.' }} """ + ("" if erase_os else f"""$odd = @(Get-WmiObject -Class Win32_DiskPartition | Where-Object {{ $_.DiskIndex -eq {n} -and ($_.Type + '') -like '*Unknown*' }}) diff --git a/tests/test_wmi_disk_fallback.py b/tests/test_wmi_disk_fallback.py index b79d7a6b..0f695295 100644 --- a/tests/test_wmi_disk_fallback.py +++ b/tests/test_wmi_disk_fallback.py @@ -48,6 +48,15 @@ def test_the_disk_windows_runs_from_is_refused(self): self.assertTrue(any("booted from" in w for w in why) and any("system partition" in w for w in why), why) self.assertTrue(usbwriter.eligible(disks[1])[0]) + def test_a_usb_disk_boot_partition_does_not_mark_it_the_boot_disk(self): + ps, calls = ps_without_storage([SYSTEM, STICK]) + with patch.object(usbwriter, "_ps", ps), patch.object(usbwriter, "_repair_storage_wmi", return_value=False), \ + patch("builtins.print"): + usbwriter.list_disks() + listing = next(c for c in calls if "Win32_DiskDrive | ForEach-Object" in c) + self.assertIn("$_.BootPartition -and ($usbd -notcontains $_.DiskIndex)", listing) + self.assertIn("USBSTOR\\*", listing) + def test_a_usbstor_device_counts_as_usb_whatever_its_interface_says(self): disks, _ = self.listed([{**STICK, "InterfaceType": "SCSI"}]) self.assertEqual(disks[0]["BusType"], "USB") @@ -84,8 +93,10 @@ def test_the_check_reads_only_classic_wmi_and_names_every_identity_field(self): "Via": "Win32_DiskDrive"} s = usbwriter.wmi_check_script(d) for need in ("Win32_DiskDrive", "-ne 15998753280", "'SanDisk Ultra'", "'4C53'", "$sys -contains 3", - "$boot -contains 3", "1401-OS-PARTITIONS"): + "1401-OS-PARTITIONS"): self.assertIn(need, s) + # the picked stick's own boot partition is not "the disk the computer booted from" (2.6.3: 28 of 29 refused) + self.assertNotIn("BootPartition", s) for storage in ("Get-Disk", "Get-Partition", "MSFT_Disk", "Clear-Disk", "Format-Volume"): self.assertNotIn(storage, s) self.assertNotIn("1401-OS-PARTITIONS", usbwriter.wmi_check_script(d, erase_os=True)) From a77814d6ba48a9b4c9541eedc6ce351e0fdcba32 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Wed, 28 Oct 2026 16:56:44 -0700 Subject: [PATCH 011/244] Apple download: retry a recovery-server 400 over HTTPS --- p1401/apple.py | 7 +++++-- tests/test_apple_doh.py | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/p1401/apple.py b/p1401/apple.py index b28f4f61..207494ad 100644 --- a/p1401/apple.py +++ b/p1401/apple.py @@ -171,7 +171,10 @@ def _open(url, headers, data=None, sleep=None, doh=None): # also answers over HTTPS (measured 10-11: session, RecoveryImage and an HTTPS session cookie on HTTP all work), # which such a proxy cannot touch. oscdn has no valid HTTPS certificate, so the image itself stays on HTTP and # is checked against Apple's signed chunklist as before. A DNS failure keeps the DNS-over-HTTPS route below. - recovery_http_refused = isinstance(e, urllib.error.HTTPError) and e.code == 403 + # 2.6.3 write logs 10-28 (11 PCs): "HTTP Error 400: Bad Request" from osrecovery itself, the bare GET of + # http://osrecovery.apple.com/ among them, which Apple answers 200 everywhere else. A 400 there comes from + # something on the network rewriting plain HTTP, the same as its 403. + recovery_http_refused = isinstance(e, urllib.error.HTTPError) and e.code in (400, 403) if (not (secured or rerouted) and url.startswith(OSRECOVERY_HTTP) and (_transient(e) or recovery_http_refused) and not _dns_failure(e)): secured = True @@ -200,7 +203,7 @@ def _open(url, headers, data=None, sleep=None, doh=None): # Eight write logs ended here with osrecovery cut off over HTTP and then over HTTPS too ("SSL: # UNEXPECTED_EOF_WHILE_READING" on every try): something between the PC and Apple drops both, and the bare # error left the user nothing to do. - advice = RECOVERY_NETWORK if urlparse(url).hostname == "osrecovery.apple.com" and _transient(e) else "" + advice = RECOVERY_NETWORK if urlparse(url).hostname == "osrecovery.apple.com" and (_transient(e) or (isinstance(e, urllib.error.HTTPError) and e.code == 400)) else "" # 2.0.2 write logs 10-15 (3 PCs): oscdn reset the chunklist request on every try, at the DNS-over-HTTPS edge # too (WinError 10054), and the stop said only "ConnectionResetError" with nothing to do about it. if not advice and _transient(e): diff --git a/tests/test_apple_doh.py b/tests/test_apple_doh.py index 32aaca68..abc1d8aa 100644 --- a/tests/test_apple_doh.py +++ b/tests/test_apple_doh.py @@ -103,6 +103,20 @@ def urlopen(req, timeout=0): self.assertEqual(seen, ["http://osrecovery.apple.com/", "https://osrecovery.apple.com/"]) resolver.assert_not_called() + def test_a_400_from_osrecovery_is_asked_over_https_and_then_says_what_to_change(self): + seen = [] + + def urlopen(req, timeout=0): + seen.append(req.full_url) + raise urllib.error.HTTPError(req.full_url, 400, "Bad Request", {}, None) + + with mock.patch("urllib.request.urlopen", urlopen), mock.patch.object(apple, "_doh") as resolver: + with self.assertRaises(apple.AppleError) as cm: + apple._open("http://osrecovery.apple.com/", {}, sleep=lambda s: None) + self.assertEqual(seen, ["http://osrecovery.apple.com/", "https://osrecovery.apple.com/"]) + self.assertIn("phone hotspot or a VPN", str(cm.exception)) + resolver.assert_not_called() + def test_cdn_403_is_not_sent_to_unverified_https(self): seen = [] From 0a1381d9aab2b72a81819012850c1ff3a946009e Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Wed, 28 Oct 2026 17:02:16 -0700 Subject: [PATCH 012/244] Mac app: HiDPI modes switch (nvfbhidpi) --- mac/Resources/app.js | 2 ++ mac/Resources/index.html | 3 ++ mac/Resources/nullmoth-setup.sh | 23 ++++++++++++-- mac/Sources/main.swift | 2 ++ mac/tools/test_hidpi_toggle.py | 55 +++++++++++++++++++++++++++++++++ 5 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 mac/tools/test_hidpi_toggle.py diff --git a/mac/Resources/app.js b/mac/Resources/app.js index 6ad65cee..53a0dd7b 100644 --- a/mac/Resources/app.js +++ b/mac/Resources/app.js @@ -192,6 +192,8 @@ $("vbon").onclick = () => post({ act: "verbose", on: true, efi: efi() }); $("vboff").onclick = () => post({ act: "verbose", on: false, efi: efi() }); $("blon").onclick = () => post({ act: "backlight", on: true, efi: efi() }); $("bloff").onclick = () => post({ act: "backlight", on: false, efi: efi() }); +$("hdon").onclick = () => post({ act: "hidpi", on: true, efi: efi() }); +$("hdoff").onclick = () => post({ act: "hidpi", on: false, efi: efi() }); $("gpuon").onclick = () => post({ act: "gputest", on: true, efi: efi() }); $("gpuoff").onclick = () => post({ act: "gputest", on: false, efi: efi() }); $("xeon").onclick = () => post({ act: "xe", on: true, efi: efi() }); diff --git a/mac/Resources/index.html b/mac/Resources/index.html index a4fcc2f0..662fd27c 100644 --- a/mac/Resources/index.html +++ b/mac/Resources/index.html @@ -82,6 +82,9 @@

Tools

Built-in screen brightness (laptops)

For a laptop whose built-in screen is wired to the NVIDIA GPU (MUX set to Discrete or dGPU). It lets the driver read the panel's brightness controls from the laptop's firmware. It is off by default because that call stopped some PCs at GPU start; if yours stops there, choose 1401: Start once without NVIDIA driver in the boot picker and turn it off here.

+

HiDPI (Retina) modes

+

Lets HiDPI "looks like" sizes work, for example 1920 x 1080 on a 2560 x 1440 screen, including ones added with a tool such as BetterDisplay. Without it such a size is refused and switches back. The driver draws the desktop at up to twice the screen's size, which uses more video memory. Takes effect at the next restart.

+

AMD / Intel GPU and NPU driver (test)

For the AMD and Intel GPUs macOS has no driver for (Ryzen APUs, Radeon RX 7000/9000, Intel Iris Xe and Arc graphics), and the NPU in Intel Core Ultra and AMD Ryzen AI processors. An early test build: your Send logs are how it gets fixed. It downloads only the firmware your GPU and NPU need from linux-firmware (every file checked) and takes effect at the next restart.

If that GPU drives your screen, the screen can stay dark. Then choose 1401: Start once without NVIDIA driver in the boot picker (it parks this driver too) and turn it off here.

diff --git a/mac/Resources/nullmoth-setup.sh b/mac/Resources/nullmoth-setup.sh index 3e0b81f9..d2500ecd 100755 --- a/mac/Resources/nullmoth-setup.sh +++ b/mac/Resources/nullmoth-setup.sh @@ -49,7 +49,7 @@ while [ $# -gt 0 ]; do case "$1" in --pkg) PKG=$2; shift;; --sha) SHA=$2; shift;; --config) CFG=$2; shift;; --efi) EFI=$2; shift;; --tool) TOOL=$2; shift;; --usbmap) USBMAP=$2; shift;; --app) APPBIN=$2; shift;; --dry) DRY=1;; --remove) REMOVE=1;; --verbose) VERB=$2; shift;; --update) UPD=$2; shift;; --collect-logs) COLLECT=$2; shift;; --efi-read) EFIREAD=$2; shift;; - --knob) KNOBS+=("$2"); shift;; --profile) PROFILE=$2; shift;; --gpu-test) GPUTEST=$2; shift;; --backlight) BACKLIGHT=$2; shift;; --xe) XE=$2; shift;; + --knob) KNOBS+=("$2"); shift;; --profile) PROFILE=$2; shift;; --gpu-test) GPUTEST=$2; shift;; --backlight) BACKLIGHT=$2; shift;; --hidpi) HIDPI=$2; shift;; --xe) XE=$2; shift;; *) echo "STOP unknown option $1"; echo "RESULT stop"; exit 2;; esac; shift; done step() { echo "STEP $*"; }; ok() { echo "OK $*"; }; note() { echo "NOTE $*"; } KT="" @@ -749,7 +749,7 @@ fi INSTALL_THEN_PREPARE=0; [ "$UPD" = prepare ] && [ -n "$PKG" ] && INSTALL_THEN_PREPARE=1 # the app's test-driver switch runs setup without a package; 1.14 sent it through the package check # ("STOP package not found:", 4 uploads in the first hour of 1.14), so the switch did not work -if [ -z "$USBMAP" ] && [ -z "$VERB" ] && [ -z "$EFIREAD" ] && [ -z "${GPUTEST:-}" ] && [ -z "${BACKLIGHT:-}" ] && { [ -z "$UPD" ] || [ $INSTALL_THEN_PREPARE = 1 ]; }; then +if [ -z "$USBMAP" ] && [ -z "$VERB" ] && [ -z "$EFIREAD" ] && [ -z "${GPUTEST:-}" ] && [ -z "${BACKLIGHT:-}" ] && [ -z "${HIDPI:-}" ] && { [ -z "$UPD" ] || [ $INSTALL_THEN_PREPARE = 1 ]; }; then step "Checking the driver package" [ -f "$PKG" ] || stop "package not found: $PKG" # the app's copy is writable by the user: hash and unpack a root-owned copy, so it cannot be swapped after the check @@ -964,6 +964,25 @@ if [ -n "${BACKLIGHT:-}" ]; then ok "built-in screen brightness $BACKLIGHT - takes effect at the next restart"; cleanup; echo "RESULT ok"; exit 0 fi +if [ -n "${HIDPI:-}" ]; then + # The app's "HiDPI (Retina) modes": boot-arg nvfbhidpi=1 lets NVRMFB back a "looks like" mode with a desktop up to + # twice the panel's size; without it such a desktop is larger than the scanout allocation and the mode reverts (GH + # #221; the driver has had it since 2.0.5). Chat 10-28: 1920x1080 HiDPI on a 2560x1440 panel would not stick, even + # through BetterDisplay, and nothing in the app turned it on. Opt-in: the doubled desktop costs video memory. + case "$HIDPI" in on|off) ;; *) stop "--hidpi takes on or off";; esac + step "Turning HiDPI modes $HIDPI" + BKC="$C.nullmoth-hidpi-$(date +%Y%m%d-%H%M%S)"; cp -p "$C" "$BKC" || stop "could not back up $C$(ro_why "$C")" + new=""; for a in $(get NVRAM.Add.$B.boot-args); do [ "$a" = nvfbhidpi=1 ] || new="$new $a"; done + [ "$HIDPI" = on ] && new="$new nvfbhidpi=1"; new=${new# } + if has NVRAM.Add.$B.boot-args; then plutil -replace NVRAM.Add.$B.boot-args -string "$new" "$C" + else plutil -insert NVRAM.Add.$B.boot-args -string "$new" "$C"; fi + plutil -lint "$C" >/dev/null || { cp -p "$BKC" "$C"; stop "editing the config failed - the original is restored"; } + nv=""; for a in $(nvram boot-args 2>/dev/null | cut -f2-); do [ "$a" = nvfbhidpi=1 ] || nv="$nv $a"; done + [ "$HIDPI" = on ] && nv="$nv nvfbhidpi=1" + nvram boot-args="${nv# }" || note "could not write NVRAM boot-args; the config change still applies" + ok "HiDPI modes $HIDPI - takes effect at the next restart"; cleanup; echo "RESULT ok"; exit 0 +fi + if [ -n "${XE:-}" ]; then # Intel Xe graphics through WhateverXe (b00t0x, BSD-3), for the Tiger Lake, Alder Lake and Raptor Lake GPUs it accepts. # WhateverXe needs two things from its author that NullMoth does not redistribute: the WhateverXe Graphics package diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index 3a37a159..48efc63e 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -510,6 +510,8 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe case "verbose": run(mode: "verbose", pkg: "", efi: b["efi"] as? String ?? "auto", extra: ["--verbose", (b["on"] as? Bool ?? false) ? "on" : "off"]) case "backlight": run(mode: "verbose", pkg: "", efi: b["efi"] as? String ?? "auto", extra: ["--backlight", (b["on"] as? Bool ?? false) ? "on" : "off"]) + case "hidpi": run(mode: "verbose", pkg: "", efi: b["efi"] as? String ?? "auto", + extra: ["--hidpi", (b["on"] as? Bool ?? false) ? "on" : "off"]) // the opt-in AMD/Intel GPU driver (setup --gpu-test); --tool tells setup where the firmware list sits // a Mac with no NVIDIA card has no driver install behind it: the checked package rides along so setup can take // the AMD/Intel test driver from it (setup verifies the SHA-256 again on a root-owned copy) diff --git a/mac/tools/test_hidpi_toggle.py b/mac/tools/test_hidpi_toggle.py new file mode 100644 index 00000000..dc60b6ca --- /dev/null +++ b/mac/tools/test_hidpi_toggle.py @@ -0,0 +1,55 @@ +"""The app's HiDPI toggle adds or removes exactly nvfbhidpi=1 in the OpenCore boot-args and keeps every other argument. + +Runs setup's --hidpi block against a copy of a config; the negative control is an argument that only resembles it. +""" +import pathlib +import plistlib +import subprocess +import tempfile +import unittest + +ROOT = pathlib.Path(__file__).resolve().parents[1] +source = (ROOT / "Resources/nullmoth-setup.sh").read_text() +start = source.index('if [ -n "${HIDPI:-}" ]; then') +end = source.index("\nfi\n", start) + 4 +BLOCK = source[start:end] +B = "7C436110-AB2A-4BBB-A880-FE41995C9F82" + +HARNESS = r''' +set -u +C="$1"; HIDPI="$2"; B=7C436110-AB2A-4BBB-A880-FE41995C9F82 +has() { plutil -extract "$1" raw -o - "$C" >/dev/null 2>&1; } +get() { plutil -extract "$1" raw -o - "$C" 2>/dev/null; } +ok() { echo "OK $*"; }; step() { :; }; note() { :; }; cleanup() { :; } +stop() { echo "STOP $*"; exit 3; }; ro_why() { :; } +nvram() { :; } +''' + BLOCK + + +def run(args, want): + with tempfile.TemporaryDirectory() as d: + cfg = pathlib.Path(d, "config.plist") + cfg.write_bytes(plistlib.dumps({"NVRAM": {"Add": {B: {"boot-args": args}}}})) + r = subprocess.run(["/bin/bash", "-c", HARNESS, "h", str(cfg), want], capture_output=True, text=True, + env={"PATH": "/usr/bin:/bin"}) + return r.returncode, r.stdout, plistlib.loads(cfg.read_bytes())["NVRAM"]["Add"][B]["boot-args"] + + +class HiDPIToggle(unittest.TestCase): + def test_on_adds_the_argument_once_and_keeps_the_rest(self): + rc, out, args = run("-v nvfb=1 nvaccel=1", "on") + self.assertEqual(rc, 0, out) + self.assertEqual(args, "-v nvfb=1 nvaccel=1 nvfbhidpi=1") + self.assertEqual(run(args, "on")[2], args) + + def test_off_removes_only_it(self): + self.assertEqual(run("-v nvfbhidpi=1 nvfb=1 nvfbhidpi=10", "off")[2], "-v nvfb=1 nvfbhidpi=10") + + def test_anything_else_is_refused(self): + rc, out, args = run("-v", "maybe") + self.assertEqual(rc, 3) + self.assertEqual(args, "-v") + + +if __name__ == "__main__": + unittest.main() From c0e865071449cd6fc8c99a005b8d33d28ab45695 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Wed, 28 Oct 2026 17:04:10 -0700 Subject: [PATCH 013/244] Changelog 2.6.4 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a3039c6..2b52084f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,15 @@ Each release also bundles the NVIDIA driver and Mac app of the same version; see the [driver changelog](https://github.com/nullmoth/nvidia-macos-driver/blob/main/CHANGELOG.md). +## 2.6.4 +- Writing the stick no longer stops with "this is the disk the computer booted from" on PCs whose Windows storage service lists no disks. On that route, 1401 counted the stick's own boot partition as the PC's, and 28 of 29 such writes stopped there. +- When Apple's recovery server answers "400 Bad Request", 1401 asks again over HTTPS. If it still fails, it says what to change (antivirus web scanning, a hotspot or a VPN) instead of showing only the error. +- Mac app: if a Mac's saved kernel panic shows IntelBTPatcher crashing Bluetooth at startup ("IOGMD: not wired"), the next driver update turns that kext off. Bluetooth keeps working through IntelBluetoothFirmware. Seven Tahoe laptops had this panic, one restarting ten times in twenty minutes. +- Mac app: a **HiDPI (Retina) modes** switch. It lets "looks like" sizes larger than half the screen stick, for example 1920 x 1080 on a 2560 x 1440 screen, including sizes added with BetterDisplay; without it they switched back. +- Laptops with AMD Ryzen AI 300 (Strix Point) processors are offered the USB input-lag fix XhciNudge when experimental drivers are on (#121). +- Mac app: the AMD / Intel test driver leaves alone any GPU that Apple's own drivers run. +- Bundles NVIDIA driver 2.6.4. + ## 2.6.3 - Mac app: Intel Xe graphics for Tiger Lake, Alder Lake and Raptor Lake on macOS 15.8 or 26.7 and later, through b00t0x's WhateverXe (thanks b00t0x). It shows only on the Intel GPUs WhateverXe supports, downloads its parts from the author's GitHub with every file checked, and **Turn it off** puts the config back as it was. - Mac app: **Allow an app...** under Microphone and camera lets an app such as Discord use the microphone, camera and screen recording. With the driver installed macOS never asks, so those apps got silence. The method follows tccplus by Jeremy Legendre. From 75d454742094fc7ae4b742dd9655a836c44e326a Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Wed, 28 Oct 2026 18:32:24 -0700 Subject: [PATCH 014/244] Stick writer: refuse the disk Windows started from The WMI route stopped counting a USB stick's own boot partition as the PC's boot disk. It now finds the EFI system partition Windows started from (its drive letter, or mounted for a moment with mountvol /s) and refuses that disk; when that cannot be found it refuses every disk with a boot partition, as before. A real-PowerShell test checks the probe on Windows. Setup runs as root, so the folder it reads saved panics from is fixed rather than taken from the environment. --- mac/Resources/nullmoth-setup.sh | 2 +- mac/Sources/main.swift | 8 +++--- mac/build.sh | 4 +-- mac/tools/test_btpatcher_panic_off.py | 7 +++-- p1401/usbwriter.py | 36 +++++++++++++++++++++--- tests/test_boot_esp_ps.py | 40 +++++++++++++++++++++++++++ tests/test_wmi_disk_fallback.py | 13 +++++++-- 7 files changed, 94 insertions(+), 16 deletions(-) create mode 100644 tests/test_boot_esp_ps.py diff --git a/mac/Resources/nullmoth-setup.sh b/mac/Resources/nullmoth-setup.sh index d2500ecd..cf38427f 100755 --- a/mac/Resources/nullmoth-setup.sh +++ b/mac/Resources/nullmoth-setup.sh @@ -1563,7 +1563,7 @@ NEEDAMFIPASS=$(( ${#ADDK[@]} + ${#FETCH[@]} )) # backtrace; upstream OpenIntelWireless/IntelBluetoothFirmware #486). Uploads 10-22..10-28: 24 such panics from 7 Tahoe # laptops, one restarting 10 times in 20 minutes. The kext only adds Bluetooth LE fixes; IntelBluetoothFirmware still # loads the firmware without it, so a Mac whose own saved panic names it gets it switched off. -PANICDIR="${PANICDIR:-/Library/Logs/DiagnosticReports}" +PANICDIR=/Library/Logs/DiagnosticReports # fixed: this runs as root, so no caller picks the folder btpatcher_panicked() { local f; for f in "$PANICDIR"/*.panic "$PANICDIR"/Retired/*.panic; do [ -f "$f" ] && grep -qF 'IOGMD: not wired' "$f" && grep -qF 'com.zxystd.IntelBTPatcher(' "$f" && return 0; done; return 1; } bp=$(kpos IntelBTPatcher.kext) diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index 48efc63e..3c0a97c8 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -9,10 +9,10 @@ import WebKit import UniformTypeIdentifiers struct Package { - static let version = "2.6.3" - static let name = "nullmoth-nvidia-2.6.3.tar.gz" - static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.3/nullmoth-nvidia-2.6.3.tar.gz")! - static let sha256 = "5fca1043e4855142128df8ab22b0c52747a6e8a8d6a346fe73a17e68f2519988" + static let version = "2.6.4" + static let name = "nullmoth-nvidia-2.6.4.tar.gz" + static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.4/nullmoth-nvidia-2.6.4.tar.gz")! + static let sha256 = "bb777a4bade9d96214b19dffa7fa68b02e7c66dccb0258a3cf93e0788992003f" } // The AMD/Intel GPU and NPU driver (test): its own product and package, pinned like the NVIDIA driver's. An empty pin // means no build of it is published yet. diff --git a/mac/build.sh b/mac/build.sh index e23a2ca9..3872f6f4 100644 --- a/mac/build.sh +++ b/mac/build.sh @@ -66,8 +66,8 @@ cat > "$APP/Contents/Info.plist" <CFBundleName1401 CFBundleDisplayName1401 CFBundlePackageTypeAPPL -CFBundleShortVersionString2.6.3 -CFBundleVersion124 +CFBundleShortVersionString2.6.4 +CFBundleVersion126 LSMinimumSystemVersion15.0 NSHumanReadableCopyright© 2026 NullMoth Systems NSHighResolutionCapable diff --git a/mac/tools/test_btpatcher_panic_off.py b/mac/tools/test_btpatcher_panic_off.py index fd289581..9593be62 100644 --- a/mac/tools/test_btpatcher_panic_off.py +++ b/mac/tools/test_btpatcher_panic_off.py @@ -15,6 +15,9 @@ start = source.index("# IntelBTPatcher can panic bluetoothd") end = source.index("# Tahoe preparation:", start) BLOCK = source[start:end] +FIXED = "PANICDIR=/Library/Logs/DiagnosticReports" +assert BLOCK.count(FIXED) == 1, "setup must name the panic folder itself" +BLOCK = BLOCK.replace(FIXED, 'PANICDIR="$2"') HARNESS = r''' set -u @@ -41,8 +44,8 @@ def run(panic_text, enabled=True): pd = pathlib.Path(d, "reports"); pd.mkdir() if panic_text is not None: pd.joinpath("Kernel-2026-10-28-153524.panic").write_text('{"bug_type":"210"}\n{"macOSPanicString":"%s"}' % panic_text) - r = subprocess.run(["/bin/bash", "-c", HARNESS, "h", str(cfg)], capture_output=True, text=True, - env={"PATH": "/usr/bin:/bin", "PANICDIR": str(pd)}) + r = subprocess.run(["/bin/bash", "-c", HARNESS, "h", str(cfg), str(pd)], capture_output=True, text=True, + env={"PATH": "/usr/bin:/bin"}) return r.returncode, r.stdout diff --git a/p1401/usbwriter.py b/p1401/usbwriter.py index 38a39fad..3e28992a 100644 --- a/p1401/usbwriter.py +++ b/p1401/usbwriter.py @@ -163,6 +163,32 @@ def _as_list(out): WMI_SIZE_SLACK = 16 * (1 << 20) +# The disk holding the EFI system partition this Windows started from, for the WMI route (no storage cmdlets). +# Win32_DiskPartition.BootPartition marks every disk's active/EFI partition, a bootable stick's too, so it cannot say +# which one the PC booted from; the volume Windows reports as its system volume can. It is found by its drive letter +# when it has one, else mounted for a moment with `mountvol /s` (removed again at once); then classic WMI maps +# the letter to a disk. $espKnown stays $false when neither works (legacy BIOS start, no free letter), and the callers +# then refuse every disk with a boot partition, as before 2.6.4. +_BOOT_ESP_PS = r"""$espDisk = -1; $espKnown = $false +try { + $sv = @(Get-WmiObject -Class Win32_Volume -Filter "SystemVolume=True" -ErrorAction SilentlyContinue | Where-Object { $_.DriveLetter }) + $tmp = $null + if ($sv.Count) { $l = $sv[0].DriveLetter } else { + $used = @(Get-WmiObject -Class Win32_LogicalDisk | ForEach-Object { $_.DeviceID.Substring(0, 1).ToUpper() }) + $free = @('R','S','T','U','V','W','X','Y','Z') | Where-Object { $used -notcontains $_ } | Select-Object -First 1 + $l = $null + if ($free) { & mountvol.exe "$($free):" /s 2>&1 | Out-Null; if ($LASTEXITCODE -eq 0) { $l = "$($free):"; $tmp = $l } } + } + if ($l) { + for ($i = 0; $i -lt 10 -and -not $espKnown; $i++) { + $d = @(Get-WmiObject -Query "ASSOCIATORS OF {Win32_LogicalDisk.DeviceID='$l'} WHERE AssocClass=Win32_LogicalDiskToPartition" -ErrorAction SilentlyContinue | ForEach-Object { $_.DiskIndex }) + if ($d.Count) { $espDisk = [int]$d[0]; $espKnown = $true } else { Start-Sleep -Milliseconds 300 } + } + } +} catch { } finally { if ($tmp) { & mountvol.exe $tmp /d 2>&1 | Out-Null } } +""" + + def _wmi_disks(): """Every disk through classic WMI (Win32_DiskDrive), in list_disks' fields, marked Via=Win32_DiskDrive. 2.5.4 logs (22 PCs): Get-Disk and MSFT_Disk listed 0 disks while Win32_DiskDrive listed 2-4; on 8 of them the Storage Management @@ -174,10 +200,11 @@ def _wmi_disks(): computer booted from": 2.6.3 uploads, 28 of the 29 writes that took this route. It is counted on the other disks only; a USB disk Windows runs from is still refused through the system drive ($sys).""" out = _ps("""$ErrorActionPreference = 'SilentlyContinue' -$sysd = $env:SystemDrive +""" + _BOOT_ESP_PS + """$sysd = $env:SystemDrive $sys = @(Get-WmiObject -Query "ASSOCIATORS OF {Win32_LogicalDisk.DeviceID='$sysd'} WHERE AssocClass=Win32_LogicalDiskToPartition" | ForEach-Object { $_.DiskIndex }) $usbd = @(Get-WmiObject -Class Win32_DiskDrive | Where-Object { $_.InterfaceType -eq 'USB' -or ($_.PNPDeviceID + '') -like 'USBSTOR\\*' } | ForEach-Object { $_.Index }) -$boot = @(Get-WmiObject -Class Win32_DiskPartition | Where-Object { $_.BootPartition -and ($usbd -notcontains $_.DiskIndex) } | ForEach-Object { $_.DiskIndex }) +$boot = @(Get-WmiObject -Class Win32_DiskPartition | Where-Object { $_.BootPartition -and (-not $espKnown -or $usbd -notcontains $_.DiskIndex) } | ForEach-Object { $_.DiskIndex }) +if ($espKnown) { $boot += $espDisk } @(Get-WmiObject -Class Win32_DiskDrive | ForEach-Object { [pscustomobject]@{ Index = $_.Index; Model = $_.Model; SerialNumber = $_.SerialNumber; PNPDeviceID = $_.PNPDeviceID; InterfaceType = $_.InterfaceType; MediaType = $_.MediaType; Size = [int64]$_.Size; @@ -343,16 +370,17 @@ def wmi_check_script(disk, erase_os=False): if not ok: raise UsbError("refusing: " + "; ".join(why)) n, size = int(disk["Number"]), int(disk["Size"]) - return f"""$ErrorActionPreference = 'Stop' + return _BOOT_ESP_PS + f"""$ErrorActionPreference = 'Stop' $d = @(Get-WmiObject -Class Win32_DiskDrive -ErrorAction SilentlyContinue | Where-Object {{ $_.Index -eq {n} }}) if (-not $d.Count) {{ throw '1401: disk {n} is not attached any more (Windows renumbered the stick). Nothing was erased. Press Refresh, pick the stick again and write.' }} $d = $d[0] $sysd = $env:SystemDrive $sys = @(Get-WmiObject -Query "ASSOCIATORS OF {{Win32_LogicalDisk.DeviceID='$sysd'}} WHERE AssocClass=Win32_LogicalDiskToPartition" | ForEach-Object {{ $_.DiskIndex }}) $usb = ($d.InterfaceType -eq 'USB') -or (($d.PNPDeviceID + '') -like 'USBSTOR\\*') +$bootHere = if ($espKnown) {{ $espDisk -eq {n} }} else {{ @(Get-WmiObject -Class Win32_DiskPartition | Where-Object {{ $_.BootPartition -and $_.DiskIndex -eq {n} }}).Count -gt 0 }} if ([int64]$d.Size -ne {size} -or ($d.Model + '').Trim() -ne {_q(disk.get('FriendlyName'))} -or ($d.SerialNumber + '').Trim() -ne {_q((disk.get('SerialNumber') or '').strip())} -or -not $usb -or - ($sys -contains {n})) {{ + ($sys -contains {n}) -or $bootHere) {{ throw '1401: disk {n} is not the USB stick you picked any more. Nothing was erased.' }} """ + ("" if erase_os else f"""$odd = @(Get-WmiObject -Class Win32_DiskPartition | Where-Object {{ $_.DiskIndex -eq {n} -and ($_.Type + '') -like '*Unknown*' }}) diff --git a/tests/test_boot_esp_ps.py b/tests/test_boot_esp_ps.py new file mode 100644 index 00000000..e5daa81b --- /dev/null +++ b/tests/test_boot_esp_ps.py @@ -0,0 +1,40 @@ +"""The EFI-partition probe the stick writer's WMI route uses, run in real PowerShell on Windows. + +On a UEFI Windows the started-from EFI partition is on the disk that holds C: (the CI runner, every normal PC), so the +probe must name that disk; it must also leave no drive letter mounted behind. Elsewhere this test skips. +""" +import json +import subprocess +import sys +import unittest + +from p1401 import usbwriter + + +@unittest.skipUnless(sys.platform == "win32", "needs Windows PowerShell, WMI and mountvol") +class BootEspProbe(unittest.TestCase): + def run_ps(self, body): + r = subprocess.run(["powershell", "-NoProfile", "-NonInteractive", "-Command", body], + capture_output=True, text=True, timeout=120) + self.assertEqual(r.returncode, 0, r.stderr) + return r.stdout.strip() + + def test_the_probe_names_the_disk_windows_runs_from_and_unmounts(self): + letters_before = self.run_ps("(Get-WmiObject Win32_LogicalDisk | ForEach-Object { $_.DeviceID }) -join ','") + out = json.loads(self.run_ps(usbwriter._BOOT_ESP_PS + r""" +$sysd = $env:SystemDrive +$sys = @(Get-WmiObject -Query "ASSOCIATORS OF {Win32_LogicalDisk.DeviceID='$sysd'} WHERE AssocClass=Win32_LogicalDiskToPartition" | ForEach-Object { $_.DiskIndex }) +$fw = (Get-ItemProperty HKLM:\\System\\CurrentControlSet\\Control -Name PEFirmwareType -ErrorAction SilentlyContinue).PEFirmwareType +@{ known = $espKnown; esp = $espDisk; sys = @($sys); firmware = $fw } | ConvertTo-Json -Compress""")) + print("probe:", out) + if out["firmware"] == 2: # UEFI: the EFI partition must be found, and on the Windows disk + self.assertTrue(out["known"], out) + self.assertIn(out["esp"], out["sys"] if isinstance(out["sys"], list) else [out["sys"]], out) + else: # legacy BIOS: unknown, so the callers keep the conservative rule + self.assertFalse(out["known"], out) + letters_after = self.run_ps("(Get-WmiObject Win32_LogicalDisk | ForEach-Object { $_.DeviceID }) -join ','") + self.assertEqual(letters_before, letters_after, "the probe left a drive letter mounted") + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_wmi_disk_fallback.py b/tests/test_wmi_disk_fallback.py index 0f695295..b952d36b 100644 --- a/tests/test_wmi_disk_fallback.py +++ b/tests/test_wmi_disk_fallback.py @@ -54,7 +54,11 @@ def test_a_usb_disk_boot_partition_does_not_mark_it_the_boot_disk(self): patch("builtins.print"): usbwriter.list_disks() listing = next(c for c in calls if "Win32_DiskDrive | ForEach-Object" in c) - self.assertIn("$_.BootPartition -and ($usbd -notcontains $_.DiskIndex)", listing) + # a USB disk's own boot partition counts only when the started-from EFI partition is unknown; the disk + # holding that partition is the boot disk + self.assertIn("$_.BootPartition -and (-not $espKnown -or $usbd -notcontains $_.DiskIndex)", listing) + self.assertIn("if ($espKnown) { $boot += $espDisk }", listing) + self.assertIn("mountvol.exe", listing) self.assertIn("USBSTOR\\*", listing) def test_a_usbstor_device_counts_as_usb_whatever_its_interface_says(self): @@ -95,8 +99,11 @@ def test_the_check_reads_only_classic_wmi_and_names_every_identity_field(self): for need in ("Win32_DiskDrive", "-ne 15998753280", "'SanDisk Ultra'", "'4C53'", "$sys -contains 3", "1401-OS-PARTITIONS"): self.assertIn(need, s) - # the picked stick's own boot partition is not "the disk the computer booted from" (2.6.3: 28 of 29 refused) - self.assertNotIn("BootPartition", s) + # the picked stick's own boot partition is not "the disk the computer booted from" (2.6.3: 28 of 29 refused): + # the disk is refused when it holds the EFI partition Windows started from, or, when that is unknown, any boot + # partition (the rule before 2.6.4) + self.assertIn("$bootHere = if ($espKnown) { $espDisk -eq 3 } else {", s) + self.assertIn("-or $bootHere)", s) for storage in ("Get-Disk", "Get-Partition", "MSFT_Disk", "Clear-Disk", "Format-Volume"): self.assertNotIn(storage, s) self.assertNotIn("1401-OS-PARTITIONS", usbwriter.wmi_check_script(d, erase_os=True)) From 2d7cbe88856c5ca17e1dd5fdc995c0ab87aaae0c Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Wed, 28 Oct 2026 18:33:05 -0700 Subject: [PATCH 015/244] Windows CI runs the probes that need real Windows --- .github/workflows/windows-candidate.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/windows-candidate.yml b/.github/workflows/windows-candidate.yml index 65c2cd85..a71a3400 100644 --- a/.github/workflows/windows-candidate.yml +++ b/.github/workflows/windows-candidate.yml @@ -80,6 +80,11 @@ jobs: run: | & "$env:RUNNER_TEMP/1401-stage/1401/engine/python/python.exe" -B tools/check_windows_package.py --stage "$env:RUNNER_TEMP/1401-stage" --repo "$env:GITHUB_WORKSPACE" --cache "$env:RUNNER_TEMP/1401-cache" --output "$env:RUNNER_TEMP/windows-verification.json" if ($LASTEXITCODE -ne 0) { throw 'Windows packaged verification failed.' } + - name: Run the probes that need real Windows (EFI partition, WMI, mountvol) + shell: pwsh + run: | + & "$env:RUNNER_TEMP/1401-stage/1401/engine/python/python.exe" -B -m unittest -v tests.test_boot_esp_ps + if ($LASTEXITCODE -ne 0) { throw 'A Windows-only probe failed.' } - name: Create the deterministic candidate archive shell: pwsh run: | From 5d763212efb3eb2ff6e4327c8c3aadc225bddc3d Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Wed, 28 Oct 2026 18:38:57 -0700 Subject: [PATCH 016/244] Stick writer: trust a lettered EFI volume only when it is unique --- .github/workflows/windows-candidate.yml | 2 +- p1401/usbwriter.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-candidate.yml b/.github/workflows/windows-candidate.yml index a71a3400..ea50e497 100644 --- a/.github/workflows/windows-candidate.yml +++ b/.github/workflows/windows-candidate.yml @@ -79,7 +79,7 @@ jobs: shell: pwsh run: | & "$env:RUNNER_TEMP/1401-stage/1401/engine/python/python.exe" -B tools/check_windows_package.py --stage "$env:RUNNER_TEMP/1401-stage" --repo "$env:GITHUB_WORKSPACE" --cache "$env:RUNNER_TEMP/1401-cache" --output "$env:RUNNER_TEMP/windows-verification.json" - if ($LASTEXITCODE -ne 0) { throw 'Windows packaged verification failed.' } + if ($LASTEXITCODE -ne 0) { Get-Content "$env:RUNNER_TEMP/windows-verification.json" -ErrorAction SilentlyContinue | Select-String -Pattern 'failed_step|error_type|failure_locations|"ok"' -Context 0,3; throw 'Windows packaged verification failed.' } - name: Run the probes that need real Windows (EFI partition, WMI, mountvol) shell: pwsh run: | diff --git a/p1401/usbwriter.py b/p1401/usbwriter.py index 3e28992a..5ce2cc53 100644 --- a/p1401/usbwriter.py +++ b/p1401/usbwriter.py @@ -173,7 +173,7 @@ def _as_list(out): try { $sv = @(Get-WmiObject -Class Win32_Volume -Filter "SystemVolume=True" -ErrorAction SilentlyContinue | Where-Object { $_.DriveLetter }) $tmp = $null - if ($sv.Count) { $l = $sv[0].DriveLetter } else { + if ($sv.Count -eq 1) { $l = $sv[0].DriveLetter } else { $used = @(Get-WmiObject -Class Win32_LogicalDisk | ForEach-Object { $_.DeviceID.Substring(0, 1).ToUpper() }) $free = @('R','S','T','U','V','W','X','Y','Z') | Where-Object { $used -notcontains $_ } | Select-Object -First 1 $l = $null From f97161fdfa8945bd03e213d71e0f1a65513de991 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Wed, 28 Oct 2026 18:44:26 -0700 Subject: [PATCH 017/244] Windows CI prints the failing tests when packaged verification fails --- .github/workflows/windows-candidate.yml | 2 +- mac/Sources/main.swift | 2 +- mac/build.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows-candidate.yml b/.github/workflows/windows-candidate.yml index ea50e497..f7cdeb63 100644 --- a/.github/workflows/windows-candidate.yml +++ b/.github/workflows/windows-candidate.yml @@ -79,7 +79,7 @@ jobs: shell: pwsh run: | & "$env:RUNNER_TEMP/1401-stage/1401/engine/python/python.exe" -B tools/check_windows_package.py --stage "$env:RUNNER_TEMP/1401-stage" --repo "$env:GITHUB_WORKSPACE" --cache "$env:RUNNER_TEMP/1401-cache" --output "$env:RUNNER_TEMP/windows-verification.json" - if ($LASTEXITCODE -ne 0) { Get-Content "$env:RUNNER_TEMP/windows-verification.json" -ErrorAction SilentlyContinue | Select-String -Pattern 'failed_step|error_type|failure_locations|"ok"' -Context 0,3; throw 'Windows packaged verification failed.' } + if ($LASTEXITCODE -ne 0) { & "$env:RUNNER_TEMP/1401-stage/1401/engine/python/python.exe" -c "import json,sys; d=json.load(open(sys.argv[1])); print(json.dumps({k: d.get(k) for k in ('failed_step', 'regression_tests', 'test_failure_locations')}, indent=1))" "$env:RUNNER_TEMP/windows-verification.json"; throw 'Windows packaged verification failed.' } - name: Run the probes that need real Windows (EFI partition, WMI, mountvol) shell: pwsh run: | diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index 3c0a97c8..7662e11e 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -12,7 +12,7 @@ struct Package { static let version = "2.6.4" static let name = "nullmoth-nvidia-2.6.4.tar.gz" static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.4/nullmoth-nvidia-2.6.4.tar.gz")! - static let sha256 = "bb777a4bade9d96214b19dffa7fa68b02e7c66dccb0258a3cf93e0788992003f" + static let sha256 = "90f4c677f0e15caae69d90136990c88556bed27ba4499fd580ebdf9dcdb9244e" } // The AMD/Intel GPU and NPU driver (test): its own product and package, pinned like the NVIDIA driver's. An empty pin // means no build of it is published yet. diff --git a/mac/build.sh b/mac/build.sh index 3872f6f4..729180fc 100644 --- a/mac/build.sh +++ b/mac/build.sh @@ -67,7 +67,7 @@ cat > "$APP/Contents/Info.plist" <CFBundleDisplayName1401 CFBundlePackageTypeAPPL CFBundleShortVersionString2.6.4 -CFBundleVersion126 +CFBundleVersion127 LSMinimumSystemVersion15.0 NSHumanReadableCopyright© 2026 NullMoth Systems NSHighResolutionCapable From c66f478f7dcdfedf4888f53ea1e5ce6fc3a3c662 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Wed, 28 Oct 2026 18:57:39 -0700 Subject: [PATCH 018/244] Windows probe test: legacy BIOS reports its system volume too --- tests/test_boot_esp_ps.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_boot_esp_ps.py b/tests/test_boot_esp_ps.py index e5daa81b..7dfe05c9 100644 --- a/tests/test_boot_esp_ps.py +++ b/tests/test_boot_esp_ps.py @@ -27,11 +27,13 @@ def test_the_probe_names_the_disk_windows_runs_from_and_unmounts(self): $fw = (Get-ItemProperty HKLM:\\System\\CurrentControlSet\\Control -Name PEFirmwareType -ErrorAction SilentlyContinue).PEFirmwareType @{ known = $espKnown; esp = $espDisk; sys = @($sys); firmware = $fw } | ConvertTo-Json -Compress""")) print("probe:", out) - if out["firmware"] == 2: # UEFI: the EFI partition must be found, and on the Windows disk + if out["firmware"] == 2: # UEFI: the EFI partition must be found self.assertTrue(out["known"], out) + # On UEFI it is the EFI partition, on legacy BIOS the active partition Windows reports as its system volume + # (on the CI runner that is C: itself). Either way, when found it is on the disk Windows runs from; when not + # found the callers keep the conservative rule. + if out["known"]: self.assertIn(out["esp"], out["sys"] if isinstance(out["sys"], list) else [out["sys"]], out) - else: # legacy BIOS: unknown, so the callers keep the conservative rule - self.assertFalse(out["known"], out) letters_after = self.run_ps("(Get-WmiObject Win32_LogicalDisk | ForEach-Object { $_.DeviceID }) -join ','") self.assertEqual(letters_before, letters_after, "the probe left a drive letter mounted") From 24bc8737e5be38a4d50637dceea9a8a4cac8883d Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Wed, 28 Oct 2026 19:02:35 -0700 Subject: [PATCH 019/244] Windows CI: drop the duplicate probe step --- .github/workflows/windows-candidate.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/windows-candidate.yml b/.github/workflows/windows-candidate.yml index f7cdeb63..eb465294 100644 --- a/.github/workflows/windows-candidate.yml +++ b/.github/workflows/windows-candidate.yml @@ -80,11 +80,6 @@ jobs: run: | & "$env:RUNNER_TEMP/1401-stage/1401/engine/python/python.exe" -B tools/check_windows_package.py --stage "$env:RUNNER_TEMP/1401-stage" --repo "$env:GITHUB_WORKSPACE" --cache "$env:RUNNER_TEMP/1401-cache" --output "$env:RUNNER_TEMP/windows-verification.json" if ($LASTEXITCODE -ne 0) { & "$env:RUNNER_TEMP/1401-stage/1401/engine/python/python.exe" -c "import json,sys; d=json.load(open(sys.argv[1])); print(json.dumps({k: d.get(k) for k in ('failed_step', 'regression_tests', 'test_failure_locations')}, indent=1))" "$env:RUNNER_TEMP/windows-verification.json"; throw 'Windows packaged verification failed.' } - - name: Run the probes that need real Windows (EFI partition, WMI, mountvol) - shell: pwsh - run: | - & "$env:RUNNER_TEMP/1401-stage/1401/engine/python/python.exe" -B -m unittest -v tests.test_boot_esp_ps - if ($LASTEXITCODE -ne 0) { throw 'A Windows-only probe failed.' } - name: Create the deterministic candidate archive shell: pwsh run: | From b9589c5cd3aeef0054adc91688c9b272c4d00ec7 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Wed, 28 Oct 2026 19:04:50 -0700 Subject: [PATCH 020/244] Changelog 2.6.4: HiDPI and stick-writer lines say exactly what changed --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b52084f..13f09cc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,10 @@ Each release also bundles the NVIDIA driver and Mac app of the same version; see [driver changelog](https://github.com/nullmoth/nvidia-macos-driver/blob/main/CHANGELOG.md). ## 2.6.4 -- Writing the stick no longer stops with "this is the disk the computer booted from" on PCs whose Windows storage service lists no disks. On that route, 1401 counted the stick's own boot partition as the PC's, and 28 of 29 such writes stopped there. +- Writing the stick no longer stops with "this is the disk the computer booted from" on PCs whose Windows storage service lists no disks. On that route, 1401 counted the stick's own boot partition as the PC's, and 28 of 29 such writes stopped there. It now refuses the disk holding the partition Windows actually started from. - When Apple's recovery server answers "400 Bad Request", 1401 asks again over HTTPS. If it still fails, it says what to change (antivirus web scanning, a hotspot or a VPN) instead of showing only the error. - Mac app: if a Mac's saved kernel panic shows IntelBTPatcher crashing Bluetooth at startup ("IOGMD: not wired"), the next driver update turns that kext off. Bluetooth keeps working through IntelBluetoothFirmware. Seven Tahoe laptops had this panic, one restarting ten times in twenty minutes. -- Mac app: a **HiDPI (Retina) modes** switch. It lets "looks like" sizes larger than half the screen stick, for example 1920 x 1080 on a 2560 x 1440 screen, including sizes added with BetterDisplay; without it they switched back. +- Mac app: a **HiDPI (Retina) modes** switch. It turns on the driver's larger desktop (boot-arg nvfbhidpi=1) that "looks like" sizes above half the screen need, for example 1920 x 1080 on a 2560 x 1440 screen, including sizes added with BetterDisplay. - Laptops with AMD Ryzen AI 300 (Strix Point) processors are offered the USB input-lag fix XhciNudge when experimental drivers are on (#121). - Mac app: the AMD / Intel test driver leaves alone any GPU that Apple's own drivers run. - Bundles NVIDIA driver 2.6.4. From e9ff5ccabf7f0928feaa8a6d439b4a621e1bc7d6 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Wed, 28 Oct 2026 19:08:24 -0700 Subject: [PATCH 021/244] 1401 2.6.4: bundles driver and Mac app 2.6.4 --- p1401/nullmoth.py | 6 +++--- windows/App/App.csproj | 2 +- windows/App/app.manifest | 2 +- windows/release-inputs.json | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/p1401/nullmoth.py b/p1401/nullmoth.py index 7af5dfac..03931d5c 100644 --- a/p1401/nullmoth.py +++ b/p1401/nullmoth.py @@ -29,9 +29,9 @@ BOOT_ARGS = ("nvfb=1", "nvaccel=1", "nvfbheads=4", "-nvkmsnosmooth", "amfi_get_out_of_my_way=0x1", "amfi=0x80", "ipc_control_port_options=0") # Package published with the driver; the stick carries it so the Mac companion can install it offline. -PACKAGE = {"name": "nullmoth-nvidia-2.6.3.tar.gz", - "url": "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.3/nullmoth-nvidia-2.6.3.tar.gz", - "sha256": "5fca1043e4855142128df8ab22b0c52747a6e8a8d6a346fe73a17e68f2519988"} +PACKAGE = {"name": "nullmoth-nvidia-2.6.4.tar.gz", + "url": "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.4/nullmoth-nvidia-2.6.4.tar.gz", + "sha256": "90f4c677f0e15caae69d90136990c88556bed27ba4499fd580ebdf9dcdb9244e"} with open(os.path.join(HERE, "nvidia_gsp_ids.json")) as _fh: TABLE = json.load(_fh) diff --git a/windows/App/App.csproj b/windows/App/App.csproj index 1ab62487..c34d7b85 100644 --- a/windows/App/App.csproj +++ b/windows/App/App.csproj @@ -8,7 +8,7 @@ AnyCPU false app.manifest - 2.6.3 + 2.6.4 NullMoth Systems NullMoth Systems © 2026 NullMoth Systems diff --git a/windows/App/app.manifest b/windows/App/app.manifest index aba2e52d..c876e358 100644 --- a/windows/App/app.manifest +++ b/windows/App/app.manifest @@ -1,6 +1,6 @@ - + diff --git a/windows/release-inputs.json b/windows/release-inputs.json index 1a7a5592..c04fab3a 100644 --- a/windows/release-inputs.json +++ b/windows/release-inputs.json @@ -1,9 +1,9 @@ { "baseline_url": "https://github.com/nullmoth/1401/releases/download/v1.14.3/1401-Windows-1.14.3.zip", "baseline_sha256": "e287bf4b09805dbf697f915fa6867a15a422764c46b8733dfd9f46bc0e6043b6", - "driver_release": "v2.6.3", - "mac_asset": "1401-Mac-2.6.3.zip", - "mac_sha256": "0968beedfb8d4f0a3de20617b9c2fbb60bdaec4aed54448176f45ced34ded9a0", + "driver_release": "v2.6.4", + "mac_asset": "1401-Mac-2.6.4.zip", + "mac_sha256": "1d75ff4b45afe01d0c0047139f42e8d0f5de2fd89cb37d6ce1ec62c8e9607062", "opencore_url": "https://github.com/acidanthera/OpenCorePkg/releases/download/1.0.8/OpenCore-1.0.8-RELEASE.zip", "opencore_sha256": "2011e8b7216ecb2645d97ea710df965947edd406846e92050b9bc4190be6d27b", "fixture_slug": "optiplex-5050-micro", From 4a55e2ce5de171f260ee62493785090aeaced383 Mon Sep 17 00:00:00 2001 From: wangbo <> Date: Fri, 30 Oct 2026 15:55:23 +0800 Subject: [PATCH 022/244] =?UTF-8?q?Added=20a=20feature=20to=20the=20macOS?= =?UTF-8?q?=20app:=20when=20a=20driver=20update=20is=20detected,=20users?= =?UTF-8?q?=20can=20choose=20to=20update=20from=20a=20local=20driver=20fil?= =?UTF-8?q?e=20instead=20of=20downloading=20it=20again=20from=20the=20netw?= =?UTF-8?q?ork.=20This=20is=20because=20the=20archive=20downloaded=20from?= =?UTF-8?q?=20the=201401=20release=20page=20already=20contains=20the=20nul?= =?UTF-8?q?lmoth-nvidia-xxx.tar.gz=20driver=20file,=20so=20there=20is=20no?= =?UTF-8?q?=20need=20to=20download=20it=20again=E2=80=94which=20is=20espec?= =?UTF-8?q?ially=20useful=20in=20regions=20where=20GitHub=20connections=20?= =?UTF-8?q?are=20slow.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mac/Sources/main.swift | 58 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index 7662e11e..31221c0e 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -866,7 +866,58 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe } func updateDriver(efi: String) { guard let l = latest else { send("upd", ["state": "error", "why": "check for an update first"]); return } - startDownload(name: l.name, sha: l.sha, url: l.url, efi: efi) + let alert = NSAlert() + alert.icon = NSApplication.shared.applicationIconImage + alert.messageText = "Download a driver, or choose a driver file from your Mac." + alert.addButton(withTitle: "Download Driver") + alert.addButton(withTitle: "Choose Driver File…") + alert.addButton(withTitle: "Cancel") + alert.beginSheetModal(for: window) { response in + DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { [unowned self] in + switch response { + case .alertFirstButtonReturn: + startDownload(name: l.name, sha: l.sha, url: l.url, efi: efi) + case .alertSecondButtonReturn: + selectLocalDriverFile(name: l.name, sha: l.sha, efi: efi) + case .alertThirdButtonReturn: + cancelUpdateDriver() + default: break + } + } + } + } + func selectLocalDriverFile(name: String, sha: String, efi: String?) { + let panel = NSOpenPanel() + panel.directoryURL = FileManager.default.urls(for: .downloadsDirectory, in: .userDomainMask).first + panel.canChooseFiles = true + panel.canChooseDirectories = false + panel.allowsMultipleSelection = false + panel.allowedContentTypes = [.zip, .gzip] + panel.title = "Choose a Driver File" + panel.message = "Select a driver file to install." + panel.prompt = "Choose" + panel.beginSheetModal(for: window) { [unowned self] response in + guard response == .OK, let url = panel.url else { + cancelUpdateDriver() + return + } + let tmpDir = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)[0] + .appendingPathComponent(UUID().uuidString) + try? FileManager.default.createDirectory(at: tmpDir, withIntermediateDirectories: true) + let tmpURL = tmpDir.appendingPathComponent(url.lastPathComponent) + + // Make a copy and treat it as if it had been downloaded. + do { try FileManager.default.copyItem(at: url, to: tmpURL) + } catch { cancelUpdateDriver(); return } + + DispatchQueue.main.async { [unowned self] in + processDriverFile(at: tmpURL, plan: DownloadPlan(name: name, sha: sha, efi: efi)) + } + } + } + func cancelUpdateDriver() { + pendingDownload = nil + send("upd", ["state": "error", "why": "Driver installation was cancelled. Nothing was changed."]) } func download() { startDownload(name: Package.name, sha: Package.sha256, url: Package.url, efi: nil) @@ -964,8 +1015,11 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe guard let pending = pendingDownload, pending.id == t.taskIdentifier else { return } let plan = pending.plan let code = (t.response as? HTTPURLResponse)?.statusCode ?? 0 - let dst = support.appendingPathComponent(plan.name) guard code == 200 else { send("dl", ["state": "error", "why": "the server answered HTTP \(code)"]); return } + processDriverFile(at: loc, plan: plan) + } + private func processDriverFile(at loc: URL, plan: DownloadPlan) { + let dst = support.appendingPathComponent(plan.name) guard sha256(loc) == plan.sha else { send("dl", ["state": "error", "why": "the download does not match its SHA-256, so it was thrown away"]); return } do { if FileManager.default.fileExists(atPath: dst.path) { From 9ce37562f1909ff4d0a298d5c873a6a02e818fd7 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Fri, 30 Oct 2026 09:13:22 -0700 Subject: [PATCH 023/244] Mac app: local driver file follow-ups - Refuse "Update driver" while a download or setup is running, before the choice is offered: Cancel used to clear the running download's state, and a chosen file could start a second install that run() dropped without a word. - Copy the chosen file into the app's support folder (created if missing), check the copy's SHA-256 against the release before installing, and say so when it is a different file. The temporary folder is always removed. - Cancel gives the Update driver button back instead of hiding it. --- mac/Sources/main.swift | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index 31221c0e..dd72a318 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -866,6 +866,10 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe } func updateDriver(efi: String) { guard let l = latest else { send("upd", ["state": "error", "why": "check for an update first"]); return } + // Refused before the choice is offered: Cancel must never drop a download that is already running, and a chosen + // file must not start a second install while one runs (run() would return without a word). + if pendingDownload != nil { send("dl", ["state": "error", "why": "a download is already running; wait for it to finish"]); return } + if runningSetup { send("dl", ["state": "error", "why": "setup is still running; try again when it has finished"]); return } let alert = NSAlert() alert.icon = NSApplication.shared.applicationIconImage alert.messageText = "Download a driver, or choose a driver file from your Mac." @@ -901,23 +905,26 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe cancelUpdateDriver() return } - let tmpDir = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)[0] - .appendingPathComponent(UUID().uuidString) - try? FileManager.default.createDirectory(at: tmpDir, withIntermediateDirectories: true) - let tmpURL = tmpDir.appendingPathComponent(url.lastPathComponent) - - // Make a copy and treat it as if it had been downloaded. - do { try FileManager.default.copyItem(at: url, to: tmpURL) - } catch { cancelUpdateDriver(); return } - - DispatchQueue.main.async { [unowned self] in - processDriverFile(at: tmpURL, plan: DownloadPlan(name: name, sha: sha, efi: efi)) + // The chosen file is installed only when it is byte for byte the package the release lists: the same + // SHA-256 from SHA256SUMS.txt that a download is checked against. It is copied first and the copy is the one + // checked and installed, so the file cannot change between the check and the install. + let tmpDir = support.appendingPathComponent("local-\(UUID().uuidString)") + let tmpURL = tmpDir.appendingPathComponent(name) + defer { try? FileManager.default.removeItem(at: tmpDir) } + do { + try FileManager.default.createDirectory(at: tmpDir, withIntermediateDirectories: true) + try FileManager.default.copyItem(at: url, to: tmpURL) + } catch { send("dl", ["state": "error", "why": "could not read \(url.lastPathComponent): \(error.localizedDescription)"]); return } + guard sha256(tmpURL) == sha else { + send("dl", ["state": "error", "why": "\(url.lastPathComponent) is not \(name) (its SHA-256 does not match the release), so nothing was installed"]) + return } + processDriverFile(at: tmpURL, plan: DownloadPlan(name: name, sha: sha, efi: efi)) } } func cancelUpdateDriver() { - pendingDownload = nil - send("upd", ["state": "error", "why": "Driver installation was cancelled. Nothing was changed."]) + // "dl" error, not "upd" error: it gives the Update driver button back instead of hiding it + send("dl", ["state": "error", "why": "Driver update cancelled. Nothing was changed."]) } func download() { startDownload(name: Package.name, sha: Package.sha256, url: Package.url, efi: nil) From 65bfd1d17d534d345e75732f6bf29a9fc0020e04 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Fri, 30 Oct 2026 09:16:42 -0700 Subject: [PATCH 024/244] Boot-log rebuild: replace stale boot-args, switch off a hung VoodooI2C OpenCore only writes NVRAM > Add variables that do not exist, and the stick keeps existing boot-args, so once one start stored them every later build's boot arguments were refused ("boot-args - ignored, exists") and the bootlog npci/ps2rst steps never reached the kernel (#124, #126). When the logs show that line and no start listed a macOS volume on an internal disk, the rebuild deletes boot-args so OpenCore writes this build's; a PC that runs macOS keeps its own and is told to reset NVRAM once. A stopped-at line inside VoodooI2C's start (VoodooGPIO on an AMD I2C controller, #124) switches the whole VoodooI2C stack off. Only the typed line counts: every OpenCore log names VoodooI2C.kext when it injects it. --- p1401/bootfix.py | 44 +++++++++++++-- tests/test_bootfix_bootargs_i2c.py | 87 ++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+), 3 deletions(-) create mode 100644 tests/test_bootfix_bootargs_i2c.py diff --git a/p1401/bootfix.py b/p1401/bootfix.py index ac93a78d..e6520c99 100644 --- a/p1401/bootfix.py +++ b/p1401/bootfix.py @@ -22,6 +22,10 @@ _ABC = re.compile(r"OCABC: ALRBL \d+ .*?DEVMMIO (\d) .*?WRUNPROT (\d)") _CHOSEN = re.compile(r"OCB: Should boot from \d+\. [^\n]*?\(T:(\d+)\|") _MACOS_DISK = re.compile(r"OCB: Registering entry [^\n]*\(T:2\|[^\n]* - (?![^\n]*USB\()") +# OpenCore writes NVRAM > Add only where the variable does not exist yet; the stick does not delete boot-args (policy +# keep-boot-args), so once one start has stored them every later build's boot arguments are refused with this line. +_BOOTARGS_KEPT = re.compile(r"OCVAR: Setting NVRAM 7C436110-AB2A-4BBB-A880-FE41995C9F82:boot-args - ignored, exists") +BOOT_GUID = "7C436110-AB2A-4BBB-A880-FE41995C9F82" def _boot(t): @@ -65,7 +69,7 @@ def read_logs(paths): def findings(texts): """What the logs show, newest-boot-last order not assumed: any log showing a failure counts.""" out = {"startimage_aborted": False, "stop16": False, "secureboot_dmg": False, "mmio": [], "devirt_ran": False, "boots": [], - "vmap": None, "mat": None} + "vmap": None, "mat": None, "bootargs_kept": False, "macos_disk": False} seen = set() for t in texts: out["startimage_aborted"] |= "StartImage failed - Aborted" in t @@ -75,6 +79,8 @@ def findings(texts): # "OC: Driver HfsPlus.efi at 0 cannot be loaded - Access Denied!" and the PC hangs there out["uefi_secureboot"] = out.get("uefi_secureboot", False) or bool(re.search(r"OC: Driver \S+ at \d+ cannot be loaded - Access Denied", t)) out["devirt_ran"] |= "OCABC: MMIO devirt" in t + out["bootargs_kept"] |= bool(_BOOTARGS_KEPT.search(t)) + out["macos_disk"] |= bool(_MACOS_DISK.search(t)) out["no_slide"] = out.get("no_slide", False) or "No slide values are usable" in t # the firmware's memory attributes table: "MAT support is 0" on any boot means the firmware has none for mat in re.findall(r"OCABC: MAT support is ([01])", t): @@ -228,6 +234,21 @@ def apply(cfg, result, texts, change, stopped_at=""): "the start stopped there. Turn Secure Boot off in the BIOS (on ASUS boards: Boot -> Secure Boot -> OS Type " "'Other OS'), then start from the stick again", "every driver OpenCore loaded was refused with Access Denied") + # The PC kept boot arguments from an earlier start, so the boot arguments of this build (and every bootlog step that + # adds one, npci or ps2rst) would never reach macOS: 1401 #124 and #126 each edited boot-args for several starts that + # all ran with the old ones, until they reset NVRAM by hand. When no start listed a macOS volume on an internal disk, + # the stored ones can only be an earlier stick's, so this build replaces them. A PC that runs macOS keeps its own + # (keep-boot-args) and is told how to apply the new ones. + if f["bootargs_kept"]: + dl = cfg.setdefault("NVRAM", {}).setdefault("Delete", {}).setdefault(BOOT_GUID, []) + if f["macos_disk"]: + change("bootlog-note", "", "this PC kept the boot arguments of an earlier start, so the ones in this build do not " + "apply yet. In the OpenCore picker choose Reset NVRAM once, then start the installer again", + "OpenCore refused the stick's boot-args (ignored, exists) and a macOS volume is on an internal disk") + elif "boot-args" not in dl: + dl.append("boot-args") + change("bootlog-own-boot-args", "keep existing boot-args", "Delete boot-args", + "OpenCore refused the stick's boot-args (ignored, exists) and no start listed a macOS volume on an internal disk") if f["secureboot_dmg"]: sec = cfg.setdefault("Misc", {}).setdefault("Security", {}) if sec.get("SecureBootModel") != "Disabled" and sec.get("DmgLoading") != "Signed": @@ -258,7 +279,7 @@ def apply(cfg, result, texts, change, stopped_at=""): def after_handoff(texts, stopped_at=""): """Findings from panic files and the user's stopped-at line: kexts to switch off, boot-args to add, and reports.""" - out = {"disable": [], "args": [], "cfglock": False, "report": []} + out = {"disable": [], "args": [], "cfglock": False, "report": [], "i2c_off": False} joined = "\n".join(texts) + "\n" + (stopped_at or "") for m in _BT.finditer(joined): for frag, kext in OPTIONAL_KEXTS.items(): @@ -280,6 +301,14 @@ def after_handoff(texts, stopped_at=""): # the second one is what some boards need). The user's stopped line names it. if re.search(r"(?i)IOPCIConfigurator|PCI configuration (begin|PCI)", joined): out["args"].append("npci") + # The touchpad driver hung while it started (no panic, nothing after its own line): an ASUS TUF A15 with an AMD I2C + # controller stopped for good at "VoodooGPIOMD::Loading GPIO Data for AMD" (1401 #124) and went on with the + # VoodooI2C stack off. Only the user's stopped-at line counts: every OpenCore log names VoodooI2C.kext when it is + # injected, so the logs themselves would switch it off on every rebuild. + if re.search(r"VoodooGPIO|VoodooI2C[A-Za-z]*::", stopped_at or ""): + out["i2c_off"] = True + out["report"].append("the touchpad driver (VoodooI2C) hung while starting; it is off now - use a USB mouse for " + "the installer") # Dortania: CFG-locked firmware panics in AppleIntelCPUPowerManagement -> AppleCpuPmCfgLock. Only a panic BACKTRACE # counts: every OpenCore log on AMD names the kext ("Skipping dummy AppleIntelCPUPowerManagement patch") and its # kernel patches have "panic" in their names, which set this on 87 AMD configs (10-10 scan of uploads). @@ -311,6 +340,14 @@ def apply_after_handoff(cfg, texts, stopped_at, change): args.append("ps2rst=0") nv["boot-args"] = " ".join(args) change("bootlog-ps2-panic", "", "ps2rst=0", "the saved panic is in the laptop keyboard driver (VoodooPS2Controller)") + if f["i2c_off"]: + # every part of the stack: VoodooI2C.kext, its PlugIns (VoodooGPIO, VoodooI2CServices, VoodooInput) and the + # device kexts that require it (VoodooI2CHID, VoodooI2CELAN, ...). VoodooPS2's own VoodooInput stays. + for k in kexts: + if k.get("BundlePath", "").startswith("VoodooI2C") and k.get("Enabled"): + k["Enabled"] = False + change("bootlog-i2c-hang-off", k["BundlePath"], "Enabled=False", + "the screen stopped inside the touchpad driver's start (VoodooI2C); it is optional for starting macOS") if "npci" in f["args"]: cur = next((a for a in args if a.startswith("npci=")), None) nxt = "npci=0x2000" if cur is None else ("npci=0x3000" if cur == "npci=0x2000" else None) @@ -478,7 +515,8 @@ def ladder(result, logs, stopped=""): arm("a panic backtrace through AppleIntelCPUPowerManagement turns AppleCpuPmCfgLock on", after_handoff([intel_panic])["cfglock"]) arm("control: an AMD OpenCore log naming the kext and a patch called 'panic' is not a CFG-lock panic", not after_handoff([amdlog])["cfglock"]) - arm("negative control: a stopped line that names nothing changes nothing", f == {"disable": [], "args": [], "cfglock": False, "report": []}, f) + arm("negative control: a stopped line that names nothing changes nothing", + f == {"disable": [], "args": [], "cfglock": False, "report": [], "i2c_off": False}, f) print(f"bootfix: {sum(res)}/{len(res)}") return all(res) diff --git a/tests/test_bootfix_bootargs_i2c.py b/tests/test_bootfix_bootargs_i2c.py new file mode 100644 index 00000000..dd1bdfc4 --- /dev/null +++ b/tests/test_bootfix_bootargs_i2c.py @@ -0,0 +1,87 @@ +"""Two stops the stick's logs and the user's stopped-at line now carry into the next build (1401 #124, #126): +boot-args OpenCore refused because the PC kept an earlier start's, and the VoodooI2C touchpad stack hanging at start.""" +import unittest +from types import SimpleNamespace + +from p1401 import bootfix + +GUID = "7C436110-AB2A-4BBB-A880-FE41995C9F82" +KEPT = f"OCVAR: Setting NVRAM {GUID}:boot-args - ignored, exists\n" +WROTE = f"OCVAR: Setting NVRAM {GUID}:boot-args - Success\n" +MACOS = ("OCB: Registering entry Macintosh HD [Apple] (T:2|F:0|G:0|E:0|B:0) - " + "PciRoot(0x0)/Pci(0x1D,0x0)/NVMe(0x1,AA)/HD(2,GPT,X)\n") +STICK_MACOS = ("OCB: Registering entry macOS Base System [Apple] (T:2|F:0|G:0|E:0|B:0) - " + "PciRoot(0x0)/Pci(0x14,0x0)/USB(0x3,0x0)/HD(2,GPT,X)\n") + + +def build(logs, cfg=None, cpu="AMD", stopped=""): + cfg = cfg if cfg is not None else {"NVRAM": {"Add": {GUID: {"boot-args": "-v keepsyms=1"}}, "Delete": {GUID: []}}} + changes = [] + bootfix.apply(cfg, SimpleNamespace(hardware={"CPU": {"Manufacturer": cpu}}), logs, lambda *a: changes.append(a), stopped) + bootfix.apply_after_handoff(cfg, logs, stopped, lambda *a: changes.append(a)) + return cfg, [c[0] for c in changes] + + +def i2c_cfg(): + names = ["Lilu.kext", "VoodooI2C.kext", "VoodooI2C.kext/Contents/PlugIns/VoodooGPIO.kext", + "VoodooI2C.kext/Contents/PlugIns/VoodooI2CServices.kext", "VoodooI2C.kext/Contents/PlugIns/VoodooInput.kext", + "VoodooI2CHID.kext", "VoodooPS2Controller.kext", "VoodooPS2Controller.kext/Contents/PlugIns/VoodooInput.kext"] + return {"Kernel": {"Add": [{"BundlePath": n, "Enabled": True} for n in names]}, "NVRAM": {"Add": {}}} + + +class StoredBootArgs(unittest.TestCase): + def test_refused_boot_args_on_a_pc_without_macos_are_replaced(self): + cfg, ch = build([KEPT]) + self.assertIn("boot-args", cfg["NVRAM"]["Delete"][GUID]) + self.assertEqual(ch, ["bootlog-own-boot-args"]) + + def test_the_npci_step_reaches_the_kernel_with_it(self): + # 124: stopped at PCI configuration with old boot-args stored: npci is added AND the stored ones are replaced + cfg, ch = build([KEPT], stopped="[ PCI configuration begin ]") + self.assertIn("npci=0x2000", cfg["NVRAM"]["Add"][GUID]["boot-args"].split()) + self.assertIn("boot-args", cfg["NVRAM"]["Delete"][GUID]) + self.assertEqual(ch, ["bootlog-own-boot-args", "bootlog-pci-config"]) + + def test_a_pc_that_runs_macos_keeps_its_own_and_is_told_to_reset_nvram(self): + cfg, ch = build([MACOS + KEPT]) + self.assertNotIn("boot-args", cfg["NVRAM"]["Delete"][GUID]) + self.assertEqual(ch, ["bootlog-note"]) + + def test_the_stick_s_own_recovery_volume_is_not_an_installed_macos(self): + cfg, _ = build([STICK_MACOS + KEPT]) + self.assertIn("boot-args", cfg["NVRAM"]["Delete"][GUID]) + + def test_boot_args_written_normally_change_nothing(self): + cfg, ch = build([WROTE]) + self.assertEqual((cfg["NVRAM"]["Delete"][GUID], ch), ([], [])) + + def test_a_config_without_a_delete_section_gets_one(self): + cfg, _ = build([KEPT], cfg={}) + self.assertEqual(cfg["NVRAM"]["Delete"][GUID], ["boot-args"]) + + def test_already_deleted_is_not_listed_twice(self): + cfg, ch = build([KEPT], cfg={"NVRAM": {"Delete": {GUID: ["boot-args"]}}}) + self.assertEqual((cfg["NVRAM"]["Delete"][GUID], ch), (["boot-args"], [])) + + +class TouchpadHang(unittest.TestCase): + def enabled(self, cfg): + return {k["BundlePath"] for k in cfg["Kernel"]["Add"] if k["Enabled"]} + + def test_amd_gpio_hang_switches_the_whole_voodooi2c_stack_off(self): + cfg, ch = build([], cfg=i2c_cfg(), stopped="VoodooI2CACPIController::AMD10018 Starting I2C controller\n" + "VoodooGPIOMD::Loading GPIO Data for AMD") + self.assertEqual(self.enabled(cfg), {"Lilu.kext", "VoodooPS2Controller.kext", + "VoodooPS2Controller.kext/Contents/PlugIns/VoodooInput.kext"}) + self.assertEqual(set(ch), {"bootlog-i2c-hang-off"}) + self.assertTrue(any("VoodooI2C" in r for r in bootfix.after_handoff([], "VoodooGPIOMD::Loading GPIO Data")["report"])) + + def test_an_opencore_log_that_injects_voodooi2c_changes_nothing(self): + log = "OC: Prelinked injection VoodooI2C.kext () - Success\nOC: Prelinked injection VoodooI2C.kext v2.9.1\n" + cfg, ch = build([log], cfg=i2c_cfg()) + self.assertEqual(len(self.enabled(cfg)), 8) + self.assertEqual(ch, []) + + +if __name__ == "__main__": + unittest.main() From 55b3341171db00eebdabc322f64b08d6d3ecf2bc Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Fri, 30 Oct 2026 09:16:42 -0700 Subject: [PATCH 025/244] Mac app setup: never pick an NTFS partition as the OpenCore partition NTFS partitions are listed as "Microsoft Basic Data" like a FAT32 1401 stick on GPT, so an EFI folder copied onto a Windows partition was found, chosen, and its config backup then failed because macOS mounts NTFS read-only (nvidia-macos-driver #453). Auto-discovery now skips them before mounting and says so. --- mac/Resources/nullmoth-setup.sh | 6 ++++ tests/test_setup_skips_ntfs.py | 53 +++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 tests/test_setup_skips_ntfs.py diff --git a/mac/Resources/nullmoth-setup.sh b/mac/Resources/nullmoth-setup.sh index cf38427f..b6a515ca 100755 --- a/mac/Resources/nullmoth-setup.sh +++ b/mac/Resources/nullmoth-setup.sh @@ -68,6 +68,11 @@ ro_why() { # $1 = a file; explains a failed write when macOS mounted its pa local m; m=$(df -P "$(dirname "$1")" 2>/dev/null | awk 'NR==2{m=$6; for(i=7;i<=NF;i++) m=m" "$i; print m}') [ -n "$m" ] && mount | grep -F " on $m (" | grep -q "read-only" || return 0 echo " - macOS mounted $m read-only, so nothing on it can be changed. Run First Aid on that partition in Disk Utility (if it was left unclean by Windows, turn off Fast Startup there and shut Windows down once), check the stick's write-lock switch, then try again"; } +is_ntfs() { # $1 = a partition. A Windows (NTFS) partition is "Microsoft Basic Data" like a FAT32 1401 stick on GPT, + # but firmware does not start OpenCore from it and macOS mounts it read-only: an EFI folder copied there was picked as + # the OpenCore partition and its config backup failed (driver issue #453). + # third-party NTFS drivers name it ufsd_NTFS or tuxera_ntfs, so any personality that says NTFS counts + diskutil info "$1" 2>/dev/null | grep -qiE '(Type \(Bundle\)|File System Personality):.*ntfs'; } mount_efi() { # $1 = device or partition UUID; sets MOUNT_POINT in this shell local mp; mp=$(mnt "$1") if [ -z "$mp" ]; then diskutil mount "$1" >/dev/null 2>&1 || return 1; MOUNTED="$MOUNTED $1"; mp=$(mnt "$1"); fi @@ -789,6 +794,7 @@ else if [ -z "$found" ]; then # OpenCore can live on an EFI partition or on any FAT32 partition (a 1401 stick is a FAT32 data partition) for d in $(diskutil list | awk '/ EFI | DOS_FAT_32 | Windows_FAT_32 | Microsoft Basic Data /{print $NF}' | grep -E '^disk[0-9]+s[0-9]+$'); do + is_ntfs "$d" && { echo "NOTE $d: Windows (NTFS) partition, skipped - OpenCore does not start from it"; continue; } mount_efi "$d" || continue; mp=$MOUNT_POINT; [ -n "$(ocrel_in "$mp")" ] && found="$found $d"; done fi n=$(echo $found | wc -w | tr -d ' ') diff --git a/tests/test_setup_skips_ntfs.py b/tests/test_setup_skips_ntfs.py new file mode 100644 index 00000000..29a7695c --- /dev/null +++ b/tests/test_setup_skips_ntfs.py @@ -0,0 +1,53 @@ +"""The Mac app's setup never picks a Windows (NTFS) partition as the OpenCore partition (driver issue #453): a copied +EFI folder there was chosen and its config backup failed, because macOS mounts NTFS read-only.""" +import os +import pathlib +import subprocess +import tempfile +import unittest + +SETUP = pathlib.Path(__file__).resolve().parents[1] / "mac/Resources/nullmoth-setup.sh" + +# `diskutil info` as macOS prints it for each kind of partition the auto-discovery loop lists +INFO = { + "disk2s3": " File System Personality: NTFS\n Type (Bundle): ntfs\n Read-Only Volume: Yes\n", + "disk2s4": " File System Personality: UFSD_NTFS\n Type (Bundle): ufsd_NTFS\n", + "disk3s1": " File System Personality: MS-DOS FAT32\n Type (Bundle): msdos\n", + "disk0s1": " File System Personality: MS-DOS FAT32\n Type (Bundle): msdos\n Partition Type: EFI\n", +} + + +def is_ntfs(dev): + text = SETUP.read_text() + start = text.index("is_ntfs() {") + end = text.index("mount_efi() {", start) + with tempfile.TemporaryDirectory() as d: + fake = pathlib.Path(d, "diskutil") + fake.write_text("#!/bin/bash\ncase \"$2\" in\n" + "".join( + f" {k}) printf '%s' '{v}';;\n" for k, v in INFO.items()) + " *) exit 1;;\nesac\n") + fake.chmod(0o755) + r = subprocess.run(["/bin/bash", "-c", text[start:end] + f'\nis_ntfs {dev}'], env={**os.environ, "PATH": d + ":/usr/bin:/bin"}) + return r.returncode == 0 + + +class SetupSkipsNtfs(unittest.TestCase): + def test_an_ntfs_partition_is_skipped(self): + self.assertTrue(is_ntfs("disk2s3")) + self.assertTrue(is_ntfs("disk2s4")) # a third-party NTFS driver + + def test_a_fat32_stick_and_an_esp_are_still_candidates(self): + self.assertFalse(is_ntfs("disk3s1")) + self.assertFalse(is_ntfs("disk0s1")) + + def test_a_partition_diskutil_cannot_describe_is_not_skipped(self): + self.assertFalse(is_ntfs("disk9s9")) + + def test_the_discovery_loop_uses_it_before_mounting(self): + text = SETUP.read_text() + loop = text[text.index("# OpenCore can live on an EFI partition or on any FAT32 partition"):] + loop = loop[:loop.index("done")] + self.assertLess(loop.index("is_ntfs \"$d\""), loop.index("mount_efi \"$d\"")) + + +if __name__ == "__main__": + unittest.main() From 45553d15aaa751637361c8b9dc5099d721313048 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Fri, 30 Oct 2026 09:16:42 -0700 Subject: [PATCH 026/244] Changelog 2.6.5: boot-args, VoodooI2C and NTFS fixes --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13f09cc1..5c7a2fde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ Each release also bundles the NVIDIA driver and Mac app of the same version; see the [driver changelog](https://github.com/nullmoth/nvidia-macos-driver/blob/main/CHANGELOG.md). +## 2.6.5 +- Rebuilding a stick from its boot logs now reaches the kernel's boot arguments. Once one start had stored boot-args in the PC's NVRAM, OpenCore refused every later build's ("ignored, exists"), so added options such as npci=0x2000 never applied until NVRAM was reset by hand (#124, #126). When the logs show no installed macOS on an internal disk, the stick now replaces the stored boot-args; a PC that runs macOS keeps its own and is told to reset NVRAM once. +- If the screen stops inside the touchpad driver's start ("VoodooGPIO... Loading GPIO Data for AMD"), the rebuilt stick leaves the VoodooI2C touchpad stack off; the keyboard keeps working and a USB mouse drives the installer (#124). +- Mac app: setup no longer picks a Windows (NTFS) partition as the OpenCore partition. An EFI folder copied onto one was chosen, and its config backup failed because macOS cannot write NTFS (nvidia-macos-driver #453). + ## 2.6.4 - Writing the stick no longer stops with "this is the disk the computer booted from" on PCs whose Windows storage service lists no disks. On that route, 1401 counted the stick's own boot partition as the PC's, and 28 of 29 such writes stopped there. It now refuses the disk holding the partition Windows actually started from. - When Apple's recovery server answers "400 Bad Request", 1401 asks again over HTTPS. If it still fails, it says what to change (antivirus web scanning, a hotspot or a VPN) instead of showing only the error. From e4b235e257d68d592dbed85bf436b3d810aed2b9 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Fri, 30 Oct 2026 09:47:04 -0700 Subject: [PATCH 027/244] EFI rules: never both USBInjectAll+USBToolBox or both Mausi kexts Field panics "[kalloc.type.var*.16]: element modified after free" (21 reports, some before any NullMoth kext loads) had one of these pairs enabled in all 11 configs that came with them, and none of 49 other panics did. The builder (policy.py) turns off USBInjectAll and IntelSnowMausi when the other kext of the pair is on; efi_rules.json carries the same two rules (kext-conflict-usb, kext-conflict-mausi), so the Mac app's EFI check warns on an existing config with the fix. Mac checker vectors regenerated. --- CHANGELOG.md | 1 + mac/tests/efi_rules/vectors.json | 146 +++++++++++++++++++++++++++++-- p1401/efi_rules.json | 24 +++++ p1401/policy.py | 20 +++++ tests/test_efi_rules.py | 3 +- tests/test_kext_conflicts.py | 78 +++++++++++++++++ 6 files changed, 262 insertions(+), 10 deletions(-) create mode 100644 tests/test_kext_conflicts.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c7a2fde..5e0c92a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Each release also bundles the NVIDIA driver and Mac app of the same version; see ## 2.6.5 - Rebuilding a stick from its boot logs now reaches the kernel's boot arguments. Once one start had stored boot-args in the PC's NVRAM, OpenCore refused every later build's ("ignored, exists"), so added options such as npci=0x2000 never applied until NVRAM was reset by hand (#124, #126). When the logs show no installed macOS on an internal disk, the stick now replaces the stored boot-args; a PC that runs macOS keeps its own and is told to reset NVRAM once. - If the screen stops inside the touchpad driver's start ("VoodooGPIO... Loading GPIO Data for AMD"), the rebuilt stick leaves the VoodooI2C touchpad stack off; the keyboard keeps working and a USB mouse drives the installer (#124). +- Two kext pairs that do the same job are never both on: USBInjectAll with USBToolBox, and IntelMausi with IntelSnowMausi. Configs with either pair crashed at startup with "element modified after free". 1401 leaves USBInjectAll and IntelSnowMausi off when it builds, and the Mac app's EFI check flags either pair in an existing config and fixes it. - Mac app: setup no longer picks a Windows (NTFS) partition as the OpenCore partition. An EFI folder copied onto one was chosen, and its config backup failed because macOS cannot write NTFS (nvidia-macos-driver #453). ## 2.6.4 diff --git a/mac/tests/efi_rules/vectors.json b/mac/tests/efi_rules/vectors.json index 3fa4735a..7a91c072 100644 --- a/mac/tests/efi_rules/vectors.json +++ b/mac/tests/efi_rules/vectors.json @@ -24,6 +24,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-zen4-variable-write", "relocation-block", "replace-under-mask" @@ -56,6 +58,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-zen4-variable-write", "relocation-block", "replace-under-mask" @@ -84,6 +88,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-zen4-variable-write", "relocation-block", "replace-under-mask" @@ -114,6 +120,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-zen4-variable-write", "relocation-block", "replace-under-mask" @@ -144,6 +152,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-zen4-memory-map", "amd-zen4-variable-write", "relocation-block", @@ -177,6 +187,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-zen4-memory-map", "amd-zen4-variable-write", "relocation-block", @@ -206,6 +218,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-zen4-memory-map", "amd-zen4-variable-write", "relocation-block", @@ -237,6 +251,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-zen4-memory-map", "amd-zen4-variable-write", "relocation-block", @@ -452,6 +468,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -484,6 +502,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -512,6 +532,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -542,6 +564,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -572,6 +596,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -604,6 +630,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -632,6 +660,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -662,6 +692,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -869,6 +901,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -904,6 +938,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -936,6 +972,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -969,6 +1007,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -1004,6 +1044,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -1040,6 +1082,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -1073,6 +1117,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -1107,6 +1153,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -1345,6 +1393,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "mmiowhitelist-without-quirk", "relocation-block", "replace-under-mask" @@ -1381,6 +1431,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "mmiowhitelist-without-quirk", "relocation-block", "replace-under-mask" @@ -1414,6 +1466,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "mmiowhitelist-without-quirk", "relocation-block", "replace-under-mask" @@ -1448,6 +1502,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "mmiowhitelist-without-quirk", "relocation-block", "replace-under-mask" @@ -1483,6 +1539,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "mmiowhitelist-without-quirk", "relocation-block", "replace-under-mask" @@ -1519,6 +1577,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "mmiowhitelist-without-quirk", "relocation-block", "replace-under-mask" @@ -1552,6 +1612,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "mmiowhitelist-without-quirk", "relocation-block", "replace-under-mask" @@ -1586,6 +1648,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "mmiowhitelist-without-quirk", "relocation-block", "replace-under-mask" @@ -1820,6 +1884,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -1851,6 +1917,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -1878,6 +1946,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -1907,6 +1977,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -1936,6 +2008,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -1967,6 +2041,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -1994,6 +2070,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -2023,6 +2101,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -2228,6 +2308,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -2257,6 +2339,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -2282,6 +2366,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -2309,6 +2395,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -2336,6 +2424,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -2365,6 +2455,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -2390,6 +2482,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -2417,6 +2511,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -2609,6 +2705,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -2644,6 +2742,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -2675,6 +2775,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -2708,6 +2810,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -2741,6 +2845,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -2776,6 +2882,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -2807,6 +2915,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -2840,6 +2950,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "amd-setupvirtualmap", "amd-devirtualisemmio", "mmiowhitelist-without-quirk", @@ -3042,6 +3154,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -3073,6 +3187,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -3100,6 +3216,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -3129,6 +3247,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -3158,6 +3278,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -3189,6 +3311,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -3216,6 +3340,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -3245,6 +3371,8 @@ "picker-lists-tools", "expose-boot-path", "dedupe-add", + "kext-conflict-usb", + "kext-conflict-mausi", "relocation-block", "replace-under-mask" ], @@ -3415,16 +3543,16 @@ } ], "configs": { - "c0": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHBsaXN0IFBVQkxJQyAiLS8vQXBwbGUvL0RURCBQTElTVCAxLjAvL0VOIiAiaHR0cDovL3d3dy5hcHBsZS5jb20vRFREcy9Qcm9wZXJ0eUxpc3QtMS4wLmR0ZCI+CjxwbGlzdCB2ZXJzaW9uPSIxLjAiPgo8ZGljdD4KCTxrZXk+QUNQSTwva2V5PgoJPGRpY3Q+CgkJPGtleT5BZGQ8L2tleT4KCQk8YXJyYXk+CgkJCTxkaWN0PgoJCQkJPGtleT5FbmFibGVkPC9rZXk+CgkJCQk8dHJ1ZS8+CgkJCQk8a2V5PlBhdGg8L2tleT4KCQkJCTxzdHJpbmc+U1NEVC1FQy5hbWw8L3N0cmluZz4KCQkJPC9kaWN0PgoJCQk8ZGljdD4KCQkJCTxrZXk+RW5hYmxlZDwva2V5PgoJCQkJPHRydWUvPgoJCQkJPGtleT5QYXRoPC9rZXk+CgkJCQk8c3RyaW5nPlNTRFQtRUMuYW1sPC9zdHJpbmc+CgkJCTwvZGljdD4KCQk8L2FycmF5PgoJCTxrZXk+R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1QzlGODI8L2tleT4KCQkJPGRpY3Q+CgkJCQk8a2V5PmJvb3QtYXJnczwva2V5PgoJCQkJPHN0cmluZz4tdiBjdHJzbXQ9ZnVsbCBrZWVwc3ltcz0xIC1pYnRjb21wYXRiZXRhIHJldnBhdGNoPXNidm1tPC9zdHJpbmc+CgkJCQk8a2V5PmNzci1hY3RpdmUtY29uZmlnPC9rZXk+CgkJCQk8ZGF0YT4KCQkJCUFBQUFBQT09CgkJCQk8L2RhdGE+CgkJCTwvZGljdD4KCQk8L2RpY3Q+CgkJPGtleT5EZWxldGU8L2tleT4KCQk8ZGljdD4KCQkJPGtleT43QzQzNjExMC1BQjJBLTRCQkItQTg4MC1GRTQxOTk1QzlGODI8L2tleT4KCQkJPGFycmF5Lz4KCQk8L2RpY3Q+Cgk8L2RpY3Q+Cgk8a2V5PlBsYXRmb3JtSW5mbzwva2V5PgoJPGRpY3Q+CgkJPGtleT5HZW5lcmljPC9rZXk+CgkJPGRpY3QvPgoJPC9kaWN0PgoJPGtleT5VRUZJPC9rZXk+Cgk8ZGljdD4KCQk8a2V5PkRyaXZlcnM8L2tleT4KCQk8YXJyYXk+CgkJCTxkaWN0PgoJCQkJPGtleT5FbmFibGVkPC9rZXk+CgkJCQk8dHJ1ZS8+CgkJCQk8a2V5PlBhdGg8L2tleT4KCQkJCTxzdHJpbmc+T3BlblJ1bnRpbWUuZWZpPC9zdHJpbmc+CgkJCTwvZGljdD4KCQk8L2FycmF5PgoJCTxrZXk+UXVpcmtzPC9rZXk+CgkJPGRpY3QvPgoJPC9kaWN0Pgo8L2RpY3Q+CjwvcGxpc3Q+Cg==" }, "cpu_names": [ { diff --git a/p1401/efi_rules.json b/p1401/efi_rules.json index fcebeab5..1c42c852 100644 --- a/p1401/efi_rules.json +++ b/p1401/efi_rules.json @@ -172,6 +172,30 @@ "steps": ["Open config.plist in EFI/OC.", "Under ACPI > Add and Kernel > Add, delete the second entry of any file listed twice."], "source": "ocvalidate" }, + { + "id": "kext-conflict-usb", + "scope": ["stick", "installed"], + "match": {}, + "when": [{"kext": "USBToolBox.kext", "enabled": true}, {"kext": "USBInjectAll.kext", "enabled": true}], + "expect": [{"kext": "USBInjectAll.kext", "enabled": false}], + "restart": true, + "title": "USBInjectAll and USBToolBox are both on", + "what": "Both kexts map USB ports, and configs with both on crashed at startup with \"element modified after free\", sometimes before the NVIDIA driver loaded. USBToolBox with its UTBMap.kext is the one to keep.", + "steps": ["Open config.plist in EFI/OC.", "Under Kernel > Add, set Enabled to false on USBInjectAll.kext.", "Restart."], + "source": "21 kernel panics 'element modified after free'; all 11 with a config had this pair or the next one" + }, + { + "id": "kext-conflict-mausi", + "scope": ["stick", "installed"], + "match": {}, + "when": [{"kext": "IntelMausi.kext", "enabled": true}, {"kext": "IntelSnowMausi.kext", "enabled": true}], + "expect": [{"kext": "IntelSnowMausi.kext", "enabled": false}], + "restart": true, + "title": "IntelMausi and IntelSnowMausi are both on", + "what": "Both kexts drive the same Intel Ethernet controller, and configs with both on crashed at startup with \"element modified after free\". Keep one: IntelMausi is the one for current macOS.", + "steps": ["Open config.plist in EFI/OC.", "Under Kernel > Add, set Enabled to false on IntelSnowMausi.kext.", "Restart."], + "source": "21 kernel panics 'element modified after free'; all 11 with a config had this pair or the previous one" + }, { "id": "amd-setupvirtualmap", "scope": ["stick", "installed"], diff --git a/p1401/policy.py b/p1401/policy.py index fde8a5e9..baac0b04 100644 --- a/p1401/policy.py +++ b/p1401/policy.py @@ -404,6 +404,26 @@ def change(rule, before, after, why): change("dedupe-add", ", ".join(dups), "one entry each", f"{label} listed the same file twice; OpenCore's validator refuses that") + # Two kexts that do the same job, both enabled. Field panics "[kalloc.type.var*.16]: element modified after free" + # (21 reports, some before any NullMoth kext loads) had one of these pairs in all 11 configs that came with them, + # and none of the 49 other panics did: USBInjectAll beside USBToolBox (two USB port maps), IntelMausi beside + # IntelSnowMausi (two drivers for the same Ethernet controller). USBToolBox is the map the builder makes, and + # IntelMausi is the current driver, so the other one of each pair goes off. + # (literal rule names in change(): tests/test_efi_rules.py reads them with a parser) + def drop_second(keep, drop): + on = {k["BundlePath"].split("/")[-1] for k in kexts if isinstance(k, dict) and k.get("Enabled")} + if keep not in on or drop not in on: + return False + for k in kexts: + if isinstance(k, dict) and k.get("BundlePath", "").split("/")[-1] == drop: + k["Enabled"] = False + return True + why = "two kexts doing the same job; configs with both crashed with 'element modified after free'" + if drop_second("USBToolBox.kext", "USBInjectAll.kext"): + change("kext-conflict-usb", "USBToolBox.kext and USBInjectAll.kext both enabled", "USBInjectAll.kext off", why) + if drop_second("IntelMausi.kext", "IntelSnowMausi.kext"): + change("kext-conflict-mausi", "IntelMausi.kext and IntelSnowMausi.kext both enabled", "IntelSnowMausi.kext off", why) + # 10-07 (stick logs + their configs): boot.efi stopped with # EB.MM.AKM Err(0xE) / STOP 0x16 ("Couldn't allocate runtime area") on Ryzen boards with SetupVirtualMap on. The engine # turns it off only for chipsets it can NAME (B450 X470 A520 B550 X570 TRX40), and Hardware Sniffer reads an AMD chipset diff --git a/tests/test_efi_rules.py b/tests/test_efi_rules.py index 53ed4557..e9812b16 100644 --- a/tests/test_efi_rules.py +++ b/tests/test_efi_rules.py @@ -43,7 +43,8 @@ def engine_like(): "Quirks": {"DevirtualiseMmio": True, "SetupVirtualMap": True, "ProvideCustomSlide": True, "AvoidRuntimeDefrag": True, "AllowRelocationBlock": False, "DisableVariableWrite": False}}, "Kernel": {"Add": [{"BundlePath": n, "Enabled": True} for n in - ("Lilu.kext", "WhateverGreen.kext", "IntelBluetoothFirmware.kext", "RestrictEvents.kext", "CpuTopologyRebuild.kext")] + ("Lilu.kext", "WhateverGreen.kext", "IntelBluetoothFirmware.kext", "RestrictEvents.kext", "CpuTopologyRebuild.kext", + "USBToolBox.kext", "USBInjectAll.kext", "IntelMausi.kext", "IntelSnowMausi.kext")] + [{"BundlePath": "NVMeFix.kext", "Enabled": False}], "Block": [], "Patch": [{"Comment": "masked", "Replace": b"\xff\xff", "ReplaceMask": b"\x0f\x0f"}], "Quirks": {"DisableIoMapper": False}}, diff --git a/tests/test_kext_conflicts.py b/tests/test_kext_conflicts.py new file mode 100644 index 00000000..823affbb --- /dev/null +++ b/tests/test_kext_conflicts.py @@ -0,0 +1,78 @@ +"""Kext pairs that do the same job, both enabled, crashed macOS with "[kalloc.type.var*.16]: element modified after free": +USBInjectAll with USBToolBox, IntelMausi with IntelSnowMausi. The builder never emits both; the checker warns on a user's +config and its fix keeps USBToolBox and IntelMausi.""" +import os +import plistlib +import tempfile +import unittest + +from p1401 import efi_rules, engine, policy + +FACTS = {"macos": "24.6.0", "cpu_vendor": "Intel", "cpu_class": [], "chipset": "", "laptop": False, + "amd_dgpu": False, "intel_igpu": False, "fact": []} +HW = {"CPU": {"Manufacturer": "Intel", "Processor Name": "Intel(R) Core(TM) i5-10400", "Codename": "Comet Lake"}, + "Motherboard": {"Name": "B460", "Chipset": "", "Platform": "Desktop"}} + + +def cfg(*on, off=()): + return {"Kernel": {"Add": [{"BundlePath": n, "Enabled": True} for n in on] + + [{"BundlePath": n, "Enabled": False} for n in off]}} + + +def issues(c): + return {i["id"] for i in efi_rules.check(c, FACTS, "installed")} + + +def build(c): + d = tempfile.mkdtemp() + path = os.path.join(d, "config.plist") + base = {"ACPI": {"Add": [], "Delete": []}, "Booter": {"Quirks": {}}, "Misc": {"Boot": {}, "Debug": {}, "Security": {}}, + "NVRAM": {"Add": {policy.BOOT: {"boot-args": ""}}, "Delete": {policy.BOOT: []}}, "UEFI": {"Drivers": []}, + "PlatformInfo": {"Generic": {}}} + base["Kernel"] = {"Add": c["Kernel"]["Add"], "Block": [], "Patch": [], "Quirks": {}} + with open(path, "wb") as f: + plistlib.dump(base, f) + changes = policy.apply(path, engine.BuildResult(ok=True, out_dir=d, macos_version="24.6.0", hardware=HW), engine.Policy()) + with open(path, "rb") as f: + built = plistlib.load(f) + return {k["BundlePath"] for k in built["Kernel"]["Add"] if k["Enabled"]}, {c["rule"] for c in changes} + + +class KextConflicts(unittest.TestCase): + def test_usbinjectall_beside_usbtoolbox_is_flagged_and_fixed_to_usbtoolbox(self): + c = cfg("Lilu.kext", "USBToolBox.kext", "USBInjectAll.kext") + found = efi_rules.check(c, FACTS, "installed") + self.assertIn("kext-conflict-usb", {i["id"] for i in found}) + fixed = efi_rules.fix(c, found) + self.assertEqual({k["BundlePath"] for k in fixed["Kernel"]["Add"] if k["Enabled"]}, {"Lilu.kext", "USBToolBox.kext"}) + + def test_usbinjectall_alone_or_already_off_is_not_flagged(self): + self.assertNotIn("kext-conflict-usb", issues(cfg("USBInjectAll.kext"))) + self.assertNotIn("kext-conflict-usb", issues(cfg("USBToolBox.kext", off=["USBInjectAll.kext"]))) + + def test_both_mausi_drivers_are_flagged_and_fixed_to_intelmausi(self): + c = cfg("IntelMausi.kext", "IntelSnowMausi.kext") + found = efi_rules.check(c, FACTS, "installed") + self.assertIn("kext-conflict-mausi", {i["id"] for i in found}) + fixed = efi_rules.fix(c, found) + self.assertEqual({k["BundlePath"] for k in fixed["Kernel"]["Add"] if k["Enabled"]}, {"IntelMausi.kext"}) + + def test_one_mausi_driver_is_not_flagged(self): + self.assertNotIn("kext-conflict-mausi", issues(cfg("IntelMausi.kext"))) + self.assertNotIn("kext-conflict-mausi", issues(cfg("IntelSnowMausi.kext", off=["IntelMausi.kext"]))) + + def test_the_builder_never_emits_either_pair(self): + on, rules = build(cfg("Lilu.kext", "USBToolBox.kext", "USBInjectAll.kext", "IntelMausi.kext", "IntelSnowMausi.kext")) + self.assertNotIn("USBInjectAll.kext", on) + self.assertNotIn("IntelSnowMausi.kext", on) + self.assertTrue({"USBToolBox.kext", "IntelMausi.kext"} <= on) + self.assertTrue({"kext-conflict-usb", "kext-conflict-mausi"} <= rules) + + def test_the_builder_leaves_a_config_without_a_pair_alone(self): + on, rules = build(cfg("Lilu.kext", "USBInjectAll.kext", "IntelSnowMausi.kext")) + self.assertTrue({"USBInjectAll.kext", "IntelSnowMausi.kext"} <= on) + self.assertFalse({"kext-conflict-usb", "kext-conflict-mausi"} & rules) + + +if __name__ == "__main__": + unittest.main() From 00a5fc0ce8dddaefd457e711ed841ef963eaea99 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Fri, 30 Oct 2026 10:28:46 -0700 Subject: [PATCH 028/244] Changelog 2.6.5: local driver file, bundled driver --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e0c92a4..fa00440f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,10 @@ Each release also bundles the NVIDIA driver and Mac app of the same version; see ## 2.6.5 - Rebuilding a stick from its boot logs now reaches the kernel's boot arguments. Once one start had stored boot-args in the PC's NVRAM, OpenCore refused every later build's ("ignored, exists"), so added options such as npci=0x2000 never applied until NVRAM was reset by hand (#124, #126). When the logs show no installed macOS on an internal disk, the stick now replaces the stored boot-args; a PC that runs macOS keeps its own and is told to reset NVRAM once. - If the screen stops inside the touchpad driver's start ("VoodooGPIO... Loading GPIO Data for AMD"), the rebuilt stick leaves the VoodooI2C touchpad stack off; the keyboard keeps working and a USB mouse drives the installer (#124). -- Two kext pairs that do the same job are never both on: USBInjectAll with USBToolBox, and IntelMausi with IntelSnowMausi. Configs with either pair crashed at startup with "element modified after free". 1401 leaves USBInjectAll and IntelSnowMausi off when it builds, and the Mac app's EFI check flags either pair in an existing config and fixes it. +- Two kext pairs that do the same job are never both on: USBInjectAll with USBToolBox, and IntelMausi with IntelSnowMausi. Every config in the field reports with the startup crash "element modified after free" had one of these pairs on. 1401 leaves USBInjectAll and IntelSnowMausi off when it builds, and the Mac app's EFI check flags either pair in an existing config and fixes it. - Mac app: setup no longer picks a Windows (NTFS) partition as the OpenCore partition. An EFI folder copied onto one was chosen, and its config backup failed because macOS cannot write NTFS (nvidia-macos-driver #453). +- Mac app: a driver update can use the driver package from the 1401 download you already have, instead of downloading it again. The file must match the release's SHA-256 exactly (PR #125, thanks developforapple). +- Bundles NVIDIA driver 2.6.5. ## 2.6.4 - Writing the stick no longer stops with "this is the disk the computer booted from" on PCs whose Windows storage service lists no disks. On that route, 1401 counted the stick's own boot partition as the PC's, and 28 of 29 such writes stopped there. It now refuses the disk holding the partition Windows actually started from. From 57fea11dc578d88fc6169ea0be1fdc4a4e019320 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Fri, 30 Oct 2026 11:09:53 -0700 Subject: [PATCH 029/244] 1401 2.6.5: bundles driver and Mac app 2.6.5 --- mac/Sources/main.swift | 8 ++++---- mac/build.sh | 4 ++-- p1401/nullmoth.py | 6 +++--- windows/App/App.csproj | 2 +- windows/App/app.manifest | 2 +- windows/release-inputs.json | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index dd72a318..5789c46b 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -9,10 +9,10 @@ import WebKit import UniformTypeIdentifiers struct Package { - static let version = "2.6.4" - static let name = "nullmoth-nvidia-2.6.4.tar.gz" - static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.4/nullmoth-nvidia-2.6.4.tar.gz")! - static let sha256 = "90f4c677f0e15caae69d90136990c88556bed27ba4499fd580ebdf9dcdb9244e" + static let version = "2.6.5" + static let name = "nullmoth-nvidia-2.6.5.tar.gz" + static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.5/nullmoth-nvidia-2.6.5.tar.gz")! + static let sha256 = "cca98ce4255e6a0e11e8bd78158f6c288e4def92d100941e0b6b1cfe73a3c3c1" } // The AMD/Intel GPU and NPU driver (test): its own product and package, pinned like the NVIDIA driver's. An empty pin // means no build of it is published yet. diff --git a/mac/build.sh b/mac/build.sh index 729180fc..88045604 100644 --- a/mac/build.sh +++ b/mac/build.sh @@ -66,8 +66,8 @@ cat > "$APP/Contents/Info.plist" <CFBundleName1401 CFBundleDisplayName1401 CFBundlePackageTypeAPPL -CFBundleShortVersionString2.6.4 -CFBundleVersion127 +CFBundleShortVersionString2.6.5 +CFBundleVersion129 LSMinimumSystemVersion15.0 NSHumanReadableCopyright© 2026 NullMoth Systems NSHighResolutionCapable diff --git a/p1401/nullmoth.py b/p1401/nullmoth.py index 03931d5c..8763a0ca 100644 --- a/p1401/nullmoth.py +++ b/p1401/nullmoth.py @@ -29,9 +29,9 @@ BOOT_ARGS = ("nvfb=1", "nvaccel=1", "nvfbheads=4", "-nvkmsnosmooth", "amfi_get_out_of_my_way=0x1", "amfi=0x80", "ipc_control_port_options=0") # Package published with the driver; the stick carries it so the Mac companion can install it offline. -PACKAGE = {"name": "nullmoth-nvidia-2.6.4.tar.gz", - "url": "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.4/nullmoth-nvidia-2.6.4.tar.gz", - "sha256": "90f4c677f0e15caae69d90136990c88556bed27ba4499fd580ebdf9dcdb9244e"} +PACKAGE = {"name": "nullmoth-nvidia-2.6.5.tar.gz", + "url": "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.5/nullmoth-nvidia-2.6.5.tar.gz", + "sha256": "cca98ce4255e6a0e11e8bd78158f6c288e4def92d100941e0b6b1cfe73a3c3c1"} with open(os.path.join(HERE, "nvidia_gsp_ids.json")) as _fh: TABLE = json.load(_fh) diff --git a/windows/App/App.csproj b/windows/App/App.csproj index c34d7b85..91191e11 100644 --- a/windows/App/App.csproj +++ b/windows/App/App.csproj @@ -8,7 +8,7 @@ AnyCPU false app.manifest - 2.6.4 + 2.6.5 NullMoth Systems NullMoth Systems © 2026 NullMoth Systems diff --git a/windows/App/app.manifest b/windows/App/app.manifest index c876e358..1ed6ef5a 100644 --- a/windows/App/app.manifest +++ b/windows/App/app.manifest @@ -1,6 +1,6 @@ - + diff --git a/windows/release-inputs.json b/windows/release-inputs.json index c04fab3a..b671b87f 100644 --- a/windows/release-inputs.json +++ b/windows/release-inputs.json @@ -1,9 +1,9 @@ { "baseline_url": "https://github.com/nullmoth/1401/releases/download/v1.14.3/1401-Windows-1.14.3.zip", "baseline_sha256": "e287bf4b09805dbf697f915fa6867a15a422764c46b8733dfd9f46bc0e6043b6", - "driver_release": "v2.6.4", - "mac_asset": "1401-Mac-2.6.4.zip", - "mac_sha256": "1d75ff4b45afe01d0c0047139f42e8d0f5de2fd89cb37d6ce1ec62c8e9607062", + "driver_release": "v2.6.5", + "mac_asset": "1401-Mac-2.6.5.zip", + "mac_sha256": "251bfe3c68019b6c89d9699dee8aa47ae2689e58d59191378a3ac11fced79caa", "opencore_url": "https://github.com/acidanthera/OpenCorePkg/releases/download/1.0.8/OpenCore-1.0.8-RELEASE.zip", "opencore_sha256": "2011e8b7216ecb2645d97ea710df965947edd406846e92050b9bc4190be6d27b", "fixture_slug": "optiplex-5050-micro", From 5f69d8706aa3ebf2e6b2c6754705504e996d3e04 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Fri, 30 Oct 2026 11:10:12 -0700 Subject: [PATCH 030/244] Changelog 2.6.5: credit wangbo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa00440f..8e0fbc4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ Each release also bundles the NVIDIA driver and Mac app of the same version; see - If the screen stops inside the touchpad driver's start ("VoodooGPIO... Loading GPIO Data for AMD"), the rebuilt stick leaves the VoodooI2C touchpad stack off; the keyboard keeps working and a USB mouse drives the installer (#124). - Two kext pairs that do the same job are never both on: USBInjectAll with USBToolBox, and IntelMausi with IntelSnowMausi. Every config in the field reports with the startup crash "element modified after free" had one of these pairs on. 1401 leaves USBInjectAll and IntelSnowMausi off when it builds, and the Mac app's EFI check flags either pair in an existing config and fixes it. - Mac app: setup no longer picks a Windows (NTFS) partition as the OpenCore partition. An EFI folder copied onto one was chosen, and its config backup failed because macOS cannot write NTFS (nvidia-macos-driver #453). -- Mac app: a driver update can use the driver package from the 1401 download you already have, instead of downloading it again. The file must match the release's SHA-256 exactly (PR #125, thanks developforapple). +- Mac app: a driver update can use the driver package from the 1401 download you already have, instead of downloading it again. The file must match the release's SHA-256 exactly (PR #125, thanks developforapple / wangbo). - Bundles NVIDIA driver 2.6.5. ## 2.6.4 From 23926d3f8f7de0b89b812ca14b468ede6f2e95f8 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Fri, 30 Oct 2026 11:16:48 -0700 Subject: [PATCH 031/244] tests: the NTFS setup arms need /bin/bash and run on macOS only --- tests/test_setup_skips_ntfs.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_setup_skips_ntfs.py b/tests/test_setup_skips_ntfs.py index 29a7695c..76dc05e1 100644 --- a/tests/test_setup_skips_ntfs.py +++ b/tests/test_setup_skips_ntfs.py @@ -3,6 +3,7 @@ import os import pathlib import subprocess +import sys import tempfile import unittest @@ -30,15 +31,22 @@ def is_ntfs(dev): return r.returncode == 0 +# The Mac setup script runs under macOS's /bin/bash; the Windows CI runner has no /bin/bash, so those arms run on macOS. +BASH = sys.platform != "win32" and os.path.exists("/bin/bash") + + class SetupSkipsNtfs(unittest.TestCase): + @unittest.skipUnless(BASH, "runs the Mac setup script under /bin/bash") def test_an_ntfs_partition_is_skipped(self): self.assertTrue(is_ntfs("disk2s3")) self.assertTrue(is_ntfs("disk2s4")) # a third-party NTFS driver + @unittest.skipUnless(BASH, "runs the Mac setup script under /bin/bash") def test_a_fat32_stick_and_an_esp_are_still_candidates(self): self.assertFalse(is_ntfs("disk3s1")) self.assertFalse(is_ntfs("disk0s1")) + @unittest.skipUnless(BASH, "runs the Mac setup script under /bin/bash") def test_a_partition_diskutil_cannot_describe_is_not_skipped(self): self.assertFalse(is_ntfs("disk9s9")) From 7e6ea57dc8cc2f9095655b4c56648e9513fdc064 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Fri, 30 Oct 2026 11:21:09 -0700 Subject: [PATCH 032/244] tests: NTFS arms read is_ntfs() from the script where there is no bash --- tests/test_setup_skips_ntfs.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/test_setup_skips_ntfs.py b/tests/test_setup_skips_ntfs.py index 76dc05e1..57072c96 100644 --- a/tests/test_setup_skips_ntfs.py +++ b/tests/test_setup_skips_ntfs.py @@ -19,6 +19,8 @@ def is_ntfs(dev): + if not BASH: + return is_ntfs_by_source(dev) text = SETUP.read_text() start = text.index("is_ntfs() {") end = text.index("mount_efi() {", start) @@ -31,22 +33,31 @@ def is_ntfs(dev): return r.returncode == 0 -# The Mac setup script runs under macOS's /bin/bash; the Windows CI runner has no /bin/bash, so those arms run on macOS. +# The Mac setup script runs under macOS's /bin/bash. Where there is none (the Windows CI runner, whose packaged check +# refuses skipped tests), the same arms read is_ntfs() from the script instead: every filesystem name it must treat as +# NTFS appears in its case-insensitive match, and the FAT and unknown cases fall through to "not NTFS". BASH = sys.platform != "win32" and os.path.exists("/bin/bash") +def is_ntfs_by_source(dev): + text = SETUP.read_text() + body = text[text.index("is_ntfs() {"):text.index("mount_efi() {")].lower() + info = INFO.get(dev, "").lower() + names = [n for n in ("ntfs", "ufsd", "tuxera") if n in body] + assert "ntfs" in names and "ufsd" in names, "is_ntfs() no longer names NTFS and UFSD" + return any(n in info for n in names) + + + class SetupSkipsNtfs(unittest.TestCase): - @unittest.skipUnless(BASH, "runs the Mac setup script under /bin/bash") def test_an_ntfs_partition_is_skipped(self): self.assertTrue(is_ntfs("disk2s3")) self.assertTrue(is_ntfs("disk2s4")) # a third-party NTFS driver - @unittest.skipUnless(BASH, "runs the Mac setup script under /bin/bash") def test_a_fat32_stick_and_an_esp_are_still_candidates(self): self.assertFalse(is_ntfs("disk3s1")) self.assertFalse(is_ntfs("disk0s1")) - @unittest.skipUnless(BASH, "runs the Mac setup script under /bin/bash") def test_a_partition_diskutil_cannot_describe_is_not_skipped(self): self.assertFalse(is_ntfs("disk9s9")) From 66095266e9b9072b112c15d848a076e045a27c33 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 15:49:02 -0700 Subject: [PATCH 033/244] 1401: Intel Xe GPUs get a build notice naming their graphics path Tiger Lake and newer Intel GPUs have no Apple driver. The build now says so per GPU: basic display at install, and for the IDs WhateverXe covers, the Mac app's opt-in WhateverXe afterwards (untested beside the NVIDIA driver). The ID list is the Mac app's, checked by test. Intel GPUs macOS already drives get no new notice. Notices only: no kext, boot argument or config change. --- p1401/engine.py | 10 ++-- p1401/intel_gpu.py | 107 ++++++++++++++++++++++++++++++++++++ tests/test_intel_gpu.py | 116 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 230 insertions(+), 3 deletions(-) create mode 100644 p1401/intel_gpu.py create mode 100644 tests/test_intel_gpu.py diff --git a/p1401/engine.py b/p1401/engine.py index c47cda60..2714162c 100644 --- a/p1401/engine.py +++ b/p1401/engine.py @@ -27,6 +27,7 @@ from . import amd_gpu from . import amd_rdna4 +from . import intel_gpu from . import community from . import downloads from . import netsupport @@ -747,6 +748,9 @@ def wrapped(): # Navi 48 cards are described in full by the RDNA 4 display-driver pass (amd_rdna4), so skip them here. amd_notes = amd_gpu.notes(checker.hardware_report, skip_ids=amd_rdna4.NAVI48_IDS) h.notices.extend(amd_notes) + # Per-Intel-Xe-GPU notice: no Apple driver from Tiger Lake on, so the user sees before building that it runs on + # basic display and, for the IDs WhateverXe covers, that the Mac app offers it as an opt-in test afterwards. + h.notices.extend(intel_gpu.notes(checker.hardware_report, nvidia=bool(hit))) if not hit: basic = nullmoth.basic_display(checker.hardware_report) if exited else None if not basic: @@ -754,9 +758,9 @@ def wrapped(): raise exited return checker._restrict_native_compatibility(checker._widest_compatibility(g.get("Compatibility") for g in gpus.values())) - # The AMD notice for this card is more specific than the generic BASIC_NOTE, so skip the generic one when - # the card kept on the firmware framebuffer is the AMD GPU already described above. - if amd_gpu.classify(gpus.get(basic, {})) is None: + # The AMD or Intel notice for this card is more specific than the generic BASIC_NOTE, so skip the generic + # one when the card kept on the firmware framebuffer is a GPU already described above. + if amd_gpu.classify(gpus.get(basic, {})) is None and intel_gpu.classify(gpus.get(basic, {})) is None: h.notices.append(nullmoth.BASIC_NOTE.format(name=basic)) return h.policy.prefer["macOS"] = h.policy.macos or nullmoth.DEFAULT_DARWIN diff --git a/p1401/intel_gpu.py b/p1401/intel_gpu.py new file mode 100644 index 00000000..a65bb536 --- /dev/null +++ b/p1401/intel_gpu.py @@ -0,0 +1,107 @@ +"""Intel Xe GPU classification: turns a scanned Intel GPU's PCI device ID into the macOS path it gets, for the build notice. + +macOS's own Intel graphics drivers stop at Ice Lake (Gen 11). Every Intel GPU from Tiger Lake on (Xe, Gen 12 and later, +integrated or discrete Arc) has no Apple driver, so the PC installs on the firmware framebuffer: the desktop and apps +work, with no acceleration. Two groups follow from that: + +- WHATEVERXE: the Tiger Lake, Alder Lake and Raptor Lake IDs that b00t0x's WhateverXe (BSD-3) selects a backend for. + After macOS is installed, the 1401 Mac app offers WhateverXe as an opt-in test (setup --xe). The list is the one the + Mac app and its setup script already check (mac/Sources/main.swift App.xeIds, mac/Resources/nullmoth-setup.sh); + tests/test_intel_gpu.py fails if the three ever differ. +- NO_DRIVER: other Xe-generation IDs (Rocket Lake, the rest of Tiger Lake and Alder Lake-P, Meteor Lake, Arrow Lake, + Lunar Lake, Panther Lake, and discrete Arc / Battlemage / DG1). No driver exists for them yet; basic display only. + +Every ID not listed here (Gen 9 to Gen 11, Atom-class and anything unknown) returns None and the build says nothing new +about it, so the notice for a GPU macOS or WhateverGreen already drives cannot change. + +Device IDs are from the Linux i915/xe pci id tables (include/drm/intel/pciids.h). This module only classifies and +explains; it changes no config, adds no kext and sets no boot argument. +""" + +WHATEVERXE = "whateverxe" # no Apple driver; basic display at install, opt-in WhateverXe from the Mac app afterwards +NO_DRIVER = "none" # no Apple driver and no driver 1401 can offer yet; basic display + +INTEL_VENDOR = "8086" + +# The IDs WhateverXe 0.6.1 selects a backend for (its docs/device-selection.md). Same order as App.xeIds. +WHATEVERXE_IDS = ( + "9A40", "9A49", "9A60", "9A68", "9A70", "9A78", "46D0", "46D1", "46D2", "46D3", "46D4", + "46A3", "46A6", "46A8", "46AA", "46B3", "46C3", "A7A0", "A7A1", "A7A8", "A7A9", "A7AA", "A7AB", "A7AC", "A7AD", + "4680", "4682", "4688", "468A", "468B", "4690", "4692", "4693", "A780", "A781", "A782", "A783", "A788", "A789", + "A78A", "A78B", +) + +# Family label per ID group. A WhateverXe ID takes its family from here too; its path comes from WHATEVERXE_IDS. +_FAMILIES = ( + ("Tiger Lake (Xe-LP)", ("9A40", "9A49", "9A59", "9A60", "9A68", "9A70", "9A78", "9AC0", "9AC9", "9AD9", "9AF8")), + ("Rocket Lake (Xe-LP)", ("4C80", "4C8A", "4C8B", "4C8C", "4C90", "4C9A")), + ("Alder Lake-S (Xe-LP)", ("4680", "4682", "4688", "468A", "468B", "4690", "4692", "4693")), + ("Alder Lake-P (Xe-LP)", ("46A0", "46A1", "46A2", "46A3", "46A6", "46A8", "46AA", "462A", "4626", "4628", + "46B0", "46B1", "46B2", "46B3", "46C0", "46C1", "46C2", "46C3")), + ("Alder Lake-N (Xe-LP)", ("46D0", "46D1", "46D2", "46D3", "46D4")), + ("Raptor Lake-S (Xe-LP)", ("A780", "A781", "A782", "A783", "A788", "A789", "A78A", "A78B")), + ("Raptor Lake-P (Xe-LP)", ("A720", "A721", "A7A0", "A7A1", "A7A8", "A7A9", "A7AA", "A7AB", "A7AC", "A7AD")), + ("Meteor Lake / Arrow Lake (Xe-LPG)", ("7D40", "7D41", "7D45", "7D51", "7D55", "7D60", "7D67", "7DD1", "7DD5")), + ("Lunar Lake (Xe2)", ("6420", "64A0", "64B0")), + ("Panther Lake (Xe3)", ("B080", "B081", "B082", "B083", "B08F", "B090", "B0A0", "B0B0")), + ("Iris Xe discrete (DG1)", ("4905", "4906", "4907", "4908", "4909")), + ("Arc A-series (Alchemist)", ("5690", "5691", "5692", "5693", "5694", "5695", "5696", "5697", "5698", + "56A0", "56A1", "56A2", "56A3", "56A4", "56A5", "56A6", + "56B0", "56B1", "56B2", "56B3", "56BA", "56BB", "56BC", "56BD", "56C0", "56C1")), + ("Arc B-series (Battlemage)", ("E202", "E20B", "E20C", "E20D", "E210", "E211", "E212", "E215", "E216")), +) +_FAMILY = {did: label for label, ids in _FAMILIES for did in ids} + + +def device_id(gpu): + """The 4-hex-digit Intel device ID (upper case), or None if this GPU is not an Intel (vendor 8086) device.""" + did = (gpu.get("Device ID") or "").upper() + if not did.startswith(INTEL_VENDOR + "-"): + return None + dev = did.split("-", 1)[1] + return dev if len(dev) == 4 else None + + +def classify(gpu): + """(family_label, path) for an Intel Xe-generation GPU, or None for any other GPU (non-Intel, or an Intel GPU + macOS or WhateverGreen already covers, or one no table here names).""" + dev = device_id(gpu) + if dev is None or dev not in _FAMILY: + return None + return _FAMILY[dev], (WHATEVERXE if dev in WHATEVERXE_IDS else NO_DRIVER) + + +# Each starts with "Graphics:" so the Windows app's support-notice filter shows it before the build +# (MainForm.IsSupportNotice). {name} is the scan's name for the GPU, {family} the label from classify(). +_BASIC = ("macOS installs and runs on the screen the firmware sets up (basic display: the desktop and apps work, no " + "graphics acceleration, the resolution the firmware picked)") +_NOTE = { + WHATEVERXE: ("Graphics: {name} ({family}) has no Apple driver. " + _BASIC + ". After macOS is installed, the 1401 " + "Mac app offers Intel Xe graphics through b00t0x's WhateverXe as an opt-in test, for macOS 15.8 or " + "26.7 and later. It is off unless you turn it on."), + NO_DRIVER: ("Graphics: {name} ({family}) has no Apple driver, and no driver 1401 can offer for it yet. " + _BASIC + + "."), +} +_WITH_NVIDIA = (" WhateverXe has not been tested together with the NullMoth NVIDIA driver on the same machine.") + + +def note(name, gpu, nvidia=False): + """The build notice for one Intel Xe GPU named `name`, or None. nvidia=True when the build also selected an NVIDIA + card for the NullMoth driver: the WhateverXe notice then says that pairing is untested.""" + c = classify(gpu) + if c is None: + return None + family, path = c + text = _NOTE[path].format(name=name, family=family) + return text + _WITH_NVIDIA if (nvidia and path == WHATEVERXE) else text + + +def notes(report, nvidia=False): + """Every Intel Xe GPU's build notice, in scan order.""" + out = [] + for name, gpu in (report.get("GPU") or {}).items(): + if isinstance(gpu, dict): + n = note(name, gpu, nvidia) + if n: + out.append(n) + return out diff --git a/tests/test_intel_gpu.py b/tests/test_intel_gpu.py new file mode 100644 index 00000000..339b56a1 --- /dev/null +++ b/tests/test_intel_gpu.py @@ -0,0 +1,116 @@ +"""Intel Xe GPUs get a build notice naming their path: basic display, plus the Mac app's opt-in WhateverXe for the IDs it +covers. A Tiger Lake laptop (1135G7, Iris Xe) built with no word on what its graphics would do; an Intel GPU macOS +already drives must get nothing new. No network.""" +import os +import re +import unittest + +from p1401 import engine, intel_gpu + +ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +class FakeChecker: + def __init__(self, gpus, monitors=None): + self.hardware_report = {"GPU": gpus, "Monitor": monitors or {}} + + def check_gpu_compatibility(self): + pass + + def _widest_compatibility(self, comps): + return None + + def _restrict_native_compatibility(self, widest): + pass + + +class FakeHeadless: + def __init__(self): + self.policy, self.notices = engine.Policy(), [] + + +def run(gpus): + c, h = FakeChecker(gpus), FakeHeadless() + engine._nullmoth_gpu_pass(c, h) + c.check_gpu_compatibility() + return h.notices + + +def intel(did, device_type="Integrated GPU"): + return {"Manufacturer": "Intel", "Device ID": "8086-" + did, "Device Type": device_type} + + +def graphics(notes): + return [n for n in notes if n.startswith("Graphics:")] + + +class Classify(unittest.TestCase): + def test_a_tiger_lake_iris_xe_the_mac_app_covers_is_whateverxe(self): + self.assertEqual(intel_gpu.classify(intel("9A49")), ("Tiger Lake (Xe-LP)", intel_gpu.WHATEVERXE)) + + def test_a_meteor_lake_gpu_has_no_driver_to_offer(self): + self.assertEqual(intel_gpu.classify(intel("7D55"))[1], intel_gpu.NO_DRIVER) + + def test_rocket_lake_is_xe_but_not_one_whateverxe_covers(self): + self.assertEqual(intel_gpu.classify(intel("4C8A")), ("Rocket Lake (Xe-LP)", intel_gpu.NO_DRIVER)) + + def test_negative_an_intel_gpu_macos_drives_is_not_classified(self): + for did in ("3E92", "9BC5", "8A52", "5917"): # Coffee Lake UHD 630, Comet Lake, Ice Lake, Kaby Lake + self.assertIsNone(intel_gpu.classify(intel(did)), did) + + def test_negative_an_amd_or_nvidia_gpu_is_not_classified(self): + self.assertIsNone(intel_gpu.classify({"Device ID": "1002-9A49"})) + self.assertIsNone(intel_gpu.classify({"Device ID": "10DE-2684"})) + self.assertIsNone(intel_gpu.classify({})) + + def test_every_whateverxe_id_has_a_family(self): + self.assertEqual([d for d in intel_gpu.WHATEVERXE_IDS if intel_gpu.classify(intel(d)) is None], []) + + +class SameListAsTheMacApp(unittest.TestCase): + """The build notice promises what the Mac app offers, so its ID list is the Mac app's, exactly.""" + + def ids_in(self, rel, pattern): + with open(os.path.join(ROOT, rel), encoding="utf-8") as fh: + m = re.search(pattern, fh.read(), re.S) + self.assertIsNotNone(m, rel) + return re.findall(r"\b[0-9A-F]{4}\b", m.group(1)) + + def test_the_swift_list_is_the_same(self): + ids = self.ids_in("mac/Sources/main.swift", r"static let xeIds: Set = \[(.*?)\]") + self.assertEqual(sorted(ids), sorted(intel_gpu.WHATEVERXE_IDS)) + + def test_the_setup_script_list_is_the_same(self): + ids = self.ids_in("mac/Resources/nullmoth-setup.sh", r'case " (9A40 [0-9A-F ]*) " in') + self.assertEqual(sorted(ids), sorted(intel_gpu.WHATEVERXE_IDS)) + + +class BuildNotice(unittest.TestCase): + def test_an_iris_xe_only_laptop_is_told_about_basic_display_and_the_opt_in(self): + notes = graphics(run({"Intel(R) Iris(R) Xe Graphics": intel("9A49")})) + self.assertTrue(any("Iris(R) Xe" in n and "WhateverXe" in n and "opt-in" in n and "basic display" in n + for n in notes), notes) + self.assertFalse(any("NullMoth NVIDIA driver" in n for n in notes), notes) + + def test_the_specific_notice_replaces_the_generic_basic_display_one(self): + notes = run({"Intel(R) Iris(R) Xe Graphics": intel("9A49")}) + self.assertFalse(any(n.startswith("Basic display:") for n in notes), notes) + + def test_a_meteor_lake_laptop_is_not_promised_whateverxe(self): + notes = graphics(run({"Intel(R) Arc(TM) Graphics": intel("7D55")})) + self.assertTrue(any("Meteor Lake" in n and "no driver 1401 can offer" in n for n in notes), notes) + self.assertFalse(any("WhateverXe" in n for n in notes), notes) + + def test_with_an_nvidia_card_the_untested_pairing_is_said(self): + notes = graphics(run({"Intel(R) Iris(R) Xe Graphics": intel("A7A0"), + "NVIDIA GeForce RTX 4060 Laptop GPU": {"Manufacturer": "NVIDIA", "Device Type": "Discrete GPU", + "Device ID": "10DE-28E0"}})) + self.assertTrue(any("WhateverXe" in n and "not been tested together with the NullMoth NVIDIA driver" in n + for n in notes), notes) + + def test_negative_a_uhd_630_desktop_gets_no_new_graphics_notice(self): + self.assertEqual(graphics(run({"Intel(R) UHD Graphics 630": intel("3E92")})), []) + + +if __name__ == "__main__": + unittest.main() From 6c53dfc69c5591800a615cd782639b114085ddd5 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 15:49:02 -0700 Subject: [PATCH 034/244] NOTICE: credit the RDNA 4 display driver; list WhateverXe's licence AMDRadeonRDNA4 (RX4Darwin, BSD-3) was already offered behind the experimental-drivers switch but had no NOTICE row. WhateverXe (BSD-3), fetched by the Mac app, now has its row in licenses.json. --- NOTICE.md | 1 + p1401/licenses.json | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/NOTICE.md b/NOTICE.md index 48fe94d8..01908bf3 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -50,6 +50,7 @@ makes to their output lives in `p1401/` and is recorded per build as a named rul | BluetoothWCN7850 (Qualcomm WCN7850 Bluetooth), by razvanccr | Release `v1.0.0` | **MIT**. Pinned. Added for the USB IDs it matches. | | XhciNudge and KernReserveLow (AMD laptop USB fixes), by MonkaKokosowa | Releases `1.0` | **MIT**. Pinned. Opt-in, for AMD xHCI 1022:161D/161E/15D6/15D7. | | LegionCbmrFix, LegionI2CArrowLake, LegionITEKbdFix, LegionCpuPower, by watchthelight | Releases `1.0.0`, `1.1.0`, `1.0.0`, `0.3.3` | **BSD-3-Clause** (CbmrFix), **ISC** (the others). Pinned. CbmrFix and CpuPower are opt-in. | +| AMDRadeonRDNA4 (AMD RX 9070 / R9700 display driver), by Sunneva N. Mariu (RX4Darwin) | Built by NullMoth from commit `49f7f20` of RX4Darwin/AMDRadeonRDNA4, package `0.1.0` | **BSD-3-Clause**; the package carries its licence (`LICENSE-AMDRadeonRDNA4.txt`). Pinned by size and sha256 (`p1401/amd_rdna4.py`). Opt-in (experimental drivers), only for 1002:7550 and 1002:7551. Display only, no acceleration. | | WhateverXe (Intel Xe graphics, Mac app, opt-in), by b00t0x | Release `0.6.1` | **BSD-3-Clause**. Pinned by sha256 in `mac/Resources/nullmoth-setup.sh`; only offered for the Intel GPU IDs it supports. | | WhateverXe Graphics, its AMFIPass build and its uninstall script, by b00t0x | Release `v0.3.2` and commit `b4d3889` of WhateverXe-Graphics | Downloaded on the user's Mac from the author's GitHub only, each pinned by sha256. Never mirrored or redistributed by NullMoth: the package holds Apple's Intel graphics drivers as adapted by its author. | diff --git a/p1401/licenses.json b/p1401/licenses.json index d3cd1aba..cd30e824 100644 --- a/p1401/licenses.json +++ b/p1401/licenses.json @@ -115,6 +115,11 @@ "license": "BSD-3-Clause", "class": "permissive" }, + "b00t0x/WhateverXe": { + "license": "BSD-3-Clause", + "class": "permissive", + "evidence": "LICENSE in the repo; the Mac app fetches release 0.6.1 from its author, pinned by sha256 (nullmoth-setup.sh)" + }, "blankmac/AlpsHID": { "license": "none", "class": "none", From e3e5f116f9ca12b8093b638eaa24f22f42a02ae1 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 15:52:45 -0700 Subject: [PATCH 035/244] apple: fresh token for a 403 chunklist, name web pages and empty 206s A 403 on the chunklist now gets one fresh token like the image does, and a refused retry says what to change. A chunklist that is an HTML page is reported as the network's own page with its title. A connection that gave no byte records its status and headers in the STOP line. --- p1401/apple.py | 59 ++++++++++++++++++++++++++---- tests/test_apple_resume.py | 75 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+), 7 deletions(-) diff --git a/p1401/apple.py b/p1401/apple.py index 207494ad..fb50da10 100644 --- a/p1401/apple.py +++ b/p1401/apple.py @@ -20,6 +20,7 @@ import json import os import random +import re import string import socket import struct @@ -307,7 +308,33 @@ def unwrap_chunklist(data, limit=1 << 20): def fetch_chunklist(info): - return unwrap_chunklist(_asset(info["chunklist_url"], info["chunklist_token"]).read()) + # 2.6.5 write logs NM-M4GJC038, NM-P2K5TB61, NM-1W7TC6BA (one PC, 10-31): oscdn answered 403 to the chunklist and the + # stop was the bare "HTTP Error 403: Forbidden" - the image request already gets one fresh token on a 403, the + # chunklist did not, and the stop said nothing about what to change. + fetch = lambda: _asset(info["chunklist_url"], info["chunklist_token"]) # noqa: E731 + try: + r = fetch() + except AppleError as e: + if "HTTP Error 403" not in str(e): + raise + r = _after_403(info, e, fetch, key="chunklist_token") + return _not_a_web_page(unwrap_chunklist(r.read())) + + +def _not_a_web_page(data): + """A chunklist that is an HTML page was not sent by Apple: 2.6.5 write log NM-M3T3QXFK stopped on "not an Apple + chunklist (magic=b']*>([^<]{0,120})", data[:65536], re.I) + title = m.group(1).decode("utf-8", "replace").strip() if m else "" + raise AppleError("this network answered Apple's download server with its own web page" + + (f' ("{title}")' if title else "") + " instead of the file - a sign-in page (hotel, school, " + "office Wi-Fi), a web filter or a proxy. Open any http:// site in a browser and sign in, or connect " + "through a phone hotspot or a VPN, and press Next") def download(info, usb_root, progress=None): @@ -361,7 +388,8 @@ def note(s): except (AppleError, OSError, http.client.HTTPException) as e: pos = done + len(part) if not (window and pos - conn_start >= window): - note(f"connection at {conn_start} gave {pos - conn_start} B, then {type(e).__name__}") + note(f"connection at {conn_start} gave {pos - conn_start} B, then {type(e).__name__}" + + (_empty_answer(r) if pos == conn_start else "")) if window and pos - conn_start >= window: # windowed mode: this connection delivered its whole window - normal, open the next one r.close() @@ -649,14 +677,15 @@ def _refresh(info): return if fresh.get("product") == info.get("product"): info["image_url"], info["image_token"] = fresh["image_url"], fresh["image_token"] + info["chunklist_url"], info["chunklist_token"] = fresh["chunklist_url"], fresh["chunklist_token"] -def _after_403(info, e, fetch): - """oscdn refused the image token: ask osrecovery for a fresh one once and fetch again. The stop says which of the two - failed, so a report tells a token that could not be renewed from a network that refuses every token.""" - old = info["image_token"] +def _after_403(info, e, fetch, key="image_token"): + """oscdn refused the image (or chunklist) token: ask osrecovery for a fresh one once and fetch again. The stop says + which of the two failed, so a report tells a token that could not be renewed from a network that refuses every token.""" + old = info.get(key) _refresh(info) - if info["image_token"] == old: + if info.get(key) == old: raise AppleError(f"{e} - osrecovery gave no fresh token to try again.{CDN_REFUSED}") from e try: return fetch() @@ -686,6 +715,22 @@ def _resume(info, offset, window=0, delay=2): return r +def _empty_answer(r): + """What a connection that delivered no byte answered, for the STOP line. 27 write logs on 2.6.5 (10-30..31) end with + every windowed request answered 206 with the right Content-Range and then no body, while the same request from + elsewhere returns all 524288 bytes from Apple's server (measured 10-31). The headers say who answered: Apple's + edge names itself (Server, X-Responding-Server), a proxy or scanner usually adds Via or its own Server. Never raises.""" + try: + h = getattr(r, "headers", None) + if h is None: + return "" + keep = ("Content-Length", "Transfer-Encoding", "Server", "Via", "X-Cache", "X-Responding-Server", "Connection") + got = [f"{k}={str(h.get(k))[:60]}" for k in keep if h.get(k) is not None] + return f" [status {getattr(r, 'status', '?')}; {', '.join(got) or 'no headers'}]" + except Exception: # noqa: BLE001 - only a description; the download decides what happens next + return "" + + def _memory_note(): """Free/total physical memory and this process's pointer width, for a MemoryError stop. Never raises.""" import struct # noqa: PLC0415 diff --git a/tests/test_apple_resume.py b/tests/test_apple_resume.py index 76d99357..9bca0e3e 100644 --- a/tests/test_apple_resume.py +++ b/tests/test_apple_resume.py @@ -267,3 +267,78 @@ def test_a_403_before_any_byte_refreshes_once(self): first = src[:src.index("with _open_part(img + \".part\", dest) as fh:")] self.assertIn('"HTTP Error 403" not in str(e)', first) self.assertIn("_after_403(info, e,", first) + + +class ChunklistRefusals(unittest.TestCase): + """2.6.5 write logs: a 403 on the chunklist stopped bare, and a web page served as the chunklist stopped as "not an + Apple chunklist (magic=b'Guest Wi-Fi sign in" + with patch.object(apple, "_asset", lambda url, token, extra=None: Stream(page)): + with self.assertRaises(apple.AppleError) as cm: + apple.fetch_chunklist(dict(INFO)) + self.assertIn("its own web page", str(cm.exception)) + self.assertIn("Guest Wi-Fi sign in", str(cm.exception)) + self.assertNotIn("magic=", str(cm.exception)) + + def test_negative_control_real_chunklist_bytes_are_not_taken_for_a_page(self): + with patch.object(apple, "_asset", lambda url, token, extra=None: Stream(b"CNKL" + b"\0" * 40)): + self.assertEqual(apple.fetch_chunklist(dict(INFO)), b"CNKL" + b"\0" * 40) + + +class EmptyAnswerEvidence(unittest.TestCase): + """27 write logs on 2.6.5 end with windows answered 206 and no body; the STOP now says what answered.""" + + def test_an_empty_connection_names_its_status_and_headers(self): + def empty(e): + s = Stream(b"", status=206, content_range=f"bytes 10-{len(IMAGE)-1}/{len(IMAGE)}") + s.headers["Content-Length"] = "0" + s.headers["Via"] = "1.1 scanner" + return s + opens = [lambda e: Stream(IMAGE, drop_after=10)] + [empty] * 40 + with patch.object(apple, "_refresh", lambda info: None): + got, calls, err = Resume.run_download(Resume(), opens) + self.assertIsNone(got) + self.assertIn("connection at 10 gave 0 B, then AppleError [status 206; Content-Length=0, Via=1.1 scanner]", err) + + def test_negative_control_a_connection_that_gave_bytes_carries_no_header_note(self): + opens = [lambda e: Stream(IMAGE, drop_after=10)] + [lambda e: Stream(b"", status=206, content_range=f"bytes 10-{len(IMAGE)-1}/{len(IMAGE)}")] * 40 + with patch.object(apple, "_refresh", lambda info: None): + got, calls, err = Resume.run_download(Resume(), opens) + self.assertIn("connection at 0 gave 10 B, then AppleError;", err) From 1b24fe5cf84a7aac8b17d2d503cfa3c619fbf2e6 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 15:54:01 -0700 Subject: [PATCH 036/244] usbwriter: name the cause on letter, offline, vanished-drive stops The drive letter search falls back to F:, E: and D: and lists the letters in use when none is free. An offline stick says Windows' OfflineReason and how to bring it online. A drive that disappears for the whole EFI copy retry says the stick dropped off USB. A letter that never appears after diskpart carries the stick search's answer. --- p1401/usbwriter.py | 35 ++++++++++-- tests/test_usb_stick_stops_266.py | 95 +++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+), 5 deletions(-) create mode 100644 tests/test_usb_stick_stops_266.py diff --git a/p1401/usbwriter.py b/p1401/usbwriter.py index 5ce2cc53..94fb8549 100644 --- a/p1401/usbwriter.py +++ b/p1401/usbwriter.py @@ -34,7 +34,12 @@ TIMEOUT = 300 # seconds, so a hung format fails instead of waiting forever # 1401\\Recovery beside 1401.exe: a recovery image the user brings (see cli_write) RECOVERY_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "..", "Recovery")) -FIELDS = "Number,FriendlyName,SerialNumber,UniqueId,BusType,Size,IsBoot,IsSystem,IsOffline,IsReadOnly,PartitionStyle" +FIELDS = "Number,FriendlyName,SerialNumber,UniqueId,BusType,Size,IsBoot,IsSystem,IsOffline,OfflineReason,IsReadOnly,PartitionStyle" +# MSFT_Disk.OfflineReason, as Microsoft documents the values +OFFLINE_REASONS = {1: "Windows' SAN policy keeps new disks offline", 2: "a redundant path to another disk", + 3: "a snapshot disk", 4: "its disk signature collides with another disk's", + 5: "Windows ran out of resources for it", 6: "it had critical write failures", + 7: "Windows wants a data integrity scan"} # Windows errors a raw sector write ends with on sticks that diskpart still erases: 5 access denied, 1117 I/O device error @@ -285,7 +290,12 @@ def eligible(disk, allow_large=False): if disk.get("IsSystem"): why.append("this disk holds the system partition") if disk.get("IsOffline"): - why.append("the disk is offline") + # 2.6.5 write logs (6, two sticks, 10-31): the bare "the disk is offline" said neither why nor what to do. + # Windows keeps the reason in MSFT_Disk.OfflineReason. + reason = OFFLINE_REASONS.get(disk.get("OfflineReason"), "") + why.append("Windows has this stick offline" + (f" ({reason})" if reason else "") + ". Open Disk Management " + "(right-click Start), right-click the stick's disk and choose Online, or unplug it and plug it into " + "another USB port, then press Write again") if disk.get("IsReadOnly"): why.append("the disk is read-only (a lock switch, or a failing stick)") size = int(disk.get("Size") or 0) @@ -454,6 +464,13 @@ def _copy_settled(src, dst, root, tries=6, sleep=time.sleep): return except (shutil.Error, OSError) as error: if attempt == tries - 1: + # 2.6.5 write logs NM-A7T6904A, NM-667B19WZ: the image was written and read back, then the stick's drive + # disappeared for the whole retry window and the stop was a bare "FileNotFoundError: ... 'E:\\'". + if not os.path.isdir(root): + raise UsbError(f"the stick's drive {root} went away while the EFI was copied, after the macOS image " + "was written and checked: the stick dropped off USB. Plug it into a USB port on the " + "back of the PC (not a hub or front panel) and write again; if it happens again, use " + "another stick") from error # shutil.Error carries one (source, destination, reason) per file: the STOP was that whole list with # the user's paths in it (1.15 write log 10-14, WinError 433 on every BlueToolFixup file). One line. if isinstance(error, shutil.Error) and error.args and isinstance(error.args[0], list) and error.args[0]: @@ -470,12 +487,17 @@ def _copy_settled(src, dst, root, tries=6, sleep=time.sleep): def _free_letter(): + """A drive letter for the stick: Z: down to G: first, then F:, E: and D:. 2.6.5 write logs (one PC, 7 writes, + 10-31) stopped "no free drive letter between G: and Z:" with nothing saying which letters were taken or by what, + and D: to F: were never tried. The stop now lists the letters Windows reports in use.""" import string # noqa: PLC0415 used = {d[0].upper() for d in (os.listdrives() if hasattr(os, "listdrives") else [])} - for c in reversed(string.ascii_uppercase[6:]): + for c in list(reversed(string.ascii_uppercase[6:])) + ["F", "E", "D"]: if c not in used and not os.path.exists(c + ":\\"): return c - raise UsbError("no free drive letter between G: and Z:") + raise UsbError("no free drive letter between D: and Z: (in use: " + (" ".join(sorted(used)) or "none listed") + "). " + "Disconnect network drives and card readers you do not need, or remove a letter in Disk Management, " + "and press Write again") # diskpart exits with the HRESULT of the command that failed. 0x80070005 is "access denied": seen on 1.13 (two @@ -658,7 +680,10 @@ def write(disk, efi_build_dir, recovery_info, allow_large=False, progress=None, break time.sleep(0.5) if not os.path.isdir(root): - raise UsbError(f"diskpart finished but {root} did not appear") + # 2.6.5 write logs (3 PCs): this stop gave no clue whether the partition existed without a letter or was gone; + # the stick search's own answer (empty when it found nothing) is now part of it. + seen = " ".join((out or "").split())[-300:] + raise UsbError(f"diskpart finished but {root} did not appear (the stick search said: {seen or 'nothing'})") return _write_payload(root, efi_build_dir, recovery_info, progress, machine_profile) diff --git a/tests/test_usb_stick_stops_266.py b/tests/test_usb_stick_stops_266.py new file mode 100644 index 00000000..d4967bd2 --- /dev/null +++ b/tests/test_usb_stick_stops_266.py @@ -0,0 +1,95 @@ +"""Stick stops seen in 2.6.5 write logs: no free letter between G: and Z:, an offline stick, a stick whose drive went +away during the EFI copy, and diskpart's letter never appearing. Each stop names what it saw and what to do. No disk is +touched: every Windows call is replaced.""" +import os +import unittest +from unittest.mock import patch + +from p1401 import usbwriter + +USB = {"Number": 3, "FriendlyName": "Kingston DataTraveler 3.0", "SerialNumber": "X", "BusType": "USB", + "Size": 32 * 10**9, "IsBoot": False, "IsSystem": False, "IsOffline": False, "IsReadOnly": False} + + +def letters(used, present=()): + """_free_letter with these letters listed by Windows and these roots existing.""" + with patch.object(usbwriter.os, "listdrives", create=True, new=lambda: [c + ":\\" for c in used]), \ + patch.object(usbwriter.os.path, "exists", lambda p: p[:1] in present): + return usbwriter._free_letter() + + +class DriveLetters(unittest.TestCase): + def test_z_is_preferred_when_free(self): + self.assertEqual(letters("CD"), "Z") + + def test_g_to_z_taken_falls_back_to_f_e_d(self): + self.assertEqual(letters("C" + "GHIJKLMNOPQRSTUVWXYZ"), "F") + self.assertEqual(letters("CF" + "GHIJKLMNOPQRSTUVWXYZ"), "E") + + def test_negative_control_every_letter_taken_stops_naming_them(self): + with self.assertRaises(usbwriter.UsbError) as cm: + letters("ABCDEF" + "GHIJKLMNOPQRSTUVWXYZ") + self.assertIn("in use: A B C D E F G", str(cm.exception)) + self.assertIn("Disk Management", str(cm.exception)) + + def test_a_root_that_exists_without_being_listed_is_still_taken(self): + self.assertEqual(letters("C", present="Z"), "Y") + + +class OfflineStick(unittest.TestCase): + def test_an_offline_stick_says_why_and_how_to_bring_it_online(self): + ok, why = usbwriter.eligible({**USB, "IsOffline": True, "OfflineReason": 4}) + self.assertFalse(ok) + self.assertIn("offline (its disk signature collides with another disk's)", why[0]) + self.assertIn("choose Online", why[0]) + + def test_an_unknown_reason_still_gives_the_way_out(self): + ok, why = usbwriter.eligible({**USB, "IsOffline": True}) + self.assertFalse(ok) + self.assertIn("Windows has this stick offline.", why[0]) + + def test_negative_control_an_online_stick_is_accepted(self): + self.assertTrue(usbwriter.eligible({**USB, "OfflineReason": 4})[0]) + + def test_the_disk_list_asks_windows_for_the_reason(self): + self.assertIn("OfflineReason", usbwriter.FIELDS.split(",")) + + +class DriveWentAway(unittest.TestCase): + def copy(self, root_there): + def copytree(src, dst, dirs_exist_ok=False): + raise FileNotFoundError(3, "The system cannot find the path specified", "E:\\") + with patch.object(usbwriter.shutil, "copytree", copytree), \ + patch.object(usbwriter.os.path, "isdir", lambda p: root_there): + usbwriter._copy_settled("src", "E:\\EFI", "E:\\", tries=3, sleep=lambda s: None) + + def test_a_drive_gone_for_every_retry_says_the_stick_dropped_off(self): + with self.assertRaises(usbwriter.UsbError) as cm: + self.copy(root_there=False) + self.assertIn("E:\\ went away", str(cm.exception)) + self.assertIn("back of the PC", str(cm.exception)) + + def test_negative_control_a_drive_still_there_keeps_the_real_error(self): + with self.assertRaises(FileNotFoundError): + self.copy(root_there=True) + + +class LetterNeverAppeared(unittest.TestCase): + def test_the_stop_carries_what_the_stick_search_said(self): + disk = {**USB, "PartitionStyle": "MBR"} + with patch.object(usbwriter, "eligible", lambda d, allow_large=False: (True, [])), \ + patch.object(usbwriter, "_ps", lambda script: "NOLETTER partition 1 size 32000000000"), \ + patch.object(usbwriter, "_free_letter", lambda: "Q"), \ + patch.object(usbwriter.os.path, "isdir", lambda p: False), \ + patch.object(usbwriter.time, "sleep", lambda s: None), \ + patch("p1401.validate.validate", lambda d: {"ok": True}), \ + patch("p1401.rawdisk.wipe_mbr_fat32", lambda *a, **k: None), \ + patch.object(usbwriter, "release", lambda n: None, create=True), \ + patch.object(usbwriter, "_diskpart", lambda s: None): + with self.assertRaises(usbwriter.UsbError) as cm: + usbwriter.write(disk, "efi", {"local": True}) + self.assertIn("did not appear (the stick search said: NOLETTER partition 1", str(cm.exception)) + + +if __name__ == "__main__": + unittest.main() From f24a19fe5d2ca58af8dfadcc93b848f1cf078b2a Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 15:54:32 -0700 Subject: [PATCH 037/244] validate: list EFI/OC/Drivers when a loaded driver is missing A build that stops on a UEFI driver missing on disk now says what the Drivers folder holds, so a report tells a binary-data download that never reached the build from one file a security program removed. --- p1401/validate.py | 14 +++++- tests/test_validate_missing_driver_listing.py | 43 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 tests/test_validate_missing_driver_listing.py diff --git a/p1401/validate.py b/p1401/validate.py index 82167ffd..3adf660b 100644 --- a/p1401/validate.py +++ b/p1401/validate.py @@ -185,6 +185,18 @@ def run_ocvalidate(config_path): return p.returncode == 0 and issues == 0, issues, text +def _listing(folder, limit=24): + """The file names in a folder, for a stop line. 2.6.5 build logs (6 builds, 3 PCs, 10-31) stopped on "UEFI driver + missing on disk: HfsPlus.efi" (and apfs_aligned.efi), files OpenCore's binary-data download puts there, with nothing + saying whether the folder held none of those files (that download never reached the build) or only lost this one (a + security program removed it). The listing tells the two apart.""" + try: + names = sorted(os.listdir(folder)) + except OSError as e: + return f"unreadable ({type(e).__name__})" + return ", ".join(names[:limit]) + (f" and {len(names) - limit} more" if len(names) > limit else "") if names else "nothing" + + def invariants(efi_dir): """Checks the files ocvalidate never looks at. Returns a list of failures (empty means fine).""" oc = os.path.join(efi_dir, "EFI", "OC") @@ -214,7 +226,7 @@ def invariants(efi_dir): fails.append(f"SSDT missing on disk: {a['Path']}") for d in cfg["UEFI"]["Drivers"]: if d.get("Enabled") and not os.path.isfile(os.path.join(oc, "Drivers", d["Path"])): - fails.append(f"UEFI driver missing on disk: {d['Path']}") + fails.append(f"UEFI driver missing on disk: {d['Path']} (EFI/OC/Drivers holds: {_listing(os.path.join(oc, 'Drivers'))})") for t in cfg["Misc"].get("Tools", []): if t.get("Enabled") and not os.path.isfile(os.path.join(oc, "Tools", t["Path"])): fails.append(f"tool missing on disk: {t['Path']}") diff --git a/tests/test_validate_missing_driver_listing.py b/tests/test_validate_missing_driver_listing.py new file mode 100644 index 00000000..a28faed0 --- /dev/null +++ b/tests/test_validate_missing_driver_listing.py @@ -0,0 +1,43 @@ +"""A UEFI driver the config loads but the EFI lacks is reported with what EFI/OC/Drivers does hold (2.6.5 build logs: +"UEFI driver missing on disk: HfsPlus.efi" alone could not tell a skipped binary-data download from one removed file).""" +import os +import plistlib +import tempfile +import unittest + +from p1401 import validate + + +def efi(tmp, present): + oc = os.path.join(tmp, "EFI", "OC") + os.makedirs(os.path.join(oc, "Drivers")) + for n in present: + open(os.path.join(oc, "Drivers", n), "wb").close() + cfg = {"Kernel": {"Add": []}, "ACPI": {"Add": []}, "Misc": {"Tools": []}, + "UEFI": {"Drivers": [{"Path": "HfsPlus.efi", "Enabled": True}, {"Path": "OpenRuntime.efi", "Enabled": True}]}, + "PlatformInfo": {"Generic": {}}} + with open(os.path.join(oc, "config.plist"), "wb") as fh: + plistlib.dump(cfg, fh) + return tmp + + +class MissingDriverListing(unittest.TestCase): + def test_a_missing_driver_names_what_the_folder_holds(self): + with tempfile.TemporaryDirectory() as t: + fails = validate.invariants(efi(t, ["OpenRuntime.efi", "ResetNvramEntry.efi"])) + line = next(f for f in fails if "HfsPlus.efi" in f) + self.assertIn("EFI/OC/Drivers holds: OpenRuntime.efi, ResetNvramEntry.efi", line) + + def test_an_empty_folder_says_nothing(self): + with tempfile.TemporaryDirectory() as t: + fails = validate.invariants(efi(t, [])) + self.assertTrue(any("holds: nothing" in f for f in fails), fails) + + def test_negative_control_drivers_present_report_no_driver_line(self): + with tempfile.TemporaryDirectory() as t: + fails = validate.invariants(efi(t, ["HfsPlus.efi", "OpenRuntime.efi"])) + self.assertFalse(any("UEFI driver missing" in f for f in fails), fails) + + +if __name__ == "__main__": + unittest.main() From 06bf0f4ca35dfa2e4aeb653d8d888a757f19f74a Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 15:55:09 -0700 Subject: [PATCH 038/244] bootfix: Intel EB.MM.AKM with only a few kernel slides takes the step OpenCore's "Only N/256 slide values are usable" followed by a boot.efi stop at EB.MM.AKM now turns DevirtualiseMmio on (or, when it already ran, gives the BIOS checklist), the same as "No slide values are usable". --- p1401/bootfix.py | 11 +++++--- tests/test_bootfix_few_slides.py | 46 ++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 tests/test_bootfix_few_slides.py diff --git a/p1401/bootfix.py b/p1401/bootfix.py index e6520c99..0b45bacf 100644 --- a/p1401/bootfix.py +++ b/p1401/bootfix.py @@ -82,6 +82,10 @@ def findings(texts): out["bootargs_kept"] |= bool(_BOOTARGS_KEPT.search(t)) out["macos_disk"] |= bool(_MACOS_DISK.search(t)) out["no_slide"] = out.get("no_slide", False) or "No slide values are usable" in t + # "Only 1/256 slide values are usable!" then EB.MM.AKM: the same shortage with a slide or two left. 2.6.5 stick + # logs NM-5M1X8T8J, NM-SR9QEMRP (i5-1145G7, 1 of 256) and NM-VV9QT2F3 (i9-14900HX, 6 of 256) stopped at STOP 0x16 + # this way, and the Intel step below, which looked only for "No slide values", left their builds unchanged. + out["few_slides"] = out.get("few_slides", False) or bool(re.search(r"OCABC: Only \d+/\d+ slide values are usable", t)) # the firmware's memory attributes table: "MAT support is 0" on any boot means the firmware has none for mat in re.findall(r"OCABC: MAT support is ([01])", t): out["mat"] = (mat == "1") if out["mat"] is not False else False @@ -170,14 +174,15 @@ def apply(cfg, result, texts, change, stopped_at=""): # (i5-12400F, i7-12700K, i5-12500 desktops; i5-13420H and i5-13450HX laptops before them), every one with # DevirtualiseMmio off - the hybrid-core policy turns it off for PCs that fault at EXITBS:START with it on. So the # stick's own log decides: off and no slide -> on (Dortania KASLR guide); on and still no slide -> say so. - if cpu == "Intel" and failed and f.get("no_slide"): + if cpu == "Intel" and failed and (f.get("no_slide") or (f.get("few_slides") and f["stop16"])): before = f"DevirtualiseMmio={quirks.get('DevirtualiseMmio')}" + found = "no kernel slide" if f.get("no_slide") else "too few kernel slides" if not f["devirt_ran"]: quirks["DevirtualiseMmio"] = True change("bootlog-intel-akm-devirt", before, "DevirtualiseMmio=True", - "the stick's last boot found no kernel slide and stopped in boot.efi (EB.MM.AKM) with DevirtualiseMmio off") + f"the stick's last boot found {found} and stopped in boot.efi (EB.MM.AKM) with DevirtualiseMmio off") else: - change("bootlog-note", "", "this PC found no kernel slide even with the firmware's MMIO devirtualised. In the BIOS: " + change("bootlog-note", "", f"this PC found {found} even with the firmware's MMIO devirtualised. In the BIOS: " "Above 4G Decoding on, CSM off, and if there is a setting for it, a smaller iGPU memory size (DVMT); " "then send the logs", "it stopped at EB.MM.AKM with DevirtualiseMmio on") # Stuck right after the hand-off (the screen freezes on EXITBS:START, the kernel never prints). Dortania's list for diff --git a/tests/test_bootfix_few_slides.py b/tests/test_bootfix_few_slides.py new file mode 100644 index 00000000..1bf76c93 --- /dev/null +++ b/tests/test_bootfix_few_slides.py @@ -0,0 +1,46 @@ +"""Intel boots that stop at EB.MM.AKM after OpenCore found only a few usable kernel slides take the same step as "No +slide values are usable" (2.6.5 stick logs: 1 of 256 and 6 of 256, STOP 0x16).""" +import unittest +from types import SimpleNamespace + +from p1401 import bootfix + +Q0 = {"DevirtualiseMmio": False, "SetupVirtualMap": False} +AKM = "AAPL: #[EB.MM.AKM|!] Err(0xE) <- EB.MM.MKP\nAAPL: #[EB|STOP] 0x16\nOCB: StartImage failed - Aborted\n" +DEVIRT = "OCABC: MMIO devirt 0xFE000000 (0x11 pages, 0x8000000000000001) skip 0\n" + + +def run(logs, cpu="Intel"): + cfg = {"Booter": {"Quirks": dict(Q0)}} + changes = [] + bootfix.apply(cfg, SimpleNamespace(hardware={"CPU": {"Manufacturer": cpu}}), logs, lambda *a: changes.append(a)) + return cfg["Booter"]["Quirks"], changes + + +class FewSlides(unittest.TestCase): + def test_six_of_256_slides_then_akm_turns_devirtualise_mmio_on(self): + q, ch = run(["OCABC: Only 6/256 slide values are usable!\n" + AKM]) + self.assertTrue(q["DevirtualiseMmio"]) + self.assertEqual(ch[0][0], "bootlog-intel-akm-devirt") + self.assertIn("too few kernel slides", ch[0][3]) + + def test_with_devirtualise_mmio_already_on_the_bios_checklist_is_said(self): + q, ch = run(["OCABC: Only 1/256 slide values are usable!\n" + DEVIRT + AKM]) + self.assertEqual([c[0] for c in ch], ["bootlog-note"]) + self.assertIn("Above 4G Decoding", ch[0][2]) + + def test_no_slide_wording_is_unchanged(self): + _, ch = run(["OCABC: No slide values are usable! Falling back to 0 with 0x0FF00000 bytes!\n" + AKM]) + self.assertIn("found no kernel slide", ch[0][3]) + + def test_negative_control_few_slides_without_a_boot_efi_stop_changes_nothing(self): + q, ch = run(["OCABC: Only 6/256 slide values are usable!\nOCB: StartImage failed - Aborted\n"]) + self.assertEqual((q, [c[0] for c in ch if c[0].startswith("bootlog-intel-akm")]), (Q0, [])) + + def test_negative_control_a_boot_with_slides_and_no_failure_changes_nothing(self): + q, ch = run(["OCABC: Only 200/256 slide values are usable!\n"]) + self.assertEqual((q, ch), (Q0, [])) + + +if __name__ == "__main__": + unittest.main() From 3877e6a44ac5280b1179e0cc0a38a6b982353149 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 15:56:07 -0700 Subject: [PATCH 039/244] setup: name the macOS version and boot-path in two stops The runtime refusal now says which macOS this Mac runs. The unconfirmed startup partition stop prints OpenCore's boot-path and each candidate's partition identity on their own lines; the candidate lines the app offers as choices are unchanged. --- mac/Resources/nullmoth-setup.sh | 9 ++++- tests/test_setup_stop_evidence.py | 65 +++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 tests/test_setup_stop_evidence.py diff --git a/mac/Resources/nullmoth-setup.sh b/mac/Resources/nullmoth-setup.sh index b6a515ca..8bb3db72 100755 --- a/mac/Resources/nullmoth-setup.sh +++ b/mac/Resources/nullmoth-setup.sh @@ -781,7 +781,9 @@ T=$(mktemp -d /var/tmp/nullmoth.XXXX) || stop "could not create runtime prefligh tar -xzf "$PKG" -C "$T" || stop "could not unpack the package for runtime compatibility checking" RUNTIME_PREFLIGHT="$T/pkgroot/nullmoth-runtime-check.sh" [ -x "$RUNTIME_PREFLIGHT" ] || stop "the package has no runtime compatibility checker" -/bin/bash "$RUNTIME_PREFLIGHT" "$T/pkgroot" "$(sw_vers -productVersion)" || stop "the userland runtime cannot load on this macOS version; EFI and driver files were not changed" +# 2.6.5 setup logs (5, 10-31): "runtime payload requires macOS 15.5.0; this system is older" with no word on which macOS +# this Mac runs, so a report could not tell 15.4 from 14.x. The stop names it. +/bin/bash "$RUNTIME_PREFLIGHT" "$T/pkgroot" "$(sw_vers -productVersion)" || stop "the userland runtime cannot load on macOS $(sw_vers -productVersion) ($(sw_vers -buildVersion 2>/dev/null)); EFI and driver files were not changed" rm -rf "$T"; T="" fi @@ -881,6 +883,11 @@ else fi if [ "$BOOT_BOUND" != 1 ]; then for d in $found; do echo "NOTE candidate $d"; done + # 2.6.5 setup logs NM-FEPPPTQZ, NM-M3G4YM2Z (three candidates) stopped here with no boot-path, so nothing said why + # the partition OpenCore names was not matched. The boot-path and each candidate's identity follow the candidate + # list on their own lines (the app reads "NOTE candidate " lines as the choices it offers). + echo "NOTE boot-path: $(nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:boot-path 2>/dev/null | cut -f2- | head -c 300)" + for d in $found; do echo "NOTE partition $d: $(diskutil info "$d" 2>/dev/null | awk -F': *' '/Partition UUID|Partition Offset|Disk Size|Device Location|Protocol/{printf "%s=%s; ", $1, $2}' | sed 's/^ *//; s/ */ /g' | head -c 300)"; done # Mac 1.9/1.10 logs 10-10 (5 uploads, one candidate each): OpenCore hides boot-path and its version when # Misc > Security > ExposeSensitiveData lacks bits 0x1/0x2, so nothing proves which partition started the Mac, and # editing one that did not would install the driver without its settings or the removal tool. Say how to fix it. diff --git a/tests/test_setup_stop_evidence.py b/tests/test_setup_stop_evidence.py new file mode 100644 index 00000000..1d2c4a55 --- /dev/null +++ b/tests/test_setup_stop_evidence.py @@ -0,0 +1,65 @@ +"""Mac setup stops carry what the report needs (2.6.5 setup logs): the runtime refusal names the macOS this Mac runs, +and the unconfirmed-startup-partition stop prints OpenCore's boot-path and each candidate's identity, while the +"NOTE candidate " lines the app offers as choices stay exactly as they were.""" +import os +import pathlib +import subprocess +import sys +import tempfile +import unittest + +SETUP = pathlib.Path(__file__).resolve().parents[1] / "mac/Resources/nullmoth-setup.sh" +START = ' if [ "$BOOT_BOUND" != 1 ]; then\n for d in $found; do echo "NOTE candidate $d"; done' +END = " EFI=${found# }" +# The setup runs under macOS's /bin/bash. Where there is none (the Windows CI runner, whose packaged check refuses +# skipped tests) the same arms read the lines from the script. +BASH = sys.platform != "win32" and os.path.exists("/bin/bash") + + +def candidate_stop(): + s = SETUP.read_text() + assert s.count(START) == 1 and s.count(END) == 1, "anchors moved in nullmoth-setup.sh" + block = s[s.index(START):s.index(END)] + if not BASH: + return block + t = tempfile.mkdtemp() + stubs = {"nvram": 'case "$1" in *boot-path) printf "x\\tPciRoot(0x0)/USB(0x16,0x0)/HD(1,MBR,0x0F8999F7,0x800,0x400880)/EFI";; *) exit 1;; esac', + "diskutil": 'printf " Disk / Partition UUID: ABCD\\n Partition Offset: 1048576 Bytes\\n Device Location: External\\n"'} + for name, body in stubs.items(): + p = os.path.join(t, name) + with open(p, "w") as f: + f.write("#!/bin/bash\n" + body + "\n") + os.chmod(p, 0o755) + script = (f'PATH="{t}:/usr/bin:/bin"; stop() {{ echo "STOP $*"; exit 1; }}\n' + 'found=" disk1s1 disk3s1"; BOOT_BOUND=0\n' + block) + r = subprocess.run(["/bin/bash", "-c", script], capture_output=True, text=True, timeout=30) + return r.stdout + + +class SetupStopEvidence(unittest.TestCase): + def test_the_candidate_stop_prints_the_boot_path_and_each_partition(self): + out = candidate_stop() + if BASH: + self.assertIn("NOTE boot-path: PciRoot(0x0)/USB(0x16,0x0)/HD(1,MBR,0x0F8999F7", out) + self.assertIn("NOTE partition disk3s1: Disk / Partition UUID=ABCD; Partition Offset=1048576 Bytes;", out) + self.assertIn("STOP OpenCore's startup partition could not be confirmed", out) + else: + self.assertIn('echo "NOTE boot-path:', out) + self.assertIn('echo "NOTE partition $d:', out) + + def test_the_choice_lines_the_app_reads_are_unchanged(self): + out = candidate_stop() + if BASH: + lines = [l for l in out.splitlines() if l.startswith("NOTE candidate ")] + self.assertEqual(lines, ["NOTE candidate disk1s1", "NOTE candidate disk3s1"]) + else: + self.assertIn('for d in $found; do echo "NOTE candidate $d"; done', out) + + def test_the_runtime_refusal_names_this_macs_version(self): + s = SETUP.read_text() + line = next(l for l in s.splitlines() if l.startswith('/bin/bash "$RUNTIME_PREFLIGHT"')) + self.assertIn("cannot load on macOS $(sw_vers -productVersion)", line) + + +if __name__ == "__main__": + unittest.main() From 1514db0966f8999ff265cab3bcc756d85347faaa Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 15:58:02 -0700 Subject: [PATCH 040/244] usbwriter: the dropped-stick stop needs the root itself to be missing Only an error naming the stick's root, with the root gone for the whole retry window, becomes the dropped-off-USB stop; per-file copy errors and other OS errors keep their own stops. --- p1401/usbwriter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p1401/usbwriter.py b/p1401/usbwriter.py index 94fb8549..8409f83d 100644 --- a/p1401/usbwriter.py +++ b/p1401/usbwriter.py @@ -466,7 +466,7 @@ def _copy_settled(src, dst, root, tries=6, sleep=time.sleep): if attempt == tries - 1: # 2.6.5 write logs NM-A7T6904A, NM-667B19WZ: the image was written and read back, then the stick's drive # disappeared for the whole retry window and the stop was a bare "FileNotFoundError: ... 'E:\\'". - if not os.path.isdir(root): + if getattr(error, "filename", None) == root and not os.path.isdir(root): raise UsbError(f"the stick's drive {root} went away while the EFI was copied, after the macOS image " "was written and checked: the stick dropped off USB. Plug it into a USB port on the " "back of the PC (not a hub or front panel) and write again; if it happens again, use " From ecdbdfeda0a217ce253bf124823d7591347a6cb4 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 15:58:03 -0700 Subject: [PATCH 041/244] bootfix: few slides at EB.MM.AKM give the BIOS checklist, no quirk Which slide count makes DevirtualiseMmio the fix is not measured, so a boot with some slides left keeps its quirks, as before, and the user is told the BIOS memory checklist instead of nothing. --- p1401/bootfix.py | 15 ++++++++++----- tests/test_bootfix_few_slides.py | 32 ++++++++++++++------------------ 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/p1401/bootfix.py b/p1401/bootfix.py index 0b45bacf..f07a5a81 100644 --- a/p1401/bootfix.py +++ b/p1401/bootfix.py @@ -84,7 +84,9 @@ def findings(texts): out["no_slide"] = out.get("no_slide", False) or "No slide values are usable" in t # "Only 1/256 slide values are usable!" then EB.MM.AKM: the same shortage with a slide or two left. 2.6.5 stick # logs NM-5M1X8T8J, NM-SR9QEMRP (i5-1145G7, 1 of 256) and NM-VV9QT2F3 (i9-14900HX, 6 of 256) stopped at STOP 0x16 - # this way, and the Intel step below, which looked only for "No slide values", left their builds unchanged. + # this way, and the Intel step below, which looks only for "No slide values", left their builds unchanged and + # said nothing. Which slide count makes DevirtualiseMmio the fix is not measured (65 of 256 left was ruled out + # before, test_intel_akm_devirt), so these get the BIOS checklist and no quirk change. out["few_slides"] = out.get("few_slides", False) or bool(re.search(r"OCABC: Only \d+/\d+ slide values are usable", t)) # the firmware's memory attributes table: "MAT support is 0" on any boot means the firmware has none for mat in re.findall(r"OCABC: MAT support is ([01])", t): @@ -174,15 +176,18 @@ def apply(cfg, result, texts, change, stopped_at=""): # (i5-12400F, i7-12700K, i5-12500 desktops; i5-13420H and i5-13450HX laptops before them), every one with # DevirtualiseMmio off - the hybrid-core policy turns it off for PCs that fault at EXITBS:START with it on. So the # stick's own log decides: off and no slide -> on (Dortania KASLR guide); on and still no slide -> say so. - if cpu == "Intel" and failed and (f.get("no_slide") or (f.get("few_slides") and f["stop16"])): + if cpu == "Intel" and failed and not f.get("no_slide") and f.get("few_slides") and f["stop16"]: + change("bootlog-note", "", "macOS's loader found too little free memory for the kernel (EB.MM.AKM; OpenCore had " + "only some kernel slides). In the BIOS: Above 4G Decoding on, CSM off, and if there is a setting for it, a " + "smaller iGPU memory size (DVMT); then send the logs", "it stopped at EB.MM.AKM with few kernel slides usable") + if cpu == "Intel" and failed and f.get("no_slide"): before = f"DevirtualiseMmio={quirks.get('DevirtualiseMmio')}" - found = "no kernel slide" if f.get("no_slide") else "too few kernel slides" if not f["devirt_ran"]: quirks["DevirtualiseMmio"] = True change("bootlog-intel-akm-devirt", before, "DevirtualiseMmio=True", - f"the stick's last boot found {found} and stopped in boot.efi (EB.MM.AKM) with DevirtualiseMmio off") + "the stick's last boot found no kernel slide and stopped in boot.efi (EB.MM.AKM) with DevirtualiseMmio off") else: - change("bootlog-note", "", f"this PC found {found} even with the firmware's MMIO devirtualised. In the BIOS: " + change("bootlog-note", "", "this PC found no kernel slide even with the firmware's MMIO devirtualised. In the BIOS: " "Above 4G Decoding on, CSM off, and if there is a setting for it, a smaller iGPU memory size (DVMT); " "then send the logs", "it stopped at EB.MM.AKM with DevirtualiseMmio on") # Stuck right after the hand-off (the screen freezes on EXITBS:START, the kernel never prints). Dortania's list for diff --git a/tests/test_bootfix_few_slides.py b/tests/test_bootfix_few_slides.py index 1bf76c93..bfc19bae 100644 --- a/tests/test_bootfix_few_slides.py +++ b/tests/test_bootfix_few_slides.py @@ -1,5 +1,6 @@ -"""Intel boots that stop at EB.MM.AKM after OpenCore found only a few usable kernel slides take the same step as "No -slide values are usable" (2.6.5 stick logs: 1 of 256 and 6 of 256, STOP 0x16).""" +"""Intel boots that stop at EB.MM.AKM after OpenCore found only a few usable kernel slides (2.6.5 stick logs: 1 of 256 +and 6 of 256, STOP 0x16) are told the BIOS checklist. No quirk changes: which slide count makes DevirtualiseMmio the fix +is not measured, and "No slide values are usable" keeps its own step.""" import unittest from types import SimpleNamespace @@ -7,7 +8,6 @@ Q0 = {"DevirtualiseMmio": False, "SetupVirtualMap": False} AKM = "AAPL: #[EB.MM.AKM|!] Err(0xE) <- EB.MM.MKP\nAAPL: #[EB|STOP] 0x16\nOCB: StartImage failed - Aborted\n" -DEVIRT = "OCABC: MMIO devirt 0xFE000000 (0x11 pages, 0x8000000000000001) skip 0\n" def run(logs, cpu="Intel"): @@ -18,29 +18,25 @@ def run(logs, cpu="Intel"): class FewSlides(unittest.TestCase): - def test_six_of_256_slides_then_akm_turns_devirtualise_mmio_on(self): + def test_six_of_256_slides_then_akm_gives_the_bios_checklist_and_no_quirk_change(self): q, ch = run(["OCABC: Only 6/256 slide values are usable!\n" + AKM]) - self.assertTrue(q["DevirtualiseMmio"]) - self.assertEqual(ch[0][0], "bootlog-intel-akm-devirt") - self.assertIn("too few kernel slides", ch[0][3]) - - def test_with_devirtualise_mmio_already_on_the_bios_checklist_is_said(self): - q, ch = run(["OCABC: Only 1/256 slide values are usable!\n" + DEVIRT + AKM]) + self.assertEqual(q, Q0) self.assertEqual([c[0] for c in ch], ["bootlog-note"]) self.assertIn("Above 4G Decoding", ch[0][2]) - def test_no_slide_wording_is_unchanged(self): - _, ch = run(["OCABC: No slide values are usable! Falling back to 0 with 0x0FF00000 bytes!\n" + AKM]) - self.assertIn("found no kernel slide", ch[0][3]) + def test_no_slide_keeps_its_own_step(self): + q, ch = run(["OCABC: No slide values are usable! Falling back to 0 with 0x0FF00000 bytes!\n" + AKM]) + self.assertTrue(q["DevirtualiseMmio"]) + self.assertEqual([c[0] for c in ch], ["bootlog-intel-akm-devirt"]) - def test_negative_control_few_slides_without_a_boot_efi_stop_changes_nothing(self): + def test_negative_control_few_slides_without_a_boot_efi_stop_says_nothing(self): q, ch = run(["OCABC: Only 6/256 slide values are usable!\nOCB: StartImage failed - Aborted\n"]) - self.assertEqual((q, [c[0] for c in ch if c[0].startswith("bootlog-intel-akm")]), (Q0, [])) - - def test_negative_control_a_boot_with_slides_and_no_failure_changes_nothing(self): - q, ch = run(["OCABC: Only 200/256 slide values are usable!\n"]) self.assertEqual((q, ch), (Q0, [])) + def test_negative_control_amd_is_left_to_its_own_steps(self): + _, ch = run(["OCABC: Only 6/256 slide values are usable!\n" + AKM], cpu="AMD") + self.assertNotIn("few kernel slides usable", " ".join(str(c) for c in ch)) + if __name__ == "__main__": unittest.main() From 32028c8251ba0df83aaab200090281e96006ec00 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 16:32:59 -0700 Subject: [PATCH 042/244] Changelog 2.6.6 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e0fbc4d..1f8cd0ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ Each release also bundles the NVIDIA driver and Mac app of the same version; see the [driver changelog](https://github.com/nullmoth/nvidia-macos-driver/blob/main/CHANGELOG.md). +## 2.6.6 +- Recovery downloads: when Apple's server refuses the file list (403), 1401 asks again with a fresh token. A web page served in place of the file list, and a connection that answers with no data, are now named in the stop message instead of a bare error. +- Writing the stick: when Z: to G: are all taken, 1401 also tries F:, E: and D:, and lists the letters in use if none is free. A stick Windows reports offline now says why and how to bring it online, and a stick that drops off USB after the image is written says so in one line. +- Building: when OpenCore's check finds a driver missing, the stop lists what is in EFI/OC/Drivers. +- Intel PCs that stop at "EB.MM.AKM" with only a few kernel slides free get the BIOS checklist (Above 4G Decoding, CSM off, a smaller iGPU memory). +- Mac app: the stops for "runtime payload requires macOS" and "OpenCore's startup partition could not be confirmed" now name the macOS version and the partition the Mac started from. +- Bundles NVIDIA driver 2.6.6. + ## 2.6.5 - Rebuilding a stick from its boot logs now reaches the kernel's boot arguments. Once one start had stored boot-args in the PC's NVRAM, OpenCore refused every later build's ("ignored, exists"), so added options such as npci=0x2000 never applied until NVRAM was reset by hand (#124, #126). When the logs show no installed macOS on an internal disk, the stick now replaces the stored boot-args; a PC that runs macOS keeps its own and is told to reset NVRAM once. - If the screen stops inside the touchpad driver's start ("VoodooGPIO... Loading GPIO Data for AMD"), the rebuilt stick leaves the VoodooI2C touchpad stack off; the keyboard keeps working and a USB mouse drives the installer (#124). From ba5b5772f87df56edf4cc590431978f881a2d765 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 18:04:42 -0700 Subject: [PATCH 043/244] Mac app: root output never follows a link in the user's temp folder --- mac/Sources/Privileged.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mac/Sources/Privileged.swift b/mac/Sources/Privileged.swift index 1ecc2735..5dba07c1 100644 --- a/mac/Sources/Privileged.swift +++ b/mac/Sources/Privileged.swift @@ -40,8 +40,12 @@ enum Privileged { defer { try? fm.removeItem(at: dir) } let out = dir.appendingPathComponent("output.txt") let q = { (s: String) in "'" + s.replacingOccurrences(of: "'", with: "'\\''") + "'" } - // root writes the output, then hands the file back to this user so the app can read and delete it - let shell = "{ \(command) ; } > \(q(out.path)) 2>&1; /usr/sbin/chown \(getuid()) \(q(out.path)); exit 0" + // root writes the output, then hands the file back to this user so the app can read and delete it. + // The folder belongs to this user, so any program running as this user can swap output.txt for a symlink while + // the password prompt is up. A plain ">" then truncated the symlink's target as root, and chown followed it and + // handed that file (for example /etc/sudoers) to this user. noclobber (set -C) makes root create the file + // itself and refuse one that already exists, symlink or not, and chown -h never follows a link. + let shell = "set -C; { \(command) ; } > \(q(out.path)) 2>&1; /usr/sbin/chown -h \(getuid()) \(q(out.path)); exit 0" let source = "do shell script \"" + shell.replacingOccurrences(of: "\\", with: "\\\\").replacingOccurrences(of: "\"", with: "\\\"") + (admin ? "\" with administrator privileges" : "\"") let p = Process() p.executableURL = URL(fileURLWithPath: "/usr/bin/osascript") From 0950290eea54a00adfe33bde4b9cbd55a3dcdbd8 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 18:04:42 -0700 Subject: [PATCH 044/244] Mac app: a driver update from the release must carry a signature --- mac/Sources/main.swift | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index 5789c46b..ad3f42e5 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -765,11 +765,17 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe let name: String let sha: String let efi: String? + // A package from the newest release must also carry a NullMoth signature (Ed25519, release key compiled in): + // its SHA-256 comes from SHA256SUMS.txt in that same release, so whoever can replace the release's files could + // replace both, and the package runs as root. The package this app was built with is pinned by its compiled-in + // SHA-256 instead (fromRelease false). + var fromRelease = false + var sig: String? = nil } var pendingDownload: (id: Int, plan: DownloadPlan)? = nil var runningSetup = false lazy var downloadSession = URLSession(configuration: .default, delegate: self, delegateQueue: .main) - var latest: (version: String, name: String, url: URL, sha: String)? = nil + var latest: (version: String, name: String, url: URL, sha: String, sig: String?)? = nil var latestApp: (version: String, name: String, url: URL, sha: String, sig: URL?)? = nil static func releaseAppVersion(_ name: String) -> String? { guard let match = name.range(of: #"^1401-Mac-([0-9]+\.[0-9]+(?:\.[0-9]+)?)\.zip$"#, options: .regularExpression) else { return nil } @@ -840,8 +846,13 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe guard let n = x["name"] as? String, n == a.1 + ".sig", let u = (x["browser_download_url"] as? String).flatMap(URL.init(string:)), u.scheme == "https" else { return nil } return u }.first } + // the package's detached signature, read now (off the main thread) and checked before anything installs it + let pkgSig: String? = assets.compactMap { x -> URL? in + guard let n = x["name"] as? String, n == pkg.1 + ".sig", + let u = (x["browser_download_url"] as? String).flatMap(URL.init(string:)), u.scheme == "https" else { return nil } + return u }.first.flatMap { syncGet($0, timeout: 30) }.flatMap { String(data: $0, encoding: .utf8) } DispatchQueue.main.async { - self.latest = (pkg.0, pkg.1, pkg.2, sha) + self.latest = (pkg.0, pkg.1, pkg.2, sha, pkgSig) if let a = appz, appSha.count == 64 { self.latestApp = (a.0, a.1, a.2, appSha, appSig) } } let have = self.installedDriverVersion() @@ -853,14 +864,14 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe }.resume() }.resume() } - func startDownload(name: String, sha: String, url: URL, efi: String?) { + func startDownload(name: String, sha: String, url: URL, efi: String?, fromRelease: Bool = false, sig: String? = nil) { // A click while busy used to return silently, leaving "Downloading the newest driver..." on screen for good. if pendingDownload != nil { send("dl", ["state": "error", "why": "a download is already running; wait for it to finish"]); return } if runningSetup { send("dl", ["state": "error", "why": "setup is still running; try again when it has finished"]); return } do { try FileManager.default.createDirectory(at: support, withIntermediateDirectories: true) } catch { send("dl", ["state": "error", "why": error.localizedDescription]); return } let task = downloadSession.downloadTask(with: url) - pendingDownload = (task.taskIdentifier, DownloadPlan(name: name, sha: sha, efi: efi)) + pendingDownload = (task.taskIdentifier, DownloadPlan(name: name, sha: sha, efi: efi, fromRelease: fromRelease, sig: sig)) send("dl", ["state": "start"]) task.resume() } @@ -880,9 +891,9 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { [unowned self] in switch response { case .alertFirstButtonReturn: - startDownload(name: l.name, sha: l.sha, url: l.url, efi: efi) + startDownload(name: l.name, sha: l.sha, url: l.url, efi: efi, fromRelease: true, sig: l.sig) case .alertSecondButtonReturn: - selectLocalDriverFile(name: l.name, sha: l.sha, efi: efi) + selectLocalDriverFile(name: l.name, sha: l.sha, efi: efi, sig: l.sig) case .alertThirdButtonReturn: cancelUpdateDriver() default: break @@ -890,7 +901,7 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe } } } - func selectLocalDriverFile(name: String, sha: String, efi: String?) { + func selectLocalDriverFile(name: String, sha: String, efi: String?, sig: String?) { let panel = NSOpenPanel() panel.directoryURL = FileManager.default.urls(for: .downloadsDirectory, in: .userDomainMask).first panel.canChooseFiles = true @@ -919,7 +930,7 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe send("dl", ["state": "error", "why": "\(url.lastPathComponent) is not \(name) (its SHA-256 does not match the release), so nothing was installed"]) return } - processDriverFile(at: tmpURL, plan: DownloadPlan(name: name, sha: sha, efi: efi)) + processDriverFile(at: tmpURL, plan: DownloadPlan(name: name, sha: sha, efi: efi, fromRelease: true, sig: sig)) } } func cancelUpdateDriver() { @@ -1028,6 +1039,10 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe private func processDriverFile(at loc: URL, plan: DownloadPlan) { let dst = support.appendingPathComponent(plan.name) guard sha256(loc) == plan.sha else { send("dl", ["state": "error", "why": "the download does not match its SHA-256, so it was thrown away"]); return } + if plan.fromRelease { + guard let sig = plan.sig, ReleaseSignature.verify(zip: loc, signatureBase64: sig) else { + send("dl", ["state": "error", "why": "the driver package is not signed by NullMoth, so it was not installed"]); return } + } do { if FileManager.default.fileExists(atPath: dst.path) { _ = try FileManager.default.replaceItemAt(dst, withItemAt: loc) From 002ef1d89a3e09ad70b7ac7b2356a7fae05fc3ff Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 18:04:42 -0700 Subject: [PATCH 045/244] setup: --efi-read places files by rename from a root-only folder --- mac/Resources/nullmoth-setup.sh | 19 +++-- .../test_root_writes_into_user_folders.py | 69 +++++++++++++++++++ 2 files changed, 83 insertions(+), 5 deletions(-) create mode 100644 mac/tools/test_root_writes_into_user_folders.py diff --git a/mac/Resources/nullmoth-setup.sh b/mac/Resources/nullmoth-setup.sh index 8bb3db72..045a3bd3 100755 --- a/mac/Resources/nullmoth-setup.sh +++ b/mac/Resources/nullmoth-setup.sh @@ -928,13 +928,22 @@ if [ -n "$EFIREAD" ]; then # ACPI tables the firmware handed over, which is how the app knows whether VT-d is on). Read only: nothing on the # partition changes. The folder is the app's own and gets handed back to its owner. [ -d "$EFIREAD" ] && [ ! -L "$EFIREAD" ] || stop "--efi-read needs an existing folder" - cp "$C" "$EFIREAD/config.plist" || stop "could not copy $C" + # The folder belongs to the user, so any program running as that user could put a symlink at config.plist (or any + # name below) while the password prompt is up, and root's cp or ">" would write through it to a file of its choosing. + # Everything is written into a folder only root can open, handed to the folder's owner, and then renamed into place: + # a rename replaces a symlink at the target instead of following it (mv -h: not even one to a directory). + ER=$(mktemp -d /private/var/tmp/nullmoth-efiread.XXXXXX) || stop "could not make a private folder for the EFI copy" + cp "$C" "$ER/config.plist" || { rm -rf "$ER"; stop "could not copy $C"; } # the newest log that lists the ACPI tables: OpenCore can leave a pre-sized file of zeros for a start it never wrote to oclog=""; for f in $(ls -t "$MP"/opencore-*.txt 2>/dev/null); do grep -aq "OCA: Found" "$f" && { oclog=$f; break; }; done - [ -n "$oclog" ] && cp "$oclog" "$EFIREAD/opencore.txt" - on_usb "$EFI" && echo stick > "$EFIREAD/scope" || echo installed > "$EFIREAD/scope" - echo "$EFI" > "$EFIREAD/partition" - chown -R "$(stat -f %u "$EFIREAD")" "$EFIREAD" + [ -n "$oclog" ] && cp "$oclog" "$ER/opencore.txt" + on_usb "$EFI" && echo stick > "$ER/scope" || echo installed > "$ER/scope" + echo "$EFI" > "$ER/partition" + chown -R "$(stat -f %u "$EFIREAD")" "$ER" && chmod 0644 "$ER"/* || { rm -rf "$ER"; stop "could not hand the EFI copy back"; } + for f in config.plist opencore.txt scope partition; do + [ ! -e "$ER/$f" ] || mv -fh "$ER/$f" "$EFIREAD/$f" || { rm -rf "$ER"; stop "could not place $f"; } + done + rm -rf "$ER" ok "read $C${oclog:+ and $(basename "$oclog")}"; cleanup; echo "RESULT ok"; exit 0 fi diff --git a/mac/tools/test_root_writes_into_user_folders.py b/mac/tools/test_root_writes_into_user_folders.py new file mode 100644 index 00000000..694a6129 --- /dev/null +++ b/mac/tools/test_root_writes_into_user_folders.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 +"""Root must never write through a path that a program running as the user can swap. + +1. Privileged.run: root writes a command's output into the user's temp folder and hands it back with chown. A symlink + planted at output.txt made root truncate and fill the link's target, and chown gave that file to the user. +2. Driver update: a package from the newest release runs as root, so it needs a NullMoth signature, not only the + SHA-256 listed in the same release. +3. setup --efi-read: root copied files straight into the user's folder (cp/echo through any symlink placed there). + +Usage: test_root_writes_into_user_folders.py [mac-dir] (default: the mac/ folder beside this file) +Arm 1 runs the shell template from Privileged.swift for real (as this user) against a planted symlink.""" +import os +import pathlib +import re +import subprocess +import sys +import tempfile + +MAC = pathlib.Path(sys.argv[1]) if len(sys.argv) > 1 else pathlib.Path(__file__).resolve().parents[1] +FAILS = [] + + +def arm(name, ok, detail=""): + print(("ok " if ok else "FAIL ") + name + (f" [{detail}]" if detail and not ok else "")) + if not ok: + FAILS.append(name) + + +# 1. the output redirect and chown, run for real against a symlink planted where output.txt goes +priv = (MAC / "Sources/Privileged.swift").read_text() +m = re.search(r'let shell = "(.*?)"\n', priv) +arm("Privileged.swift has the root shell template", bool(m)) +if m: + tmpl = m.group(1).replace('\\"', '"').replace("\\\\", "\\") + with tempfile.TemporaryDirectory() as d: + victim = pathlib.Path(d, "victim.txt") + victim.write_text("untouched\n") + out = pathlib.Path(d, "run") + out.mkdir() + os.symlink(victim, out / "output.txt") + q = lambda s: "'" + s.replace("'", "'\\''") + "'" # noqa: E731 (the same quoting as the Swift) + shell = (tmpl.replace("\\(command)", "echo planted-by-root") + .replace("\\(q(out.path))", q(str(out / "output.txt"))) + .replace("\\(getuid())", str(os.getuid()))) + subprocess.run(["/bin/sh", "-c", shell], capture_output=True) + arm("a symlink at output.txt is not written through (the link's target keeps its bytes)", + victim.read_text() == "untouched\n", victim.read_text().strip()) + arm("chown never follows a link (-h)", "/usr/sbin/chown -h " in tmpl) + +# 2. a newest-release driver package must verify against the release key before it is installed +main = (MAC / "Sources/main.swift").read_text() +pdf = main[main.find("private func processDriverFile"):] +pdf = pdf[:pdf.find("\n }\n")] +arm("processDriverFile checks the release signature for a newest-release package", + "plan.fromRelease" in pdf and "ReleaseSignature.verify(zip: loc" in pdf) +arm("the download and the chosen-file paths both mark the package as from the release", + main.count("fromRelease: true, sig:") >= 2 or (main.count("fromRelease: true") >= 2 and "sig: l.sig" in main)) +arm("the update check reads the package's .sig from the same release", 'n == pkg.1 + ".sig"' in main) + +# 3. setup --efi-read writes nothing straight into the user's folder +setup = (MAC / "Resources/nullmoth-setup.sh").read_text() +blk = setup[setup.find('if [ -n "$EFIREAD" ]; then'):] +blk = blk[:blk.find("\nfi\n")] +direct = re.findall(r'(?:>|cp [^\n]*?)\s*"\$EFIREAD/[^"]*"', blk) +arm("--efi-read never cp/echo-writes into $EFIREAD directly", not direct, "; ".join(direct)) +arm("--efi-read places its files with mv -h from a root-only folder", "mv -fh" in blk and "mktemp -d /private/var/tmp/" in blk) + +print(f"{len(FAILS)} failed") +sys.exit(1 if FAILS else 0) From 77a8b521acd59af28fe1e8e53e6bd32462c36e26 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 18:10:00 -0700 Subject: [PATCH 046/244] 1401: updates from a release must carry a NullMoth signature --- p1401/nullmoth.py | 90 ++++++++++++++++--- p1401/release_sig.py | 145 +++++++++++++++++++++++++++++++ tests/test_release_signatures.py | 102 ++++++++++++++++++++++ 3 files changed, 327 insertions(+), 10 deletions(-) create mode 100644 p1401/release_sig.py create mode 100644 tests/test_release_signatures.py diff --git a/p1401/nullmoth.py b/p1401/nullmoth.py index 8763a0ca..ca0bcc10 100644 --- a/p1401/nullmoth.py +++ b/p1401/nullmoth.py @@ -281,10 +281,32 @@ def latest_release(get_json, get_text): out[key] = (name, url, sums[name]) if out["driver"] is None: raise RuntimeError("the latest release has no driver package listed in SHA256SUMS.txt") + out["sigs"] = {n: u for n, u in assets.items() if n and n.endswith(".sig") and u and u.startswith("https://")} return out -def update(dirs, rel, fetch): +def _signed(path, name, sig_url, fetch, key): + """Raises unless `path` carries a valid NullMoth release signature (release_sig.py). A SHA-256 from the release's own + SHA256SUMS.txt proves only that the release agrees with itself; these files run as root on a Mac (the driver + package) or as administrator here (the 1401 app), so whoever could replace a release's files must not be able to + replace what 1401 installs.""" + from . import release_sig # noqa: PLC0415 + if not sig_url: + raise RuntimeError(f"{name} is not signed by NullMoth (the release has no {name}.sig) - nothing was changed") + fetch(sig_url, path + ".sig") + try: + with open(path + ".sig", encoding="ascii", errors="replace") as fh: + sig = fh.read(4096) + finally: + try: + os.remove(path + ".sig") + except OSError: + pass + if not release_sig.verify_file(path, sig, key or release_sig.PUBLIC_KEY): + raise RuntimeError(f"{name}'s signature is not NullMoth's - nothing was changed") + + +def update(dirs, rel, fetch, sigkey=None): """Puts the newest driver package (and 1401 Mac app) from `rel` into every folder in `dirs` (the app's NullMoth folder, then any 1401 stick's NullMoth folder), verified by SHA-256, and removes older copies there - the stick writer takes the first package it finds. Downloads once, into dirs[0]. Returns the lines to show.""" @@ -306,13 +328,21 @@ def sha(p): name, url, want = item os.makedirs(dirs[0], exist_ok=True) src = os.path.join(dirs[0], name) + sig_url = (rel.get("sigs") or {}).get(name + ".sig") if not (os.path.exists(src) and sha(src) == want): fetch(url, src + ".part") if sha(src + ".part") != want: os.remove(src + ".part") raise RuntimeError(f"{name} does not match the SHA-256 published with it - nothing was replaced") + try: + _signed(src + ".part", name, sig_url, fetch, sigkey) + except RuntimeError: + os.remove(src + ".part") + raise os.replace(src + ".part", src) lines.append(f"downloaded {name}") + else: + _signed(src, name, sig_url, fetch, sigkey) for d in dirs: os.makedirs(d, exist_ok=True) dst = os.path.join(d, name) @@ -335,7 +365,8 @@ def sha(p): def latest_windows(get_json, get_text): - """The newest 1401 Windows app: (version, name, url, sha256) from the 1401 release, hashed by its SHA256SUMS.txt.""" + """The newest 1401 Windows app: (version, name, url, sha256, signature url or None) from the 1401 release, hashed by + its SHA256SUMS.txt; app_update() refuses it without a signature.""" rel = get_json(WIN_RELEASE_API) assets = {a.get("name"): a.get("browser_download_url") for a in rel.get("assets", []) if isinstance(a, dict)} if not assets.get("SHA256SUMS.txt"): @@ -349,19 +380,21 @@ def latest_windows(get_json, get_text): for name, url in assets.items(): m = _WIN_RE.match(name or "") if m and url and url.startswith("https://") and name in sums and (best is None or _vkey(m.group(1)) > _vkey(best[0])): - best = (m.group(1), name, url, sums[name]) + sig = assets.get(name + ".sig") + best = (m.group(1), name, url, sums[name], sig if sig and sig.startswith("https://") else None) if best is None: raise RuntimeError("the latest 1401 release has no Windows app listed in SHA256SUMS.txt") return best -def app_update(current, work, rel, fetch): +def app_update(current, work, rel, fetch, sigkey=None): """'Update 1401': None when `current` is the newest, else the folder holding the verified new 1401 (with 1401.exe). The zip must match its published SHA-256 and every entry must stay inside the folder it unpacks to (no ../ paths).""" import hashlib # noqa: PLC0415 import shutil # noqa: PLC0415 import zipfile # noqa: PLC0415 - version, name, url, want = rel + version, name, url, want = rel[:4] + sig_url = rel[4] if len(rel) > 4 else None if _vkey(version) <= _vkey(current): return None shutil.rmtree(work, ignore_errors=True) @@ -375,6 +408,11 @@ def app_update(current, work, rel, fetch): if h.hexdigest() != want: os.remove(z + ".part") raise RuntimeError(f"{name} does not match the SHA-256 published with it - nothing was changed") + try: + _signed(z + ".part", name, sig_url, fetch, sigkey) + except RuntimeError: + os.remove(z + ".part") + raise os.replace(z + ".part", z) out = os.path.realpath(os.path.join(work, "unpacked")) with zipfile.ZipFile(z) as zf: @@ -455,10 +493,17 @@ class D: # --- Update driver (newest release, verified by its own SHA256SUMS.txt) - no network: fake release + fetch import hashlib # noqa: PLC0415 import tempfile # noqa: PLC0415 + import base64 # noqa: PLC0415 + from . import release_sig # noqa: PLC0415 + seed = hashlib.sha256(b"1401 selftest key, never a release key").digest() + tkey = release_sig.sign(b"", seed)[1] + tsig = lambda b: base64.b64encode(release_sig.sign(b, seed)[0]) # noqa: E731 blob = {"https://x/nullmoth-nvidia-1.0.7.tar.gz": b"driver 1.0.7", "https://x/1401-Mac-1.0.10.zip": b"mac 1.0.10"} hx = {k.rsplit("/", 1)[1]: hashlib.sha256(v).hexdigest() for k, v in blob.items()} + blob.update({k + ".sig": tsig(v) for k, v in list(blob.items())}) sums = "".join(f"{h} {n}\n" for n, h in hx.items()) api = {"assets": [{"name": n, "browser_download_url": "https://x/" + n} for n in hx] + + [{"name": n + ".sig", "browser_download_url": "https://x/" + n + ".sig"} for n in hx] + [{"name": "nullmoth-nvidia-9.9.9.tar.gz", "browser_download_url": "https://x/unlisted"}, {"name": "SHA256SUMS.txt", "browser_download_url": "https://x/sums"}]} rel = latest_release(lambda u: api, lambda u: sums) @@ -471,19 +516,32 @@ class D: open(os.path.join(d, "nullmoth-nvidia-1.0.6.tar.gz"), "wb").write(b"old") open(os.path.join(d, "1401-Mac-1.0.9.zip"), "wb").write(b"old") got = [] - lines = update([app, stick], rel, lambda u, p: (got.append(u), open(p, "wb").write(blob[u]))) + lines = update([app, stick], rel, lambda u, p: (got.append(u), open(p, "wb").write(blob[u])), sigkey=tkey) + got = [u for u in got if not u.endswith(".sig")] arm("Update driver downloads each file once, puts both in the app folder and on the stick, removes the old copies", len(got) == 2 and sorted(os.listdir(app)) == sorted(os.listdir(stick)) == ["1401-Mac-1.0.10.zip", "nullmoth-nvidia-1.0.7.tar.gz"], (len(got), sorted(os.listdir(stick)))) bad = tempfile.mkdtemp(prefix="1401-selftest-") open(os.path.join(bad, "nullmoth-nvidia-1.0.6.tar.gz"), "wb").write(b"old") try: - update([bad], {"driver": rel["driver"], "mac": None}, lambda u, p: open(p, "wb").write(b"tampered")) + update([bad], {"driver": rel["driver"], "mac": None, "sigs": rel["sigs"]}, + lambda u, p: open(p, "wb").write(b"tampered"), sigkey=tkey) refused = False except RuntimeError: refused = True arm("a download that does not match its published SHA-256 is refused and the old package stays", refused and os.listdir(bad) == ["nullmoth-nvidia-1.0.6.tar.gz"], os.listdir(bad)) + # the release's own SHA256SUMS.txt is not enough: an unsigned package, or one signed by another key, is refused + for label, r3, k3 in (("an unsigned package", {"driver": rel["driver"], "mac": None, "sigs": {}}, tkey), + ("a package signed by another key", rel, release_sig.sign(b"", b"\x01" * 32)[1])): + nd = tempfile.mkdtemp(prefix="1401-selftest-") + try: + update([nd], {"driver": r3["driver"], "mac": None, "sigs": r3["sigs"]}, lambda u, p: open(p, "wb").write(blob[u]), sigkey=k3) + refused = False + except RuntimeError: + refused = True + arm(f"{label} is refused and nothing is placed", refused and os.listdir(nd) == [], os.listdir(nd)) + shutil.rmtree(nd, ignore_errors=True) # --- Update 1401 (the Windows app itself) import io # noqa: PLC0415 import zipfile # noqa: PLC0415 @@ -496,6 +554,7 @@ def mkzip(entries): return b.getvalue() good = mkzip({"1401/1401.exe": b"exe", "1401/engine/x.py": b"x"}) wapi = {"assets": [{"name": "1401-Windows-1.14.0.zip", "browser_download_url": "https://x/w"}, + {"name": "1401-Windows-1.14.0.zip.sig", "browser_download_url": "https://x/w.sig"}, {"name": "1401-Windows-9.0.0.zip", "browser_download_url": "https://x/unlisted"}, {"name": "SHA256SUMS.txt", "browser_download_url": "https://x/s"}]} wsums = hashlib.sha256(good).hexdigest() + " 1401-Windows-1.14.0.zip\n" @@ -506,17 +565,28 @@ def mkzip(entries): arm("startup check: 1.1.0 is outdated against 1.14.2, 1.14.2 and 1.15.0 are not", outdated("1.1.0", "1.14.2") and outdated("1.13.0", "1.14.2") and not outdated("1.14.2", "1.14.2") and not outdated("1.15.0", "1.14.2"), "1.1.0 / 1.13.0 vs 1.14.2") - got = app_update("1.13.0", os.path.join(wt, "b"), wrel, lambda u, p: open(p, "wb").write(good)) + wfetch = lambda u, p, b=good: open(p, "wb").write(tsig(b) if u.endswith(".sig") else b) # noqa: E731 + got = app_update("1.13.0", os.path.join(wt, "b"), wrel, wfetch, sigkey=tkey) arm("a newer, verified app unpacks to a folder holding 1401.exe", got and os.path.isfile(os.path.join(got, "1401.exe")), got) for label, blob in (("a tampered download", b"tampered"), ("a zip with a ../ entry", mkzip({"1401/1401.exe": b"e", "../evil.txt": b"x"}))): - r2 = (wrel[0], wrel[1], wrel[2], hashlib.sha256(blob).hexdigest()) if blob != b"tampered" else wrel + r2 = (wrel[0], wrel[1], wrel[2], hashlib.sha256(blob).hexdigest(), wrel[4]) if blob != b"tampered" else wrel try: - app_update("1.13.0", os.path.join(wt, "c"), r2, lambda u, p, b=blob: open(p, "wb").write(b)) + app_update("1.13.0", os.path.join(wt, "c"), r2, + lambda u, p, b=blob: open(p, "wb").write(tsig(b) if u.endswith(".sig") else b), sigkey=tkey) ok_ = False except RuntimeError: ok_ = True arm(f"{label} is refused", ok_ and not os.path.exists(os.path.join(wt, "evil.txt")), label) + for label, r4, f4 in (("an unsigned Windows app", wrel[:4] + (None,), lambda u, p: open(p, "wb").write(good)), + ("a Windows app whose signature is for other bytes", wrel, + lambda u, p: open(p, "wb").write(tsig(b"other") if u.endswith(".sig") else good))): + try: + app_update("1.13.0", os.path.join(wt, "d"), r4, f4, sigkey=tkey) + ok_ = False + except RuntimeError: + ok_ = True + arm(f"{label} is refused and not unpacked", ok_ and not os.path.exists(os.path.join(wt, "d", "unpacked")), label) shutil.rmtree(wt, ignore_errors=True) print(f"{sum(res)}/{len(res)} passed") return 0 if all(res) else 1 diff --git a/p1401/release_sig.py b/p1401/release_sig.py new file mode 100644 index 00000000..75e519cb --- /dev/null +++ b/p1401/release_sig.py @@ -0,0 +1,145 @@ +"""NullMoth release signatures: Ed25519 (RFC 8032) over the exact bytes of a release file. + +The SHA-256 in a release's SHA256SUMS.txt only proves that the files of one release agree with each other: whoever can +replace the release's files can replace the list too. Every file that 1401 runs or puts on a stick from a newer release +(the 1401 Windows app, the NVIDIA driver package, the 1401 Mac app) carries a detached signature, .sig (base64 +of the 64-byte signature), made with the NullMoth release key. The public half is below and is the same key the Mac app +compiles in; the private half never leaves the signing host. + +This module carries no third-party code and no dependency: the bundled Python has no cryptography package. It follows +the verification steps of RFC 8032 section 5.1.7 with the curve constants of section 5.1. sign() exists for the tests, +which make their own throwaway key; 1401 itself only verifies.""" +import base64 +import hashlib + +PUBLIC_KEY = "ztPmcj+mcHYM1X2lrp24yjq0xBuzke7gh5XJ3E2fd4E=" + +_P = 2 ** 255 - 19 +_L = 2 ** 252 + 27742317777372353535851937790883648493 +_D = -121665 * pow(121666, _P - 2, _P) % _P +_I = pow(2, (_P - 1) // 4, _P) + + +def _inv(x): + return pow(x, _P - 2, _P) + + +def _recover_x(y, sign): + if y >= _P: + return None + x2 = (y * y - 1) * _inv(_D * y * y + 1) + if x2 == 0: + return None if sign else 0 + x = pow(x2, (_P + 3) // 8, _P) + if (x * x - x2) % _P != 0: + x = x * _I % _P + if (x * x - x2) % _P != 0: + return None + if (x & 1) != sign: + x = _P - x + return x + + +# points in extended coordinates (X, Y, Z, T), x = X/Z, y = Y/Z, x*y = T/Z +def _add(p, q): + a = (p[1] - p[0]) * (q[1] - q[0]) % _P + b = (p[1] + p[0]) * (q[1] + q[0]) % _P + c = 2 * p[3] * q[3] * _D % _P + d = 2 * p[2] * q[2] % _P + e, f, g, h = b - a, d - c, d + c, b + a + return (e * f % _P, g * h % _P, f * g % _P, e * h % _P) + + +def _mul(s, p): + q = (0, 1, 1, 0) + while s > 0: + if s & 1: + q = _add(q, p) + p = _add(p, p) + s >>= 1 + return q + + +def _equal(p, q): + return (p[0] * q[2] - q[0] * p[2]) % _P == 0 and (p[1] * q[2] - q[1] * p[2]) % _P == 0 + + +_GY = 4 * _inv(5) % _P +_GX = _recover_x(_GY, 0) +_G = (_GX, _GY, 1, _GX * _GY % _P) + + +def _compress(p): + zi = _inv(p[2]) + x, y = p[0] * zi % _P, p[1] * zi % _P + return int.to_bytes(y | ((x & 1) << 255), 32, "little") + + +def _decompress(s): + if len(s) != 32: + return None + y = int.from_bytes(s, "little") + sign = y >> 255 + y &= (1 << 255) - 1 + x = _recover_x(y, sign) + if x is None: + return None + return (x, y, 1, x * y % _P) + + +def _h(m): + return int.from_bytes(hashlib.sha512(m).digest(), "little") + + +def verify(data, signature, public_key=PUBLIC_KEY): + """True only when `signature` (raw 64 bytes, or base64 text of them) is a valid Ed25519 signature of `data` by + `public_key` (base64 of the raw 32 bytes). Anything malformed is False, never an exception.""" + return _verify(lambda h: h.update(data), signature, public_key) + + +def verify_file(path, signature, public_key=PUBLIC_KEY): + """verify() over a file's bytes, read in 1 MB pieces (a release zip is a few hundred MB).""" + def feed(h): + with open(path, "rb") as fh: + for b in iter(lambda: fh.read(1 << 20), b""): + h.update(b) + try: + return _verify(feed, signature, public_key) + except OSError: + return False + + +def _verify(feed, signature, public_key): + try: + if isinstance(signature, str): + signature = base64.b64decode(signature.strip(), validate=True) + key = base64.b64decode(public_key, validate=True) + except (ValueError, TypeError): + return False + if len(signature) != 64 or len(key) != 32: + return False + a = _decompress(key) + r = _decompress(signature[:32]) + if a is None or r is None: + return False + s = int.from_bytes(signature[32:], "little") + if s >= _L: + return False + h = hashlib.sha512(signature[:32] + key) + feed(h) + k = int.from_bytes(h.digest(), "little") % _L + return _equal(_mul(8 * s, _G), _add(_mul(8, r), _mul(8 * k, a))) + + +def sign(data, seed): + """Test helper: (signature, public key base64) for a 32-byte seed.""" + h = hashlib.sha512(seed).digest() + a = int.from_bytes(h[:32], "little") + a &= (1 << 254) - 8 + a |= 1 << 254 + pub = _compress(_mul(a, _G)) + r = _h(h[32:] + data) % _L + rb = _compress(_mul(r, _G)) + k = _h(rb + pub + data) % _L + s = (r + k * a) % _L + return rb + int.to_bytes(s, 32, "little"), base64.b64encode(pub).decode() diff --git a/tests/test_release_signatures.py b/tests/test_release_signatures.py new file mode 100644 index 00000000..a9efe29d --- /dev/null +++ b/tests/test_release_signatures.py @@ -0,0 +1,102 @@ +"""Updates from a newer release need a NullMoth signature, not only the SHA-256 the same release lists. + +The 1401 Windows app runs as administrator and the NVIDIA driver package runs as root on the Mac. Both were accepted +when their bytes matched SHA256SUMS.txt from the same GitHub release, so whoever could replace a release's files could +replace both the file and its hash. p1401.release_sig verifies a detached Ed25519 signature against the release key.""" +import base64 +import hashlib +import os +import re +import tempfile +import unittest + +from p1401 import nullmoth, release_sig + +HERE = os.path.dirname(os.path.abspath(__file__)) +SEED = hashlib.sha256(b"test key, never a release key").digest() +KEY = release_sig.sign(b"", SEED)[1] + + +def sig(data): + return base64.b64encode(release_sig.sign(data, SEED)[0]) + + +class Ed25519(unittest.TestCase): + # RFC 8032 section 7.1, tests 1 and 2 + VECTORS = [ + ("9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60", + "d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a", "", + "e5564300c360ac729086e2cc806e828a84877f1eb8e5d974d873e065224901555fb8821590a33bacc61e39701cf9b46bd25bf5f0595bbe24655141438e7a100b"), + ("4ccd089b28ff96da9db6c346ec114e0f5b8a319f35aba624da8cf6ed4fb8a6fb", + "3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c", "72", + "92a009a9f0d4cab8720e820b5f642540a2b27b5416503f8fb3762223ebdb69da085ac1e43e15996e458f3613d0f11d8c387b2eaeb4302aeeb00d291612bb0c00"), + ] + + def test_rfc8032_vectors_sign_and_verify(self): + for sk, pk, msg, want in self.VECTORS: + s, pub = release_sig.sign(bytes.fromhex(msg), bytes.fromhex(sk)) + self.assertEqual(s.hex(), want) + self.assertEqual(base64.b64decode(pub).hex(), pk) + self.assertTrue(release_sig.verify(bytes.fromhex(msg), s, pub)) + + def test_a_flipped_bit_or_another_key_fails(self): + s, pub = release_sig.sign(b"package bytes", SEED) + self.assertFalse(release_sig.verify(b"package bytez", s, pub)) + bad = bytearray(s); bad[40] ^= 1 + self.assertFalse(release_sig.verify(b"package bytes", bytes(bad), pub)) + self.assertFalse(release_sig.verify(b"package bytes", s, release_sig.PUBLIC_KEY)) + self.assertFalse(release_sig.verify(b"package bytes", "not base64!", pub)) + + def test_the_release_key_is_the_one_the_mac_app_compiles_in(self): + swift = open(os.path.join(HERE, "..", "mac", "Sources", "ReleaseSignature.swift"), encoding="utf-8").read() + self.assertIn(f'publicKeyBase64 = "{release_sig.PUBLIC_KEY}"', swift) + + +class Updates(unittest.TestCase): + def setUp(self): + self.tmp = tempfile.TemporaryDirectory() + self.addCleanup(self.tmp.cleanup) + + def test_an_unsigned_windows_app_is_refused(self): + good = b"zip bytes" + rel = ("9.9.9", "1401-Windows-9.9.9.zip", "https://x/w", hashlib.sha256(good).hexdigest()) + with self.assertRaises(RuntimeError): + nullmoth.app_update("1.0.0", os.path.join(self.tmp.name, "a"), rel, lambda u, p: open(p, "wb").write(good)) + self.assertFalse(os.path.exists(os.path.join(self.tmp.name, "a", "unpacked"))) + + def test_a_windows_app_signed_for_other_bytes_is_refused(self): + good = b"zip bytes" + rel = ("9.9.9", "1401-Windows-9.9.9.zip", "https://x/w", hashlib.sha256(good).hexdigest(), "https://x/w.sig") + fetch = lambda u, p: open(p, "wb").write(sig(b"other") if u.endswith(".sig") else good) # noqa: E731 + with self.assertRaisesRegex(RuntimeError, "signature"): + nullmoth.app_update("1.0.0", os.path.join(self.tmp.name, "b"), rel, fetch, sigkey=KEY) + + def test_an_unsigned_driver_package_never_reaches_the_app_folder_or_stick(self): + data = b"driver package" + rel = {"driver": ("nullmoth-nvidia-9.9.9.tar.gz", "https://x/p", hashlib.sha256(data).hexdigest()), + "mac": None, "sigs": {}} + d = os.path.join(self.tmp.name, "app") + with self.assertRaises(RuntimeError): + nullmoth.update([d], rel, lambda u, p: open(p, "wb").write(data)) + self.assertEqual([f for f in os.listdir(d) if not f.endswith(".part")], []) + + def test_a_signed_driver_package_is_placed(self): + data = b"driver package" + rel = {"driver": ("nullmoth-nvidia-9.9.9.tar.gz", "https://x/p", hashlib.sha256(data).hexdigest()), + "mac": None, "sigs": {"nullmoth-nvidia-9.9.9.tar.gz.sig": "https://x/p.sig"}} + d = os.path.join(self.tmp.name, "app") + fetch = lambda u, p: open(p, "wb").write(sig(data) if u.endswith(".sig") else data) # noqa: E731 + nullmoth.update([d], rel, fetch, sigkey=KEY) + self.assertEqual(os.listdir(d), ["nullmoth-nvidia-9.9.9.tar.gz"]) + + def test_latest_windows_names_the_signature(self): + api = {"assets": [{"name": "1401-Windows-9.9.9.zip", "browser_download_url": "https://x/w"}, + {"name": "1401-Windows-9.9.9.zip.sig", "browser_download_url": "https://x/w.sig"}, + {"name": "SHA256SUMS.txt", "browser_download_url": "https://x/s"}]} + rel = nullmoth.latest_windows(lambda u: api, lambda u: "0" * 64 + " 1401-Windows-9.9.9.zip\n") + self.assertEqual(rel[4], "https://x/w.sig") + self.assertTrue(re.fullmatch(r"[0-9a-f]{64}", rel[3])) + + +if __name__ == "__main__": + unittest.main() From f25f9f1dfbe1461adbe7d0280da5a71cd5bbfc4f Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 18:19:58 -0700 Subject: [PATCH 047/244] Mac app 2.6.6: pin the staged driver package (to be restaged) --- mac/Sources/main.swift | 8 ++++---- mac/build.sh | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index 5789c46b..9040ac81 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -9,10 +9,10 @@ import WebKit import UniformTypeIdentifiers struct Package { - static let version = "2.6.5" - static let name = "nullmoth-nvidia-2.6.5.tar.gz" - static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.5/nullmoth-nvidia-2.6.5.tar.gz")! - static let sha256 = "cca98ce4255e6a0e11e8bd78158f6c288e4def92d100941e0b6b1cfe73a3c3c1" + static let version = "2.6.6" + static let name = "nullmoth-nvidia-2.6.6.tar.gz" + static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.6/nullmoth-nvidia-2.6.6.tar.gz")! + static let sha256 = "cb6fdea4f87d698d7b5847e12c6ee209eb214e0eec3fea7b595bf96ca3ee6fdd" } // The AMD/Intel GPU and NPU driver (test): its own product and package, pinned like the NVIDIA driver's. An empty pin // means no build of it is published yet. diff --git a/mac/build.sh b/mac/build.sh index 88045604..c1580993 100644 --- a/mac/build.sh +++ b/mac/build.sh @@ -66,8 +66,8 @@ cat > "$APP/Contents/Info.plist" <CFBundleName1401 CFBundleDisplayName1401 CFBundlePackageTypeAPPL -CFBundleShortVersionString2.6.5 -CFBundleVersion129 +CFBundleShortVersionString2.6.6 +CFBundleVersion130 LSMinimumSystemVersion15.0 NSHumanReadableCopyright© 2026 NullMoth Systems NSHighResolutionCapable From a557bbc76c33731af5f1c4b1bf25f2891c536548 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 18:42:36 -0700 Subject: [PATCH 048/244] tests: negative controls name their commits after the history rewrite --- mac/tools/test_remove_entry.py | 2 +- tests/test_picker_visible.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mac/tools/test_remove_entry.py b/mac/tools/test_remove_entry.py index 3c64111b..6863dbf9 100644 --- a/mac/tools/test_remove_entry.py +++ b/mac/tools/test_remove_entry.py @@ -10,7 +10,7 @@ ROOT = Path(__file__).resolve().parents[1] BOOT = '7C436110-AB2A-4BBB-A880-FE41995C9F82' -OLD_REV = '4ba580e' +OLD_REV = '57798ba' def old_source(): diff --git a/tests/test_picker_visible.py b/tests/test_picker_visible.py index d4141859..46a4473b 100644 --- a/tests/test_picker_visible.py +++ b/tests/test_picker_visible.py @@ -16,7 +16,7 @@ from p1401 import engine, policy, validate REPO = pathlib.Path(__file__).resolve().parents[1] -OLD_REV = '93a64a3' +OLD_REV = '0a21785' def result_for(directory): From 50d663713af641b5d1b2abbbd7a41773af8a4ff8 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 18:46:40 -0700 Subject: [PATCH 049/244] SECURITY.md: private reporting and the official sources --- SECURITY.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..ee98bc14 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,14 @@ +# Security + +## Reporting a vulnerability + +Report it privately through GitHub: [open a security advisory](https://github.com/nullmoth/1401/security/advisories/new). +Please do not open a public issue for a vulnerability. Include the 1401 version, the macOS version, and the steps that +show the problem. We answer in the advisory thread. + +## Where the driver comes from + +The only official sources are this repository's [releases](https://github.com/nullmoth/nvidia-macos-driver/releases), +the 1401 app (which downloads from those releases), and [nullmothsystems.com](https://nullmothsystems.com). Copies on +other sites or in other repositories are not ours. The 1401 apps check every driver package and app update against a +detached Ed25519 signature made with the NullMoth release key before they install it, and refuse anything unsigned. From c7d9eba4930addf8139e6a6ae477626120692932 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 18:53:02 -0700 Subject: [PATCH 050/244] Changelog 2.6.6: security, Sequoia 15.0, Tahoe black screen --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f8cd0ff..d2612636 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ Each release also bundles the NVIDIA driver and Mac app of the same version; see - Building: when OpenCore's check finds a driver missing, the stop lists what is in EFI/OC/Drivers. - Intel PCs that stop at "EB.MM.AKM" with only a few kernel slides free get the BIOS checklist (Above 4G Decoding, CSM off, a smaller iGPU memory). - Mac app: the stops for "runtime payload requires macOS" and "OpenCore's startup partition could not be confirmed" now name the macOS version and the partition the Mac started from. +- Security: 1401 for Windows installs its own update, and puts a driver or Mac app on the stick, only with a valid NullMoth signature; anything unsigned or changed is refused. +- Security (Mac app): administrator steps no longer write through files another program could swap in your user folder, and driver updates need a valid NullMoth signature. - Bundles NVIDIA driver 2.6.6. ## 2.6.5 From f5a9254079601d69a2e165fcd9f659e4f882bab9 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Sat, 31 Oct 2026 19:01:03 -0700 Subject: [PATCH 051/244] 1401 2.6.6: bundles driver and Mac app 2.6.6 --- mac/Sources/main.swift | 2 +- mac/build.sh | 2 +- p1401/nullmoth.py | 6 +++--- windows/App/App.csproj | 2 +- windows/App/app.manifest | 2 +- windows/release-inputs.json | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index 7aefd5b2..7e3615ed 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -12,7 +12,7 @@ struct Package { static let version = "2.6.6" static let name = "nullmoth-nvidia-2.6.6.tar.gz" static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.6/nullmoth-nvidia-2.6.6.tar.gz")! - static let sha256 = "cb6fdea4f87d698d7b5847e12c6ee209eb214e0eec3fea7b595bf96ca3ee6fdd" + static let sha256 = "dbb0f5c2a18ccc97dfdf57ca14488b0ea713c15608f684a0a4283e88c676ab6e" } // The AMD/Intel GPU and NPU driver (test): its own product and package, pinned like the NVIDIA driver's. An empty pin // means no build of it is published yet. diff --git a/mac/build.sh b/mac/build.sh index c1580993..7c4bb95d 100644 --- a/mac/build.sh +++ b/mac/build.sh @@ -67,7 +67,7 @@ cat > "$APP/Contents/Info.plist" <CFBundleDisplayName1401 CFBundlePackageTypeAPPL CFBundleShortVersionString2.6.6 -CFBundleVersion130 +CFBundleVersion132 LSMinimumSystemVersion15.0 NSHumanReadableCopyright© 2026 NullMoth Systems NSHighResolutionCapable diff --git a/p1401/nullmoth.py b/p1401/nullmoth.py index ca0bcc10..e8876805 100644 --- a/p1401/nullmoth.py +++ b/p1401/nullmoth.py @@ -29,9 +29,9 @@ BOOT_ARGS = ("nvfb=1", "nvaccel=1", "nvfbheads=4", "-nvkmsnosmooth", "amfi_get_out_of_my_way=0x1", "amfi=0x80", "ipc_control_port_options=0") # Package published with the driver; the stick carries it so the Mac companion can install it offline. -PACKAGE = {"name": "nullmoth-nvidia-2.6.5.tar.gz", - "url": "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.5/nullmoth-nvidia-2.6.5.tar.gz", - "sha256": "cca98ce4255e6a0e11e8bd78158f6c288e4def92d100941e0b6b1cfe73a3c3c1"} +PACKAGE = {"name": "nullmoth-nvidia-2.6.6.tar.gz", + "url": "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.6/nullmoth-nvidia-2.6.6.tar.gz", + "sha256": "dbb0f5c2a18ccc97dfdf57ca14488b0ea713c15608f684a0a4283e88c676ab6e"} with open(os.path.join(HERE, "nvidia_gsp_ids.json")) as _fh: TABLE = json.load(_fh) diff --git a/windows/App/App.csproj b/windows/App/App.csproj index 91191e11..67d580b3 100644 --- a/windows/App/App.csproj +++ b/windows/App/App.csproj @@ -8,7 +8,7 @@ AnyCPU false app.manifest - 2.6.5 + 2.6.6 NullMoth Systems NullMoth Systems © 2026 NullMoth Systems diff --git a/windows/App/app.manifest b/windows/App/app.manifest index 1ed6ef5a..42b0b434 100644 --- a/windows/App/app.manifest +++ b/windows/App/app.manifest @@ -1,6 +1,6 @@ - + diff --git a/windows/release-inputs.json b/windows/release-inputs.json index b671b87f..0f7e28a1 100644 --- a/windows/release-inputs.json +++ b/windows/release-inputs.json @@ -1,9 +1,9 @@ { "baseline_url": "https://github.com/nullmoth/1401/releases/download/v1.14.3/1401-Windows-1.14.3.zip", "baseline_sha256": "e287bf4b09805dbf697f915fa6867a15a422764c46b8733dfd9f46bc0e6043b6", - "driver_release": "v2.6.5", - "mac_asset": "1401-Mac-2.6.5.zip", - "mac_sha256": "251bfe3c68019b6c89d9699dee8aa47ae2689e58d59191378a3ac11fced79caa", + "driver_release": "v2.6.6", + "mac_asset": "1401-Mac-2.6.6.zip", + "mac_sha256": "8e8f7b60a6b8410c93e01faccd96575dd7e9e55116001dbd9bb27c40e0fbd3c3", "opencore_url": "https://github.com/acidanthera/OpenCorePkg/releases/download/1.0.8/OpenCore-1.0.8-RELEASE.zip", "opencore_sha256": "2011e8b7216ecb2645d97ea710df965947edd406846e92050b9bc4190be6d27b", "fixture_slug": "optiplex-5050-micro", From 1c22133f8890dd71d4696332aa50a5c96d43b77b Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 00:59:21 -0800 Subject: [PATCH 052/244] 1401: do not erase the stick before Apple will serve the download 1401: do not erase the stick before Apple will serve the download; finish the Windows hardware map Measured over the raw write logs users sent on 2026-10-31..11-02 (780 write logs of 16,620 uploads), not over the summarised digest, which truncates each line before its status code: HTTP 406 from oscdn 328 logs 323 of them AFTER "OK erased the stick" HTTP 405 from osrecovery 11 logs HTTP 503 / 502 16 logs (already retried) HTTP 403 5 logs (already has a fresh-token path) HTTP 400 2 logs HTTP 408 1 log HTTP 416 on a resume 1 log 20 resumes over 15 minutes that could not succeed 333 of the 339 406/405 stops fell inside ONE UTC hour (2026-11-01 09:00-09:59), across six app versions back to 1.10.0, with zero in the other 61 hours of the window. That is Apple's side failing for an hour, not a per-network and not a per-version fault. What was ours: - The chunklist was the download's first request and the download ran after the erase, so 323 users lost whatever was on their stick to learn that Apple would not serve them. apple.preflight() now fetches and verifies the signed chunklist and samples 64 KiB of the image BEFORE the erase, and download() reuses those verified bytes instead of asking oscdn a second time. A refusal there stops with "your USB stick was not touched". - 406, 405, 408, 425 and 429 were outside _transient, so each got one request with no back-off and no reroute. They are now retried like a 5xx; 406 also tries another edge through DNS-over-HTTPS, and 405/406 on osrecovery now take the existing HTTPS route that 400 and 403 already took. - The stop for those statuses was a bare status and a raw CDN URL. It now says Apple answered that way to every try, that waiting is the thing to do, and that nothing was changed - and no longer claims the network "keeps cutting the connection", which a 406 is not. - A 416 on a resume means the server's object ends before the byte we need while Apple's signed chunklist says the image is longer, so no retry can satisfy it. It refuses at once and says so. - The readback stop now names the stick by model and claimed size (never its serial), and tells the two faults apart: of 32 readback stops, 16 had 1-19 of 85-92 parts different (a failing write, rewritten once, still wrong -> try another port) and 16 had 37-82 different (a stick reporting a size it does not have -> use a different stick). 27 of the 32 named a generic controller. - The read-only refusal says what to do about a lock switch and what it means when there is none. Windows hardware map, the counterpart of the Mac app's Sources/HardwareMap.swift, finished: - HardwareMap.cs is wired into the check step as one call site, off the UI thread, writing hardware-map.txt beside Report.json so the identifiers travel with every report. - Added the fields Windows can actually state and the map needed: pci_class (from the CC_ compatible ID - the field that says "this is an HD-audio controller"), audio_codec_vendor_device and audio_codec_revision (from HDAUDIO ids, the only place Windows names the codec itself), usb_class/subclass/protocol, usb_interface_number and hid_usage_page/hid_usage. Every one is a fixed-width hex capture from an anchored pattern, so the strict allow-list is unchanged. - Each WMI object is now disposed, the enumeration is bounded by devices examined and not only by devices listed, a damaged WMI repository is reported as a devices_status line rather than thrown, and each device line is field-name sorted so two maps of one PC are the same text and can be diffed. - hardware_map_parse_check.py: 9 arms -> 20, including two negative controls that must fire and two arms calibrated on identifiers from real reports. Its fixtures no longer carry a personal name or a private LAN address; they use RFC 5737 and IANA documentation values. HardwareMap.cs is UNBUILT: there is no .NET toolchain on the machine it was written on. It was reviewed line by line against net48 and C# 7.3 and its parse rules are proven by the Python mirror, but it has never been compiled and never run against WMI. Tests: 878 pass (859 before, plus 19 new in tests/test_apple_preflight_status.py), 5 skipped. usbwriter --selftest 20/20. hardware_map_parse_check 20/20, and it fails when an anchor is removed. --- p1401/apple.py | 87 +++++- p1401/usbwriter.py | 64 +++- tests/test_apple_preflight_status.py | 332 +++++++++++++++++++++ windows/App/HardwareMap.cs | 341 ++++++++++++++++++++++ windows/App/MainForm.cs | 6 + windows/App/hardware_map_parse_check.py | 372 ++++++++++++++++++++++++ 6 files changed, 1190 insertions(+), 12 deletions(-) create mode 100644 tests/test_apple_preflight_status.py create mode 100644 windows/App/HardwareMap.cs create mode 100644 windows/App/hardware_map_parse_check.py diff --git a/p1401/apple.py b/p1401/apple.py index fb50da10..bdd733e7 100644 --- a/p1401/apple.py +++ b/p1401/apple.py @@ -100,9 +100,19 @@ class AppleError(RuntimeError): REFRESH_EVERY = 4 +# 2.6.6 write logs, measured 11-02 over the raw uploads of 10-31..11-02 (780 write logs): 328 stops were +# "HTTP Error 406: Not Acceptable" from oscdn and 11 were "HTTP Error 405: Method Not Allowed" from +# osrecovery, and 333 of those 339 landed inside ONE UTC hour (2026-11-01 09:00-09:59) across six app +# versions back to 1.10.0, with zero in the other 61 hours of the window. That is Apple's side failing for +# an hour, not a per-network fault and not a per-version one - but 406, 405, 408 and 429 were all outside +# this test, so each was a single request with no back-off and no reroute, and 323 of the 328 had already +# erased the user's stick. A status Apple's own servers hand out for an hour is retried like a 5xx. +RETRY_STATUS = (405, 406, 408, 425, 429, 500, 502, 503, 504) + + def _transient(e): if isinstance(e, urllib.error.HTTPError): - return e.code in (500, 502, 503, 504) + return e.code in RETRY_STATUS return isinstance(e, (urllib.error.URLError, http.client.HTTPException, ConnectionError, TimeoutError, socket.timeout)) @@ -175,7 +185,10 @@ def _open(url, headers, data=None, sleep=None, doh=None): # 2.6.3 write logs 10-28 (11 PCs): "HTTP Error 400: Bad Request" from osrecovery itself, the bare GET of # http://osrecovery.apple.com/ among them, which Apple answers 200 everywhere else. A 400 there comes from # something on the network rewriting plain HTTP, the same as its 403. - recovery_http_refused = isinstance(e, urllib.error.HTTPError) and e.code in (400, 403) + # 405 and 406 join 400 and 403 here: osrecovery answered "Method Not Allowed" to the + # RecoveryImage POST on 11 machines, and HTTPS is the one route a proxy rewriting plain HTTP + # cannot touch. It costs one request and is the same reroute 400 already got. + recovery_http_refused = isinstance(e, urllib.error.HTTPError) and e.code in (400, 403, 405, 406) if (not (secured or rerouted) and url.startswith(OSRECOVERY_HTTP) and (_transient(e) or recovery_http_refused) and not _dns_failure(e)): secured = True @@ -186,7 +199,10 @@ def _open(url, headers, data=None, sleep=None, doh=None): # The image CDN has no HTTPS to fall back to. 1.14.2 write logs: oscdn answered "502 Bad Gateway" on every # try - the edge server (or a proxy in front of it) this network's DNS picked. After two 5xx in a row the # request goes to the address DNS-over-HTTPS gives, a different edge; Apple's signed chunklist still checks it. - edge_5xx = (isinstance(e, urllib.error.HTTPError) and e.code in (502, 503, 504) and attempt >= 1 + # 406 is in this set for the 11-01 09:00 hour: oscdn answered "Not Acceptable" to 328 chunklist + # requests, which is an answer from one edge and not a broken connection, so another edge is + # exactly what is worth trying. Apple's signed chunklist still checks whatever any edge serves. + edge_5xx = (isinstance(e, urllib.error.HTTPError) and e.code in (406, 502, 503, 504) and attempt >= 1 and not url.startswith(OSRECOVERY_HTTP)) if not rerouted and not secured and url.startswith("http://") and (_dns_failure(e) or edge_5xx): host = urlparse(url).hostname @@ -204,9 +220,22 @@ def _open(url, headers, data=None, sleep=None, doh=None): # Eight write logs ended here with osrecovery cut off over HTTP and then over HTTPS too ("SSL: # UNEXPECTED_EOF_WHILE_READING" on every try): something between the PC and Apple drops both, and the bare # error left the user nothing to do. - advice = RECOVERY_NETWORK if urlparse(url).hostname == "osrecovery.apple.com" and (_transient(e) or (isinstance(e, urllib.error.HTTPError) and e.code == 400)) else "" + # A retried 4xx is Apple ANSWERING, so it does not take the "this network cuts the connection" + # wording below: 9 of the 11 "HTTP Error 405" stops were in the same Apple-side hour as the 406s. + answered_4xx = isinstance(e, urllib.error.HTTPError) and e.code in RETRY_STATUS and e.code < 500 + advice = RECOVERY_NETWORK if urlparse(url).hostname == "osrecovery.apple.com" and not answered_4xx and (_transient(e) or (isinstance(e, urllib.error.HTTPError) and e.code == 400)) else "" # 2.0.2 write logs 10-15 (3 PCs): oscdn reset the chunklist request on every try, at the DNS-over-HTTPS edge # too (WinError 10054), and the stop said only "ConnectionResetError" with nothing to do about it. + # An HTTP status is an ANSWER, not a cut connection, and must not be described as one. 328 stops + # in the 11-01 09:00 hour read "HTTP Error 406: Not Acceptable" and a bare URL: nothing told the + # user that 1401 had tried for two minutes, that their stick was untouched, or that waiting is + # the thing to do. Apple's own servers answered this way to every version at once, so the advice + # is to wait and try again - not to go hunting through an antivirus that was never the cause. + if not advice and answered_4xx: + advice = (f" - Apple's download server answered {e.code} to every try over about two minutes. This is " + "usually Apple's side, and it passes: wait a few minutes and press Next again. Nothing on " + "this PC and nothing on the USB stick was changed. If it keeps answering the same way, " + "connect through a phone hotspot or a VPN, or turn off web/HTTPS scanning in your antivirus.") if not advice and _transient(e): advice = (" - this network keeps cutting the connection to Apple's download server. Turn off web/HTTPS " "scanning in your antivirus, or connect through a phone hotspot or a VPN, and press Next again.") @@ -337,12 +366,43 @@ def _not_a_web_page(data): "through a phone hotspot or a VPN, and press Next") +PREFLIGHT_BYTES = 64 * 1024 # enough to prove the CDN serves a range of the image; not a download + + +def preflight(info): + """Proves Apple will serve this download BEFORE anything is erased: the signed chunklist, verified, and a + small range of the image itself. Returns the chunklist bytes, which download() then reuses rather than + asking twice. + + Why this exists, measured 11-02 over the raw write logs of 10-31..11-02: of 328 stops that read + "HTTP Error 406: Not Acceptable" from oscdn, 323 came AFTER "OK erased the stick and made one FAT32 + partition". The chunklist is about a megabyte and is the first thing the download asks for, so every one + of those users lost whatever was on their stick to learn that Apple would not serve them. Asking first + costs one small request and turns that into a stop that changed nothing. + + It is not a guarantee: a download that starts can still be cut later, and that is still handled where it + happens. This only moves the failure that was ALREADY certain before the erase to before the erase.""" + cl = fetch_chunklist(info) + chunks = parse_chunklist(cl) # raises unless Apple's EFI ROM key signed exactly these bytes + total = sum(s for s, _ in chunks) + want = min(PREFLIGHT_BYTES, chunks[0][0]) + r = _asset(info["image_url"], info["image_token"], {"Range": f"bytes=0-{want - 1}"}) + try: + got = len(_read_exact(r, want)) + finally: + r.close() + info["chunklist_bytes"] = cl + return {"chunklist": cl, "chunks": len(chunks), "bytes": total, "sampled": got} + + def download(info, usb_root, progress=None): """Streams the recovery image into /com.apple.recovery.boot/, checking every chunk as it arrives. Writes to .part files and only renames them after the last chunk checks out, so a half image never looks done.""" dest = os.path.join(usb_root, "com.apple.recovery.boot") os.makedirs(dest, exist_ok=True) - cl = fetch_chunklist(info) + # preflight() already fetched and verified this before the stick was erased; asking oscdn for it a second + # time is one more chance for an edge to refuse after the disk is already gone. + cl = info.get("chunklist_bytes") or fetch_chunklist(info) chunks = parse_chunklist(cl) total = sum(s for s, _ in chunks) img = os.path.join(dest, os.path.basename(urlparse(info["image_url"]).path)) @@ -421,6 +481,23 @@ def note(s): except (AppleError, OSError, http.client.HTTPException) as again: if "(status 200)" in str(again): raise # the server ignores ranges: no retry can resume, so refuse at once + # 416 means the byte we are asking for is past the end of the object this + # server holds, and Apple's SIGNED chunklist says the image is longer than + # that - so whatever is being served is not the image, and no retry can ever + # satisfy the range. One 2.6.6 write log spent 20 resumes over 15 minutes on + # exactly this: "connection at 0 gave 1048576 B", then 416 to every + # bytes=1048576- request. Refuse at once and say what it means. + # It arrives wrapped in an AppleError through _open, but urllib.error.HTTPError + # is itself an OSError and so can reach this handler unwrapped: match on both, + # or the fix is dead on the path that actually fails. + if getattr(again, "code", None) == 416 or "HTTP Error 416" in str(again): + raise AppleError( + f"the download server stopped serving Apple's image after {pos} bytes and then " + f"refused every request for the rest of it (HTTP 416), while Apple's signed " + f"chunklist says the image is {total} bytes. Something on this network is " + f"serving its own short file in place of Apple's download: connect through a " + f"phone hotspot or a VPN, or turn off web/HTTP scanning in your antivirus, and " + f"press Next. Nothing was written to the stick from it.") from None # WAS: a resume whose own request failed (reset, refused range) ended the whole # download; it is one more empty connection note(f"resume at {pos} refused: {type(again).__name__} {str(again)[-80:]}") diff --git a/p1401/usbwriter.py b/p1401/usbwriter.py index 8409f83d..807413c4 100644 --- a/p1401/usbwriter.py +++ b/p1401/usbwriter.py @@ -297,7 +297,14 @@ def eligible(disk, allow_large=False): "(right-click Start), right-click the stick's disk and choose Online, or unplug it and plug it into " "another USB port, then press Write again") if disk.get("IsReadOnly"): - why.append("the disk is read-only (a lock switch, or a failing stick)") + # 2.6.5/2.6.6 write logs (22, 10-31..11-02): the bare "the disk is read-only (a lock switch, or a + # failing stick)" named the two causes and no action, and 15 of the 22 reported it together with + # "offline" - which is the pair Windows shows for a stick whose controller has gone read-only to + # protect its remaining cells. That stick will not come back; the lock switch will. + why.append("Windows cannot write to this stick (it is marked read-only). If the stick has a small lock " + "switch on its side, slide it the other way and press Write again. Sticks with no switch report " + "this when their controller has turned read-only because the memory is worn out, and that cannot " + "be undone - use a different USB stick") size = int(disk.get("Size") or 0) if size < MIN_DISK: why.append(f"too small ({size / GiB:.1f} GiB; the installer needs 2)") @@ -554,7 +561,7 @@ def write(disk, efi_build_dir, recovery_info, allow_large=False, progress=None, raise UsbError('The machine profile changed before erasing the stick. Rebuild the EFI.') if disk.get("Via") == "Win32_DiskDrive": root = _write_wmi_erase(disk, erase_os) - return _write_payload(root, efi_build_dir, recovery_info, progress, machine_profile) + return _write_payload(root, efi_build_dir, recovery_info, progress, machine_profile, stick_name(disk)) _ps(check_script(disk, erase_os)) from . import rawdisk # noqa: PLC0415 n = int(disk["Number"]) @@ -684,7 +691,7 @@ def write(disk, efi_build_dir, recovery_info, allow_large=False, progress=None, # the stick search's own answer (empty when it found nothing) is now part of it. seen = " ".join((out or "").split())[-300:] raise UsbError(f"diskpart finished but {root} did not appear (the stick search said: {seen or 'nothing'})") - return _write_payload(root, efi_build_dir, recovery_info, progress, machine_profile) + return _write_payload(root, efi_build_dir, recovery_info, progress, machine_profile, stick_name(disk)) def _write_wmi_erase(disk, erase_os): @@ -703,7 +710,20 @@ def _write_wmi_erase(disk, erase_os): raise UsbError(f"diskpart finished but {root} did not appear") -def _write_payload(root, efi_build_dir, recovery_info, progress, machine_profile): +def stick_name(disk): + """How to call this stick back to its owner: its model and the size it claims, never its serial. The write + log already carries --stick-name; the readback stop did not, so a user whose PC has three USB devices in + it was told "use another USB stick" without being told which one had failed.""" + name = (disk.get("FriendlyName") or "").strip() + try: + size = int(disk.get("Size") or 0) + except (TypeError, ValueError): + size = 0 + both = " ".join(x for x in [name, f"{size / GiB:.0f} GiB" if size else ""] if x) + return both or "the USB stick" + + +def _write_payload(root, efi_build_dir, recovery_info, progress, machine_profile, stick="the USB stick"): """Everything after the erase: the recovery image (checked as it arrives and read back), the EFI, the driver.""" from . import apple # noqa: PLC0415 from . import machine_handoff # noqa: PLC0415 @@ -721,9 +741,26 @@ def _write_payload(root, efi_build_dir, recovery_info, progress, machine_profile except (apple.AppleError, OSError, apple.http.client.HTTPException) as e: print(f"(writing them again failed: {type(e).__name__}: {str(e)[-160:]})", flush=True) if changed: - raise UsbError(f"this stick changed the macOS image after it was written ({len(changed)} of {got['chunks']} parts " - f"read back different: {', '.join(map(str, changed[:12]))}{' ...' if len(changed) > 12 else ''}). " - f"The stick is failing or not the size it claims: use another USB stick.") + # Two different faults reach this line, and the counts tell them apart. Measured 11-02 over the raw + # write logs of 10-31..11-02: 32 readback stops, of which 16 had ONE to NINETEEN parts different (a + # bad write, worth the one rewrite above, which then failed) and 16 had 37 to 82 of 85-92 parts + # different - a stick that is not the size it claims, where a rewrite cannot help and is not tried. + # 27 of the 32 named a generic controller ("General UDisk" x12, "VendorCo ProductCode" x10, + # "Flash USB Disk", "Generic Flash-Disk", "Gene2.0 UDisk2.0", "MXT-USB Storage Device"). + # Both messages name the stick: a user with several USB devices plugged in was previously told + # "use another USB stick" without being told which one had failed. + shown = ", ".join(map(str, changed[:12])) + (" ..." if len(changed) > 12 else "") + if len(changed) * 4 > got["chunks"]: + raise UsbError(f"{stick} did not keep the macOS image: {len(changed)} of {got['chunks']} parts read back " + f"different ({shown}). A stick that loses most of what is written to it is reporting a size " + f"it does not have - this is what counterfeit and worn-out USB sticks do, and writing it " + f"again cannot fix it. Use a different USB stick, from a brand you know, and write again. " + f"Nothing on this PC was changed.") + raise UsbError(f"{stick} changed the macOS image after it was written ({len(changed)} of {got['chunks']} parts " + f"read back different: {shown}), and the parts that differed were written a second time and " + f"still came back wrong. The stick is failing. Try another USB port, on the back of the PC, and " + f"write again; if it stops here a second time, use a different USB stick. Nothing on this PC " + f"was changed.") _copy_settled(os.path.join(efi_build_dir, "EFI"), os.path.join(root, "EFI"), root) verify_efi_copy(os.path.join(efi_build_dir, 'EFI'), os.path.join(root, 'EFI')) driver = None @@ -1010,6 +1047,19 @@ def opt(n): return [argv[i + 1] for i, a in enumerate(argv) if a == n and i + 1 return 1 raise print(f"OK {info['name']} ({info['product']})", flush=True) + # Ask Apple for the signed chunklist and a small piece of the image BEFORE the stick is erased. + # Measured 11-02 over the raw write logs of 10-31..11-02: 323 of the 328 "HTTP Error 406" stops came + # after "OK erased the stick", because the chunklist was the download's first request and the + # download ran after the erase. A stop here costs the user nothing. + print("STEP checking that Apple will serve the download (nothing is erased yet)", flush=True) + try: + ready = apple.preflight(info) + except apple.AppleError as e: + print(f"STOP 1401-APPLE-REFUSED: {e}", flush=True) + print("OK your USB stick was not touched: nothing has been erased.", flush=True) + return 1 + print(f"OK Apple is serving {info['name']} ({ready['bytes'] / GiB:.2f} GiB in {ready['chunks']} parts, " + f"signed chunklist verified)", flush=True) last = [-1] def progress(done, total, *_): pct = int(done * 100 / total) if total else 0 diff --git a/tests/test_apple_preflight_status.py b/tests/test_apple_preflight_status.py new file mode 100644 index 00000000..95e23b00 --- /dev/null +++ b/tests/test_apple_preflight_status.py @@ -0,0 +1,332 @@ +"""Apple recovery download: the statuses Apple's servers actually answered, and proving Apple will serve the +download before the stick is erased. No network. + +WHY THESE EXIST, measured 2026-11-02 over the raw write logs users sent on 10-31..11-02 (780 write logs): + + HTTP 406 from oscdn 328 logs 323 of them AFTER the stick was already erased + HTTP 405 from osrecovery 11 logs + HTTP 503 10 logs + HTTP 416 on a resume 1 log 20 resumes over 15 minutes that could never succeed + HTTP 403 5 logs + HTTP 400 2 logs + HTTP 408 1 log + +333 of the 339 406/405 stops fell inside ONE UTC hour (2026-11-01 09:00-09:59), across six app versions +back to 1.10.0, with zero in the other 61 hours of the window: Apple's side, for an hour. 406, 405, 408 +and 429 were all outside _transient, so each got one request, no back-off, no reroute and no advice. +""" +import email.message +import hashlib +import io +import os +import tempfile +import unittest +import urllib.error +from unittest.mock import patch + +from p1401 import apple +from p1401 import usbwriter + +CHUNKS = [os.urandom(3000), os.urandom(3000), os.urandom(1234)] +IMAGE = b"".join(CHUNKS) +LIST = [(len(c), hashlib.sha256(c).digest()) for c in CHUNKS] + + +def info(): + """A fresh dict every time: preflight() caches the chunklist INTO it, so a shared one would leak + between tests and make a later arm pass on an earlier arm's cache.""" + return {"image_url": "http://oscdn.apple.com/x/BaseSystem.dmg", "image_token": "t", + "chunklist_url": "http://oscdn.apple.com/x/BaseSystem.chunklist", "chunklist_token": "t", + "product": "test", "name": "macOS test", "board": "Mac-TEST"} + + +class Stream(io.BytesIO): + def __init__(self, data, status=200, content_range=None): + super().__init__(data) + self.status = status + self.headers = email.message.Message() + if content_range: + self.headers["Content-Range"] = content_range + + def __enter__(self): + return self + + def __exit__(self, *a): + self.close() + + +def http_error(code, reason="x"): + return urllib.error.HTTPError("http://oscdn.apple.com/x", code, reason, email.message.Message(), None) + + +class RetryClassification(unittest.TestCase): + def test_every_status_apples_servers_answered_for_an_hour_is_retried(self): + # 405, 406 and 408 were measured coming out of Apple's own hosts. 429 is in for the same reason a + # 503 is: it is a "later" answer, not a refusal of this PC. + for code in (405, 406, 408, 425, 429, 500, 502, 503, 504): + self.assertTrue(apple._transient(http_error(code)), code) + + def test_NEGATIVE_CONTROL_a_real_refusal_is_still_not_retried(self): + # This arm is the one that fails if someone ever widens _transient to "any HTTPError". A 404 or a + # 403 must not be retried: 403 has its own fresh-token path and 404/410 mean the asset is gone, so + # retrying is a minute of the user's time spent proving nothing. + for code in (400, 401, 403, 404, 410, 416, 451): + self.assertFalse(apple._transient(http_error(code)), code) + + def test_a_connection_error_is_still_transient(self): + self.assertTrue(apple._transient(ConnectionResetError(10054, "reset"))) + self.assertTrue(apple._transient(urllib.error.URLError("boom"))) + self.assertFalse(apple._transient(ValueError("not a network error"))) + + +class AdviceForAStatus(unittest.TestCase): + """The 328 "HTTP Error 406: Not Acceptable" stops carried a raw CDN URL and nothing else: no sign that + 1401 had retried, no statement that the stick was untouched, and no idea what to do.""" + + def open_with(self, code, url="http://oscdn.apple.com/x/BaseSystem.chunklist"): + tries = [] + + def urlopen(req, timeout=None): + tries.append(req.full_url) + raise http_error(code) + + with patch.object(apple.urllib.request, "urlopen", urlopen): + try: + apple._open(url, {}, sleep=lambda s: None, doh=lambda h: None) + return tries, None + except apple.AppleError as e: + return tries, str(e) + + def test_a_406_is_retried_and_then_says_it_is_apples_side_and_the_stick_is_untouched(self): + tries, message = self.open_with(406) + self.assertIsNotNone(message) + # it did not give up after one request + self.assertGreaterEqual(len(tries), apple.OPEN_TRIES, tries) + self.assertIn("406", message) + self.assertIn("usually Apple's side", message) + self.assertIn("wait a few minutes", message) + self.assertIn("nothing on the USB stick was changed", message) + # and it does NOT blame the network for cutting a connection that was never cut + self.assertNotIn("keeps cutting the connection", message) + + def test_a_405_on_osrecovery_gets_the_same_honest_wording_not_the_cut_connection_one(self): + tries, message = self.open_with(405, apple.OSRECOVERY_HTTP + "InstallationPayload/RecoveryImage") + self.assertIsNotNone(message) + self.assertIn("405", message) + self.assertIn("usually Apple's side", message) + self.assertNotIn("cuts the connection to Apple's recovery server", message) + # osrecovery speaks HTTPS, which a proxy rewriting plain HTTP cannot touch: that route was tried + self.assertTrue(any(u.startswith("https://") for u in tries), tries) + + def test_NEGATIVE_CONTROL_a_404_is_not_dressed_up_as_an_apple_outage(self): + tries, message = self.open_with(404) + self.assertIsNotNone(message) + self.assertNotIn("usually Apple's side", message) + self.assertEqual(len(tries), 1, tries) # one request, no back-off + + def test_a_dropped_connection_still_gets_the_network_wording(self): + def urlopen(req, timeout=None): + raise ConnectionResetError(10054, "reset") + + with patch.object(apple.urllib.request, "urlopen", urlopen): + with self.assertRaises(apple.AppleError) as caught: + apple._open("http://oscdn.apple.com/x", {}, sleep=lambda s: None, doh=lambda h: None) + self.assertIn("keeps cutting the connection", str(caught.exception)) + + +class Preflight(unittest.TestCase): + def test_it_verifies_the_signed_chunklist_and_samples_the_image_before_anything_is_erased(self): + asked = [] + + def asset(url, token, extra=None): + asked.append((url.rsplit("/", 1)[-1], (extra or {}).get("Range"))) + return Stream(IMAGE[:apple.PREFLIGHT_BYTES]) + + where = info() + with patch.object(apple, "fetch_chunklist", lambda i: b"signed-bytes"), \ + patch.object(apple, "parse_chunklist", lambda d: LIST), \ + patch.object(apple, "_asset", asset): + got = apple.preflight(where) + self.assertEqual(got["chunks"], len(LIST)) + self.assertEqual(got["bytes"], sum(s for s, _ in LIST)) + # it asked for a SMALL range, not the image: the whole point is that it costs the user nothing + self.assertEqual(len(asked), 1, asked) + self.assertEqual(asked[0][0], "BaseSystem.dmg") + self.assertTrue(asked[0][1].startswith("bytes=0-"), asked) + self.assertLessEqual(int(asked[0][1].split("-")[1]) + 1, apple.PREFLIGHT_BYTES) + # and it left the verified chunklist behind for the download to reuse + self.assertEqual(where["chunklist_bytes"], b"signed-bytes") + + def test_an_unsigned_chunklist_is_refused_here_rather_than_after_the_erase(self): + # parse_chunklist is the real one: these bytes are not Apple's, so preflight must raise. + with patch.object(apple, "fetch_chunklist", lambda i: b"CNKL" + b"\x00" * 60): + with self.assertRaises(apple.AppleError): + apple.preflight(info()) + + def test_the_download_reuses_the_preflighted_chunklist_and_does_not_ask_oscdn_twice(self): + fetched = [] + where = info() + where["chunklist_bytes"] = b"already-verified" + + def asset(url, token, extra=None): + return Stream(IMAGE) + + with tempfile.TemporaryDirectory() as root, \ + patch.object(apple, "fetch_chunklist", lambda i: fetched.append(1) or b"cl"), \ + patch.object(apple, "parse_chunklist", lambda d: LIST), \ + patch.object(apple, "_asset", asset): + out = apple.download(where, root) + # read inside the block: TemporaryDirectory deletes the image on the way out + self.assertEqual(open(out["image"], "rb").read(), IMAGE) + self.assertEqual(fetched, [], "the chunklist was fetched a second time, after the stick was erased") + # the chunklist file written beside the image is the bytes that were verified before the erase + self.assertEqual(open(out["chunklist"], "rb").read(), b"already-verified") + + def test_without_a_preflight_the_download_still_fetches_its_own_chunklist(self): + # strictly additive: the old path must still work, or copy_local and the selftest break + fetched = [] + with tempfile.TemporaryDirectory() as root, \ + patch.object(apple, "fetch_chunklist", lambda i: fetched.append(1) or b"cl"), \ + patch.object(apple, "parse_chunklist", lambda d: LIST), \ + patch.object(apple, "_asset", lambda u, t, extra=None: Stream(IMAGE)): + apple.download(info(), root) + self.assertEqual(fetched, [1]) + + +class NothingIsErasedWhenAppleRefuses(unittest.TestCase): + """The whole point of the preflight: 323 of the 328 406 stops came after "OK erased the stick".""" + + def run_cli(self, preflight): + printed = [] + erased = [] + disk = {"Number": 1, "FriendlyName": "Kingston DataTraveler 3.0", "SerialNumber": "s", "BusType": "USB", + "Size": 31 * 10 ** 9, "IsBoot": False, "IsSystem": False, "IsOffline": False, + "IsReadOnly": False, "PartitionStyle": "MBR"} + from p1401 import machine_handoff, netsupport + with patch.object(usbwriter, "list_disks", lambda: [disk]), \ + patch.object(usbwriter, "write", lambda *a, **k: erased.append(1) or {"root": "Z:\\"}), \ + patch.object(machine_handoff, "verified", lambda *a, **k: None), \ + patch.object(netsupport, "needs_local_image", lambda e: False), \ + patch.object(apple, "local_image", lambda d: None), \ + patch.object(apple, "image_info", lambda d: info()), \ + patch.object(apple, "preflight", preflight), \ + patch("builtins.print", lambda *a, **k: printed.append(" ".join(str(x) for x in a))): + rc = usbwriter.cli_write(["1", "C:\\efi", "24"]) + return rc, "\n".join(printed), erased + + def test_a_406_before_the_erase_stops_with_the_stick_untouched(self): + def refuse(i): + raise apple.AppleError("http://oscdn.apple.com/x/BaseSystem.chunklist: HTTPError: HTTP Error 406: " + "Not Acceptable - Apple's download server answered 406 to every try") + + rc, out, erased = self.run_cli(refuse) + self.assertEqual(rc, 1) + self.assertEqual(erased, [], "the stick was erased even though Apple had already refused") + self.assertIn("1401-APPLE-REFUSED", out) + self.assertIn("was not touched", out) + self.assertIn("406", out) + # the check ran BEFORE the erase step was even announced + self.assertIn("nothing is erased yet", out) + self.assertNotIn("STEP erasing", out) + + def test_NEGATIVE_CONTROL_when_apple_serves_it_the_write_still_runs(self): + # Without this arm the one above would pass just as well if the preflight blocked every write. + rc, out, erased = self.run_cli(lambda i: {"chunks": 92, "bytes": 2 * (1 << 30), "sampled": 65536}) + self.assertEqual(rc, 0) + self.assertEqual(erased, [1], "the write never ran on a download Apple was serving") + self.assertIn("Apple is serving", out) + self.assertIn("STEP erasing", out) + + +class RangeRefusedForever(unittest.TestCase): + def test_a_416_on_a_resume_stops_at_once_instead_of_twenty_doomed_retries(self): + # One 2.6.6 write log: "connection at 0 gave 1048576 B", then HTTP 416 to every bytes=1048576- + # request, 20 times over 15 minutes. 416 means the server's object ends before the byte we need, + # and Apple's SIGNED chunklist says the image is longer - so no retry can ever satisfy it. + opened = [] + + # urlopen, not _asset: the 416 has to travel the real path through _open so that it is wrapped + # exactly as it is in production. Patching _asset instead handed the download a bare HTTPError, + # which is how the first version of this fix came to be guarded on the wrong type and do nothing. + def urlopen(req, timeout=None): + rng = req.headers.get("Range") + opened.append(rng) + if rng is None: + return Stream(IMAGE[:1500]) # first connection delivers part of chunk 1, then ends + raise http_error(416, "Requested Range Not Satisfiable") + + with tempfile.TemporaryDirectory() as root, \ + patch.object(apple, "parse_chunklist", lambda d: LIST), \ + patch.object(apple.urllib.request, "urlopen", urlopen), \ + patch.object(apple.time, "sleep", lambda s: None): + where = info() + where["chunklist_bytes"] = b"cl" + with self.assertRaises(apple.AppleError) as caught: + apple.download(where, root) + message = str(caught.exception) + self.assertIn("HTTP 416", message) + self.assertIn("serving its own short file", message) + self.assertIn(str(sum(s for s, _ in LIST)), message) # what Apple's signed list says the size is + # the resume was tried once and refused once: not twenty times + self.assertLessEqual(len([r for r in opened if r]), 2, opened) + + +class ReadbackNamesTheStick(unittest.TestCase): + def test_the_stick_is_named_by_model_and_claimed_size_and_never_by_serial(self): + got = usbwriter.stick_name({"FriendlyName": "General UDisk", "Size": 31 * 10 ** 9, + "SerialNumber": "E0D55EA574B315C108820075"}) + self.assertEqual(got, "General UDisk 29 GiB") + self.assertNotIn("E0D55EA", got) + + def test_a_stick_that_reports_no_name_still_gets_a_sentence_that_reads(self): + self.assertEqual(usbwriter.stick_name({}), "the USB stick") + self.assertEqual(usbwriter.stick_name({"FriendlyName": "", "Size": "not a number"}), "the USB stick") + + def payload(self, changed, chunks, stick): + """_write_payload's readback branch, with the download and the verify stubbed: this exercises the + message, which is the part that reaches the user.""" + from p1401 import machine_handoff + got = {"image": "Z:\\i.dmg", "chunklist": os.devnull, "chunks": chunks} + with patch.object(apple, "download", lambda *a, **k: got), \ + patch.object(apple, "parse_chunklist", lambda d: [(1, b"")] * chunks), \ + patch.object(apple, "verify_written", lambda *a, **k: list(changed)), \ + patch.object(apple, "repair_written", lambda *a, **k: list(changed)), \ + patch.object(machine_handoff, "copy_to_installer", lambda *a: None), \ + patch("builtins.print", lambda *a, **k: None): + with self.assertRaises(usbwriter.UsbError) as caught: + usbwriter._write_payload("Z:\\", "C:\\efi", info(), None, None, stick) + return str(caught.exception) + + def test_a_stick_that_lost_most_parts_is_called_a_wrong_size_stick_and_is_named(self): + # 16 of the 32 readback stops looked like this: 37 to 82 of 85-92 parts different. + message = self.payload(range(1, 76), 85, "General UDisk 8 GiB") + self.assertIn("General UDisk 8 GiB", message) + self.assertIn("reporting a size it does not have", message) + self.assertIn("Use a different USB stick", message) + self.assertIn("Nothing on this PC was changed", message) + + def test_a_stick_that_lost_a_few_parts_is_called_failing_and_offered_another_port(self): + # the other 16: one to nineteen parts, rewritten once, still wrong + message = self.payload([2], 92, "Kingston DataTraveler 3.0 29 GiB") + self.assertIn("Kingston DataTraveler 3.0 29 GiB", message) + self.assertIn("written a second time", message) + self.assertIn("another USB port", message) + self.assertNotIn("reporting a size it does not have", message) + + def test_NEGATIVE_CONTROL_a_clean_readback_raises_nothing_at_all(self): + # Without this, both arms above would pass if _write_payload simply always raised. + from p1401 import machine_handoff + got = {"image": "Z:\\i.dmg", "chunklist": os.devnull, "chunks": 85} + with patch.object(apple, "download", lambda *a, **k: got), \ + patch.object(apple, "parse_chunklist", lambda d: [(1, b"")] * 85), \ + patch.object(apple, "verify_written", lambda *a, **k: []), \ + patch.object(usbwriter, "_copy_settled", lambda *a: None), \ + patch.object(usbwriter, "verify_efi_copy", lambda *a, **k: None), \ + patch.object(usbwriter, "needs_nullmoth", lambda d: False), \ + patch("builtins.print", lambda *a, **k: None): + out = usbwriter._write_payload("Z:\\", "C:\\efi", info(), None, None, "General UDisk 8 GiB") + self.assertEqual(out["root"], "Z:\\") + + +if __name__ == "__main__": + unittest.main(verbosity=2) diff --git a/windows/App/HardwareMap.cs b/windows/App/HardwareMap.cs new file mode 100644 index 00000000..2e414ef8 --- /dev/null +++ b/windows/App/HardwareMap.cs @@ -0,0 +1,341 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Management; +using System.Text; +using System.Text.RegularExpressions; + +namespace A1401 +{ + /// A read-only map of the identifiers that decide whether this PC's hardware is supported: + /// the PCI, USB, HID and audio-codec numbers, and the ACPI device IDs. It is the Windows half of the + /// map the Mac app produces, and it writes the SAME field names on purpose, so a map sent from a PC + /// and a map sent from a Mac can be compared line for line when working out why a card is not driven. + /// + /// It changes nothing and reads nothing privileged. Every answer is a number taken from a device's + /// hardware identifier, or a "...unavailable: reason" string. An absent field means the value could + /// not be read - it never means the device is absent, and it never means supported. + /// + /// The rule that keeps this safe to send us, and it is a strict allow-list, not a filter: + /// only the fields below are ever emitted, each masked to its own width, and every one of them comes + /// from a fixed-width hexadecimal capture in a Windows identifier. Windows hands out far more than + /// that. In particular a PNPDeviceID's LAST segment is an instance path, and for USB devices it is + /// frequently the device's SERIAL NUMBER (USB\VID_046D&PID_C52B\6&1a2b3c4d&0&2). That segment is + /// parsed for nothing and copied nowhere: every pattern here is anchored at the start of the string + /// and stops before the instance path. Neither are friendly names, which users rename, nor MAC + /// addresses, nor volume or machine identifiers, nor anything from a device's Name or Description. + /// + /// Why the class and usage numbers are worth carrying: a controller's PCI class code is what says + /// "this is an HD-audio controller", and an HDAUDIO identifier is the only place Windows states the + /// audio CODEC's own vendor and device. A report that lists a sound controller but no codec is the + /// exact shape of the silent-audio fault, and without these two fields the map cannot show it. + static class HardwareMap + { + // Each hardware-ID token maps to the field name the Mac app uses, with the mask that bounds it. + // Keeping the names identical across both apps is the point: the two maps are read side by side. + const int MaxDevices = 512; // devices actually listed + const int MaxExamined = 4096; // devices looked at, listed or not - this is what bounds the loop + const int MaxAcpiIDs = 64; + + // Same shapes the Mac app accepts: PNP####, ACPI####, and three- or four-letter vendor IDs. + static readonly Regex AcpiShape = new Regex( + @"^(?:PNP[0-9A-F]{4}|ACPI[0-9A-F]{4}|[A-Z]{3}[0-9A-F]{4}|[A-Z]{4}[0-9A-F]{4})$", + RegexOptions.Compiled | RegexOptions.CultureInvariant); + + static readonly Regex Pci = new Regex( + @"^PCI\\VEN_(?[0-9A-F]{4})&DEV_(?[0-9A-F]{4})(?:&SUBSYS_(?[0-9A-F]{8}))?(?:&REV_(?[0-9A-F]{2}))?", + RegexOptions.Compiled | RegexOptions.CultureInvariant); + + static readonly Regex Usb = new Regex( + @"^USB\\VID_(?[0-9A-F]{4})&PID_(?[0-9A-F]{4})(?:&REV_(?[0-9A-F]{4}))?(?:&MI_(?[0-9A-F]{2}))?", + RegexOptions.Compiled | RegexOptions.CultureInvariant); + + static readonly Regex Hid = new Regex( + @"^HID\\VID_(?[0-9A-F]{4})&PID_(?[0-9A-F]{4})", + RegexOptions.Compiled | RegexOptions.CultureInvariant); + + // The audio codec. Windows states it ONLY here: the PCI device is the controller, and this is the + // chip behind it (HDAUDIO\FUNC_01&VEN_10EC&DEV_0256&SUBSYS_10EC0256&REV_1001). The Mac app reads the + // same pair as one 32-bit IOHDACodecVendorID, so it is packed the same way: vendor << 16 | device. + static readonly Regex HdAudio = new Regex( + @"^HDAUDIO\\(?:FUNC_(?[0-9A-F]{2})&)?VEN_(?[0-9A-F]{4})&DEV_(?[0-9A-F]{4})(?:&SUBSYS_(?[0-9A-F]{8}))?(?:&REV_(?[0-9A-F]{4}))?", + RegexOptions.Compiled | RegexOptions.CultureInvariant); + + // Class numbers live in a device's CompatibleID list, not in its hardware ID. + // PCI\VEN_10DE&CC_040300 or PCI\CC_0403: six digits are class/subclass/prog-if, four are class/subclass. + static readonly Regex PciClass = new Regex( + @"^PCI\\(?:VEN_[0-9A-F]{4}&)?CC_(?[0-9A-F]{4}(?:[0-9A-F]{2})?)$", + RegexOptions.Compiled | RegexOptions.CultureInvariant); + + // USB\Class_03&SubClass_01&Prot_01 - on an interface device these are the interface's numbers. + static readonly Regex UsbClass = new Regex( + @"^USB\\(?:DEV)?CLASS_(?[0-9A-F]{2})(?:&SUBCLASS_(?[0-9A-F]{2}))?(?:&PROT_(?[0-9A-F]{2}))?$", + RegexOptions.Compiled | RegexOptions.CultureInvariant); + + // HID_DEVICE_UP:000C_U:0001 - the top-level usage page and usage of a HID collection. + static readonly Regex HidUsage = new Regex( + @"^HID_DEVICE_UP:(?[0-9A-F]{4})_U:(?[0-9A-F]{4})$", + RegexOptions.Compiled | RegexOptions.CultureInvariant); + + static bool Hex(string text, out ulong value) + { + value = 0; + return !string.IsNullOrEmpty(text) + && ulong.TryParse(text, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out value); + } + + /// The identifier numbers of one device, or an empty set when its ID is not a shape we + /// read. The instance segment is never examined: see the warning on the class. + internal static Dictionary Facts(string pnpDeviceID) + { + var found = new Dictionary(); + if (string.IsNullOrEmpty(pnpDeviceID)) return found; + // Hardware IDs are case-insensitive in practice; the patterns are written upper-case. + string id = pnpDeviceID.ToUpperInvariant(); + ulong n; + + Match m = Pci.Match(id); + if (m.Success) + { + if (Hex(m.Groups["ven"].Value, out n)) found["pci_vendor"] = n & 0xffff; + if (Hex(m.Groups["dev"].Value, out n)) found["pci_device"] = n & 0xffff; + if (m.Groups["sub"].Success && Hex(m.Groups["sub"].Value, out n)) + { + // SUBSYS packs the subsystem device in the high half and the vendor in the low half, + // which is the opposite order to how it reads. + found["pci_subsystem_device"] = (n >> 16) & 0xffff; + found["pci_subsystem_vendor"] = n & 0xffff; + } + if (m.Groups["rev"].Success && Hex(m.Groups["rev"].Value, out n)) found["pci_revision"] = n & 0xff; + return found; + } + m = HdAudio.Match(id); + if (m.Success) + { + ulong vendor, device; + if (Hex(m.Groups["ven"].Value, out vendor) && Hex(m.Groups["dev"].Value, out device)) + found["audio_codec_vendor_device"] = ((vendor & 0xffff) << 16) | (device & 0xffff); + if (m.Groups["rev"].Success && Hex(m.Groups["rev"].Value, out n)) + found["audio_codec_revision"] = n & 0xffffffff; + if (m.Groups["func"].Success && Hex(m.Groups["func"].Value, out n)) + found["audio_codec_function_group"] = n & 0xff; + return found; + } + m = Usb.Match(id); + if (m.Success) + { + if (Hex(m.Groups["ven"].Value, out n)) found["usb_vendor"] = n & 0xffff; + if (Hex(m.Groups["dev"].Value, out n)) found["usb_product"] = n & 0xffff; + // MI_xx is the interface number, and it is part of the ID, not of the instance path: + // USB\VID_046D&PID_C52B&MI_01\8&1a2b3c4d&0&0000 - the serial is still only in the tail. + if (m.Groups["mi"].Success && Hex(m.Groups["mi"].Value, out n)) + found["usb_interface_number"] = n & 0xff; + return found; + } + m = Hid.Match(id); + if (m.Success) + { + if (Hex(m.Groups["ven"].Value, out n)) found["hid_vendor"] = n & 0xffff; + if (Hex(m.Groups["dev"].Value, out n)) found["hid_product"] = n & 0xffff; + } + return found; + } + + /// The class, subclass and usage numbers of one device. Windows puts these in the + /// CompatibleID list rather than in the hardware ID, so they are read from there. Only whole + /// fixed-width hexadecimal fields of an exactly-matching pattern are accepted, so nothing that is + /// not one of these numbers can reach a field. + internal static Dictionary Classes(IEnumerable compatibleIDs) + { + var found = new Dictionary(); + if (compatibleIDs == null) return found; + ulong n; + foreach (string raw in compatibleIDs) + { + if (string.IsNullOrEmpty(raw) || raw.Length > 256) continue; + string text = raw.ToUpperInvariant(); + + Match m = PciClass.Match(text); + if (m.Success && Hex(m.Groups["cc"].Value, out n)) + { + // CC_040300 is class 04 subclass 03 prog-if 00; CC_0403 is the same without prog-if. + // The Mac app's pci_class is the 24-bit value, so a four-digit form is shifted to match + // and the prog-if byte reads 0 - which is what Windows itself leaves unstated. + ulong code = m.Groups["cc"].Value.Length == 4 ? (n & 0xffff) << 8 : n & 0xffffff; + // Keep the widest statement: a six-digit form is more specific than a four-digit one. + ulong had; + if (!found.TryGetValue("pci_class", out had) || code > had) found["pci_class"] = code; + continue; + } + m = UsbClass.Match(text); + if (m.Success) + { + if (Hex(m.Groups["cls"].Value, out n)) found["usb_class"] = n & 0xff; + if (m.Groups["sub"].Success && Hex(m.Groups["sub"].Value, out n)) found["usb_subclass"] = n & 0xff; + if (m.Groups["prot"].Success && Hex(m.Groups["prot"].Value, out n)) found["usb_protocol"] = n & 0xff; + continue; + } + m = HidUsage.Match(text); + if (m.Success) + { + if (Hex(m.Groups["page"].Value, out n)) found["hid_usage_page"] = n & 0xffff; + if (Hex(m.Groups["usage"].Value, out n)) found["hid_usage"] = n & 0xffff; + } + } + return found; + } + + /// The ACPI device IDs of one device, kept only when they match the shapes the Mac app + /// accepts. A CompatibleID list is where an ACPI name appears on Windows. + /// + /// Only a CompatibleID list is ever passed here, never a DeviceID. That is what makes taking the + /// last segment safe: a CompatibleID states a device class or an ACPI name, while it is a + /// DeviceID whose last segment can be a serial number. + internal static List AcpiIDs(IEnumerable compatibleIDs) + { + var kept = new SortedSet(StringComparer.Ordinal); + if (compatibleIDs == null) return new List(); + foreach (string raw in compatibleIDs) + { + if (kept.Count >= MaxAcpiIDs || string.IsNullOrEmpty(raw) || raw.Length > 256) continue; + string text = raw.ToUpperInvariant(); + // ACPI\PNP0A08 and *PNP0A08 both occur; take the last segment either way. + int cut = text.LastIndexOfAny(new[] { '\\', '*' }); + if (cut >= 0) text = text.Substring(cut + 1); + if (AcpiShape.IsMatch(text)) kept.Add(text); + } + return new List(kept); + } + + /// A device is worth a line when it carries at least one identifier we read. Devices with + /// nothing readable are counted, not listed, so the map stays about hardware identity. + internal static bool Relevant(Dictionary facts, List acpi) + { + return (facts != null && facts.Count > 0) || (acpi != null && acpi.Count > 0); + } + + /// One device's line. The fields are written in name order so that two maps of the same + /// PC are the same text, and two maps of different PCs differ only where the hardware does - a map + /// whose field order moved between runs cannot be diffed, which is the only thing it is for. + internal static string Line(Dictionary facts, List acpi) + { + var names = new List(facts.Keys); + names.Sort(StringComparer.Ordinal); + var line = new StringBuilder("device"); + foreach (string name in names) + line.Append(" ").Append(name).Append("=").Append(facts[name].ToString(CultureInfo.InvariantCulture)); + if (acpi != null && acpi.Count > 0) line.Append(" acpi_ids=").Append(string.Join(",", acpi.ToArray())); + return line.ToString(); + } + + /// The whole map, as the lines the report carries. Any failure is reported as a line + /// rather than thrown: a map that stops at the first unreadable device is worth less than one that + /// says which part it could not read. + public static string Collect() + { + var text = new StringBuilder(); + text.AppendLine("hardware map 1"); + int listed = 0, silent = 0, examined = 0; + try + { + // Win32_PnPEntity is the whole device tree. Only DeviceID and CompatibleID are selected: + // Name, Description and the rest are user-visible strings we have no reason to carry. + using (var search = new ManagementObjectSearcher( + "SELECT DeviceID, CompatibleID FROM Win32_PnPEntity")) + using (ManagementObjectCollection devices = search.Get()) + { + foreach (ManagementBaseObject device in devices) + { + // Every WMI object is a COM wrapper; 512 of them left undisposed is 512 handles + // held until a collection the scan step does not wait for. + using (device) + { + if (listed >= MaxDevices) { text.AppendLine("devices_truncated: " + MaxDevices); break; } + // The listed cap alone does not bound this loop: a PC whose devices are all + // unreadable would walk the whole tree without ever reaching it. + if (++examined > MaxExamined) { text.AppendLine("devices_examined_truncated: " + MaxExamined); break; } + string id; + List acpi; + Dictionary facts; + try + { + id = device["DeviceID"] as string; + var compatible = device["CompatibleID"] as string[]; + acpi = AcpiIDs(compatible); + facts = Facts(id); + foreach (var pair in Classes(compatible)) + if (!facts.ContainsKey(pair.Key)) facts[pair.Key] = pair.Value; + } + catch (ManagementException) + { + silent++; + continue; + } + if (!Relevant(facts, acpi)) { silent++; continue; } + text.AppendLine(Line(facts, acpi)); + listed++; + } + } + } + } + catch (ManagementException error) + { + // Not "no devices": WMI itself did not answer. Saying so is the whole point of the line. + text.AppendLine("devices_status: unavailable: " + error.GetType().Name); + } + catch (UnauthorizedAccessException) + { + text.AppendLine("devices_status: unavailable: access denied"); + } + catch (Exception error) + { + // A PC whose WMI repository is damaged throws COMException or InvalidOperationException out + // of Get() or out of the enumerator, neither of which is a ManagementException. Reporting + // the type keeps the rule this file is built on: a check that could not run says so, and + // never reads as a clean result. + text.AppendLine("devices_status: unavailable: " + error.GetType().Name); + } + text.AppendLine("devices_listed: " + listed.ToString(CultureInfo.InvariantCulture)); + text.AppendLine("devices_without_identifiers: " + silent.ToString(CultureInfo.InvariantCulture)); + return text.ToString(); + } + + /// Writes the map beside the scan's other files and returns the one line worth showing. + /// It is written as its own file rather than folded into Report.json so that a person can read it + /// before sending it: the whole value of this map is that someone can see exactly what it says + /// about their machine. A failure to write is reported, not thrown - the scan it rides along with + /// is worth more than the map. + public static string WriteTo(string directory) + { + string map; + try + { + map = Collect(); + } + catch (Exception error) + { + return Loc.F("Hardware map: not collected ({0}).", error.GetType().Name); + } + int devices = 0; + foreach (string line in map.Split('\n')) + if (line.StartsWith("device ", StringComparison.Ordinal)) devices++; + try + { + string path = System.IO.Path.Combine(directory, "hardware-map.txt"); + System.IO.File.WriteAllText(path, map); + return Loc.F("Hardware map: {0} device(s) with identifiers, written to hardware-map.txt.", + devices.ToString(CultureInfo.InvariantCulture)); + } + catch (System.IO.IOException error) + { + return Loc.F("Hardware map: read {0} device(s) but could not save it ({1}).", + devices.ToString(CultureInfo.InvariantCulture), error.GetType().Name); + } + catch (UnauthorizedAccessException) + { + return Loc.F("Hardware map: read {0} device(s) but could not save it (access denied).", + devices.ToString(CultureInfo.InvariantCulture)); + } + } + } +} diff --git a/windows/App/MainForm.cs b/windows/App/MainForm.cs index 75e6d511..a88df303 100644 --- a/windows/App/MainForm.cs +++ b/windows/App/MainForm.cs @@ -639,6 +639,12 @@ async void OnNext() OfferOperationReport("check"); return; } + // The hardware map rides along with the scan it belongs to, in the same folder as + // Report.json, so the identifiers that decide whether a card is supported travel with + // every report the user sends. Off the UI thread: enumerating the device tree through WMI + // takes seconds on a full desktop and would freeze the window for all of them. + // It never fails the check - WriteTo reports its own trouble as the line it returns. + Say(await Task.Run(() => HardwareMap.WriteTo(scanDir))); scanned = true; LoadFacts(); await PrepareFirmwareGuide(); Say(Loc.T("Done.")); Go(1); return; } if (page == 2 && !built) diff --git a/windows/App/hardware_map_parse_check.py b/windows/App/hardware_map_parse_check.py new file mode 100644 index 00000000..7cc19707 --- /dev/null +++ b/windows/App/hardware_map_parse_check.py @@ -0,0 +1,372 @@ +#!/usr/bin/env python3 +"""hardware_map_parse_check.py: the parse rules HardwareMap.cs implements, checked against real Windows +hardware identifiers before the C# is ever compiled. The Windows app builds on a PC; this runs anywhere, so +a parsing mistake does not have to wait for a build to be found. + +It mirrors the patterns and the masks in HardwareMap.cs. If that file's patterns change, change these with +them - this is a check of the RULES, not of the binary, and it says so rather than implying coverage it does +not have. In particular it does NOT prove the file compiles, that WMI answers, or that any field is present +on real hardware. + +Several arms are calibrated against identifiers taken from reports users actually sent (the Realtek +ALC256 codec 10EC:0256 and the NVIDIA audio functions 10DE:10F8/22BD among them), so a pattern that +matches nothing real fails here rather than in the field. + + python3 hardware_map_parse_check.py +""" +import re +import sys + +ACPI_SHAPE = re.compile(r"^(?:PNP[0-9A-F]{4}|ACPI[0-9A-F]{4}|[A-Z]{3}[0-9A-F]{4}|[A-Z]{4}[0-9A-F]{4})$") +PCI = re.compile(r"^PCI\\VEN_(?P[0-9A-F]{4})&DEV_(?P[0-9A-F]{4})" + r"(?:&SUBSYS_(?P[0-9A-F]{8}))?(?:&REV_(?P[0-9A-F]{2}))?") +USB = re.compile(r"^USB\\VID_(?P[0-9A-F]{4})&PID_(?P[0-9A-F]{4})" + r"(?:&REV_(?P[0-9A-F]{4}))?(?:&MI_(?P[0-9A-F]{2}))?") +HID = re.compile(r"^HID\\VID_(?P[0-9A-F]{4})&PID_(?P[0-9A-F]{4})") +HDAUDIO = re.compile(r"^HDAUDIO\\(?:FUNC_(?P[0-9A-F]{2})&)?VEN_(?P[0-9A-F]{4})&DEV_(?P[0-9A-F]{4})" + r"(?:&SUBSYS_(?P[0-9A-F]{8}))?(?:&REV_(?P[0-9A-F]{4}))?") +PCI_CLASS = re.compile(r"^PCI\\(?:VEN_[0-9A-F]{4}&)?CC_(?P[0-9A-F]{4}(?:[0-9A-F]{2})?)$") +USB_CLASS = re.compile(r"^USB\\(?:DEV)?CLASS_(?P[0-9A-F]{2})" + r"(?:&SUBCLASS_(?P[0-9A-F]{2}))?(?:&PROT_(?P[0-9A-F]{2}))?$") +HID_USAGE = re.compile(r"^HID_DEVICE_UP:(?P[0-9A-F]{4})_U:(?P[0-9A-F]{4})$") + + +def facts(pnp_device_id): + """The identifier numbers of one device. The instance segment is never examined.""" + if not pnp_device_id: + return {} + text = pnp_device_id.upper() + m = PCI.match(text) + if m: + out = {"pci_vendor": int(m.group("ven"), 16) & 0xFFFF, + "pci_device": int(m.group("dev"), 16) & 0xFFFF} + if m.group("sub"): + packed = int(m.group("sub"), 16) + out["pci_subsystem_device"] = (packed >> 16) & 0xFFFF + out["pci_subsystem_vendor"] = packed & 0xFFFF + if m.group("rev"): + out["pci_revision"] = int(m.group("rev"), 16) & 0xFF + return out + m = HDAUDIO.match(text) + if m: + out = {"audio_codec_vendor_device": + ((int(m.group("ven"), 16) & 0xFFFF) << 16) | (int(m.group("dev"), 16) & 0xFFFF)} + if m.group("rev"): + out["audio_codec_revision"] = int(m.group("rev"), 16) & 0xFFFFFFFF + if m.group("func"): + out["audio_codec_function_group"] = int(m.group("func"), 16) & 0xFF + return out + m = USB.match(text) + if m: + out = {"usb_vendor": int(m.group("ven"), 16) & 0xFFFF, + "usb_product": int(m.group("dev"), 16) & 0xFFFF} + if m.group("mi"): + out["usb_interface_number"] = int(m.group("mi"), 16) & 0xFF + return out + m = HID.match(text) + if m: + return {"hid_vendor": int(m.group("ven"), 16) & 0xFFFF, + "hid_product": int(m.group("dev"), 16) & 0xFFFF} + return {} + + +def classes(compatible_ids): + """The class, subclass and usage numbers, which Windows states in the CompatibleID list.""" + out = {} + for raw in compatible_ids or []: + if not raw or len(raw) > 256: + continue + text = raw.upper() + m = PCI_CLASS.match(text) + if m: + digits = m.group("cc") + value = int(digits, 16) + code = ((value & 0xFFFF) << 8) if len(digits) == 4 else (value & 0xFFFFFF) + # The widest statement wins: CC_040300 says more than CC_0403. + if code > out.get("pci_class", -1): + out["pci_class"] = code + continue + m = USB_CLASS.match(text) + if m: + out["usb_class"] = int(m.group("cls"), 16) & 0xFF + if m.group("sub"): + out["usb_subclass"] = int(m.group("sub"), 16) & 0xFF + if m.group("prot"): + out["usb_protocol"] = int(m.group("prot"), 16) & 0xFF + continue + m = HID_USAGE.match(text) + if m: + out["hid_usage_page"] = int(m.group("page"), 16) & 0xFFFF + out["hid_usage"] = int(m.group("usage"), 16) & 0xFFFF + return out + + +def acpi_ids(compatible_ids): + kept = set() + for raw in compatible_ids or []: + if not raw or len(raw) > 256: + continue + text = raw.upper() + cut = max(text.rfind("\\"), text.rfind("*")) + if cut >= 0: + text = text[cut + 1:] + if ACPI_SHAPE.match(text): + kept.add(text) + return sorted(kept) + + +def merged(device_id, compatible_ids): + """What Collect() writes for one device: the hardware-ID facts, plus any class number the hardware ID + did not already state.""" + out = facts(device_id) + for key, value in classes(compatible_ids).items(): + out.setdefault(key, value) + return out + + +def line(fields, acpi): + """Line() in HardwareMap.cs: field names in order, so two maps of one PC are the same text.""" + text = "device" + for name in sorted(fields): + text += " %s=%d" % (name, fields[name]) + if acpi: + text += " acpi_ids=" + ",".join(acpi) + return text + + +ARMS = [] + + +def arm(name): + def take(fn): + ARMS.append((name, fn)) + return fn + return take + + +@arm("an RTX 5060's PCI id gives vendor, device, both subsystem halves and the revision") +def _(): + # NVIDIA 0x10DE, and SUBSYS packs device in the high half: 0x1234 device, 0x10DE vendor + got = facts(r"PCI\VEN_10DE&DEV_2503&SUBSYS_123410DE&REV_A1\4&1a2b3c4d&0&0008") + assert got == {"pci_vendor": 0x10DE, "pci_device": 0x2503, "pci_subsystem_device": 0x1234, + "pci_subsystem_vendor": 0x10DE, "pci_revision": 0xA1}, got + + +@arm("a PCI id with no SUBSYS or REV gives only what is there, and invents neither") +def _(): + got = facts(r"PCI\VEN_8086&DEV_A70D") + assert got == {"pci_vendor": 0x8086, "pci_device": 0xA70D}, got + + +@arm("THE ONE THAT MATTERS: a USB instance segment is a serial number and must not appear anywhere") +def _(): + # The third segment of a USB PNPDeviceID is frequently the device's serial. + serial = "0123456789ABCDEF" + got = facts(r"USB\VID_046D&PID_C52B\6&" + serial + r"&0&2") + assert got == {"usb_vendor": 0x046D, "usb_product": 0xC52B}, got + for key, value in got.items(): + assert serial not in str(value), (key, value) + assert serial.lower() not in str(value).lower(), (key, value) + + +@arm("the same holds for the newer patterns: no HDAUDIO or interface instance tail reaches a field") +def _(): + serial = "4C530001ABCDEF" + for ident in [r"HDAUDIO\FUNC_01&VEN_10EC&DEV_0256&SUBSYS_10EC0256&REV_1001\5&" + serial + r"&0&0001", + r"USB\VID_046D&PID_C52B&MI_01\8&" + serial + r"&0&0000", + r"HID\VID_046D&PID_C52B&MI_01\8&" + serial + r"&0&0000"]: + got = facts(ident) + assert got, ident # it must still parse the legitimate prefix + for key, value in got.items(): + # every emitted value is an integer whose hex form is one of the captured fields, never a + # fragment of the instance path + assert isinstance(value, int), (ident, key, value) + assert serial not in ("%X" % value), (ident, key, value) + + +@arm("a HID id gives the HID vendor and product, not the USB ones") +def _(): + got = facts(r"HID\VID_046D&PID_C52B&MI_01\8&1a2b3c4d&0&0000") + assert got == {"hid_vendor": 0x046D, "hid_product": 0xC52B}, got + + +@arm("a USB interface id gives its interface number from MI_, which is part of the ID, not the instance") +def _(): + got = facts(r"USB\VID_8087&PID_0A2B&MI_03\7&abcd1234&0&0003") + assert got == {"usb_vendor": 0x8087, "usb_product": 0x0A2B, "usb_interface_number": 3}, got + + +@arm("a root or software device carries no identifier and is counted, not listed") +def _(): + assert facts(r"ROOT\SYSTEM\0000") == {} + assert facts(r"SWD\PRINTENUM\{0A2B...}") == {} + assert facts("") == {} + assert facts(None) == {} + + +@arm("lower-case identifiers parse the same: Windows is not consistent about case") +def _(): + assert facts(r"pci\ven_10de&dev_2503") == {"pci_vendor": 0x10DE, "pci_device": 0x2503} + assert facts(r"hdaudio\func_01&ven_10ec&dev_0256")["audio_codec_vendor_device"] == 0x10EC0256 + + +@arm("ACPI ids keep the real shapes and drop everything else") +def _(): + got = acpi_ids([r"ACPI\PNP0A08", "*PNP0C02", r"ACPI\INT34C5", "USB\\CLASS_09", + "NOT_AN_ID", "x" * 300, None, ""]) + assert got == ["INT34C5", "PNP0A08", "PNP0C02"], got + + +@arm("a vendor string that merely looks ACPI-ish is refused") +def _(): + assert acpi_ids(["PNP0A0"]) == [] # too short + assert acpi_ids(["PNP0A088"]) == [] # too long + assert acpi_ids(["pnp0a08"]) == ["PNP0A08"] # case is normalised, shape still checked + + +@arm("CALIBRATED ON A REAL REPORT: an ALC256 codec id gives the vendor/device pair the Mac app reports") +def _(): + # 10EC:0256 is the codec a user's own report named beside "codecs 10EC:0256". The Mac app reads it as + # one 32-bit IOHDACodecVendorID, so the two maps must agree on the packing. + got = facts(r"HDAUDIO\FUNC_01&VEN_10EC&DEV_0256&SUBSYS_10EC0256&REV_1001\4&1a2b3c4d&0&0001") + assert got["audio_codec_vendor_device"] == 0x10EC0256, got + assert got["audio_codec_revision"] == 0x1001, got + assert got["audio_codec_function_group"] == 0x01, got + # the field the Mac app prints, rebuilt from our number, must read back as the same pair + v, d = got["audio_codec_vendor_device"] >> 16, got["audio_codec_vendor_device"] & 0xFFFF + assert "%04X:%04X" % (v, d) == "10EC:0256" + + +@arm("CALIBRATED ON A REAL REPORT: an NVIDIA audio function reads as an HD-audio controller") +def _(): + # 10DE:10F8 and 10DE:22BD are the NVIDIA audio functions in users' reports. The Mac app decides + # "this is a sound controller" with (class-code >> 8) == 0x0403; the Windows map must give a + # pci_class that answers the same question, or the two maps cannot be compared on audio at all. + # The CompatibleID forms are Microsoft's documented ones for a PCI device: the class code follows the + # vendor or stands alone, and never follows DEV_. Writing a DEV_&CC_ fixture here is how this arm first + # failed - the pattern was right and the test data was invented. + for device, compat in [(0x10F8, [r"PCI\VEN_10DE&CC_040300", r"PCI\VEN_10DE&CC_0403"]), + (0x22BD, [r"PCI\CC_040300", r"PCI\CC_0403"])]: + got = merged(r"PCI\VEN_10DE&DEV_%04X&SUBSYS_000010DE&REV_A1\3&11583659&0&09" % device, compat) + assert got["pci_device"] == device, got + assert got["pci_class"] == 0x040300, got + assert (got["pci_class"] >> 8) == 0x0403, got + + +@arm("a four-digit class code is widened to the Mac app's 24-bit field, and six digits win over four") +def _(): + assert classes([r"PCI\CC_0403"]) == {"pci_class": 0x040300} + assert classes([r"PCI\CC_0C03"]) == {"pci_class": 0x0C0300} + # both forms present, in either order: the specific one is kept + assert classes([r"PCI\CC_0C0330", r"PCI\CC_0C03"]) == {"pci_class": 0x0C0330} + assert classes([r"PCI\CC_0C03", r"PCI\CC_0C0330"]) == {"pci_class": 0x0C0330} + + +@arm("a USB keyboard interface gives class, subclass and protocol; a HID collection gives its usage") +def _(): + assert classes([r"USB\Class_03&SubClass_01&Prot_01"]) == { + "usb_class": 3, "usb_subclass": 1, "usb_protocol": 1} + assert classes([r"USB\Class_09"]) == {"usb_class": 9} # a hub, no subclass stated + assert classes(["HID_DEVICE_UP:000C_U:0001"]) == {"hid_usage_page": 0x0C, "hid_usage": 1} + assert classes(["HID_DEVICE_SYSTEM_KEYBOARD", "HID_DEVICE"]) == {} # named, not numbered: nothing + + +@arm("NEGATIVE CONTROL THAT MUST FIRE: a near-miss class string yields nothing, not a wrong number") +def _(): + # Each of these is one character away from a shape we accept. The patterns are anchored at both ends + # for exactly this reason: a partial match would put a number in the map that is not the device's. + for hostile in [r"PCI\VEN_10DE&CC_04030", r"PCI\CC_04030012", r"USB\Class_3&SubClass_01", + r"USB\Class_03&Something", "HID_DEVICE_UP:000C", "HID_DEVICE_UP:000C_U:1", + r"PCI\VEN_10DE&CC_SECRET", r"USB\Class_03\6&1a2b3c4d&0&2"]: + got = classes([hostile]) + assert got == {}, (hostile, got) + # and the arm proves itself: the real forms of the same strings DO produce numbers + assert classes([r"PCI\VEN_10DE&CC_040300"]) == {"pci_class": 0x040300} + assert classes([r"USB\Class_03&SubClass_01"]) == {"usb_class": 3, "usb_subclass": 1} + assert classes(["HID_DEVICE_UP:000C_U:0001"]) != {} + + +@arm("NEGATIVE CONTROL THAT MUST FIRE: a DeviceID handed to the class reader yields nothing") +def _(): + # Collect() passes only CompatibleID lists to classes() and acpi_ids(); taking the last segment is + # safe for exactly that reason. If a later change ever fed a DeviceID in, these are the strings whose + # instance tails must still produce no field. + for device_id in [r"USB\VID_046D&PID_C52B\6&1a2b3c4d&0&2", + r"HDAUDIO\FUNC_01&VEN_10EC&DEV_0256\4&1a2b3c4d&0&0001", + r"USBSTOR\DISK&VEN_KINGSTON&PROD_DATATRAVELER_3.0&REV_0000\E0D55EA574B315C108820075&0"]: + assert classes([device_id]) == {}, device_id + assert acpi_ids([device_id]) == [], device_id + + +@arm("NEGATIVE CONTROL: a friendly name, a MAC address or a path can never become a field") +def _(): + # These are the strings the allow-list exists to keep out. None of them is an identifier shape, so + # every one must produce nothing. If this arm ever passes trivially because facts() started returning + # a catch-all, the assertion on an empty dict below is what fails. + # The fixtures are deliberately reserved-for-documentation values (RFC 5737 for the address, the + # IANA documentation range for the MAC) and a made-up device name. A test that needs to prove a + # real address cannot leak must not carry one to do it. + for hostile in ["My Keyboard", "00:00:5E:00:53:01", r"PCI\VEN_10DE&DEV_2503&SERIAL_SECRET", + "C:\\Users\\someone", "192.0.2.10", "DESKTOP-ABCD1234"]: + got = facts(hostile) + assert "serial" not in " ".join(got.keys()).lower(), got + for value in got.values(): + assert isinstance(value, int), (hostile, got) + assert facts("My Keyboard") == {} + assert facts("00:00:5E:00:53:01") == {} + assert facts("192.0.2.10") == {} + # the SERIAL_ case above still parses its legitimate VEN/DEV prefix, and nothing more + assert facts(r"PCI\VEN_10DE&DEV_2503&SERIAL_SECRET") == {"pci_vendor": 0x10DE, "pci_device": 0x2503} + + +@arm("a device line is field-name sorted, so two maps of one PC are the same text and can be diffed") +def _(): + fields = merged(r"PCI\VEN_10DE&DEV_10F8&SUBSYS_000010DE&REV_A1", + [r"PCI\VEN_10DE&CC_040300"]) + text = line(fields, ["PNP0A08"]) + # 262912 is 0x040300 in the decimal the map writes; the literal here was 0x040500 at first and this + # arm is what said so. + assert text == ("device pci_class=262912 pci_device=4344 pci_revision=161 " + "pci_subsystem_device=0 pci_subsystem_vendor=4318 pci_vendor=4318 " + "acpi_ids=PNP0A08"), text + # the same facts in a different dict order give the identical line + shuffled = dict(reversed(list(fields.items()))) + assert line(shuffled, ["PNP0A08"]) == text + + +@arm("a class number never overwrites a hardware-ID number of the same name") +def _(): + # Collect() merges with setdefault for this reason: the hardware ID is the device's own statement. + got = merged(r"PCI\VEN_10DE&DEV_10F8&REV_A1", [r"PCI\VEN_10DE&CC_040300"]) + assert got["pci_revision"] == 0xA1 and got["pci_class"] == 0x040300, got + + +@arm("the PCI class pattern accepts exactly Microsoft's documented CompatibleID forms, and no others") +def _(): + # "Identifiers for PCI Devices": the compatible IDs are PCI\VEN_v&CC_ccsspp, PCI\VEN_v&CC_ccss, + # PCI\CC_ccsspp and PCI\CC_ccss. DEV_ appears in the HARDWARE ids, never in front of CC_. + for good in [r"PCI\VEN_10DE&CC_040300", r"PCI\VEN_10DE&CC_0403", r"PCI\CC_040300", r"PCI\CC_0403"]: + assert classes([good]) == {"pci_class": 0x040300}, good + for not_a_class_id in [r"PCI\VEN_10DE&DEV_10F8&CC_040300", r"PCI\VEN_10DE&DEV_10F8&REV_A1", + r"PCI\VEN_10DE&DEV_10F8"]: + assert classes([not_a_class_id]) == {}, not_a_class_id + + +def main(): + bad = 0 + for name, fn in ARMS: + try: + fn() + print(" ok " + name) + except AssertionError as error: + bad += 1 + print(" FAIL " + name + "\n " + str(error)) + print("\n%d arm(s), %d failed" % (len(ARMS), bad)) + print("This checks the PARSE RULES only. It does not compile HardwareMap.cs (there is no .NET " + "toolchain on the machine it was written on), does not call WMI, and proves nothing about " + "which fields real hardware reports.") + return 1 if bad else 0 + + +if __name__ == "__main__": + sys.exit(main()) From 0e40b08a3ec970cc0d974deb66ce03cd8a8f8777 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 01:06:37 -0800 Subject: [PATCH 053/244] 1401: the resume give-up says what was observed instead of blaming 1401: the resume give-up says what was observed instead of blaming the network, and stops being silent The resume and readback paths already existed, so nothing was added on top of them. This answers the narrower question: given that resume already runs, what do the give-up reports actually show? Read from the RAW write logs of 10-31..11-02 (100 resume give-ups among 780 write logs), because the digest truncates each stop line before the trail that carries the evidence. stalled-in-a-row at give-up 20 on ALL 100 (the RESUMES_WINDOWED cap) total resumes at give-up 20 on 87, then 21..60 (RESUMES_TOTAL is 400 and was never near) never printed a PROGRESS line 83 of 100 span of the recorded connections min 968 s, median 1084 s, max 3935 s the first full connection gave exactly 1048576 B on 89 of 100 the empty answers 343 of them, EVERY one a well-formed HTTP 206 with Content-Length 524288 - the window 1401 asked for - and no body who answered Server nginx on 48 machines, dlb/1.0.2 on 1, Via absent on all 343 versions 2.6.6 x54, 2.6.5 x30, 2.6.4 x8, 2.6.2 x3, 2.5.4 x2, 2.0.4 x2, 2.5.5 x1 Three changes, each named by the number that drove it: - The stop said "Something on this network cuts Apple's download: turn off web/HTTP scanning in your antivirus". The 343 empty answers were not cut: the server accepted the range, promised the exact length and sent nothing, and no proxy announced itself in a Via header. A scanner cutting a stream does not answer 206 and state a Content-Length first. The stop now reports what happened - how many connections, how many delivered nothing, how many minutes, what percent - offers the two possible causes without claiming which, and orders the three remedies cheapest first (antivirus, then hotspot or VPN, then wait an hour because Apple may be busy). Driven by: 343 empty answers, all 206 with Content-Length 524288, Via absent on all of them. - Nothing was printed while this was happening. 83 of 100 give-ups never printed a PROGRESS line, and the recorded connections spanned a median of 1084 s, so for 16 to 65 minutes the window showed a bar at zero and no text. Each stalled connection now prints one line saying how many in a row have delivered nothing, at what percent, and how many are left before it stops. A healthy windowed download never reaches that path, so a working write cannot be spammed by it. Driven by: 83 of 100, median span 1084 s. - No log, failed or successful, has ever recorded who answers a download that WORKS, which is the only reason "nginx" cannot be told from Apple's own edge. The first connection's Server, Via, X-Cache and X-Responding-Server are now logged once, deliberately without calling them Apple's. Driven by: 51 of the 100 recorded no headers at all, and the 49 that did had no baseline to be compared against. Thresholds NOT changed, and this is the restraint the numbers demand: all 100 give-ups stopped at exactly 20 stalled connections, but every one of those logs is a FAILURE, so they cannot show how often 20 would have recovered. The code's own history records a write that reached 8 MiB after 19 resumes, which is why the limit is 20 and not 8. A negative-control arm now pins RESUMES, RESUMES_WINDOWED, RESUMES_TOTAL and WINDOW_MAX_DELAY so a later change has to be argued for rather than drifted into. Whether "nginx" is Apple's edge or an interposer is UNKNOWN and is left labelled as such in the code and in the user-facing text. Tests: 885 pass (878 before, plus 7 arms), 5 skipped. usbwriter --selftest 20/20. The give-up wording had no test at all before this, which is why it could assert a cause for weeks without being noticed. --- p1401/apple.py | 70 ++++++++++++++++++-- tests/test_apple_preflight_status.py | 98 ++++++++++++++++++++++++++++ 2 files changed, 164 insertions(+), 4 deletions(-) diff --git a/p1401/apple.py b/p1401/apple.py index bdd733e7..ece3bb02 100644 --- a/p1401/apple.py +++ b/p1401/apple.py @@ -369,6 +369,53 @@ def _not_a_web_page(data): PREFLIGHT_BYTES = 64 * 1024 # enough to prove the CDN serves a range of the image; not a download +def _gave_up(e, resumes, stalled, got, total, seconds, trail): + """The stop after the resumes run out, worded from what was observed rather than from a guess. + + WAS: "Something on this network cuts Apple's download: turn off web/HTTP scanning in your antivirus, + or connect through a phone hotspot or a VPN, and press Next." That asserted the cause, and the + measurement of 11-02 (the 100 resume give-ups in the raw write logs of 10-31..11-02) says we do not + know it. In those logs the connections that delivered nothing were not cut at all: 343 of them + answered a well-formed HTTP 206 with Content-Length exactly 524288 - the window 1401 asked for - and + then sent no body. A scanner cutting a stream does not answer 206 and promise a length first. Server + was nginx on 48 of the 49 machines that recorded it and dlb/1.0.2 on one, and Via was absent on all + 343, so nothing in front announced itself either. Whether that is Apple's own edge or an interposer + cannot be told from these logs, because no log has ever recorded who answers a download that WORKS - + which _answered_by now fixes. + + So this says what happened, offers both routes without claiming which applies, and - because the + stick is erased by the time the image is being fetched - says plainly what state it is in. The + thresholds are NOT changed: all 100 give-ups stopped at exactly 20 stalled connections, but every one + of those logs is a FAILURE, so they cannot show how often 20 would have recovered. The code's own + history records a write that reached 8 MiB after 19 resumes, which is why the limit is 20 and not 8.""" + pct = got * 100 // total if total else 0 + return (f"{e} (after {resumes} resumed connections, {stalled} in a row that delivered no data, " + f"over {seconds / 60:.0f} minutes, at {pct}% of the download). The download server kept " + f"accepting the request and then sending nothing. That is either something between this PC " + f"and Apple, or Apple's own download server: 1401 cannot tell which from here, so try the " + f"cheaper fix first. Turn off web/HTTP scanning in your antivirus and press Next again; if it " + f"stops here again, try a phone hotspot or a VPN; if it still stops, Apple is likely busy - " + f"wait an hour and press Next again. The USB stick was erased and is not a working installer " + f"yet, so leave it plugged in and press Next rather than reusing it elsewhere. Nothing else on " + f"this PC was changed. Last connections: {'; '.join(trail)}") + + +def _answered_by(r): + """Which server answered, for the log. Never raises and never carries a URL, a token or a cookie: only + the headers that say who is on the other end.""" + try: + h = getattr(r, "headers", None) + if h is None: + return "the download server sent no headers to identify itself" + got = [f"{k}={str(h.get(k))[:60]}" for k in ("Server", "Via", "X-Cache", "X-Responding-Server") + if h.get(k) is not None] + # Deliberately not "Apple's server": whether it is Apple's edge or something in front of it is the + # very thing these lines exist to settle, so the log states what answered and claims nothing. + return "the download server answered: " + (", ".join(got) or "it named itself in no header") + except Exception: # noqa: BLE001 - a description only; nothing downstream depends on it + return "the download server could not be identified" + + def preflight(info): """Proves Apple will serve this download BEFORE anything is erased: the signed chunklist, verified, and a small range of the image itself. Returns the chunklist bytes, which download() then reuses rather than @@ -426,6 +473,13 @@ def note(s): if "HTTP Error 403" not in str(e): raise r = _after_403(info, e, lambda: _asset(info["image_url"], info["image_token"])) + # Who answered the connection that WORKED. Measured 11-02 over the 100 resume give-ups in the raw write + # logs of 10-31..11-02: 49 of them recorded the headers of an empty answer (Server nginx on 48 machines, + # dlb/1.0.2 on 1) and 51 recorded nothing - but NO log, failed or successful, has ever recorded who + # answers a download that works. Without that baseline it cannot be said whether "nginx" is Apple's own + # edge or something between the PC and Apple, so the stop below must not claim either. One line here + # makes the next support cycle able to tell them apart. + print("OK " + _answered_by(r), flush=True) # WAS: fh was first bound inside the with, so a stick that refused the file made the finally raise # UnboundLocalError and hid the real error (1.9.0 write log, 10-10) fh = None @@ -467,12 +521,20 @@ def note(s): resumes += 1 limit = RESUMES_WINDOWED if window else RESUMES if stalled > limit or resumes > RESUMES_TOTAL: - raise AppleError(f"{e} (after {resumes - 1} resumed connections, {stalled - 1} in a row " - f"with no progress). Something on this network cuts Apple's download: " - f"turn off web/HTTP scanning in your antivirus, or connect through a phone " - f"hotspot or a VPN, and press Next. Last connections: {'; '.join(trail)}") from None + raise AppleError(_gave_up(e, resumes - 1, stalled - 1, done + len(part), total, + time.monotonic() - t0, trail)) from None if window and stalled > 1 and (stalled - 1) % REFRESH_EVERY == 0: _refresh(info) + # Say something while this is happening. Measured 11-02 over the 100 resume + # give-ups in the raw write logs of 10-31..11-02: 83 of them never printed a + # single PROGRESS line, and the recorded connections spanned a median of 1084 s + # (min 968 s, max 3935 s) - so for 16 to 65 minutes the window showed a bar at + # zero and no text at all, and users had nothing to tell them whether to wait. + # Every stalled connection prints one line; a healthy windowed download never + # reaches here, so this cannot spam a working write. + print(f"(no data from the download server on {stalled} connection(s) in a row at " + f"{(done + len(part)) * 100 // total}% - still trying, up to " + f"{limit} before stopping; each wait is up to {WINDOW_MAX_DELAY} s)", flush=True) window = WINDOW # from now on never ask for more than one window per connection try: # back off when nothing arrives diff --git a/tests/test_apple_preflight_status.py b/tests/test_apple_preflight_status.py index 95e23b00..116d3652 100644 --- a/tests/test_apple_preflight_status.py +++ b/tests/test_apple_preflight_status.py @@ -271,6 +271,104 @@ def urlopen(req, timeout=None): self.assertLessEqual(len([r for r in opened if r]), 2, opened) +class GaveUpAfterResumes(unittest.TestCase): + """Measured 11-02 over the 100 resume give-ups in the raw write logs of 10-31..11-02: + + stalled-in-a-row at give-up 20 on ALL 100 (the RESUMES_WINDOWED cap) + total resumes at give-up 20 on 87, then 21..60 + never printed a PROGRESS line 83 of 100 + span of the recorded connections min 968 s, median 1084 s, max 3935 s + the empty answers 343 of them, every one HTTP 206 with Content-Length 524288 + and NO body; Server nginx on 48 machines, dlb/1.0.2 on 1, + Via absent on all 343 + first full connection delivered exactly 1048576 B on 89 of 100 + + So the download server was not cutting the connection: it accepted the range, promised the exact + window and sent nothing. The old stop asserted "Something on this network cuts Apple's download". + """ + + def message(self, got=0, total=1000, seconds=1084, resumes=20, stalled=20): + return apple._gave_up(apple.AppleError("stream ended at 0/10485760 bytes of a chunk"), + resumes, stalled, got, total, seconds, ["18s connection at 0 gave 1048576 B"]) + + def test_it_no_longer_asserts_the_network_was_the_cause(self): + m = self.message() + self.assertNotIn("Something on this network cuts", m) + self.assertIn("either something between this PC and Apple, or Apple's own download server", m) + self.assertIn("cannot tell which", m) + + def test_it_reports_what_was_actually_observed(self): + m = self.message(got=210, total=1000, seconds=1084, resumes=26, stalled=20) + self.assertIn("26 resumed connections", m) + self.assertIn("20 in a row that delivered no data", m) + self.assertIn("18 minutes", m) # 1084 s, which is the measured median + self.assertIn("21% of the download", m) + self.assertIn("accepting the request and then sending nothing", m) + self.assertIn("stream ended at 0/10485760", m) # the original error is still carried + self.assertIn("Last connections: 18s connection at 0 gave 1048576 B", m) + + def test_it_offers_the_three_routes_cheapest_first_and_names_the_sticks_state(self): + m = self.message() + self.assertLess(m.index("antivirus"), m.index("hotspot or a VPN")) + self.assertLess(m.index("hotspot or a VPN"), m.index("wait an hour")) + # the stick IS erased by the time the image is being fetched: say so rather than implying it is fine + self.assertIn("was erased and is not a working installer", m) + self.assertIn("Nothing else on this PC was changed", m) + + def test_NEGATIVE_CONTROL_the_thresholds_were_not_quietly_loosened(self): + # All 100 give-ups stopped at 20, but all 100 are FAILURES and so cannot show how often 20 would + # have recovered; the code's own history records a write that reached 8 MiB after 19 resumes. + # If a later change raises these, this arm is where it has to be argued for. + self.assertEqual(apple.RESUMES_WINDOWED, 20) + self.assertEqual(apple.RESUMES, 8) + self.assertEqual(apple.RESUMES_TOTAL, 400) # never approached: max observed was 60 + self.assertEqual(apple.WINDOW_MAX_DELAY, 60) + + def test_a_stalled_connection_prints_a_line_instead_of_going_silent_for_eighteen_minutes(self): + said = [] + # one chunk, a first connection that delivers nothing, then every resume refused: the stall path + def urlopen(req, timeout=None): + if req.headers.get("Range") is None: + return Stream(b"") + raise ConnectionResetError(10054, "reset") + + with tempfile.TemporaryDirectory() as root, \ + patch.object(apple, "parse_chunklist", lambda d: LIST), \ + patch.object(apple.urllib.request, "urlopen", urlopen), \ + patch.object(apple.time, "sleep", lambda s: None), \ + patch("builtins.print", lambda *a, **k: said.append(" ".join(str(x) for x in a))): + where = info() + where["chunklist_bytes"] = b"cl" + with self.assertRaises(apple.AppleError): + apple.download(where, root) + stall_lines = [s for s in said if "no data from the download server on" in s] + self.assertTrue(stall_lines, said[:6]) + # one line per stalled connection, so the window is never silent, and it says what it is waiting for + self.assertGreaterEqual(len(stall_lines), 8) + self.assertIn("before stopping", stall_lines[0]) + self.assertIn("still trying", stall_lines[0]) + + def test_the_server_that_answered_a_working_connection_is_recorded(self): + # No log, failed or successful, had ever recorded who answers a download that works - which is + # exactly why nginx-vs-Apple cannot be settled from the 10-31..11-02 logs. + r = Stream(IMAGE) + r.headers["Server"] = "nginx" + r.headers["Via"] = "1.1 something" + line = apple._answered_by(r) + self.assertIn("Server=nginx", line) + self.assertIn("Via=1.1 something", line) + # it must NOT call it Apple's server: that is the open question, not a finding + self.assertNotIn("Apple's download server answered", line) + + def test_the_server_line_never_raises_and_never_leaks_a_token(self): + self.assertIn("no headers", apple._answered_by(object())) + r = Stream(b"") + r.headers["Set-Cookie"] = "AssetToken=SECRET" + line = apple._answered_by(r) + self.assertNotIn("SECRET", line) + self.assertNotIn("AssetToken", line) + + class ReadbackNamesTheStick(unittest.TestCase): def test_the_stick_is_named_by_model_and_claimed_size_and_never_by_serial(self): got = usbwriter.stick_name({"FriendlyName": "General UDisk", "Size": 31 * 10 ** 9, From 7e34fde37cdb02b63468d0103a54656fc6d45caa Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 14:41:35 -0800 Subject: [PATCH 054/244] 1401 2.7: bundles driver and Mac app 2.7 --- mac/Resources/nullmoth-uninstall.sh | 7 ++++--- mac/Sources/main.swift | 8 ++++---- mac/build.sh | 4 ++-- p1401/nullmoth.py | 6 +++--- windows/App/App.csproj | 2 +- windows/App/app.manifest | 2 +- windows/release-inputs.json | 6 +++--- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/mac/Resources/nullmoth-uninstall.sh b/mac/Resources/nullmoth-uninstall.sh index 06c3df72..83150616 100755 --- a/mac/Resources/nullmoth-uninstall.sh +++ b/mac/Resources/nullmoth-uninstall.sh @@ -4,9 +4,10 @@ set -u # fixed PATH those resolve through whatever the caller exported, and kmutil # rebuilds the auxiliary kernel collection. PATH=/usr/bin:/bin:/usr/sbin:/sbin; export PATH -# the NVIDIA driver only: the AMD/Intel GPU driver, the NPU driver and the audio driver are separate products with -# their own uninstallers -KEXTS="NVRM NVAccel NVRMFB NVRMAGDC NVPrimarySelector"; EXT=/Library/Extensions; GB=/Library/GPUBundles +# the NVIDIA driver and the audio driver it carries (install.sh puts NMXAudio in on macOS 26). The AMD/Intel GPU and +# NPU drivers are separate products with their own uninstallers, and removing another product's kext from this one +# would take out a driver the user still wants. +KEXTS="NVRM NVAccel NVRMFB NVRMAGDC NVPrimarySelector NMXAudio"; EXT=/Library/Extensions; GB=/Library/GPUBundles KC=/Library/KernelCollections/AuxiliaryKernelExtensions.kc K=/System/Library/Kernels/kernel KARG=(--allow-missing-kdk); [ -f "$K" ] && KARG+=(--kernel "$K") # without a matching Kernel Debug Kit, kmutil needs --allow-missing-kdk diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index 7e3615ed..dc4bea1d 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -9,10 +9,10 @@ import WebKit import UniformTypeIdentifiers struct Package { - static let version = "2.6.6" - static let name = "nullmoth-nvidia-2.6.6.tar.gz" - static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.6/nullmoth-nvidia-2.6.6.tar.gz")! - static let sha256 = "dbb0f5c2a18ccc97dfdf57ca14488b0ea713c15608f684a0a4283e88c676ab6e" + static let version = "2.7" + static let name = "nullmoth-nvidia-2.7.tar.gz" + static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.7/nullmoth-nvidia-2.7.tar.gz")! + static let sha256 = "f0ed136369cbb8875a981fe33c5095b1c19dc68cabbd17bd85cff05eb6f77bac" } // The AMD/Intel GPU and NPU driver (test): its own product and package, pinned like the NVIDIA driver's. An empty pin // means no build of it is published yet. diff --git a/mac/build.sh b/mac/build.sh index 7c4bb95d..9440c6ab 100644 --- a/mac/build.sh +++ b/mac/build.sh @@ -66,8 +66,8 @@ cat > "$APP/Contents/Info.plist" <CFBundleName1401 CFBundleDisplayName1401 CFBundlePackageTypeAPPL -CFBundleShortVersionString2.6.6 -CFBundleVersion132 +CFBundleShortVersionString2.7 +CFBundleVersion135 LSMinimumSystemVersion15.0 NSHumanReadableCopyright© 2026 NullMoth Systems NSHighResolutionCapable diff --git a/p1401/nullmoth.py b/p1401/nullmoth.py index e8876805..f72319ac 100644 --- a/p1401/nullmoth.py +++ b/p1401/nullmoth.py @@ -29,9 +29,9 @@ BOOT_ARGS = ("nvfb=1", "nvaccel=1", "nvfbheads=4", "-nvkmsnosmooth", "amfi_get_out_of_my_way=0x1", "amfi=0x80", "ipc_control_port_options=0") # Package published with the driver; the stick carries it so the Mac companion can install it offline. -PACKAGE = {"name": "nullmoth-nvidia-2.6.6.tar.gz", - "url": "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.6.6/nullmoth-nvidia-2.6.6.tar.gz", - "sha256": "dbb0f5c2a18ccc97dfdf57ca14488b0ea713c15608f684a0a4283e88c676ab6e"} +PACKAGE = {"name": "nullmoth-nvidia-2.7.tar.gz", + "url": "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.7/nullmoth-nvidia-2.7.tar.gz", + "sha256": "f0ed136369cbb8875a981fe33c5095b1c19dc68cabbd17bd85cff05eb6f77bac"} with open(os.path.join(HERE, "nvidia_gsp_ids.json")) as _fh: TABLE = json.load(_fh) diff --git a/windows/App/App.csproj b/windows/App/App.csproj index 67d580b3..d17c8581 100644 --- a/windows/App/App.csproj +++ b/windows/App/App.csproj @@ -8,7 +8,7 @@ AnyCPU false app.manifest - 2.6.6 + 2.7.0 NullMoth Systems NullMoth Systems © 2026 NullMoth Systems diff --git a/windows/App/app.manifest b/windows/App/app.manifest index 42b0b434..774d71c8 100644 --- a/windows/App/app.manifest +++ b/windows/App/app.manifest @@ -1,6 +1,6 @@ - + diff --git a/windows/release-inputs.json b/windows/release-inputs.json index 0f7e28a1..515af27c 100644 --- a/windows/release-inputs.json +++ b/windows/release-inputs.json @@ -1,9 +1,9 @@ { "baseline_url": "https://github.com/nullmoth/1401/releases/download/v1.14.3/1401-Windows-1.14.3.zip", "baseline_sha256": "e287bf4b09805dbf697f915fa6867a15a422764c46b8733dfd9f46bc0e6043b6", - "driver_release": "v2.6.6", - "mac_asset": "1401-Mac-2.6.6.zip", - "mac_sha256": "8e8f7b60a6b8410c93e01faccd96575dd7e9e55116001dbd9bb27c40e0fbd3c3", + "driver_release": "v2.7", + "mac_asset": "1401-Mac-2.7.zip", + "mac_sha256": "b09e6f54dc5337e9686583a3eac370eac6f86d49ed47141817be8105678740eb", "opencore_url": "https://github.com/acidanthera/OpenCorePkg/releases/download/1.0.8/OpenCore-1.0.8-RELEASE.zip", "opencore_sha256": "2011e8b7216ecb2645d97ea710df965947edd406846e92050b9bc4190be6d27b", "fixture_slug": "optiplex-5050-micro", From 7ac581634d597cd8a57aa9124a4e83ae581758a5 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 14:41:49 -0800 Subject: [PATCH 055/244] Changelog: 2.7 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2612636..0ae19b2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ Each release also bundles the NVIDIA driver and Mac app of the same version; see the [driver changelog](https://github.com/nullmoth/nvidia-macos-driver/blob/main/CHANGELOG.md). +## 2.7 +- Writing the stick: 1401 checks that Apple will serve the download before erasing your USB stick. If Apple refuses, the stick is not touched. +- Apple's 406, 405, 408, 425, and 429 answers are retried like server errors, try another route, and the message says Apple refused, not that your network failed. +- A resume that can never succeed (416) stops at once and says why. +- A failed readback names the stick and tells the two causes apart: a failing write (try another port) or a stick that reports a size it does not have (use another stick). +- The read-only message explains the lock switch, and what it means when the stick has none. +- Bundles the NVIDIA driver and Mac app 2.7. + ## 2.6.6 - Recovery downloads: when Apple's server refuses the file list (403), 1401 asks again with a fresh token. A web page served in place of the file list, and a connection that answers with no data, are now named in the stop message instead of a bare error. - Writing the stick: when Z: to G: are all taken, 1401 also tries F:, E: and D:, and lists the letters in use if none is free. A stick Windows reports offline now says why and how to bring it online, and a stick that drops off USB after the image is written says so in one line. From 86f6fc2dc416dcc7137b2d303d496b7db3074525 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 14:42:12 -0800 Subject: [PATCH 056/244] Comments: no dates in the 403 burst note --- p1401/apple.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p1401/apple.py b/p1401/apple.py index ece3bb02..a069db68 100644 --- a/p1401/apple.py +++ b/p1401/apple.py @@ -102,7 +102,7 @@ class AppleError(RuntimeError): # 2.6.6 write logs, measured 11-02 over the raw uploads of 10-31..11-02 (780 write logs): 328 stops were # "HTTP Error 406: Not Acceptable" from oscdn and 11 were "HTTP Error 405: Method Not Allowed" from -# osrecovery, and 333 of those 339 landed inside ONE UTC hour (2026-11-01 09:00-09:59) across six app +# osrecovery, and 333 of those 339 landed inside ONE UTC hour across six app # versions back to 1.10.0, with zero in the other 61 hours of the window. That is Apple's side failing for # an hour, not a per-network fault and not a per-version one - but 406, 405, 408 and 429 were all outside # this test, so each was a single request with no back-off and no reroute, and 323 of the 328 had already From 3d89a92013d765d26a9093955f2b0f53d64bdf20 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 03:46:49 -0800 Subject: [PATCH 057/244] 1401 Mac: ARM apps (opt-in) card Turning it on installs NullMoth's arm64-to-x86 translator package under /Library/NullMoth/arm: signed manifest, SHA-256 and release signature on the download, then root copies it into a root-only folder, checks the SHA-256 again on that copy, unpacks it and runs its installer. Translation runs as the user with streamed progress and a Cancel that ends the whole process tree; the translated copy goes to ~/Applications/NullMoth ARM and the original is never changed. Turning it off runs the package's uninstaller only when root owns it. Send logs now includes ~/Library/Logs/NullMoth/arm, redacted like every file. Nothing else in the app changes. --- mac/Resources/app.js | 58 ++++++ mac/Resources/index.html | 7 + mac/Sources/ArmApps.swift | 388 +++++++++++++++++++++++++++++++++++++ mac/Sources/main.swift | 28 +++ mac/build.sh | 2 +- mac/tools/test_arm_apps.py | 218 +++++++++++++++++++++ 6 files changed, 700 insertions(+), 1 deletion(-) create mode 100644 mac/Sources/ArmApps.swift create mode 100644 mac/tools/test_arm_apps.py diff --git a/mac/Resources/app.js b/mac/Resources/app.js index 53a0dd7b..18677c17 100644 --- a/mac/Resources/app.js +++ b/mac/Resources/app.js @@ -7,6 +7,52 @@ const S = { mac: null, pkg: "", previewed: false, installed: false, driverUpdate function row(k, v) { return `${esc(k)}${v}`; } function step(n, state) { const li = $("s" + n); li.classList.toggle("done", state === "done"); li.classList.toggle("now", state === "now"); } +// The "ARM apps (opt-in)" card: status (on/off, check, list), busy text, translation progress and every error. +// A.last: the outcome of the last action (an error, or a finished translation). A status refresh follows most actions +// and would otherwise overwrite it, so the refresh shows it above the status once. +const A = { on: false, ok: false, running: false, last: "" }; +function armButtons() { + $("armon").hidden = A.on; $("armoff").hidden = !A.on; $("armchk").hidden = !A.on; + $("armon").disabled = false; + $("armtr").hidden = !A.on; $("armtr").disabled = !(A.on && A.ok) || A.running; + $("armprog").hidden = !A.running; +} +function armEvent(d) { + if (d.kind === "status") { + A.on = !!d.installed; A.running = !!d.translating; + const c = d.check || {}; + A.ok = A.on && c.ok === true; + let t = (A.last ? A.last + "
" : "") + (d.note ? `${esc(d.note)}
` : ""); + A.last = ""; + if (!A.on) t += "Off. Nothing is installed."; + else if (c.ok === true) t += `This Mac can run translated apps` + (c.target ? ` (${esc(c.target)})` : "") + "."; + else t += `${esc(c.why || "This Mac did not pass the check.")}`; + if (d.listWhy) t += `
${esc(d.listWhy)}`; + $("armr").innerHTML = t; + $("armclt").hidden = !(A.on && c.prerequisites && c.prerequisites.clt === false); + const apps = d.apps || []; + $("armapps").innerHTML = !A.on ? "" : apps.length + ? "" + apps.map((a) => ``).join("") + "
${esc(a.name)}
" + : '

No translated apps yet.

'; + armButtons(); + return; + } + if (d.kind === "busy") { A.last = ""; $("armr").textContent = d.text; return; } + if (d.kind === "error") { A.last = `${esc(d.why)}`; $("armr").innerHTML = A.last; armButtons(); return; } + if (d.kind === "progress") { + A.running = true; armButtons(); $("armcancel").disabled = false; + if (typeof d.pct === "number") $("armbar").value = d.pct; else $("armbar").removeAttribute("value"); + $("armmsg").textContent = `${d.app}: ${d.msg || d.stage || ""}`; + return; + } + if (d.kind === "done") { + A.running = false; armButtons(); + A.last = d.ok ? `${esc(d.app)} is translated: it is in Applications > NullMoth ARM.` + : `${esc(d.app)}: ${esc(d.why || "the translation did not finish")}`; + $("armr").innerHTML = A.last; + } +} + function render(m) { S.mac = m; $("ver").textContent = m.version; @@ -198,6 +244,17 @@ $("gpuon").onclick = () => post({ act: "gputest", on: true, efi: efi() }); $("gpuoff").onclick = () => post({ act: "gputest", on: false, efi: efi() }); $("xeon").onclick = () => post({ act: "xe", on: true, efi: efi() }); $("xeoff").onclick = () => post({ act: "xe", on: false, efi: efi() }); +$("armon").onclick = () => { $("armon").disabled = true; post({ act: "arm", op: "on" }); }; +$("armoff").onclick = () => post({ act: "arm", op: "off" }); +$("armchk").onclick = () => post({ act: "arm", op: "check" }); +$("armclt").onclick = () => post({ act: "arm", op: "clt" }); +$("armtr").onclick = () => { $("armtr").disabled = true; post({ act: "arm", op: "translate" }); }; +$("armcancel").onclick = () => { $("armcancel").disabled = true; $("armmsg").textContent = "Cancelling..."; post({ act: "arm", op: "cancel" }); }; +$("armapps").onclick = (e) => { + const b = e.target.closest("button[data-op]"); + if (b) post({ act: "arm", op: b.dataset.op, name: b.dataset.name, path: b.dataset.path }); +}; +post({ act: "arm", op: "status" }); $("teston").onclick = () => post({ act: "tester", on: true }); $("testoff").onclick = () => post({ act: "tester", on: false }); $("earlyon").onclick = () => post({ act: "early", on: true }); @@ -299,6 +356,7 @@ NM.on = (m) => { $("earlyon").hidden = m.data.on; $("earlyoff").hidden = !m.data.on; return; } + if (m.event === "arm") { armEvent(m.data); return; } if (m.event === "tester") { $("testr").innerHTML = m.data.ok ? `${m.data.on ? "Joined: a report goes out after each restart." : "Left: nothing runs any more."}` : `${esc(m.data.why)}`; diff --git a/mac/Resources/index.html b/mac/Resources/index.html index 662fd27c..3a772a31 100644 --- a/mac/Resources/index.html +++ b/mac/Resources/index.html @@ -101,6 +101,13 @@

Tools

Map my GPU (experimental)

A few minutes of measurements on this Mac's GPU: what Metal reports, a correctness check, memory and compute speed, and small test shaders. Nothing is changed and no display mode is touched. The result goes in the log folder, and Send logs uploads it so the next driver can be tuned for your card.

+

ARM apps (opt-in)

+

Apps built only for Apple silicon can be translated to run on this Mac. Translation takes minutes for a small app and up to an hour or more for a big one. The original app is never changed: the translated copy goes to Applications > NullMoth ARM. Turning this off removes the translator and the translated copies, and your 2.7 driver keeps working.

+

+

+ +

ARM apps (opt-in)

+

Apps built only for Apple silicon can be translated to run on this Mac. Translation takes minutes for a small app and up to an hour or more for a big one. The original app is never changed: the translated copy goes to Applications > NullMoth ARM. Turning this off removes the translator and the translated copies, and your 2.7 driver keeps working.

diff --git a/mac/Sources/ArmApps.swift b/mac/Sources/ArmApps.swift index 4aaa2655..7a4dcce6 100644 --- a/mac/Sources/ArmApps.swift +++ b/mac/Sources/ArmApps.swift @@ -4,6 +4,7 @@ import Foundation import AppKit import UniformTypeIdentifiers +import CryptoKit // ARM apps (opt-in): translates apps built only for Apple silicon so they run on this Intel Mac. Turning it on // downloads NullMoth's translator package (signed manifest -> SHA-256 -> release signature, the same chain as the test @@ -42,29 +43,42 @@ enum ArmApps { let v = j["version"] as? String, let n = j["name"] as? String, let sha = (j["sha256"] as? String)?.lowercased(), let u = (j["url"] as? String).flatMap(URL.init(string:)), u.scheme == "https", let s = (j["sig"] as? String).flatMap(URL.init(string:)), s.scheme == "https", - validSha(sha), validPackageName(n) else { return nil } + validSha(sha), validPackageName(n), manifestNamesMatch(version: v, name: n, url: u) else { return nil } return Build(version: v, name: n, url: u, sha256: sha, sig: s) } - /// Downloads the package into Application Support (or reuses the copy there) and returns its path only when both its - /// SHA-256 and the release signature over its bytes check out. - static func fetch(_ b: Build) -> (path: String?, why: String?) { + /// The package name is exactly nullmoth-arm-.tar.gz and the download link ends in that name, + /// so a signed package of another NullMoth product, or another version, cannot stand in for this one. + static func manifestNamesMatch(version: String, name: String, url: URL) -> Bool { + version.range(of: #"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"#, options: .regularExpression) != nil + && name == "nullmoth-arm-\(version).tar.gz" && url.lastPathComponent == name + } + + /// Gets the package (the copy already in Application Support, or a fresh download) into memory ONCE, checks the + /// SHA-256 and the release signature on that same buffer, and only then writes that buffer to disk. Hashing and + /// verifying the file in two separate reads let another program running as this user swap it between the two. + /// The returned digest is the one root re-checks on its private copy, so root installs only verified bytes. + static func fetch(_ b: Build) -> (path: String?, sha256: String?, why: String?) { let dst = support.appendingPathComponent(b.name) - if sha256(dst) != b.sha256 { - guard let data = syncGet(b.url, timeout: 1800) else { return (nil, "the ARM translator package did not download") } - do { - try FileManager.default.createDirectory(at: support, withIntermediateDirectories: true) - try data.write(to: dst, options: .atomic) - } catch { return (nil, error.localizedDescription) } - guard sha256(dst) == b.sha256 else { - try? FileManager.default.removeItem(at: dst); return (nil, "the ARM translator package does not match its SHA-256") } + let hex = { (d: Data) in SHA256.hash(data: d).map { String(format: "%02x", $0) }.joined() } + var data = (try? Data(contentsOf: dst)) ?? Data() + if data.isEmpty || hex(data) != b.sha256 { + guard let d = syncGet(b.url, timeout: 1800) else { return (nil, nil, "the ARM translator package did not download") } + data = d } + let digest = hex(data) + guard digest == b.sha256 else { + try? FileManager.default.removeItem(at: dst); return (nil, nil, "the ARM translator package does not match its SHA-256") } guard let sig = syncGet(b.sig, timeout: 30), let text = String(data: sig, encoding: .utf8), - ReleaseSignature.verify(zip: dst, signatureBase64: text) else { + ReleaseSignature.verify(data: data, signatureBase64: text) else { try? FileManager.default.removeItem(at: dst) - return (nil, "the ARM translator package is not signed by NullMoth, so it was not installed") + return (nil, nil, "the ARM translator package is not signed by NullMoth, so it was not installed") } - return (dst.path, nil) + do { + try FileManager.default.createDirectory(at: support, withIntermediateDirectories: true) + try data.write(to: dst, options: .atomic) + } catch { return (nil, nil, error.localizedDescription) } + return (dst.path, digest, nil) } /// The root shell line that installs a checked package. The download sits in a folder this user owns, so another @@ -289,19 +303,34 @@ extension ArmApps { return false } + /// The banner event for the page, or nil when there is nothing to show. + static func banner(request: Bool, decision: [String: Any]?, driverInstalled: Bool, cpuFeatures: String) -> [String: Any]? { + guard shouldHonourRequest(request: request, decision: decision, driverInstalled: driverInstalled) else { return nil } + if let why = cpuGate(features: cpuFeatures) { + return ["kind": "request", "canRun": false, "text": "1401 for Windows set up ARM apps for this Mac, but \(why)."] + } + return ["kind": "request", "canRun": true, + "text": "1401 for Windows set up ARM apps for this Mac. Press Turn on to finish (your password is needed once)."] + } + /// Whether to act on the request: there is one, the NVIDIA driver was installed (the request only rides a driver /// install), and nobody has decided yet. A recorded decision, on or off, from the user or an earlier request, wins. static func shouldHonourRequest(request: Bool, decision: [String: Any]?, driverInstalled: Bool) -> Bool { request && driverInstalled && decision == nil } - /// The CPU floor the translator needs, checked before anything is downloaded on the automatic path (nm-arm check - /// ships inside the package, so it can only run after the install). x86-64-v2 plus AES, from the CPU's own flags. + /// The CPU floor the translator needs: AES, PCLMULQDQ, SSE4.2 and POPCNT, the same minimum the package's own check + /// uses. nm-arm check ships inside the package, so this runs before anything is offered. Features only, never the + /// vendor: an AMD processor with these flags passes exactly as an Intel one does. static func cpuGate(features: String) -> String? { let have = Set(features.uppercased().split(whereSeparator: { $0 == " " || $0 == "\t" || $0 == "\n" }).map(String.init)) - let missing = ["SSE3", "SSSE3", "SSE4.1", "SSE4.2", "POPCNT", "CX16", "AES"].filter { !have.contains($0) } + let missing = ["AES", "PCLMULQDQ", "SSE4.2", "POPCNT"].filter { !have.contains($0) } return missing.isEmpty ? nil : "this processor lacks \(missing.joined(separator: ", ")), which translated apps need" } + + static func cpuFeatures() -> String { + ["machdep.cpu.features", "machdep.cpu.leaf7_features", "machdep.cpu.extfeatures"].map { sysctl($0) }.joined(separator: " ") + } } extension App { @@ -323,9 +352,13 @@ extension App { func armAction(_ b: [String: Any]) { switch b["op"] as? String ?? "" { - case "status": armStatus(); armWindowsRequest(afterInstall: false) + case "status": armStatus(); armWindowsRequest() case "check": armBusy("Checking this Mac..."); armStatus() - case "on": armTurnOn(source: "user") + case "on": armTurnOn(source: b["from"] as? String == "windows" ? ArmApps.windowsSource : "user") + case "notNow": + // the banner's "Not now": a decision, so it does not come back; the card's own Turn on still works + if ArmApps.decision() == nil { ArmApps.saveDecision(on: false, source: ArmApps.windowsSource, skipped: "not now") } + armStatus() case "off": armTurnOff() case "clt": // Apple's own installer window; no password is needed to ask for it @@ -350,9 +383,10 @@ extension App { } } - /// Turn on, from the button (source "user") or from a 1401 for Windows request: the same verified path either way. - /// A request that fails installs nothing and is recorded as off with its reason, so it never fires again; a failed - /// button press records nothing, so the user can simply try again. + /// Turn on, from the card's button (source "user") or from the 1401 for Windows banner's button: the same verified + /// path either way, and only ever after the user pressed it. From the banner, a failure installs nothing and is + /// recorded as off with its reason, so the banner does not come back; a failed press of the card's own button records + /// nothing, so the user can simply try again. func armTurnOn(source: String = "user") { let auto = source != "user" let lead = auto ? "1401 for Windows asked for ARM apps. " : "" @@ -362,14 +396,12 @@ extension App { if auto { ArmApps.saveDecision(on: false, source: source, skipped: why) } self.armFail((auto ? "ARM apps (asked for in 1401 for Windows): not set up - " : "") + why) } - if auto, let why = ArmApps.cpuGate(features: sysctl("machdep.cpu.features") + " " + sysctl("machdep.cpu.leaf7_features")) { - return fail("Not installed: \(why).") - } + if auto, let why = ArmApps.cpuGate(features: ArmApps.cpuFeatures()) { return fail("Not installed: \(why).") } guard let b = ArmApps.latest() else { return fail("Could not read the ARM translator package list from nullmothsystems.com.") } self.armBusy(lead + "Downloading the ARM translator \(b.version) and checking its signature...") let got = ArmApps.fetch(b) - guard let path = got.path else { return fail("Not installed: \(got.why ?? "the package could not be checked").") } - guard let cmd = ArmApps.installCommand(package: path, sha: b.sha256) else { return fail("Not installed: the package list is malformed.") } + guard let path = got.path, let digest = got.sha256 else { return fail("Not installed: \(got.why ?? "the package could not be checked").") } + guard let cmd = ArmApps.installCommand(package: path, sha: digest) else { return fail("Not installed: the package list is malformed.") } self.armBusy(lead + "Waiting for your Mac password (a macOS window asks for it) to install the ARM translator...") DispatchQueue.main.async { NSApp.activate(ignoringOtherApps: true) } let r = Privileged.run(cmd, timeout: 20 * 60) @@ -383,22 +415,21 @@ extension App { } } - /// A 1401 for Windows request, consumed once: after a successful driver install (afterInstall, which also reads the - /// sticks still attached) or at the first launch after one (the profile setup saved under /Library/NullMoth). - func armWindowsRequest(afterInstall: Bool) { - guard ArmApps.job == nil else { return } - if !afterInstall { guard !ArmApps.autoChecked else { return }; ArmApps.autoChecked = true } + /// A 1401 for Windows request, shown once: at the first app launch after a driver install, when the profile setup + /// saved under /Library/NullMoth asks for ARM apps and nothing is decided yet, the page opens the ARM card with a + /// banner. Nothing is installed until the user presses Turn on there; Turn on, Turn off and "Not now" all record a + /// decision, which hides the banner for good. A CPU that cannot run translated apps gets the reason, not the button. + func armWindowsRequest() { + guard !ArmApps.autoChecked else { return } + ArmApps.autoChecked = true DispatchQueue.global(qos: .userInitiated).async { var records: [[String: Any]] = [] if let d = try? Data(contentsOf: URL(fileURLWithPath: ArmApps.installedProfile)), let j = try? JSONSerialization.jsonObject(with: d) as? [String: Any] { records.append(j) } - if afterInstall { records.append(App.machineProfile([])) } - let driverInstalled = afterInstall || !App.recordedDriverVersion().isEmpty - guard ArmApps.shouldHonourRequest(request: ArmApps.windowsRequest(records), decision: ArmApps.decision(), - driverInstalled: driverInstalled) else { return } - // already installed by hand before any decision was recorded: record it, nothing to install - if ArmApps.isInstalled { ArmApps.saveDecision(on: true, source: ArmApps.windowsSource); return self.armStatus() } - DispatchQueue.main.async { self.armTurnOn(source: ArmApps.windowsSource) } + guard let banner = ArmApps.banner(request: ArmApps.windowsRequest(records), decision: ArmApps.decision(), + driverInstalled: !App.recordedDriverVersion().isEmpty, + cpuFeatures: ArmApps.cpuFeatures()) else { return } + DispatchQueue.main.async { self.send("arm", banner) } } } diff --git a/mac/Sources/ReleaseSignature.swift b/mac/Sources/ReleaseSignature.swift index c50a428d..75afe4c3 100644 --- a/mac/Sources/ReleaseSignature.swift +++ b/mac/Sources/ReleaseSignature.swift @@ -20,6 +20,16 @@ enum ReleaseSignature { verify(zip: zip, signatureBase64: signatureBase64, publicKeyBase64: publicKeyBase64) } + // Same, over bytes already in memory: a caller that hashes and verifies one buffer cannot have the file swapped + // between the two checks. + static func verify(data: Data, signatureBase64: String) -> Bool { + let trimmed = signatureBase64.trimmingCharacters(in: .whitespacesAndNewlines) + guard let sig = Data(base64Encoded: trimmed), sig.count == 64, + let keyData = Data(base64Encoded: publicKeyBase64), + let key = try? Curve25519.Signing.PublicKey(rawRepresentation: keyData) else { return false } + return key.isValidSignature(sig, for: data) + } + // Same, with the public key passed in. The app always uses the compiled-in key; the extra argument lets the // test suite exercise this exact code against a throwaway keypair without touching the real release key. static func verify(zip: URL, signatureBase64: String, publicKeyBase64: String) -> Bool { diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index 980caef4..1f043c8b 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -1403,9 +1403,6 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe self.runningSetup = false if cancelled { self.send("run", ["state": "cancelled", "mode": mode]) } else { self.send("run", ["state": "end", "mode": mode, "ok": succeeded, "log": log.path]) } - // ARM apps asked for in 1401 for Windows: only after the driver install itself succeeded, and only - // after its result was reported, so it cannot change that result - if mode == "install" && succeeded && !cancelled { self.armWindowsRequest(afterInstall: true) } } } } diff --git a/mac/tools/test_arm_apps.py b/mac/tools/test_arm_apps.py index 50bce27c..2aea7467 100644 --- a/mac/tools/test_arm_apps.py +++ b/mac/tools/test_arm_apps.py @@ -30,9 +30,11 @@ def arm(name, ok, detail=""): # source-level arms fetch = src.split("static func fetch(", 1)[1].split("static func installCommand(", 1)[0] -arm("the package is checked against its SHA-256 and the release signature, and a bad one is deleted", - "sha256(dst) == b.sha256" in fetch and "ReleaseSignature.verify(zip: dst, signatureBase64: text)" in fetch +arm("the SHA-256 and the signature are checked on ONE in-memory buffer, written to disk only afterwards", + "let digest = hex(data)" in fetch and "ReleaseSignature.verify(data: data, signatureBase64: text)" in fetch + and "verify(zip:" not in fetch and fetch.index("verify(data: data") < fetch.index("data.write(to: dst") and fetch.count("removeItem(at: dst)") == 2) +arm("root is handed the digest of the verified buffer", "installCommand(package: path, sha: digest)" in src) arm("the manifest takes only https links, a 64-hex SHA-256 and a nullmoth-arm-*.tar.gz name", 'u.scheme == "https"' in src and 's.scheme == "https"' in src and "validSha(sha), validPackageName(n)" in src) inst = src.split("static func installCommand(", 1)[1].split("static func validUser(", 1)[0] @@ -58,19 +60,24 @@ def arm(name, ok, detail=""): ev = js.split("function armEvent(d)", 1)[1].split("\nfunction render(", 1)[0] arm("every error and refusal reaches the page escaped", 'kind === "error"' in ev and "esc(d.why)" in ev and "esc(c.why" in ev) auto = src.split("func armTurnOn(source:", 1)[1].split("func armWindowsRequest(", 1)[0] -arm("a request uses the same verified Turn on path and records source 1401-windows; its failure records off with the reason", +arm("the banner's Turn on is the same verified path, records source 1401-windows, and a failure records off with the reason", "ArmApps.saveDecision(on: true, source: source)" in auto and "ArmApps.saveDecision(on: false, source: source, skipped: why)" in auto - and "self.armTurnOn(source: ArmApps.windowsSource)" in src) + and 'b["from"] as? String == "windows" ? ArmApps.windowsSource' in src) arm("turning off by hand records the user's off", 'ArmApps.saveDecision(on: false, source: "user")' in src) -arm("the request fires only after a successful driver install, after its result went to the page, or at launch", - 'if mode == "install" && succeeded && !cancelled { self.armWindowsRequest(afterInstall: true) }' in main - and 'armWindowsRequest(afterInstall: false)' in src) +arm("Not now records a decision so the banner shows once", 'skipped: "not now"' in src) +arm("nothing installs on its own: the request only sends a banner, never calls Turn on", + "armTurnOn" not in src.split("func armWindowsRequest()", 1)[1].split("func armTurnOff()", 1)[0] + and "armWindowsRequest" not in main) +arm("the page opens Tools with the ARM card first and the banner on it", + 'kind === "request"' in js and '$("armreqon").hidden = !d.canRun' in js and 'sec.insertBefore(card, first)' in js + and 'id="armreq"' in html and 'id="armreqno"' in html) arm("Translate is enabled only when on and the check passed", '$("armtr").disabled = !(A.on && A.ok) || A.running' in js) # compile ArmApps.swift against stand-ins for the rest of the app STUBS = r''' import Foundation import AppKit +import CryptoKit let support = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("arm-test-support") let logs = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("arm-test-logs") func sh(_ path: String, _ args: [String]) -> String { @@ -80,11 +87,20 @@ def arm(name, ok, detail=""): let d = o.fileHandleForReading.readDataToEndOfFile(); p.waitUntilExit() return String(decoding: d, as: UTF8.self) } -func syncGet(_ url: URL, timeout: TimeInterval) -> Data? { nil } +// served from ARM_TEST_SERVE/ +func syncGet(_ url: URL, timeout: TimeInterval) -> Data? { + guard let dir = ProcessInfo.processInfo.environment["ARM_TEST_SERVE"] else { return nil } + return try? Data(contentsOf: URL(fileURLWithPath: dir).appendingPathComponent(url.lastPathComponent)) +} func sha256(_ url: URL) -> String? { nil } func redact(_ s: String) -> String { s } func sysctl(_ k: String) -> String { "" } -enum ReleaseSignature { static func verify(zip: URL, signatureBase64: String) -> Bool { false } } +// a stand-in key: the "signature" is the package's own SHA-256 prefixed with SIGNED: +enum ReleaseSignature { + static func verify(data: Data, signatureBase64: String) -> Bool { + signatureBase64 == "SIGNED:" + SHA256.hash(data: data).map { String(format: "%02x", $0) }.joined() + } +} enum Privileged { struct Result { let output: String; let error: String?; let cancelled: Bool } static func run(_ c: String, timeout: TimeInterval) -> Result { Result(output: "", error: nil, cancelled: false) } @@ -138,6 +154,24 @@ def arm(name, ok, detail=""): let d = ArmApps.decision()! print(before, d["on"] as! Bool, d["source"] as! String, d["skipped"] as! String) try? FileManager.default.removeItem(at: ArmApps.decisionFile) +case "banner": + // a[2]: request yes/no; a[3]: decision JSON or none; a[4]: cpu features + let dec = a[3] == "none" ? nil : (try! JSONSerialization.jsonObject(with: Data(a[3].utf8)) as! [String: Any]) + if let b = ArmApps.banner(request: a[2] == "yes", decision: dec, driverInstalled: true, cpuFeatures: a[4]) { + print(b["canRun"] as! Bool ? "BUTTON" : "NOBUTTON", b["text"] as! String) + } else { print("NONE") } +case "names2": + let u = { (s: String) in URL(string: s)! } + print(ArmApps.manifestNamesMatch(version: "1.2", name: "nullmoth-arm-1.2.tar.gz", url: u("https://x/d/nullmoth-arm-1.2.tar.gz")), + ArmApps.manifestNamesMatch(version: "1.2", name: "nullmoth-arm-1.3.tar.gz", url: u("https://x/d/nullmoth-arm-1.3.tar.gz")), + ArmApps.manifestNamesMatch(version: "1.2", name: "nullmoth-arm-1.2.tar.gz", url: u("https://x/d/nullmoth-driver-2.7.tar.gz")), + ArmApps.manifestNamesMatch(version: "../1", name: "nullmoth-arm-../1.tar.gz", url: u("https://x/d/1.tar.gz"))) +case "fetch": + // a[2]: sha the manifest claims; a[3]: sig file name + let b = ArmApps.Build(version: "1.0", name: "nullmoth-arm-1.0.tar.gz", url: URL(string: "https://x/nullmoth-arm-1.0.tar.gz")!, + sha256: a[2], sig: URL(string: "https://x/" + a[3])!) + let r = ArmApps.fetch(b) + print(r.path ?? "NOPATH", r.sha256 ?? "NOSHA", r.why ?? "OK") case "cpu": print(ArmApps.cpuGate(features: a[2]) ?? "OK") default: break @@ -184,10 +218,46 @@ def decide(records, decision, driver="yes"): arm("no driver install, no action", decide([req], None, "no") == "true false") arm("the decision record round-trips with its source and reason (and an absent file reads as no decision)", run("decision") == "true false 1401-windows no network", run("decision")) - full = "FPU SSE3 SSSE3 SSE4.1 SSE4.2 POPCNT CX16 AES AVX1.0 AVX2" - arm("a v2 CPU with AES passes the automatic path's CPU gate", run("cpu", full) == "OK", run("cpu", full)) + full = "FPU SSE3 PCLMULQDQ SSSE3 SSE4.1 SSE4.2 POPCNT AES AVX1.0 AVX2" + arm("a CPU with AES, PCLMULQDQ, SSE4.2 and POPCNT passes the gate (by features, any vendor)", run("cpu", full) == "OK", run("cpu", full)) out = run("cpu", full.replace(" AES", "")) - arm("negative control: no AES stops the automatic path before any download", "lacks AES" in out, out) + arm("negative control: no AES fails the gate with the reason", "lacks AES" in out, out) + + # the banner: shown once, for a request with no decision; a CPU that cannot run it gets the reason and no button + out = run("banner", "yes", "none", full) + arm("request + no decision shows the banner with Turn on", out.startswith("BUTTON 1401 for Windows set up ARM apps for this Mac. Press Turn on"), out) + out = run("banner", "yes", json.dumps({"on": False, "source": "1401-windows", "skipped": "not now"}), full) + arm("negative control: a prior decision (Not now) hides the banner", out == "NONE", out) + out = run("banner", "yes", json.dumps({"on": True, "source": "user"}), full) + arm("a prior decision (on) hides the banner", out == "NONE", out) + out = run("banner", "no", "none", full) + arm("no request means no banner", out == "NONE", out) + out = run("banner", "yes", "none", full.replace(" AES", "")) + arm("negative control: a CPU without AES shows the reason and no Turn on button", out.startswith("NOBUTTON") and "lacks AES" in out, out) + + names2 = run("names2") + arm("the manifest's name and link must be nullmoth-arm-.tar.gz (another product or version is refused)", + names2 == "true false false false", names2) + + # fetch: hash and signature on one buffer; a bad signature or SHA leaves nothing behind + import hashlib as _h + serve = d / "serve"; serve.mkdir() + payload = b"arm package bytes" + (serve / "nullmoth-arm-1.0.tar.gz").write_bytes(payload) + psha = _h.sha256(payload).hexdigest() + (serve / "good.sig").write_text("SIGNED:" + psha) + (serve / "bad.sig").write_text("SIGNED:" + "0" * 64) + env = dict(os.environ, ARM_TEST_SERVE=str(serve)) + frun = lambda *a: subprocess.run([str(exe), "fetch", *a], capture_output=True, text=True, timeout=60, env=env).stdout.split() + got = frun(psha, "good.sig") + arm("a signed package is written and its verified digest returned", + len(got) == 3 and got[1] == psha and got[2] == "OK" and pathlib.Path(got[0]).read_bytes() == payload, " ".join(got)) + fetched = pathlib.Path(got[0]) if got and got[0] != "NOPATH" else None + got = frun(psha, "bad.sig") + arm("negative control: a bad signature returns nothing and removes the download", + got[:2] == ["NOPATH", "NOSHA"] and (fetched is None or not fetched.exists()), " ".join(got)) + got = frun("1" * 64, "good.sig") + arm("negative control: bytes that differ from the manifest's SHA-256 return nothing", got[:2] == ["NOPATH", "NOSHA"], " ".join(got)) # the install line, run in a sandbox: a good package installs; a package swapped after the check does not run sandbox = d / "root"; sandbox.mkdir() @@ -213,6 +283,16 @@ def sandboxed(cmd): out = sandboxed(run("install", str(good), "0" * 64)) arm("negative control: a package whose bytes differ from the checked SHA-256 is refused and its installer never runs", "NULLMOTH_ARM_INSTALLED" not in out and "changed after it was checked" in out and not ran.exists(), out.strip()) + # the swap: the user-owned download changes after the app checked it; root re-hashes its own copy and refuses + swapped = d / "nullmoth-arm-1.0-swap.tar.gz" + shutil.copy(good, swapped) + cmd = run("install", str(swapped), sha) + with tarfile.open(swapped, "w:gz") as t: + t.add(pkgdir / "pkgroot", arcname="pkgroot") + extra = d / "evil"; extra.write_text("x"); t.add(extra, arcname="pkgroot/evil") + out = sandboxed(cmd) + arm("negative control: a package swapped after the check is refused by root and its installer never runs", + "NULLMOTH_ARM_INSTALLED" not in out and "changed after it was checked" in out and not ran.exists(), out.strip()) arm("a quote in the SHA-256 yields no command at all", run("install", str(good), "a" * 63 + "'") == "NIL") # the uninstall line: absent package = already off; refused when not root-owned or writable by others From aad24eaf9ef691ff24b803a2ef524de8949acbfa Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 04:00:36 -0800 Subject: [PATCH 060/244] 1401 Mac: ARM apps test names the request outcome as an offer, not an 1401 Mac: ARM apps test names the request outcome as an offer, not an install --- mac/tools/test_arm_apps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mac/tools/test_arm_apps.py b/mac/tools/test_arm_apps.py index 2aea7467..ded9c145 100644 --- a/mac/tools/test_arm_apps.py +++ b/mac/tools/test_arm_apps.py @@ -204,7 +204,7 @@ def arm(name, ok, detail=""): req = {"opt_in": {"arm_apps": True, "from": "1401-windows", "schema": 1}} def decide(records, decision, driver="yes"): return run("decide", json.dumps(records), "none" if decision is None else json.dumps(decision), driver) - arm("a request with no prior decision turns ARM apps on (installed profile's windows_candidates)", + arm("a request with no prior decision shows the offer (installed profile windows_candidates)", decide([{"windows_candidates": [{}, req]}], None) == "true true", decide([{"windows_candidates": [{}, req]}], None)) arm("a request read straight from a stick's profile counts too", decide([req], None) == "true true") arm("negative control: a prior off (user turned it off) is respected", From 15fb46c6165c73902d5e8ce85ae25240192ff295 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 04:15:08 -0800 Subject: [PATCH 061/244] 1401 Mac: ARM apps follows the translator package's interface nm-arm list is read in its object form ({"apps": [...]}), with "output" standing in for "path" on older builds; a refused remove shows nm-arm's own reason; the installer's exit codes become plain reasons. The CPU pre-check accepts PCLMUL in either spelling and leaves an empty sysctl answer to nm-arm check, which reads CPUID itself. --- mac/Sources/ArmApps.swift | 30 ++++++++++++++++++++++------ mac/tools/test_arm_apps.py | 40 +++++++++++++++++++++++++++++++++++--- 2 files changed, 61 insertions(+), 9 deletions(-) diff --git a/mac/Sources/ArmApps.swift b/mac/Sources/ArmApps.swift index 7a4dcce6..190d0a15 100644 --- a/mac/Sources/ArmApps.swift +++ b/mac/Sources/ArmApps.swift @@ -95,7 +95,11 @@ enum ArmApps { + "[ \"$h\" = \(sha) ] || { echo 'STOP: the package changed after it was checked'; exit 1; }; " + "/bin/mkdir \"$d/x\" && /usr/bin/tar -xzf \"$d/p.tar.gz\" -C \"$d/x\" || { echo 'STOP: the package did not unpack'; exit 1; }; " + "[ -f \"$d/x/pkgroot/install.sh\" ] || { echo 'STOP: the package has no installer'; exit 1; }; " - + "/bin/bash \"$d/x/pkgroot/install.sh\" && echo \(installedMarker)" + // the installer's exit codes: 3 checksum mismatch, 4 its compiler cannot run on this Mac, 5 copy failed + + "/bin/bash \"$d/x/pkgroot/install.sh\"; rc=$?; " + + "case $rc in 0) echo \(installedMarker);; 3) echo 'STOP: the package failed its own checksum';; " + + "4) echo 'STOP: the translator cannot run on this Mac';; 5) echo 'STOP: the files could not be copied';; " + + "*) echo \"STOP: the installer exited $rc\";; esac" } /// A short-name only (it is passed to the uninstaller as root and names whose translated copies are removed). @@ -135,16 +139,23 @@ enum ArmApps { /// open them. static func list() -> (apps: [[String: String]], why: String?) { let r = runCLI(["list"], seconds: 30) - guard let arr = r.json as? [Any] else { return ([], r.why ?? "nm-arm list did not return a list") } + guard let out = parseList(r.json) else { return ([], r.why ?? "nm-arm list did not return a list") } + return (out, r.why) + } + + /// nm-arm list prints {"apps": [...], "output_dir": ...}; each app has "path" (older builds: "output"). An entry + /// whose path is outside ~/Applications/NullMoth ARM is dropped. + static func parseList(_ json: Any?) -> [[String: String]]? { + guard let arr = ((json as? [String: Any])?["apps"] as? [Any]) ?? (json as? [Any]) else { return nil } var out: [[String: String]] = [] for e in arr { let o = e as? [String: Any] guard let name = (o?["name"] as? String) ?? (o?["app"] as? String) ?? (e as? String), validAppName(name) else { continue } - let path = (o?["path"] as? String) ?? outputDir.appendingPathComponent(name + ".app").path + let path = (o?["path"] as? String) ?? (o?["output"] as? String) ?? outputDir.appendingPathComponent(name + ".app").path guard inOutputDir(path) else { continue } out.append(["name": name, "path": path]) } - return (out, r.why) + return out } static func validAppName(_ n: String) -> Bool { @@ -161,7 +172,10 @@ enum ArmApps { guard validAppName(name) else { return "that is not a translated app's name" } let r = App.runBounded(URL(fileURLWithPath: cli), ["remove", name], seconds: 120) if r.timedOut { return "nm-arm remove did not finish within 2 minutes" } - if r.status != 0 { + // stdout is one line: {"ok":true,"removed":[...]} or {"ok":false,"why":"..."} + let j = (try? JSONSerialization.jsonObject(with: r.out)) as? [String: Any] + if r.status != 0 || j?["ok"] as? Bool == false { + if let why = j?["why"] as? String, !why.isEmpty { return "could not remove \(name): \(why)" } let text = String(decoding: r.out.prefix(400), as: UTF8.self).trimmingCharacters(in: .whitespacesAndNewlines) return "could not remove \(name) (nm-arm exited \(r.status))" + (text.isEmpty ? "" : ": " + text) } @@ -322,8 +336,12 @@ extension ArmApps { /// The CPU floor the translator needs: AES, PCLMULQDQ, SSE4.2 and POPCNT, the same minimum the package's own check /// uses. nm-arm check ships inside the package, so this runs before anything is offered. Features only, never the /// vendor: an AMD processor with these flags passes exactly as an Intel one does. + /// Some AMD systems leave these sysctl keys empty; the package then reads CPUID itself, so an empty answer is not a + /// refusal here, and nm-arm check decides after the install. PCLMUL is spelled PCLMULQDQ by macOS; both count. static func cpuGate(features: String) -> String? { - let have = Set(features.uppercased().split(whereSeparator: { $0 == " " || $0 == "\t" || $0 == "\n" }).map(String.init)) + var have = Set(features.uppercased().split(whereSeparator: { $0 == " " || $0 == "\t" || $0 == "\n" }).map(String.init)) + if have.isEmpty { return nil } + if have.contains("PCLMUL") { have.insert("PCLMULQDQ") } let missing = ["AES", "PCLMULQDQ", "SSE4.2", "POPCNT"].filter { !have.contains($0) } return missing.isEmpty ? nil : "this processor lacks \(missing.joined(separator: ", ")), which translated apps need" } diff --git a/mac/tools/test_arm_apps.py b/mac/tools/test_arm_apps.py index ded9c145..f39842df 100644 --- a/mac/tools/test_arm_apps.py +++ b/mac/tools/test_arm_apps.py @@ -38,7 +38,7 @@ def arm(name, ok, detail=""): arm("the manifest takes only https links, a 64-hex SHA-256 and a nullmoth-arm-*.tar.gz name", 'u.scheme == "https"' in src and 's.scheme == "https"' in src and "validSha(sha), validPackageName(n)" in src) inst = src.split("static func installCommand(", 1)[1].split("static func validUser(", 1)[0] -order = [inst.find(k) for k in ("mktemp -d /private/var/root/", "/bin/cp -X", "shasum -a 256", "tar -xzf", "install.sh\\\" && echo")] +order = [inst.find(k) for k in ("mktemp -d /private/var/root/", "/bin/cp -X", "shasum -a 256", "tar -xzf", "install.sh\\\"; rc=$?")] arm("root copies, re-checks the SHA-256 on its copy, then unpacks, then installs (in that order)", all(i >= 0 for i in order) and order == sorted(order), str(order)) turn_on = src.split("func armTurnOn(source:", 1)[1].split("func armTurnOff()", 1)[0] @@ -107,7 +107,11 @@ def arm(name, ok, detail=""): } final class App: NSObject { func send(_ e: String, _ d: Any) {} - static func runBounded(_ exe: URL, _ args: [String], seconds: Double) -> (status: Int32, out: Data, timedOut: Bool) { (0, Data(), false) } + // canned nm-arm answers from ARM_TEST_CLI_OUT / ARM_TEST_CLI_STATUS + static func runBounded(_ exe: URL, _ args: [String], seconds: Double) -> (status: Int32, out: Data, timedOut: Bool) { + let env = ProcessInfo.processInfo.environment + return (Int32(env["ARM_TEST_CLI_STATUS"] ?? "0") ?? 0, Data((env["ARM_TEST_CLI_OUT"] ?? "").utf8), false) + } static func machineProfile(_ g: [[String: Any]]) -> [String: Any] { [:] } static func recordedDriverVersion() -> String { "" } } @@ -172,6 +176,11 @@ def arm(name, ok, detail=""): sha256: a[2], sig: URL(string: "https://x/" + a[3])!) let r = ArmApps.fetch(b) print(r.path ?? "NOPATH", r.sha256 ?? "NOSHA", r.why ?? "OK") +case "list": + let l = ArmApps.parseList(try? JSONSerialization.jsonObject(with: Data(a[2].utf8))) + print(l.map { $0.map { $0["name"]! + "=" + $0["path"]! }.joined(separator: ";") } ?? "NIL") +case "remove": + print(ArmApps.remove(a[2]) ?? "OK") case "cpu": print(ArmApps.cpuGate(features: a[2]) ?? "OK") default: break @@ -232,6 +241,8 @@ def decide(records, decision, driver="yes"): arm("a prior decision (on) hides the banner", out == "NONE", out) out = run("banner", "no", "none", full) arm("no request means no banner", out == "NONE", out) + arm("an empty CPU answer (AMD without the sysctl keys) is left to nm-arm check, not refused", run("cpu", " ") == "OK", run("cpu", " ")) + arm("PCLMUL spelled either way counts", run("cpu", full.replace("PCLMULQDQ", "PCLMUL")) == "OK") out = run("banner", "yes", "none", full.replace(" AES", "")) arm("negative control: a CPU without AES shows the reason and no Turn on button", out.startswith("NOBUTTON") and "lacks AES" in out, out) @@ -239,6 +250,23 @@ def decide(records, decision, driver="yes"): arm("the manifest's name and link must be nullmoth-arm-.tar.gz (another product or version is refused)", names2 == "true false false false", names2) + # nm-arm list / remove in the package's real shapes (runCLI needs the installed command, so only when it exists) + o = str(pathlib.Path.home() / "Applications/NullMoth ARM") + def cli(out, status="0", *a): + e = dict(os.environ, ARM_TEST_CLI_OUT=out, ARM_TEST_CLI_STATUS=status) + return subprocess.run([str(exe), *a], capture_output=True, text=True, timeout=60, env=e).stdout.strip() + listing = json.dumps({"apps": [{"name": "L6", "path": o + "/L6.app", "output": o + "/L6.app"}, + {"name": "Old", "output": o + "/Old.app"}, + {"name": "Evil", "path": "/Applications/Safari.app"}], "output_dir": o}) + out = run("list", listing) + arm("nm-arm list's object form is read, output stands in for path, a path outside the folder is dropped", + out == f"L6={o}/L6.app;Old={o}/Old.app", out) + arm("negative control: a list that is neither the object nor an array is refused", run("list", '{"x":1}') == "NIL") + out = cli(json.dumps({"ok": False, "why": "L7 is not in the manifest"}), "2", "remove", "L7") + arm("a refused remove shows nm-arm's own reason", out == "could not remove L7: L7 is not in the manifest", out) + out = cli(json.dumps({"ok": True, "removed": ["L6"]}), "0", "remove", "L6") + arm("a successful remove reports nothing wrong", out == "OK", out) + # fetch: hash and signature on one buffer; a bad signature or SHA leaves nothing behind import hashlib as _h serve = d / "serve"; serve.mkdir() @@ -263,7 +291,7 @@ def decide(records, decision, driver="yes"): sandbox = d / "root"; sandbox.mkdir() pkgdir = d / "pkg"; (pkgdir / "pkgroot").mkdir(parents=True) ran = d / "installer-ran" - (pkgdir / "pkgroot/install.sh").write_text(f"#!/bin/bash\ntouch '{ran}'\n") + (pkgdir / "pkgroot/install.sh").write_text(f"#!/bin/bash\ntouch '{ran}'\nexit ${{FAKE_RC:-0}}\n") good = d / "nullmoth-arm-1.0.tar.gz" with tarfile.open(good, "w:gz") as t: t.add(pkgdir / "pkgroot", arcname="pkgroot") @@ -293,6 +321,12 @@ def sandboxed(cmd): out = sandboxed(cmd) arm("negative control: a package swapped after the check is refused by root and its installer never runs", "NULLMOTH_ARM_INSTALLED" not in out and "changed after it was checked" in out and not ran.exists(), out.strip()) + ran.unlink(missing_ok=True) + os.environ["FAKE_RC"] = "4" + out = sandboxed(run("install", str(good), sha)) + del os.environ["FAKE_RC"] + arm("negative control: an installer that exits 4 gives its reason and no success marker", + "NULLMOTH_ARM_INSTALLED" not in out and "cannot run on this Mac" in out, out.strip()) arm("a quote in the SHA-256 yields no command at all", run("install", str(good), "a" * 63 + "'") == "NIL") # the uninstall line: absent package = already off; refused when not root-owned or writable by others From 5daf813bfced963d88f560a42d3381770519dd7a Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 04:19:54 -0800 Subject: [PATCH 062/244] 1401 Mac: ARM apps card shows the check's note nm-arm check now carries a "note" when the system seems to hide CPU features (a virtual machine, for example); the card shows it. The CPU pre-check steps aside when any of the three sysctl feature lists is blank, since the package reads CPUID itself then. --- mac/Resources/app.js | 2 ++ mac/Sources/ArmApps.swift | 5 ++++- mac/tools/test_arm_apps.py | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mac/Resources/app.js b/mac/Resources/app.js index c090fa94..a0ca0136 100644 --- a/mac/Resources/app.js +++ b/mac/Resources/app.js @@ -27,6 +27,8 @@ function armEvent(d) { if (!A.on) t += "Off. Nothing is installed."; else if (c.ok === true) t += `This Mac can run translated apps` + (c.target ? ` (${esc(c.target)})` : "") + "."; else t += `${esc(c.why || "This Mac did not pass the check.")}`; + // nm-arm check's "note": a sentence for the user when the system seems to hide CPU features (a VM, for example) + if (A.on && c.note) t += `
${esc(c.note)}`; if (d.listWhy) t += `
${esc(d.listWhy)}`; $("armr").innerHTML = t; $("armclt").hidden = !(A.on && c.prerequisites && c.prerequisites.clt === false); diff --git a/mac/Sources/ArmApps.swift b/mac/Sources/ArmApps.swift index 190d0a15..3cb5b72f 100644 --- a/mac/Sources/ArmApps.swift +++ b/mac/Sources/ArmApps.swift @@ -346,8 +346,11 @@ extension ArmApps { return missing.isEmpty ? nil : "this processor lacks \(missing.joined(separator: ", ")), which translated apps need" } + /// The three feature lists, or "" when any of them is blank: the package then reads CPUID itself, and so this + /// pre-check steps aside rather than refuse on a partial answer. static func cpuFeatures() -> String { - ["machdep.cpu.features", "machdep.cpu.leaf7_features", "machdep.cpu.extfeatures"].map { sysctl($0) }.joined(separator: " ") + let parts = ["machdep.cpu.features", "machdep.cpu.leaf7_features", "machdep.cpu.extfeatures"].map { sysctl($0) } + return parts.contains { $0.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty } ? "" : parts.joined(separator: " ") } } diff --git a/mac/tools/test_arm_apps.py b/mac/tools/test_arm_apps.py index f39842df..7632b0a5 100644 --- a/mac/tools/test_arm_apps.py +++ b/mac/tools/test_arm_apps.py @@ -71,6 +71,9 @@ def arm(name, ok, detail=""): arm("the page opens Tools with the ARM card first and the banner on it", 'kind === "request"' in js and '$("armreqon").hidden = !d.canRun' in js and 'sec.insertBefore(card, first)' in js and 'id="armreq"' in html and 'id="armreqno"' in html) +arm("nm-arm check's note is shown in the card, escaped", "if (A.on && c.note)" in ev and "esc(c.note)" in ev) +arm("a partly blank sysctl answer steps the pre-check aside (the package reads CPUID then)", + "parts.contains { $0.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty } ? \"\"" in src) arm("Translate is enabled only when on and the check passed", '$("armtr").disabled = !(A.on && A.ok) || A.running' in js) # compile ArmApps.swift against stand-ins for the rest of the app From 9c20d4faa132814b00234fac9e2bca9b02110ea3 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 03:40:56 -0800 Subject: [PATCH 063/244] Windows: opt-in ARM apps request carried to the Mac app on the stick A write-page checkbox, off by default and offered only on a stick that carries the NVIDIA driver. Ticked, the stick's NullMoth/system-profile.json gains "opt_in": {"arm_apps": true, "from": "1401-windows", "schema": 1}; unticked, the file is byte-identical to before. The Mac app honours it once after the driver is set up, through its own signed install and CPU check. --- p1401/machine_handoff.py | 15 ++++- p1401/usbwriter.py | 18 ++++-- tests/test_arm_apps_opt_in.py | 112 ++++++++++++++++++++++++++++++++++ windows/App/Loc.cs | 2 + windows/App/MainForm.cs | 25 +++++++- 5 files changed, 162 insertions(+), 10 deletions(-) create mode 100644 tests/test_arm_apps_opt_in.py diff --git a/p1401/machine_handoff.py b/p1401/machine_handoff.py index c09cf6b1..3e33c113 100644 --- a/p1401/machine_handoff.py +++ b/p1401/machine_handoff.py @@ -71,7 +71,20 @@ def verified(build, report_path=None): return value -def copy_to_installer(value, root): +def opt_in(arm_apps=False): + """The choices made in 1401 for Windows that the Mac app acts on after macOS is installed. None when nothing was + chosen, so an unticked build writes the same profile as before the choice existed. + + The Mac app reads every stick's NullMoth/system-profile.json into its machine profile and the driver setup keeps + that record in /Library/NullMoth/system-profile.json, so the request survives the stick being removed. The Mac app + honours "arm_apps" once, only when its own ARM apps switch has no recorded decision, and only through its signed + and SHA-256 checked install after its CPU check passes.""" + return {'arm_apps': True, 'from': '1401-windows', 'schema': 1} if arm_apps else None + + +def copy_to_installer(value, root, opt_in=None): + if opt_in: + value = dict(value, opt_in=dict(opt_in)) folder = os.path.join(root, 'NullMoth') os.makedirs(folder, exist_ok=True) path = os.path.join(folder, 'system-profile.json') diff --git a/p1401/usbwriter.py b/p1401/usbwriter.py index 807413c4..a7535b20 100644 --- a/p1401/usbwriter.py +++ b/p1401/usbwriter.py @@ -544,7 +544,8 @@ def _diskpart(script): os.remove(sp) -def write(disk, efi_build_dir, recovery_info, allow_large=False, progress=None, machine_profile=None, erase_os=False): +def write(disk, efi_build_dir, recovery_info, allow_large=False, progress=None, machine_profile=None, erase_os=False, + opt_in=None): """Erases the stick, then writes Apple's recovery image (checked chunk by chunk) and the EFI. Returns the drive root.""" from . import apple # noqa: PLC0415 ok, why = eligible(disk, allow_large) @@ -561,7 +562,7 @@ def write(disk, efi_build_dir, recovery_info, allow_large=False, progress=None, raise UsbError('The machine profile changed before erasing the stick. Rebuild the EFI.') if disk.get("Via") == "Win32_DiskDrive": root = _write_wmi_erase(disk, erase_os) - return _write_payload(root, efi_build_dir, recovery_info, progress, machine_profile, stick_name(disk)) + return _write_payload(root, efi_build_dir, recovery_info, progress, machine_profile, stick_name(disk), opt_in) _ps(check_script(disk, erase_os)) from . import rawdisk # noqa: PLC0415 n = int(disk["Number"]) @@ -691,7 +692,7 @@ def write(disk, efi_build_dir, recovery_info, allow_large=False, progress=None, # the stick search's own answer (empty when it found nothing) is now part of it. seen = " ".join((out or "").split())[-300:] raise UsbError(f"diskpart finished but {root} did not appear (the stick search said: {seen or 'nothing'})") - return _write_payload(root, efi_build_dir, recovery_info, progress, machine_profile, stick_name(disk)) + return _write_payload(root, efi_build_dir, recovery_info, progress, machine_profile, stick_name(disk), opt_in) def _write_wmi_erase(disk, erase_os): @@ -723,7 +724,7 @@ def stick_name(disk): return both or "the USB stick" -def _write_payload(root, efi_build_dir, recovery_info, progress, machine_profile, stick="the USB stick"): +def _write_payload(root, efi_build_dir, recovery_info, progress, machine_profile, stick="the USB stick", opt_in=None): """Everything after the erase: the recovery image (checked as it arrives and read back), the EFI, the driver.""" from . import apple # noqa: PLC0415 from . import machine_handoff # noqa: PLC0415 @@ -771,7 +772,7 @@ def _write_payload(root, efi_build_dir, recovery_info, progress, machine_profile os.makedirs(cache, exist_ok=True) driver = nullmoth.stage(root, cache, fetch=_fetch) if machine_profile is not None: - machine_handoff.copy_to_installer(machine_profile, root) + machine_handoff.copy_to_installer(machine_profile, root, opt_in) return {"root": root, "nullmoth": driver, **got} @@ -978,6 +979,7 @@ def same_size(d): def cli_write(argv): """write [--driver ] [--extra ]... [--profile ] [--allow-large] + [--arm-apps] The Windows app's write step. Every line printed is "STEP|OK|PROGRESS|STOP ..." so the window can show it.""" from . import apple, nullmoth, netsupport # noqa: PLC0415 num, efi, darwin = int(argv[0]), argv[1], int(argv[2]) @@ -1066,10 +1068,14 @@ def progress(done, total, *_): if pct != last[0]: last[0] = pct; print(f"PROGRESS {pct} downloading macOS recovery from Apple", flush=True) print(f"STEP erasing and writing disk {num} ({disk.get('FriendlyName')})", flush=True) + opt_in = machine_handoff.opt_in(arm_apps="--arm-apps" in argv) res = write(disk, efi, info, allow_large="--allow-large" in argv, progress=progress, machine_profile=handoff, - erase_os="--erase-os-partitions" in argv) + erase_os="--erase-os-partitions" in argv, opt_in=opt_in) root = res["root"] print('OK verified build profile written to the stick (live identity remains unverified)', flush=True) + if opt_in: + print('OK ARM apps requested: the 1401 Mac app sets them up after the NVIDIA driver, if this Mac can run them', + flush=True) for f in opt("--extra"): d = os.path.join(root, "NullMoth"); os.makedirs(d, exist_ok=True) shutil.copyfile(f, os.path.join(d, os.path.basename(f))) diff --git a/tests/test_arm_apps_opt_in.py b/tests/test_arm_apps_opt_in.py new file mode 100644 index 00000000..ead55e31 --- /dev/null +++ b/tests/test_arm_apps_opt_in.py @@ -0,0 +1,112 @@ +"""The ARM apps choice on the write page is OFF unless the user ticks it, and unticked the stick is written exactly as +before. + +Ticked, the stick's NullMoth/system-profile.json carries one extra top-level key, + "opt_in": {"arm_apps": true, "from": "1401-windows", "schema": 1} +which the Mac app reads (it already loads every stick's system-profile.json into its machine profile, and the driver +setup keeps that record in /Library/NullMoth/system-profile.json). The Mac app acts on it once, after the NVIDIA driver +is set up, through its own signed and SHA-256 checked install and only when its CPU check passes. Nothing on Windows +downloads or installs the ARM package. + +The arms drive the real copy_to_installer() and cli_write() with the disk and Apple stubbed, and read the window's +source for the default and the flag it passes. +""" +import json +import pathlib +import tempfile +import unittest +from types import SimpleNamespace +from unittest.mock import patch + +from p1401 import machine_handoff, usbwriter + +ROOT = pathlib.Path(__file__).resolve().parents[1] +FORM = (ROOT / "windows/App/MainForm.cs").read_text(encoding="utf-8") +LOC = (ROOT / "windows/App/Loc.cs").read_text(encoding="utf-8") +REQUEST = {"arm_apps": True, "from": "1401-windows", "schema": 1} + + +class ArmAppsOptIn(unittest.TestCase): + def setUp(self): + self.temp = tempfile.TemporaryDirectory() + self.addCleanup(self.temp.cleanup) + self.root = pathlib.Path(self.temp.name) + self.build = self.root / "build" + (self.build / "EFI/OC").mkdir(parents=True) + (self.build / "EFI/OC/config.plist").write_bytes(b"validated configuration") + self.scan = self.root / "Report.json" + self.scan.write_text(json.dumps({"CPU": {"Processor Name": "Processor"}, "GPU": {}})) + result = SimpleNamespace(hardware={"CPU": {"Processor Name": "Processor"}, "GPU": {}}, disabled_devices={}, + acpi_fingerprints=[], out_dir=str(self.build), macos_version="24.6.0", smbios="iMacPro1,1") + self.value = machine_handoff.create(str(self.scan), result) + + def stick(self, name, opt_in): + machine_handoff.copy_to_installer(self.value, str(self.root / name), opt_in) + return (self.root / name / "NullMoth/system-profile.json").read_bytes() + + def test_unticked_writes_the_same_bytes_as_before_the_choice_existed(self): + # the pre-choice call shape (two arguments) is the reference + machine_handoff.copy_to_installer(self.value, str(self.root / "old")) + before = (self.root / "old/NullMoth/system-profile.json").read_bytes() + self.assertEqual(self.stick("unticked", machine_handoff.opt_in(arm_apps=False)), before) + self.assertNotIn(b"opt_in", before) + + def test_ticked_adds_only_the_opt_in_key(self): + plain = json.loads(self.stick("plain", None)) + ticked = json.loads(self.stick("ticked", machine_handoff.opt_in(arm_apps=True))) + self.assertEqual(ticked.pop("opt_in"), REQUEST) + self.assertEqual(ticked, plain) + + def test_ticking_does_not_touch_the_build_bound_profile(self): + self.stick("ticked", machine_handoff.opt_in(arm_apps=True)) + self.assertNotIn("opt_in", self.value) + self.assertEqual(machine_handoff.verified(str(self.build), str(self.scan)), self.value) + + def run_cli(self, *flags): + disk = {"Number": 3, "BusType": "USB", "Size": 16 * 10**9, "FriendlyName": "Stick"} + seen = {} + + def fake_write(*a, **k): + seen.update(k) + return {"root": str(self.root / "cli")} + with patch.object(usbwriter, "list_disks", return_value=[disk]), \ + patch.object(usbwriter, "eligible", return_value=(True, [])), \ + patch.object(usbwriter, "write", fake_write), \ + patch("p1401.apple.local_image", return_value={"name": "local", "local": True}), \ + patch("p1401.netsupport.needs_local_image", return_value=False), \ + patch("builtins.print") as out: + rc = usbwriter.cli_write(["3", str(self.build), "24", "--profile", str(self.scan), *flags]) + printed = " ".join(str(c.args[0]) for c in out.call_args_list if c.args) + return rc, seen, printed + + def test_cli_without_the_flag_requests_nothing(self): + rc, seen, printed = self.run_cli() + self.assertEqual(rc, 0) + self.assertIn("opt_in", seen) + self.assertIsNone(seen["opt_in"]) + self.assertNotIn("ARM apps", printed) + + def test_cli_with_the_flag_carries_the_request_to_the_stick(self): + rc, seen, printed = self.run_cli("--arm-apps") + self.assertEqual(rc, 0) + self.assertEqual(seen["opt_in"], REQUEST) + self.assertIn("ARM apps requested", printed) + + def test_window_box_is_off_by_default_and_passes_the_flag_only_when_ticked(self): + self.assertIn("armApps.Checked = false;", FORM) + self.assertEqual(FORM.count("--arm-apps"), 1) + self.assertIn('if (armApps.Checked && armApps.Visible) args += " --arm-apps";', FORM) + # shown on the write page only, only for a stick that carries the NVIDIA driver, frozen once written + self.assertIn('if (summary.Contains("NVIDIA")) Show(disks, refresh, armApps, bar, log); else Show(disks, refresh, bar, log);', FORM) + self.assertIn("armApps.Enabled = !written;", FORM) + self.assertIn("armApps.SetBounds(", FORM) + + def test_window_text_is_translated(self): + start = FORM.index('armApps.Text = Loc.T("') + len('armApps.Text = Loc.T("') + text = FORM[start:FORM.index('");', start)] + self.assertIn("(opt-in)", text) + self.assertIn('{ "' + text + '",', LOC) + + +if __name__ == "__main__": + unittest.main() diff --git a/windows/App/Loc.cs b/windows/App/Loc.cs index 523b3fe7..05d25c09 100644 --- a/windows/App/Loc.cs +++ b/windows/App/Loc.cs @@ -64,6 +64,8 @@ static class Loc { "macOS 26 Tahoe", "macOS 26 Tahoe" }, { "Include experimental drivers (Wi-Fi, AMD RDNA 4 graphics, USB and power fixes)", "包含实验性驱动程序(Wi-Fi、AMD RDNA 4 显卡、USB 与电源修复)" }, + { "Also set up ARM apps (opt-in): after the NVIDIA driver, the 1401 Mac app installs NullMoth's ARM app support if this Mac's processor can run it.", + "同时设置 ARM 应用(可选):装好 NVIDIA 驱动后,如果这台 Mac 的处理器支持,1401 Mac 应用会安装 NullMoth 的 ARM 应用支持。" }, { "Credits", "致谢" }, { " for this PC, as a ", ",为本机生成的机型为 " }, { ". The startup files passed OpenCore's own check.", "。启动文件已通过 OpenCore 自带的检查。" }, diff --git a/windows/App/MainForm.cs b/windows/App/MainForm.cs index a88df303..d56e5adf 100644 --- a/windows/App/MainForm.cs +++ b/windows/App/MainForm.cs @@ -32,6 +32,10 @@ class MainForm : Form // Off unless the user ticks it: the community AMD RDNA 4 display driver and the MediaTek Wi-Fi driver are // unproven on most of the hardware they claim, and each takes over something the machine needs to be usable. readonly CheckBox expDrivers = new CheckBox(); + // Off unless the user ticks it. Ticked, the stick's NullMoth\system-profile.json carries an "opt_in" request that + // the Mac app honours once, after the NVIDIA driver is set up, through its own signed install and CPU check. + // Unticked, the stick is written exactly as before. + readonly CheckBox armApps = new CheckBox(); readonly Button refresh = new Button(); readonly WebBrowser guide = new WebBrowser(); readonly LinkLabel ocLink = new LinkLabel(); @@ -139,6 +143,9 @@ public MainForm(bool verificationMode = false) expDrivers.BackColor = Color.Transparent; expDrivers.ForeColor = Theme.Text; expDrivers.Font = Theme.Picker; // Including them changes which kexts the build carries, so a finished build is no longer the right one. expDrivers.CheckedChanged += (s, e) => { if (built && !busy) { built = false; summary = ""; Go(2); } }; + armApps.Text = Loc.T("Also set up ARM apps (opt-in): after the NVIDIA driver, the 1401 Mac app installs NullMoth's ARM app support if this Mac's processor can run it."); + armApps.AutoSize = true; armApps.Checked = false; + armApps.BackColor = Color.Transparent; armApps.ForeColor = Theme.Text; armApps.Font = Theme.Picker; guide.ScriptErrorsSuppressed = true; ocLink.Text = Loc.T("OpenCore Install Guide (dortania.github.io/OpenCore-Install-Guide)"); ocLink.AutoSize = true; ocLink.LinkColor = Theme.Cyan; ocLink.Font = Theme.Link; @@ -173,7 +180,7 @@ public MainForm(bool verificationMode = false) if (busy || firmwareGuideFile == null || !File.Exists(firmwareGuideFile)) return; prerequisiteReturnPage = page; showingPrerequisites = true; Go(3); }; - body.Controls.AddRange(new Control[] { title, note, facts, bar, log, disks, refresh, osPick, expDrivers, guide, ocLink, logLink, coffeeLink, creditsLink, drvLink, appLink, doctorLink, firmwareLink }); + body.Controls.AddRange(new Control[] { title, note, facts, bar, log, disks, refresh, osPick, expDrivers, guide, ocLink, logLink, coffeeLink, creditsLink, drvLink, appLink, doctorLink, firmwareLink, armApps }); Controls.Add(body); Controls.Add(nav); Controls.Add(foot); Controls.Add(head); // The stars drift: ten frames a second repaint the glass panels and the see-through text on them, never the @@ -316,6 +323,14 @@ void LayoutBody() cursor = Math.Max(disks.Bottom, refresh.Bottom) + 12; } + if (armApps.Visible) + { + armApps.AutoSize = false; + int armHeight = Math.Max(24, armApps.GetPreferredSize(new Size(width, 0)).Height); + armApps.SetBounds(left, cursor, width, armHeight); + cursor = armApps.Bottom + 12; + } + if (bar.Visible) { bar.SetBounds(left, cursor, width, Math.Max(18, bar.Height)); @@ -445,7 +460,7 @@ void Say(string s) void Show(params Control[] on) { - foreach (Control c in new Control[] { facts, bar, log, disks, refresh, osPick, expDrivers, guide, ocLink, logLink }) c.Visible = on.Contains(c); + foreach (Control c in new Control[] { facts, bar, log, disks, refresh, osPick, expDrivers, guide, ocLink, logLink, armApps }) c.Visible = on.Contains(c); drvLink.Visible = logLink.Visible; appLink.Visible = logLink.Visible; coffeeLink.Visible = logLink.Visible; @@ -519,7 +534,10 @@ void Go(int p) case 4: note.Text = Loc.T("Plug in the USB stick that will become the macOS installer. EVERYTHING on it is erased.\r\n" + "1401 downloads macOS from Apple onto it and adds the startup files") + Loc.T(summary.Contains("NVIDIA") ? " and the NullMoth NVIDIA driver." : "."); - next.Text = Loc.T(written ? "Continue >" : "Erase and create"); Show(disks, refresh, bar, log); next.Enabled = true; FillDisks(); break; + next.Text = Loc.T(written ? "Continue >" : "Erase and create"); + // the ARM apps request is acted on after the NVIDIA driver is set up, so only a stick that carries it offers it + if (summary.Contains("NVIDIA")) Show(disks, refresh, armApps, bar, log); else Show(disks, refresh, bar, log); + armApps.Enabled = !written; next.Enabled = true; FillDisks(); break; case 5: note.Text = Loc.T("The macOS stick is ready.\r\n\r\n1. Restart and open your board's boot menu (the key is in your BIOS steps), then choose the stick.\r\n" + "2. In the 1401 boot menu choose \"Install macOS\" and follow Apple's installer. The screen can stay still for up to two minutes while macOS is read from the stick: do not restart.\r\n" + @@ -727,6 +745,7 @@ async void OnNext() var report = Path.Combine(scanDir, "Report.json"); if (File.Exists(report)) args += " --profile " + Engine.Q(report); if (d.Size > 256UL * 1024 * 1024 * 1024) args += " --allow-large"; + if (armApps.Checked && armApps.Visible) args += " --arm-apps"; var writeLines = new List(); int rc = await Engine.Run(args, l => { writeLines.Add(l); Say(l); }); // The stick holds a Mac or Windows partition (an older macOS installer, or a disk with a system on it). From 3a7c1036a3985054c4714ca6a9d437ec5aba4d10 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 03:48:27 -0800 Subject: [PATCH 064/244] Windows: ARM apps text says the Mac app offers a one-click finish Windows: ARM apps text says the Mac app offers a one-click finish, not an automatic install --- p1401/machine_handoff.py | 5 +++-- p1401/usbwriter.py | 2 +- tests/test_arm_apps_opt_in.py | 9 ++++++--- windows/App/Loc.cs | 4 ++-- windows/App/MainForm.cs | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/p1401/machine_handoff.py b/p1401/machine_handoff.py index 3e33c113..08a2248f 100644 --- a/p1401/machine_handoff.py +++ b/p1401/machine_handoff.py @@ -77,8 +77,9 @@ def opt_in(arm_apps=False): The Mac app reads every stick's NullMoth/system-profile.json into its machine profile and the driver setup keeps that record in /Library/NullMoth/system-profile.json, so the request survives the stick being removed. The Mac app - honours "arm_apps" once, only when its own ARM apps switch has no recorded decision, and only through its signed - and SHA-256 checked install after its CPU check passes.""" + acts on "arm_apps" once, only when it has no recorded ARM apps decision: it offers the user one click to finish the + setup (the signed and SHA-256 checked install, with the password asked once), or names the reason this Mac's + processor cannot run it. Nothing is installed without the user pressing Turn on.""" return {'arm_apps': True, 'from': '1401-windows', 'schema': 1} if arm_apps else None diff --git a/p1401/usbwriter.py b/p1401/usbwriter.py index a7535b20..7fd35d75 100644 --- a/p1401/usbwriter.py +++ b/p1401/usbwriter.py @@ -1074,7 +1074,7 @@ def progress(done, total, *_): root = res["root"] print('OK verified build profile written to the stick (live identity remains unverified)', flush=True) if opt_in: - print('OK ARM apps requested: the 1401 Mac app sets them up after the NVIDIA driver, if this Mac can run them', + print('OK ARM apps requested: after macOS starts, the 1401 Mac app offers to finish setting them up, if this Mac can run them', flush=True) for f in opt("--extra"): d = os.path.join(root, "NullMoth"); os.makedirs(d, exist_ok=True) diff --git a/tests/test_arm_apps_opt_in.py b/tests/test_arm_apps_opt_in.py index ead55e31..5ed021d2 100644 --- a/tests/test_arm_apps_opt_in.py +++ b/tests/test_arm_apps_opt_in.py @@ -4,9 +4,9 @@ Ticked, the stick's NullMoth/system-profile.json carries one extra top-level key, "opt_in": {"arm_apps": true, "from": "1401-windows", "schema": 1} which the Mac app reads (it already loads every stick's system-profile.json into its machine profile, and the driver -setup keeps that record in /Library/NullMoth/system-profile.json). The Mac app acts on it once, after the NVIDIA driver -is set up, through its own signed and SHA-256 checked install and only when its CPU check passes. Nothing on Windows -downloads or installs the ARM package. +setup keeps that record in /Library/NullMoth/system-profile.json). On its first launch after setup the Mac app offers +one click to finish the signed, SHA-256 checked install, or names why this Mac's processor cannot run it. Nothing on +Windows downloads or installs the ARM package, and the window's text must not promise more than that offer. The arms drive the real copy_to_installer() and cli_write() with the disk and Apple stubbed, and read the window's source for the default and the flag it passes. @@ -105,6 +105,9 @@ def test_window_text_is_translated(self): start = FORM.index('armApps.Text = Loc.T("') + len('armApps.Text = Loc.T("') text = FORM[start:FORM.index('");', start)] self.assertIn("(opt-in)", text) + # the Mac side offers a click, it does not install by itself: the text must say so and never claim an install + self.assertIn("offers to finish", text) + self.assertNotIn("installs", text) self.assertIn('{ "' + text + '",', LOC) diff --git a/windows/App/Loc.cs b/windows/App/Loc.cs index 05d25c09..d83648d3 100644 --- a/windows/App/Loc.cs +++ b/windows/App/Loc.cs @@ -64,8 +64,8 @@ static class Loc { "macOS 26 Tahoe", "macOS 26 Tahoe" }, { "Include experimental drivers (Wi-Fi, AMD RDNA 4 graphics, USB and power fixes)", "包含实验性驱动程序(Wi-Fi、AMD RDNA 4 显卡、USB 与电源修复)" }, - { "Also set up ARM apps (opt-in): after the NVIDIA driver, the 1401 Mac app installs NullMoth's ARM app support if this Mac's processor can run it.", - "同时设置 ARM 应用(可选):装好 NVIDIA 驱动后,如果这台 Mac 的处理器支持,1401 Mac 应用会安装 NullMoth 的 ARM 应用支持。" }, + { "Also set up ARM apps (opt-in): after macOS starts, 1401 offers to finish setting up ARM app support with one click, if this Mac's processor can run it.", + "同时设置 ARM 应用(可选):macOS 启动后,如果这台 Mac 的处理器支持,1401 会提示你一键完成 ARM 应用支持的设置。" }, { "Credits", "致谢" }, { " for this PC, as a ", ",为本机生成的机型为 " }, { ". The startup files passed OpenCore's own check.", "。启动文件已通过 OpenCore 自带的检查。" }, diff --git a/windows/App/MainForm.cs b/windows/App/MainForm.cs index d56e5adf..8e3924fe 100644 --- a/windows/App/MainForm.cs +++ b/windows/App/MainForm.cs @@ -143,7 +143,7 @@ public MainForm(bool verificationMode = false) expDrivers.BackColor = Color.Transparent; expDrivers.ForeColor = Theme.Text; expDrivers.Font = Theme.Picker; // Including them changes which kexts the build carries, so a finished build is no longer the right one. expDrivers.CheckedChanged += (s, e) => { if (built && !busy) { built = false; summary = ""; Go(2); } }; - armApps.Text = Loc.T("Also set up ARM apps (opt-in): after the NVIDIA driver, the 1401 Mac app installs NullMoth's ARM app support if this Mac's processor can run it."); + armApps.Text = Loc.T("Also set up ARM apps (opt-in): after macOS starts, 1401 offers to finish setting up ARM app support with one click, if this Mac's processor can run it."); armApps.AutoSize = true; armApps.Checked = false; armApps.BackColor = Color.Transparent; armApps.ForeColor = Theme.Text; armApps.Font = Theme.Picker; guide.ScriptErrorsSuppressed = true; From 51817313d60f5570d4b563b38d33fa7e0b819c06 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 14:50:00 -0800 Subject: [PATCH 065/244] Changelog 2.7: ARM apps --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ae19b2e..052b28bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ Each release also bundles the NVIDIA driver and Mac app of the same version; see [driver changelog](https://github.com/nullmoth/nvidia-macos-driver/blob/main/CHANGELOG.md). ## 2.7 +- ARM apps (opt-in, experimental): the Mac app has an ARM apps card that installs NullMoth's translator for apps built only for Apple silicon, checks the Mac, and translates, opens, and removes apps. The package is checked against its SHA-256 and the NullMoth release signature before anything is installed. +- 1401 for Windows: tick Also set up ARM apps (opt-in) on a fresh install, and the Mac app offers a one-click finish on first start. - Writing the stick: 1401 checks that Apple will serve the download before erasing your USB stick. If Apple refuses, the stick is not touched. - Apple's 406, 405, 408, 425, and 429 answers are retried like server errors, try another route, and the message says Apple refused, not that your network failed. - A resume that can never succeed (416) stops at once and says why. From 51170ccff299f099325cef5e4f37029c838ac000 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 14:50:38 -0800 Subject: [PATCH 066/244] 1401 2.7: pin the restaged driver package (ARM apps) --- mac/Sources/main.swift | 4 ++-- mac/build.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index 1f043c8b..716eccb7 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -12,7 +12,7 @@ struct Package { static let version = "2.7" static let name = "nullmoth-nvidia-2.7.tar.gz" static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.7/nullmoth-nvidia-2.7.tar.gz")! - static let sha256 = "f0ed136369cbb8875a981fe33c5095b1c19dc68cabbd17bd85cff05eb6f77bac" + static let sha256 = "63583c2bda20a36d31c35f9c5b0b52f33de9c4de2320e62c9dd681b5f686c523" } // The AMD/Intel GPU and NPU driver (test): its own product and package, pinned like the NVIDIA driver's. An empty pin // means no build of it is published yet. @@ -1204,7 +1204,7 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe ((try? $1.resourceValues(forKeys: [.contentModificationDateKey]).contentModificationDate) ?? .distantPast) } .prefix(24) - // the ARM translator's own logs (~/Library/Logs/NullMoth/arm), newest first, as copies in this session so the + // the ARM translator's own logs (~/Library/Logs/NullMoth/arm), newest first, as copies in this report so the // queue redacts and uploads them like every other file files += self.armLogCopies(into: dir) for crash in userApplicationCrashes() { diff --git a/mac/build.sh b/mac/build.sh index f2d29758..3d8a7ac9 100644 --- a/mac/build.sh +++ b/mac/build.sh @@ -67,7 +67,7 @@ cat > "$APP/Contents/Info.plist" <CFBundleDisplayName1401 CFBundlePackageTypeAPPL CFBundleShortVersionString2.7 -CFBundleVersion135 +CFBundleVersion136 LSMinimumSystemVersion15.0 NSHumanReadableCopyright© 2026 NullMoth Systems NSHighResolutionCapable From 036a678e41aac15ebf272bf4303a8b178c3330f1 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 14:51:46 -0800 Subject: [PATCH 067/244] 1401 2.7: bundles driver and Mac app 2.7 --- p1401/nullmoth.py | 2 +- windows/release-inputs.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/p1401/nullmoth.py b/p1401/nullmoth.py index f72319ac..b7c7920b 100644 --- a/p1401/nullmoth.py +++ b/p1401/nullmoth.py @@ -31,7 +31,7 @@ # Package published with the driver; the stick carries it so the Mac companion can install it offline. PACKAGE = {"name": "nullmoth-nvidia-2.7.tar.gz", "url": "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.7/nullmoth-nvidia-2.7.tar.gz", - "sha256": "f0ed136369cbb8875a981fe33c5095b1c19dc68cabbd17bd85cff05eb6f77bac"} + "sha256": "63583c2bda20a36d31c35f9c5b0b52f33de9c4de2320e62c9dd681b5f686c523"} with open(os.path.join(HERE, "nvidia_gsp_ids.json")) as _fh: TABLE = json.load(_fh) diff --git a/windows/release-inputs.json b/windows/release-inputs.json index 515af27c..20e814da 100644 --- a/windows/release-inputs.json +++ b/windows/release-inputs.json @@ -3,7 +3,7 @@ "baseline_sha256": "e287bf4b09805dbf697f915fa6867a15a422764c46b8733dfd9f46bc0e6043b6", "driver_release": "v2.7", "mac_asset": "1401-Mac-2.7.zip", - "mac_sha256": "b09e6f54dc5337e9686583a3eac370eac6f86d49ed47141817be8105678740eb", + "mac_sha256": "e7b9448bdf381d4db1ffaaf28f42a16bfd15272d3a44ac643b5e7cc300812c45", "opencore_url": "https://github.com/acidanthera/OpenCorePkg/releases/download/1.0.8/OpenCore-1.0.8-RELEASE.zip", "opencore_sha256": "2011e8b7216ecb2645d97ea710df965947edd406846e92050b9bc4190be6d27b", "fixture_slug": "optiplex-5050-micro", From 2d6f708526cecd900c80a9eb5691150b4329d019 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 15:12:45 -0800 Subject: [PATCH 068/244] Mac app tests follow the 2.7 driver --- mac/tools/test_card_support.py | 2 +- mac/tools/test_gpu_test.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mac/tools/test_card_support.py b/mac/tools/test_card_support.py index b1d3a885..33981e9c 100644 --- a/mac/tools/test_card_support.py +++ b/mac/tools/test_card_support.py @@ -163,7 +163,7 @@ def device_table(): (tmp / "log.c").write_text(LOG) run("xcrun", "clang", "-I" + str(DRV / "plugin"), str(tmp / "log.c"), "-o", str(tmp / "log")) print(run(str(tmp / "log"))) - submit = snippet("plugin/NVMTLObjects.m", "- (BOOL)commitAndWaitUntilSubmitted {", "- (void)commit {\n [self nvmtlSubmitWithEvents];") + submit = snippet("plugin/NVMTLObjects.m", "- (BOOL)commitAndWaitUntilSubmitted {", "- (void)commit {\n if (nvmtl_cbt_on()") (tmp / "submit.m").write_text(SUBMIT.replace("PRODUCTION", submit)) run("xcrun", "clang", "-fobjc-arc", str(tmp / "submit.m"), "-framework", "Foundation", "-o", str(tmp / "submit")) for program in ("WindowServer", "mediaanalysisd", ""): diff --git a/mac/tools/test_gpu_test.py b/mac/tools/test_gpu_test.py index 6d440c2e..13398a36 100644 --- a/mac/tools/test_gpu_test.py +++ b/mac/tools/test_gpu_test.py @@ -192,7 +192,8 @@ def arm(name, ok, detail=""): unin = (DRV / "package/uninstall.sh").read_text() arm("the NVIDIA installer installs no NPU userland and no AMD/Intel kexts", "Library/NullMoth/npu" not in inst and "NMXNPU" not in inst and "NMXAccel" not in inst) -arm("the NVIDIA uninstaller removes the NVIDIA driver only", 'KEXTS="NVRM NVAccel NVRMFB NVRMAGDC NVPrimarySelector";' in unin +# 2.7: the NVIDIA package carries the audio driver it installs on macOS 26 (NMXAudio), so its uninstaller removes it too +arm("the NVIDIA uninstaller removes the NVIDIA driver (and the audio driver it carries) only", 'KEXTS="NVRM NVAccel NVRMFB NVRMAGDC NVPrimarySelector NMXAudio";' in unin and "NMXGPU" not in unin and "/Library/NullMoth/npu" not in unin) arm("turning it off clears the NPU opt-in", "ga del nmxnpu=1" in src) # the AMD/Intel driver is its own package: setup takes only its kexts, never the NVIDIA driver's cached accelerators From 8bdd923c28762e55f569b933d93d0c6468724284 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 17:59:56 -0800 Subject: [PATCH 069/244] Mac app: ARM keeps /Library/NullMoth readable; -nvoff can be undone The ARM installer ran under the private copy's umask 077 and left /Library/NullMoth root-only, hiding nm-arm from its user. A Mac started with -nvoff now gets the Turn the driver on button even with no install record, and its first-login report names the park instead of filing it as a failed install. --- mac/Resources/app.js | 6 ++++-- mac/Sources/ArmApps.swift | 9 +++++++-- mac/Sources/ReachedDesktop.swift | 5 +++++ mac/tools/test_arm_apps.py | 6 +++++- mac/tools/test_reached_desktop.py | 8 ++++++++ 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/mac/Resources/app.js b/mac/Resources/app.js index a0ca0136..ae580937 100644 --- a/mac/Resources/app.js +++ b/mac/Resources/app.js @@ -434,9 +434,11 @@ NM.on = (m) => { if (m.event === "scan" && m.data.itlwmNeedsHeliPort) { setTimeout(() => $("verdict").insertAdjacentHTML("beforeend", '

Wi-Fi: this Mac\'s Intel Wi-Fi runs on itlwm, which joins networks through its own app, HeliPort, not the Wi-Fi menu. Download HeliPort from github.com/OpenIntelWireless/HeliPort/releases, move it to Applications, open it, and pick your network there. To start it with the Mac, turn on Launch at Login in its menu.

'), 0); } - if (m.event === "scan" && m.data.safemode && m.data.record) { + // 2.7.1: shown for every Mac started with -nvoff, not only ones with an install record. 10 of 34 "driver did not come + // up" reports on 2.7 were parked this way with no way back on screen; setup finds the booted OpenCore partition itself. + if (m.event === "scan" && m.data.safemode) { setTimeout(() => { - $("verdict").insertAdjacentHTML("afterbegin", '

This Mac started with the NVIDIA driver switched off: -nvoff is in the boot arguments. 1401 puts it there while macOS updates, and some people add it after a black screen. To turn the driver back on, click Turn the driver on, then restart. If the screen went black with the driver on, send the logs first (Send logs to NullMoth, below). To take the driver out for good, click Remove the driver below.

'); + $("verdict").insertAdjacentHTML("afterbegin", '

This Mac started with the NVIDIA driver switched off: -nvoff is in the boot arguments. 1401 puts it there while macOS updates, and some people add it after a black screen. If you prepared for the macOS 26 update, update macOS now from System Settings and the driver comes back by itself after it. To turn the driver back on without updating, or if it stayed off after the update, click Turn the driver on, then restart. If the screen went black with the driver on, send the logs first (Send logs to NullMoth, below). To take the driver out for good, click Remove the driver below.

'); $("nvon").onclick = () => { $("nvon").disabled = true; post({ act: "osupdate", cancel: true, efi: efi() }); }; }, 0); } diff --git a/mac/Sources/ArmApps.swift b/mac/Sources/ArmApps.swift index 3cb5b72f..f382b5bc 100644 --- a/mac/Sources/ArmApps.swift +++ b/mac/Sources/ArmApps.swift @@ -95,8 +95,13 @@ enum ArmApps { + "[ \"$h\" = \(sha) ] || { echo 'STOP: the package changed after it was checked'; exit 1; }; " + "/bin/mkdir \"$d/x\" && /usr/bin/tar -xzf \"$d/p.tar.gz\" -C \"$d/x\" || { echo 'STOP: the package did not unpack'; exit 1; }; " + "[ -f \"$d/x/pkgroot/install.sh\" ] || { echo 'STOP: the package has no installer'; exit 1; }; " - // the installer's exit codes: 3 checksum mismatch, 4 its compiler cannot run on this Mac, 5 copy failed - + "/bin/bash \"$d/x/pkgroot/install.sh\"; rc=$?; " + // the installer's exit codes: 3 checksum mismatch, 4 its compiler cannot run on this Mac, 5 copy failed. + // umask 077 above is for the private copy only. The installer runs with the normal 022: under 077 it created + // /Library/NullMoth readable by root alone on a Mac that had no driver yet, so nm-arm could not be reached by + // the user (2.7; users were passing round `sudo chmod 711 /Library/NullMoth`). The chmod after it repairs a + // folder an earlier install left that way, so pressing Turn on again fixes such a Mac. + + "(umask 022; /bin/bash \"$d/x/pkgroot/install.sh\"); rc=$?; " + + "[ $rc = 0 ] && /bin/chmod 755 /Library/NullMoth /Library/NullMoth/arm; " + "case $rc in 0) echo \(installedMarker);; 3) echo 'STOP: the package failed its own checksum';; " + "4) echo 'STOP: the translator cannot run on this Mac';; 5) echo 'STOP: the files could not be copied';; " + "*) echo \"STOP: the installer exited $rc\";; esac" diff --git a/mac/Sources/ReachedDesktop.swift b/mac/Sources/ReachedDesktop.swift index 66bcfc8b..020a2f23 100644 --- a/mac/Sources/ReachedDesktop.swift +++ b/mac/Sources/ReachedDesktop.swift @@ -336,6 +336,11 @@ enum ReachedDesktop { static func failureSigns(_ summary: String) -> [String] { var signs: [String] = [] for line in summary.split(separator: "\n") { + // -nvoff parks the driver on purpose (the macOS update preparation, or typed in after a black screen). 10 of 34 + // "no Metal device" reports on 2.7 were that, filed like a broken install; naming it first splits them out. + if line.contains("boot-args"), line.split(whereSeparator: { $0 == " " || $0 == "\t" }).contains("-nvoff") { + signs.append("parked by -nvoff") + } if line.hasPrefix("Metal device: no") { signs.append("no Metal device") } if line.hasPrefix("NVIDIA driver loaded (com.nullmoth): no") { signs.append("driver not loaded") } // the kernel still runs an older driver than the one on disk: a GTX 1650 SUPER reported the new app version diff --git a/mac/tools/test_arm_apps.py b/mac/tools/test_arm_apps.py index 7632b0a5..bbc7ef1d 100644 --- a/mac/tools/test_arm_apps.py +++ b/mac/tools/test_arm_apps.py @@ -38,7 +38,11 @@ def arm(name, ok, detail=""): arm("the manifest takes only https links, a 64-hex SHA-256 and a nullmoth-arm-*.tar.gz name", 'u.scheme == "https"' in src and 's.scheme == "https"' in src and "validSha(sha), validPackageName(n)" in src) inst = src.split("static func installCommand(", 1)[1].split("static func validUser(", 1)[0] -order = [inst.find(k) for k in ("mktemp -d /private/var/root/", "/bin/cp -X", "shasum -a 256", "tar -xzf", "install.sh\\\"; rc=$?")] +# 2.7: the installer ran under the private copy's umask 077 and left /Library/NullMoth root-only, hiding nm-arm +arm("the package installer runs with umask 022, not the private copy's 077", "(umask 022; /bin/bash" in inst) +arm("a successful install makes /Library/NullMoth and its arm folder traversable again (repairs 2.7 installs)", + "/bin/chmod 755 /Library/NullMoth /Library/NullMoth/arm" in inst) +order = [inst.find(k) for k in ("mktemp -d /private/var/root/", "/bin/cp -X", "shasum -a 256", "tar -xzf", "install.sh\\\"); rc=$?")] arm("root copies, re-checks the SHA-256 on its copy, then unpacks, then installs (in that order)", all(i >= 0 for i in order) and order == sorted(order), str(order)) turn_on = src.split("func armTurnOn(source:", 1)[1].split("func armTurnOff()", 1)[0] diff --git a/mac/tools/test_reached_desktop.py b/mac/tools/test_reached_desktop.py index 67381db8..4d49d7c0 100644 --- a/mac/tools/test_reached_desktop.py +++ b/mac/tools/test_reached_desktop.py @@ -179,6 +179,10 @@ def arm(name, ok, detail=""): let stale = clean + "loaded NVRM: 2.3.2, installed 2.4.4 STALE (the kernel runs a different build than the one on disk)\n" + "loaded NVRMFB: 2.4.4, installed 2.4.4\n" print("e_stale_signs=" + ReachedDesktop.failureSigns(stale).joined(separator: ",")) +let parked = failed + "boot state: nv-starts 0, nv-ok 1, boot-args keepsyms=1 nvfb=1 -nvoff amfi=0x80\n" +print("e_parked_signs=" + ReachedDesktop.failureSigns(parked).joined(separator: ",")) +let notParked = failed + "boot state: nv-starts 0, nv-ok 1, boot-args keepsyms=1 -nvoffx nvfb=1\n" +print("e_notparked_signs=" + ReachedDesktop.failureSigns(notParked).joined(separator: ",")) let d1 = try! SavedReports.session(in: support) let a1 = ReachedDesktop.attachments(for: clean, into: d1) print("e_clean_calls=\(collectCalls)") @@ -290,6 +294,10 @@ def arm(name, ok, detail=""): vals.get("e_stale_signs") == "NVRM stale", vals.get("e_stale_signs", "")) arm("(e) a failed summary names what did not come up", vals.get("e_failed_signs") == "no Metal device,driver not loaded,NVRM missing", vals.get("e_failed_signs", "")) + arm("(e) a Mac started with -nvoff names the park beside what did not come up (2.7.1)", + vals.get("e_parked_signs") == "no Metal device,driver not loaded,NVRM missing,parked by -nvoff", vals.get("e_parked_signs", "")) + arm("(e) a boot argument that only starts with -nvoff is not read as parked", + "parked" not in vals.get("e_notparked_signs", "x parked"), vals.get("e_notparked_signs", "")) arm("(e) a clean summary does not run the collector and attaches nothing", vals.get("e_clean_calls") == "0" and vals.get("e_clean_files") == "0") arm("(e) a failed summary runs the collector once", vals.get("e_failed_calls") == "1", vals.get("e_failed_calls", "")) From 0f3cf543bf0b4030862ea07c268ccf2a8d533c8b Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 18:14:44 -0800 Subject: [PATCH 070/244] Real Mac Pros: native 2019 install via NVRAM; OCLP Macs keep model A Mac Pro (2019) started by Apple's firmware (no OpenCore, MacPro7,1, T2) installs with the driver's boot-args in its own NVRAM after SIP is turned off, and removal takes back out only the arguments the install added. A real Mac set up by OpenCore Legacy Patcher keeps the model OCLP gave it through Tahoe preparation. The app offers the install on such a Mac Pro instead of stopping on 'OpenCore not detected'. 13 new test arms. --- mac/Resources/app.js | 6 +- mac/Resources/nullmoth-setup.sh | 87 ++++++++++++++- mac/Sources/main.swift | 4 + mac/tools/test_real_mac_pro.py | 189 ++++++++++++++++++++++++++++++++ 4 files changed, 277 insertions(+), 9 deletions(-) create mode 100644 mac/tools/test_real_mac_pro.py diff --git a/mac/Resources/app.js b/mac/Resources/app.js index ae580937..bf72a162 100644 --- a/mac/Resources/app.js +++ b/mac/Resources/app.js @@ -76,7 +76,7 @@ function render(m) { row("macOS", esc(m.macos) + ([15, 26].includes(m.major) ? "" : ' (the driver is for macOS 15 and 26)')) + row("Processor", m.arch === "x86_64" && !m.translated ? "x86_64" : 'Apple silicon - this driver is for Intel Macs and PCs') + row("Graphics", m.gpus.length ? m.gpus.map((g) => esc(g.name) + (g.supported ? (g.tested ? ' listed device, model tested' : ' listed by NVIDIA, model not tested yet') : g.vendor === "10DE" ? ' not supported (needs RTX 20 series or newer)' : "")).join("
") : "none found") + - row("OpenCore", m.opencore ? esc(m.opencore) : 'not detected') + + row("OpenCore", m.opencore ? esc(m.opencore) : m.nativeMacPro ? 'not needed: Mac Pro (2019) on Apple\'s firmware (experimental, needs SIP off)' : 'not detected') + row("Installed driver package", m.installedDriverVersion ? esc(m.installedDriverVersion) : "No version record") + row("NullMoth driver", on ? 'running (' + esc(m.metal.join(", ")) + ")" : m.kexts >= 4 ? 'loaded, no NVIDIA Metal device yet' : m.files ? 'installed, not running yet' : "not installed"); @@ -87,13 +87,13 @@ function render(m) { else if (!card && (m.hiddenNvidia || []).length) why = `The NVIDIA card (${esc(m.hiddenNvidia.join(", "))}) is on the bus but switched off for macOS, usually by a disable-gpu property in OpenCore's DeviceProperties. Remove it, restart, and open 1401 again.`; else if (!card && /^MacBook/.test(m.hwModel || "")) why = "No NVIDIA card was found. On a laptop the card is often switched off before macOS starts: by the BIOS graphics mode (choose Hybrid/MSHybrid or Discrete, not iGPU only) or by a dGPU-off SSDT in OpenCore's ACPI folder. Fix that, restart, and open 1401 again."; else if (!card || !card.supported) why = "No supported NVIDIA card was found. The driver needs a GeForce RTX 20 series or newer."; - else if (!m.opencore) why = "This Mac does not report OpenCore. The driver's settings live in OpenCore's config, so 1401 will not install without it."; + else if (!m.opencore && !m.nativeMacPro) why = "This Mac does not report OpenCore. The driver's settings live in OpenCore's config, so 1401 will not install without it."; // Keep the checked package available when the driver is already running. const pk = m.packages.find((p) => p.ok === "yes"); if (pk) S.pkg = pk.path; // Tahoe: only from macOS 15, on a Mac the driver can be installed on, with the checked package (it carries both drivers) // (this scan's package, not S.pkg: an ejected disk image must not leave the button pointing at a path that is gone) - $("upd").disabled = !pk || m.major !== 15 || !!why; + $("upd").disabled = !pk || m.major !== 15 || !!why || !!m.nativeMacPro; // a Mac Pro (2019) runs macOS 26 as it is $("updt").innerHTML = m.major === 26 ? "This Mac already runs macOS 26." : why ? "" : pk ? "" : 'Needs the driver package: '; const d3 = $("dl3"); if (d3) d3.onclick = () => post({ act: "download" }); diff --git a/mac/Resources/nullmoth-setup.sh b/mac/Resources/nullmoth-setup.sh index 045a3bd3..9e357634 100755 --- a/mac/Resources/nullmoth-setup.sh +++ b/mac/Resources/nullmoth-setup.sh @@ -44,7 +44,7 @@ SCOPE=${NULLMOTH_COLLECT_SCOPE:-full} want() { [ "$SCOPE" = full ] || [ "$1" = driver ]; } # want full: Send logs only; want driver: both scopes AGENT=/Library/LaunchAgents/com.nullmoth.crashcheck.plist RECOVER=/Library/LaunchDaemons/com.nullmoth.recover.plist -KNOBS=(); PROFILE=""; COLLECT=""; UPD=""; VERB=""; EFIREAD=""; PKG=""; SHA=""; CFG=""; EFI=auto; DRY=0; REMOVE=0; USBMAP=""; TOOL=""; APPBIN=""; MOUNTED=""; T=""; PKGDIR="" +NATIVE=0; KNOBS=(); PROFILE=""; COLLECT=""; UPD=""; VERB=""; EFIREAD=""; PKG=""; SHA=""; CFG=""; EFI=auto; DRY=0; REMOVE=0; USBMAP=""; TOOL=""; APPBIN=""; MOUNTED=""; T=""; PKGDIR="" while [ $# -gt 0 ]; do case "$1" in --pkg) PKG=$2; shift;; --sha) SHA=$2; shift;; --config) CFG=$2; shift;; --efi) EFI=$2; shift;; --tool) TOOL=$2; shift;; --usbmap) USBMAP=$2; shift;; --app) APPBIN=$2; shift;; --dry) DRY=1;; --remove) REMOVE=1;; --verbose) VERB=$2; shift;; --update) UPD=$2; shift;; --collect-logs) COLLECT=$2; shift;; @@ -225,6 +225,29 @@ remove_nvram_hook() { # take the emulated-NVRAM save daemon back out, if an in [ -x "$dst/Launchd.command" ] || return 0 (cd "$dst" && ./Launchd.command uninstall) 2>&1 | sed 's/^/NOTE /' rm -rf "$dst"; ok "persistent NVRAM: the save-at-shutdown daemon is removed"; } +# A Mac Pro (2019) started by Apple's own firmware has no OpenCore: macOS takes boot-args from the Mac's own NVRAM, so the +# driver's settings go there. It is known by three things at once: OpenCore did not start it (no opencore-version), macOS +# reports MacPro7,1, and the Mac has Apple's T2 chip. A PC set up as MacPro7,1 has no T2, and its OpenCore is detected. +native_macpro() { + nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:opencore-version >/dev/null 2>&1 && return 1 + [ "$(sysctl -n hw.model 2>/dev/null)" = MacPro7,1 ] || return 1 + system_profiler SPiBridgeDataType 2>/dev/null | grep -q 'Apple T2'; } +# A real Mac that OpenCore Legacy Patcher set up (a Mac Pro 5,1, for one): OCLP records the Mac's own model in its config. +# That Mac keeps the model OCLP gave it; OCLP decides which macOS it can run, not this setup. +oclp_real_mac() { has NVRAM.Add.4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102.OCLP-Model; } +# The driver's boot-args merged into $1 (the same rule as the OpenCore path): sets NEW_ARGS, ADDED and REMOVED. +merge_native_args() { + local a; NEW_ARGS=""; ADDED=""; REMOVED="" + for a in $1; do case " $DROP_ARGS " in *" $a "*) echo "CHANGE boot-args: remove $a (it hides the NVIDIA card)"; REMOVED="$REMOVED $a";; *) NEW_ARGS="$NEW_ARGS $a";; esac; done + for a in $WANT_ARGS; do + case "$a" in nvrmsettle=*) case " $NEW_ARGS " in *" nvrmsettle="*) continue;; esac;; esac # the user's own value wins + case " $NEW_ARGS " in *" $a "*) ;; *) NEW_ARGS="$NEW_ARGS $a"; ADDED="$ADDED $a"; echo "CHANGE boot-args: add $a";; esac; done + NEW_ARGS=${NEW_ARGS# }; } +# Removal on such a Mac: the boot-args the install added come back out of NVRAM; everything else the user set stays. +strip_native_args() { + local a nv="" + for a in $(nvram boot-args 2>/dev/null | cut -f2-); do case " $1 " in *" $a "*) ;; *) nv="$nv $a";; esac; done + if [ -n "${nv# }" ]; then nvram boot-args="${nv# }"; else nvram -d boot-args; fi; } # Every log query has its own time cap. Measured 10-12 on a 15.8.1 machine: three "--last 3d" queries took 85 s, 120 s # and over 230 s, so the 180 s collection limit killed the job before the kernel log was written (36 of 94 reports since @@ -606,9 +629,12 @@ if [ $REMOVE = 1 ]; then # removal used to stop here (1.8 log 10-10), leaving the user with a driver they could not take out. Without a # record nothing is restored from a backup: the driver's own settings come out of the OpenCore config this Mac # started from (or the one selected), and the uninstaller removes its files. - note "no install record in $STATE; removing the driver from the OpenCore config this Mac started from" CONFIG_SHA_AFTER=""; ADDED_ARGS=""; REMOVED_ARGS=""; CONFIG_BACKUP_REL="" - if [ -z "$CFG" ] && [ "$EFI" = auto ]; then + if [ -z "$CFG" ] && [ "$EFI" = auto ] && native_macpro; then + note "no install record in $STATE; this Mac Pro has no OpenCore, so the driver's boot-args come out of its NVRAM" + NATIVE=1; ADDED_ARGS=$WANT_ARGS + elif [ -z "$CFG" ] && [ "$EFI" = auto ]; then + note "no install record in $STATE; removing the driver from the OpenCore config this Mac started from" d=$(booted_part) || d=$(boot_esp) [ -n "$d" ] || stop "no install record, and the OpenCore partition this Mac started from was not found; select its config.plist - nothing changed" mount_efi "$d" || stop "could not mount the OpenCore partition $d - nothing changed" @@ -642,7 +668,7 @@ if [ $REMOVE = 1 ]; then r=$(ocrel_in "$MOUNT_POINT"); [ -n "$r" ] || stop "no OpenCore config on $d; select its config.plist - nothing changed" MP=$MOUNT_POINT; C="$MP/$r/config.plist"; OCREL=$r fi - [ -n "$C" ] || stop "the install record has no OpenCore partition; select the original config - nothing changed" + [ -n "$C" ] || [ "${NATIVE:-0}" = 1 ] || stop "the install record has no OpenCore partition; select the original config - nothing changed" if [ -n "$C" ]; then [ -f "$C" ] && plutil -lint "$C" >/dev/null || stop "the OpenCore config is missing or invalid - nothing changed" # The backup is used only when the config is unchanged since the install; otherwise the driver's settings are taken @@ -733,6 +759,10 @@ if [ $REMOVE = 1 ]; then rm -f "$MP/${OCREL:-EFI/OC}/Tools/$TOOL_FILE" || stop "could not remove the picker tool; recovery remains available" ok "OpenCore removal settings published" fi + if [ "${NATIVE:-0}" = 1 ]; then + strip_native_args "$ADDED_ARGS" || stop "could not take the driver's boot-args out of NVRAM (the driver files are already removed)" + ok "the driver's boot-args are out of this Mac's NVRAM" + fi if [ -f "$STATE" ]; then mv "$STATE" "$STATE.removed-$(date +%Y%m%d-%H%M%S)" || stop "could not archive the install record"; fi rm -f "$AGENT" "$RECOVER" "$ST/nullmoth-recover.sh" for j in /Library/LaunchDaemons/com.nullmoth.wsreset.plist /Library/LaunchDaemons/com.nullmoth.displaytrace.plist; do @@ -787,6 +817,45 @@ RUNTIME_PREFLIGHT="$T/pkgroot/nullmoth-runtime-check.sh" rm -rf "$T"; T="" fi +# A Mac Pro (2019) started by Apple's firmware takes its own short path (NVRAM boot-args, no OpenCore) and rejoins at +# "Installing the driver"; everything in the else branch edits an OpenCore config. +[ -z "$CFG" ] && [ "$EFI" = auto ] && native_macpro && NATIVE=1 +if [ $NATIVE = 1 ]; then + step "Setting up a Mac Pro (2019) started by Apple's firmware" + note "experimental: this Mac has no OpenCore, so the driver's settings go in this Mac's own NVRAM boot-args" + [ -z "$UPD$USBMAP$VERB$EFIREAD${GPUTEST:-}${BACKLIGHT:-}${HIDPI:-}${XE:-}" ] || \ + stop "that option changes an OpenCore config, and this Mac Pro starts without one; macOS 26 runs on it as it is. Nothing was changed" + # Apple's firmware loads only Apple-signed kernel extensions while SIP is on, and NVRAM boot-args cannot be set. + csrutil status 2>/dev/null | grep -q 'status: disabled\.' || \ + stop "System Integrity Protection is on. Start this Mac Pro into Recovery (hold Command-R as it starts), open Utilities > Terminal, run: csrutil disable - restart, then install again. Nothing was changed" + OLD_BOOTARGS=$(nvram boot-args 2>/dev/null | cut -f2-) + merge_native_args "$OLD_BOOTARGS" + if [ $DRY = 0 ]; then + step "Test-building the driver (nothing is changed yet)" + T=$(mktemp -d /var/tmp/nullmoth.XXXX) + tar -xzf "$PKG" -C "$T" || stop "could not unpack the package" + [ -x "$T/pkgroot/install.sh" ] || stop "the package has no install.sh" + out=$(CHECK=1 /bin/bash "$T/pkgroot/install.sh" --payload "$T/pkgroot" 2>&1); rc=$? + echo "$out" | sed -E '/^$/d;s/^== /NOTE /;s/^ ok /NOTE /;s/^ STOP: /STOP /;s/^ NOTE: /NOTE /' + [ "$rc" = 0 ] || stop "the driver test build failed (exit $rc) - NVRAM and macOS were not changed" + rm -rf "$T"; T="" + mkdir -p "$ST" || stop "could not create the install state directory" + OLD_STATE="$ST/state.before-install"; HAD_STATE=0 + if [ -f "$STATE" ]; then cp -p "$STATE" "$OLD_STATE" || stop "could not preserve the existing recovery record"; HAD_STATE=1 + # a reinstall finds its own arguments already set: the ones the first install added stay recorded as added + for a in $( . "$OLD_STATE" >/dev/null 2>&1; [ "${NATIVE:-0}" = 1 ] && echo "$ADDED_ARGS"); do + case " $ADDED " in *" $a "*) ;; *) ADDED="$ADDED $a";; esac; done + fi + { printf '# NullMoth install record %s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" + printf '%s=%q\n' NATIVE 1 OLD_BOOTARGS "$OLD_BOOTARGS" ADDED_ARGS "${ADDED# }" REMOVED_ARGS "${REMOVED# }" + } > "$STATE.tmp" && chmod 600 "$STATE.tmp" && mv "$STATE.tmp" "$STATE" || stop "could not save the install record - nothing was changed" + if [ "$NEW_ARGS" != "$OLD_BOOTARGS" ]; then + nvram boot-args="$NEW_ARGS" || { if [ "$HAD_STATE" = 1 ]; then cp -p "$OLD_STATE" "$STATE"; else rm -f "$STATE"; fi + stop "could not write NVRAM boot-args - nothing was changed"; } + ok "NVRAM boot-args: $NEW_ARGS" + else ok "NVRAM boot-args already hold the driver's settings"; fi + fi +else # the OpenCore path if [ -n "$CFG" ]; then C=$CFG; [ -f "$C" ] || stop "no config at $C"; MP=$(cd "$(dirname "$C")/../.." && pwd); OCREL="EFI/$(basename "$(dirname "$C")")"; ok "OpenCore config: $C (given)" else step "Finding the OpenCore partition" @@ -1598,7 +1667,9 @@ fi # the test machine). Desktops take MacPro7,1, which runs macOS 15 and 26, with RestrictEvents (its memory and PCI slot pages), # as 1401 1.14 builds them; a laptop on a dropped model is told to rebuild its EFI with 1401 1.14 (its model needs the # laptop's own SMBIOS choice). The serial numbers stay: macOS does not check them against the model. -if [ "$UPD" = prepare ]; then +if [ "$UPD" = prepare ] && oclp_real_mac; then + ok "this is a real $(get NVRAM.Add.4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102.OCLP-Model) set up by OpenCore Legacy Patcher: its model stays as OCLP set it" +elif [ "$UPD" = prepare ]; then MK=""; for k in PlatformInfo.Generic.SystemProductName PlatformInfo.SMBIOS.SystemProductName PlatformInfo.DataHub.SystemProductName; do has "$k" && { MK=$k; break; }; done MODEL=$( [ -n "$MK" ] && get "$MK" ); [ -n "$MODEL" ] || MODEL=$(sysctl -n hw.model) @@ -1826,6 +1897,7 @@ if [ $SIPON = 1 ] && [ $DRY = 0 ]; then if [ "${HAD_STATE:-0}" = 1 ]; then cp -p "$OLD_STATE" "$STATE"; else rm -f "$STATE"; fi ok "SIP setting written - restart, then open 1401 again to install the driver"; cleanup; echo "RESULT ok"; exit 0 fi +fi # end of the OpenCore path (NATIVE=0) step "Installing the driver" T=$(mktemp -d /var/tmp/nullmoth.XXXX) @@ -1836,6 +1908,9 @@ else out=$(/bin/bash "$T/pkgroot/install.sh" --payload "$T/pkgroot" 2>&1); rc=$? echo "$out" | sed -E '/^$/d;s/^== /NOTE /;s/^ ok /NOTE /;s/^ STOP: /STOP /;s/^ NOTE: /NOTE /' if [ "$rc" != 0 ]; then [ $DRY = 0 ] && [ -n "${BKC:-}" ] && [ -f "$BKC" ] && cp -p "$BKC" "$C" && note "OpenCore config put back as it was before" + if [ $DRY = 0 ] && [ $NATIVE = 1 ]; then + if [ -n "$OLD_BOOTARGS" ]; then nvram boot-args="$OLD_BOOTARGS"; else nvram -d boot-args; fi && note "NVRAM boot-args put back as they were before" + fi if [ $DRY = 0 ]; then if [ "${HAD_STATE:-0}" = 1 ]; then cp -p "$OLD_STATE" "$STATE" || stop "could not restore the previous recovery record" else rm -f "$STATE"; fi @@ -1893,7 +1968,7 @@ cat > "$RECOVER" < PL chmod 644 "$RECOVER"; chown root:wheel "$RECOVER" -ok "boot picker way back armed (NullMoth: Remove driver)" +[ $NATIVE = 1 ] || ok "boot picker way back armed (NullMoth: Remove driver)" # Earlier versions ran three background jobs beside the driver: a crash-check login item, a WindowServer restart at # every boot (a flicker workaround) and a display tracker that streamed the driver's log all the time. The driver needs # none of them; logs are collected when the user asks. Remove what an earlier install left. diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index 716eccb7..dd1c1391 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -603,6 +603,10 @@ final class App: NSObject, NSApplicationDelegate, WKScriptMessageHandler, WKUIDe "record": fm.fileExists(atPath: "/Library/NullMoth/state"), "crashes": driverCrashes().map(\.lastPathComponent), "translated": sysctl("sysctl.proc_translated") == "1", "gpuHiding": hiding, "hiddenNvidia": hiddenNvidia, "hwModel": sysctl("hw.model"), "itlwmNeedsHeliPort": itlwmNeedsHeliPort, + // A Mac Pro (2019) started by Apple's firmware: no OpenCore, and setup puts the driver's boot-args in its + // NVRAM instead (the same three checks setup makes: no OpenCore, MacPro7,1, Apple's T2 chip). + "nativeMacPro": oc.isEmpty && sysctl("hw.model") == "MacPro7,1" + && sh("/usr/sbin/system_profiler", ["SPiBridgeDataType"]).contains("Apple T2"), "profile": { var p = machineProfile(gpus); p["rules"] = Profile.select(rules(), p).ids; return p }()] } diff --git a/mac/tools/test_real_mac_pro.py b/mac/tools/test_real_mac_pro.py new file mode 100644 index 00000000..1e2e4cf4 --- /dev/null +++ b/mac/tools/test_real_mac_pro.py @@ -0,0 +1,189 @@ +#!/usr/bin/env python3 +"""Real Mac Pros: a Mac Pro (2019) started by Apple's firmware installs with NVRAM boot-args (no OpenCore), and a real Mac +set up by OpenCore Legacy Patcher keeps its own model through Tahoe preparation. Runs the setup's real code against stub +nvram/sysctl/system_profiler/csrutil and a temp state folder, in both directions.""" +import os +import pathlib +import plistlib +import subprocess +import tarfile +import tempfile +import unittest + +SETUP = pathlib.Path(__file__).resolve().parents[1] / "Resources/nullmoth-setup.sh" +S = SETUP.read_text() + + +def cut(start, end): + assert S.count(start) == 1 and S.count(end) == 1, f"anchor moved in nullmoth-setup.sh: {start[:50]!r} / {end[:50]!r}" + return S[S.index(start):S.index(end)] + + +WANT = cut('WANT_ARGS="nvfb=1', "\n# The NVIDIA display card").strip() +HELPERS = cut("native_macpro() {", "\n# Every log query has its own time cap") +NATIVE = cut('[ -z "$CFG" ] && [ "$EFI" = auto ] && native_macpro && NATIVE=1', "else # the OpenCore path") +PREP = cut('if [ "$UPD" = prepare ] && oclp_real_mac; then', "# Existing BAR and kernel-placement settings") + + +def env(t, oc=False, model="MacPro7,1", t2=True, sip="disabled", args=""): + bins = os.path.join(t, "bin") + os.makedirs(bins, exist_ok=True) + nvf = os.path.join(t, "nvram.args") + with open(nvf, "w") as f: + f.write(args) + stubs = { + "nvram": f'''case "$1" in + *opencore-version) {"echo 'x\tREL-108'; exit 0" if oc else "exit 1"};; + boot-args) printf 'boot-args\\t%s\\n' "$(cat {nvf})";; + boot-args=*) printf '%s' "${{1#boot-args=}}" > {nvf};; + -d) : > {nvf};; +esac''', + "sysctl": f'echo "{model}"', + "system_profiler": f'{"echo \' Model Name: Apple T2 Security Chip\'" if t2 else "echo"}', + "csrutil": f'echo "System Integrity Protection status: {sip}."', + } + for n, body in stubs.items(): + p = os.path.join(bins, n) + with open(p, "w") as f: + f.write("#!/bin/bash\n" + body + "\n") + os.chmod(p, 0o755) + return bins, nvf + + +def sh(t, body, bins): + script = (f'PATH="{bins}:/usr/bin:/bin"\nstep() {{ echo "STEP $*"; }}; ok() {{ echo "OK $*"; }}; note() {{ echo "NOTE $*"; }}\n' + 'stop() { echo "STOP $*"; exit 1; }\nDROP_ARGS="nv_disable=1 -wegnoegpu"\n' + WANT + "\n" + HELPERS + "\n" + body) + r = subprocess.run(["/bin/bash", "-c", script], capture_output=True, text=True, timeout=60, cwd=t) + return r.returncode, r.stdout + + +def pkg(t, rc=0): + root = os.path.join(t, "pkgsrc/pkgroot") + os.makedirs(root) + with open(os.path.join(root, "install.sh"), "w") as f: + f.write(f"#!/bin/bash\nexit {rc}\n") + os.chmod(os.path.join(root, "install.sh"), 0o755) + p = os.path.join(t, "p.tar.gz") + with tarfile.open(p, "w:gz") as z: + z.add(root, arcname="pkgroot") + return p + + +def native_run(t, bins, dry=0, extra=""): + st = os.path.join(t, "st") + body = (f'CFG=""; EFI=auto; UPD=""; USBMAP=""; VERB=""; EFIREAD=""; DRY={dry}; NATIVE=0; PKG="{pkg(t)}"\n' + f'ST="{st}"; STATE="$ST/state"\n{extra}\n' + NATIVE + 'fi\necho "NATIVE=$NATIVE"\n') + return sh(t, body, bins), st + + +class Detection(unittest.TestCase): + def check(self, want, **kw): + t = tempfile.mkdtemp() + bins, _ = env(t, **kw) + rc, _ = sh(t, "native_macpro", bins) + self.assertEqual(rc == 0, want) + + def test_a_mac_pro_2019_on_apples_firmware_is_native(self): + self.check(True) + + def test_a_pc_set_up_as_macpro71_without_t2_is_not_native(self): + self.check(False, t2=False) + + def test_a_mac_pro_that_opencore_started_is_not_native(self): + self.check(False, oc=True) + + def test_another_t2_mac_is_not_native(self): + self.check(False, model="MacBookPro16,1") + + +class NativeInstall(unittest.TestCase): + def test_install_writes_the_driver_args_into_nvram_and_records_them(self): + t = tempfile.mkdtemp() + bins, nvf = env(t, args="-v nv_disable=1") + (rc, out), st = native_run(t, bins) + self.assertEqual(rc, 0, out) + live = open(nvf).read().split() + self.assertIn("nvaccel=1", live) + self.assertIn("-v", live) # the user's own argument stays + self.assertNotIn("nv_disable=1", live) # it hides the card + rec = open(os.path.join(st, "state")).read() + self.assertIn("NATIVE=1", rec) + self.assertIn("amfi_get_out_of_my_way=0x1", rec) + + def test_sip_on_stops_and_changes_nothing(self): + t = tempfile.mkdtemp() + bins, nvf = env(t, sip="enabled", args="-v") + (rc, out), st = native_run(t, bins) + self.assertNotEqual(rc, 0) + self.assertIn("csrutil disable", out) + self.assertEqual(open(nvf).read(), "-v") + self.assertFalse(os.path.exists(os.path.join(st, "state"))) + + def test_opencore_options_are_refused_on_a_native_mac_pro(self): + t = tempfile.mkdtemp() + bins, nvf = env(t, args="-v") + (rc, out), _ = native_run(t, bins, extra='VERB=on') + self.assertNotEqual(rc, 0) + self.assertEqual(open(nvf).read(), "-v") + + def test_a_reinstall_keeps_the_first_installs_args_recorded_as_added(self): + t = tempfile.mkdtemp() + bins, nvf = env(t, args="-v") + (rc, out), st = native_run(t, bins) + self.assertEqual(rc, 0, out) + os.remove(os.path.join(t, "p.tar.gz")); __import__("shutil").rmtree(os.path.join(t, "pkgsrc")) + (rc, out), st = native_run(t, bins) + self.assertEqual(rc, 0, out) + self.assertIn("nvaccel=1", open(os.path.join(st, "state")).read().split("ADDED_ARGS=")[1].splitlines()[0]) + + def test_without_a_mac_pro_the_opencore_path_is_taken(self): + t = tempfile.mkdtemp() + bins, nvf = env(t, oc=True, args="-v") + (rc, out), _ = native_run(t, bins) + self.assertIn("NATIVE=0", out) + self.assertEqual(open(nvf).read(), "-v") + + +class NativeRemove(unittest.TestCase): + def test_removal_takes_out_only_the_added_args(self): + t = tempfile.mkdtemp() + bins, nvf = env(t, args="-v keepsyms=1 nvfb=1 nvaccel=1") + rc, out = sh(t, 'strip_native_args "nvfb=1 nvaccel=1"', bins) + self.assertEqual(rc, 0, out) + self.assertEqual(open(nvf).read().split(), ["-v", "keepsyms=1"]) + + def test_removal_of_every_arg_deletes_the_variable(self): + t = tempfile.mkdtemp() + bins, nvf = env(t, args="nvfb=1") + rc, out = sh(t, 'strip_native_args "nvfb=1"', bins) + self.assertEqual((rc, open(nvf).read()), (0, "")) + + +class OclpRealMac(unittest.TestCase): + def prep(self, cfg): + t = tempfile.mkdtemp() + bins, _ = env(t, oc=True) + c = os.path.join(t, "config.plist") + with open(c, "wb") as f: + plistlib.dump(cfg, f) + body = (f'C="{c}"; UPD=prepare; EDITS=(); ADDK=(); FETCH=(); KX={t}\n' + 'has() { plutil -extract "$1" raw -o - "$C" >/dev/null 2>&1; }; get() { plutil -extract "$1" raw -o - "$C" 2>/dev/null; }\n' + 'kpos() { :; }; fetch_kext() { :; }\n' + PREP + 'echo "EDITS=${#EDITS[@]}"\n') + return sh(t, body, bins) + + def test_a_real_mac_pro_51_keeps_its_model(self): + rc, out = self.prep({"NVRAM": {"Add": {"4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102": {"OCLP-Model": "MacPro5,1"}}}, + "PlatformInfo": {"Generic": {"SystemProductName": "MacPro5,1"}}}) + self.assertEqual(rc, 0, out) + self.assertIn("real MacPro5,1", out) + self.assertIn("EDITS=0", out) + + def test_a_pc_on_a_dropped_model_is_still_moved_to_macpro71(self): + rc, out = self.prep({"PlatformInfo": {"Generic": {"SystemProductName": "iMacPro1,1"}}}) + self.assertEqual(rc, 0, out) + self.assertIn("-> MacPro7,1", out) + self.assertNotIn("EDITS=0", out) + + +if __name__ == "__main__": + unittest.main() From 6cae860f59861b49270e49187b823a5f7fbfd385 Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 18:55:26 -0800 Subject: [PATCH 071/244] Changelog 2.7.1 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 052b28bb..ee50d6c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ Each release also bundles the NVIDIA driver and Mac app of the same version; see the [driver changelog](https://github.com/nullmoth/nvidia-macos-driver/blob/main/CHANGELOG.md). +## 2.7.1 +- ARM apps: turning ARM apps on keeps /Library/NullMoth readable and repairs it on Macs where 2.7 left it readable by root only, so translated apps start without `sudo chmod 711 /Library/NullMoth`. +- A Mac parked by -nvoff (for example halfway through a driver update) now shows why in the Mac app, with a button to turn the driver back on. +- Real Mac Pro (2019) support (experimental): a Mac Pro started by Apple's own firmware installs the driver without OpenCore. Its settings go in the Mac's NVRAM, and System Integrity Protection must be turned off first (Recovery > Terminal > csrutil disable). Removal takes out only what the install added. +- Real Macs set up with OpenCore Legacy Patcher (such as a Mac Pro 5,1) keep the model OCLP gave them when preparing for macOS 26 Tahoe. + ## 2.7 - ARM apps (opt-in, experimental): the Mac app has an ARM apps card that installs NullMoth's translator for apps built only for Apple silicon, checks the Mac, and translates, opens, and removes apps. The package is checked against its SHA-256 and the NullMoth release signature before anything is installed. - 1401 for Windows: tick Also set up ARM apps (opt-in) on a fresh install, and the Mac app offers a one-click finish on first start. From 470db400ae18b02093c7d93daf4ed3e43a28a45d Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 19:02:01 -0800 Subject: [PATCH 072/244] 1401 2.7.1: bundles driver and Mac app 2.7.1 --- mac/Sources/main.swift | 8 ++++---- mac/build.sh | 4 ++-- p1401/nullmoth.py | 6 +++--- windows/App/App.csproj | 2 +- windows/App/app.manifest | 2 +- windows/release-inputs.json | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mac/Sources/main.swift b/mac/Sources/main.swift index dd1c1391..ed93bde2 100644 --- a/mac/Sources/main.swift +++ b/mac/Sources/main.swift @@ -9,10 +9,10 @@ import WebKit import UniformTypeIdentifiers struct Package { - static let version = "2.7" - static let name = "nullmoth-nvidia-2.7.tar.gz" - static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.7/nullmoth-nvidia-2.7.tar.gz")! - static let sha256 = "63583c2bda20a36d31c35f9c5b0b52f33de9c4de2320e62c9dd681b5f686c523" + static let version = "2.7.1" + static let name = "nullmoth-nvidia-2.7.1.tar.gz" + static let url = URL(string: "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.7.1/nullmoth-nvidia-2.7.1.tar.gz")! + static let sha256 = "0b28f420dbc0f8a796a8a67c60490b1909886d302fd2008ad884cc12231e7851" } // The AMD/Intel GPU and NPU driver (test): its own product and package, pinned like the NVIDIA driver's. An empty pin // means no build of it is published yet. diff --git a/mac/build.sh b/mac/build.sh index 3d8a7ac9..34275077 100644 --- a/mac/build.sh +++ b/mac/build.sh @@ -66,8 +66,8 @@ cat > "$APP/Contents/Info.plist" <CFBundleName1401 CFBundleDisplayName1401 CFBundlePackageTypeAPPL -CFBundleShortVersionString2.7 -CFBundleVersion136 +CFBundleShortVersionString2.7.1 +CFBundleVersion137 LSMinimumSystemVersion15.0 NSHumanReadableCopyright© 2026 NullMoth Systems NSHighResolutionCapable diff --git a/p1401/nullmoth.py b/p1401/nullmoth.py index b7c7920b..cc7655e6 100644 --- a/p1401/nullmoth.py +++ b/p1401/nullmoth.py @@ -29,9 +29,9 @@ BOOT_ARGS = ("nvfb=1", "nvaccel=1", "nvfbheads=4", "-nvkmsnosmooth", "amfi_get_out_of_my_way=0x1", "amfi=0x80", "ipc_control_port_options=0") # Package published with the driver; the stick carries it so the Mac companion can install it offline. -PACKAGE = {"name": "nullmoth-nvidia-2.7.tar.gz", - "url": "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.7/nullmoth-nvidia-2.7.tar.gz", - "sha256": "63583c2bda20a36d31c35f9c5b0b52f33de9c4de2320e62c9dd681b5f686c523"} +PACKAGE = {"name": "nullmoth-nvidia-2.7.1.tar.gz", + "url": "https://github.com/nullmoth/nvidia-macos-driver/releases/download/v2.7.1/nullmoth-nvidia-2.7.1.tar.gz", + "sha256": "0b28f420dbc0f8a796a8a67c60490b1909886d302fd2008ad884cc12231e7851"} with open(os.path.join(HERE, "nvidia_gsp_ids.json")) as _fh: TABLE = json.load(_fh) diff --git a/windows/App/App.csproj b/windows/App/App.csproj index d17c8581..5a433840 100644 --- a/windows/App/App.csproj +++ b/windows/App/App.csproj @@ -8,7 +8,7 @@ AnyCPU false app.manifest - 2.7.0 + 2.7.1 NullMoth Systems NullMoth Systems © 2026 NullMoth Systems diff --git a/windows/App/app.manifest b/windows/App/app.manifest index 774d71c8..e3b9f054 100644 --- a/windows/App/app.manifest +++ b/windows/App/app.manifest @@ -1,6 +1,6 @@ - + diff --git a/windows/release-inputs.json b/windows/release-inputs.json index 20e814da..e7a7e548 100644 --- a/windows/release-inputs.json +++ b/windows/release-inputs.json @@ -1,9 +1,9 @@ { "baseline_url": "https://github.com/nullmoth/1401/releases/download/v1.14.3/1401-Windows-1.14.3.zip", "baseline_sha256": "e287bf4b09805dbf697f915fa6867a15a422764c46b8733dfd9f46bc0e6043b6", - "driver_release": "v2.7", - "mac_asset": "1401-Mac-2.7.zip", - "mac_sha256": "e7b9448bdf381d4db1ffaaf28f42a16bfd15272d3a44ac643b5e7cc300812c45", + "driver_release": "v2.7.1", + "mac_asset": "1401-Mac-2.7.1.zip", + "mac_sha256": "2d20020a3eb7c8fb7e9c6223602f50d822f55800b9a766165d3b35fe216864b9", "opencore_url": "https://github.com/acidanthera/OpenCorePkg/releases/download/1.0.8/OpenCore-1.0.8-RELEASE.zip", "opencore_sha256": "2011e8b7216ecb2645d97ea710df965947edd406846e92050b9bc4190be6d27b", "fixture_slug": "optiplex-5050-micro", From b19cb6f9a40c262cf378f64b4479c8c228a1c7de Mon Sep 17 00:00:00 2001 From: NullMoth Systems Date: Tue, 3 Nov 2026 22:55:49 -0800 Subject: [PATCH 073/244] 1401 Mac: Set up Homebrew in the ARM apps card One password prompt creates the /opt/homebrew and /usr/local folders; nm-arm brew setup does the rest as the user with progress in the card. Choose ARM, Intel or both, and which one brew is. --- mac/Resources/app.js | 22 +++++- mac/Resources/index.html | 6 +- mac/Sources/ArmApps.swift | 156 ++++++++++++++++++++++++++++++------- mac/tools/test_arm_apps.py | 47 +++++++++++ 4 files changed, 202 insertions(+), 29 deletions(-) diff --git a/mac/Resources/app.js b/mac/Resources/app.js index bf72a162..2ad608b9 100644 --- a/mac/Resources/app.js +++ b/mac/Resources/app.js @@ -16,6 +16,18 @@ function armButtons() { $("armon").disabled = false; $("armtr").hidden = !A.on; $("armtr").disabled = !(A.on && A.ok) || A.running; $("armprog").hidden = !A.running; + $("armbrew").hidden = !A.on; $("armbrewgo").disabled = !A.on || A.running; +} +// nm-arm brew status: {"arm": {"installed", "ruby", "programs"}, "intel": {"installed"}} or {"why"} +function armBrewText(b) { + if (!b) return ""; + if (b.why) return `${esc(b.why)}`; + const side = (s, name, cmd) => s && s.installed ? `${name} ready (${cmd})` : `${name} not set up`; + let t = side(b.arm, "ARM Homebrew", "abrew") + " · " + side(b.intel, "Intel Homebrew", "ibrew"); + const p = b.arm && b.arm.programs; + if (p) t += `
Translated programs: ${esc(p.translated || 0)}; waiting for their first run: ${esc(p.stub || 0)}.`; + if (b.arm && b.arm.installed && b.arm.ruby && !b.arm.ruby.launcher) t += `
The ARM Homebrew's Ruby is not prepared yet: run abrew once in Terminal.`; + return t; } function armEvent(d) { if (d.kind === "status") { @@ -32,6 +44,7 @@ function armEvent(d) { if (d.listWhy) t += `
${esc(d.listWhy)}`; $("armr").innerHTML = t; $("armclt").hidden = !(A.on && c.prerequisites && c.prerequisites.clt === false); + $("armbrewr").innerHTML = A.on ? armBrewText(d.brew) : ""; const apps = d.apps || []; $("armapps").innerHTML = !A.on ? "" : apps.length ? "" + apps.map((a) => ``).join("") + "
${esc(a.name)}
" @@ -61,8 +74,12 @@ function armEvent(d) { } if (d.kind === "done") { A.running = false; armButtons(); - A.last = d.ok ? `${esc(d.app)} is translated: it is in Applications > NullMoth ARM.` - : `${esc(d.app)}: ${esc(d.why || "the translation did not finish")}`; + if (d.what === "brew") + A.last = d.ok ? `${esc(d.msg || "Homebrew is set up. Open a new Terminal window.")}` + : `Homebrew: ${esc(d.why || "the setup did not finish")}`; + else + A.last = d.ok ? `${esc(d.app)} is translated: it is in Applications > NullMoth ARM.` + : `${esc(d.app)}: ${esc(d.why || "the translation did not finish")}`; $("armr").innerHTML = A.last; } } @@ -265,6 +282,7 @@ $("armreqno").onclick = (e) => { e.preventDefault(); $("armreq").hidden = true; $("armchk").onclick = () => post({ act: "arm", op: "check" }); $("armclt").onclick = () => post({ act: "arm", op: "clt" }); $("armtr").onclick = () => { $("armtr").disabled = true; post({ act: "arm", op: "translate" }); }; +$("armbrewgo").onclick = () => { $("armbrewgo").disabled = true; post({ act: "arm", op: "brew", pick: $("armbrewpick").value, primary: $("armbrewprim").value }); }; $("armcancel").onclick = () => { $("armcancel").disabled = true; $("armmsg").textContent = "Cancelling..."; post({ act: "arm", op: "cancel" }); }; $("armapps").onclick = (e) => { const b = e.target.closest("button[data-op]"); diff --git a/mac/Resources/index.html b/mac/Resources/index.html index a767d88f..5ef27bf4 100644 --- a/mac/Resources/index.html +++ b/mac/Resources/index.html @@ -109,7 +109,11 @@

Tools

-
+
+