Commit 7cd7082
committed
extensions/nvidia: pre-ship modprobe blacklist; remove + modprobe at boot when GPU is found
Previous flow on a host without an NVIDIA GPU:
- First boot: kernel modules auto-load from initrd udev → probe
fails → noisy dmesg ("nvidia: probe failed", DKMS rebuild
artefacts in journal, etc.)
- armbian-nvidia-autodetect runs in userspace → writes blacklist
+ purges packages
- Second boot: clean
Inverting the default so the first boot is also clean:
1. Build-time write of /etc/modprobe.d/armbian-nvidia-disabled.conf
BEFORE the apt install. nvidia-dkms postinst triggers
update-initramfs which now bakes the blacklist into initramfs,
so initrd udev doesn't try to load nvidia* at all.
2. Boot-time autodetect:
- lspci finds [10de:] → rm -f blacklist file + modprobe
nvidia_drm modeset=1 (pulls nvidia + nvidia_modeset via
deps; Wayland-friendly KMS). Display-manager (we're
Before= it) sees the driver loaded.
- No [10de:] → keep blacklist + purge packages (unchanged).
Self-healing for hosts that gain a GPU later: rootfs blacklist file
deleted on first NVIDIA-detected boot; next kernel upgrade
regenerates initramfs from the (now blacklist-free) rootfs, so
subsequent boots are clean directly from initrd. Until that kernel
upgrade, the runtime modprobe covers the gap each boot.
|| true on modprobe handles the edge case where packages were
previously purged on a no-GPU run, then the operator swapped in a
GPU but hasn't re-apt-installed. Operator runs apt install manually
in that case; the cleared blacklist makes it work on next boot.1 parent 7a00894 commit 7cd7082
1 file changed
Lines changed: 32 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
34 | 51 | | |
35 | 52 | | |
36 | 53 | | |
| |||
174 | 191 | | |
175 | 192 | | |
176 | 193 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
187 | 208 | | |
188 | 209 | | |
189 | 210 | | |
190 | 211 | | |
| 212 | + | |
191 | 213 | | |
192 | 214 | | |
193 | 215 | | |
| |||
0 commit comments