mirror of
https://github.com/Zagitta/gpu-unlock.git
synced 2026-12-03 19:44:49 +07:00
[PR #76] initramfs-tools: load nvidia-drm in the initramfs right after gpu_unlock #137
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Zagitta/gpu-unlock#137
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Zagitta/gpu-unlock/pull/76
Author: @soltia48
Created: 10/25/2026
Status: 🔄 Open
Base:
main← Head:initramfs-tools-nvidia-drm📝 Commits (2)
68a224cinitramfs-tools: load nvidia-drm right after gpu_unlock620ebe1initramfs-tools: load nvidia_drm from an init-premount script📊 Changes
5 files changed (+149 additions, -2 deletions)
View changed files
📝
Makefile(+4 -0)📝
README.md(+20 -2)➕
packaging/boot/initramfs-tools-hook(+47 -0)➕
packaging/boot/initramfs-tools-premount(+23 -0)📝
tests/test_packaging.py(+55 -0)📄 Description
Problem
On a display card, gpu_unlock removes the firmware framebuffer
(simpledrm/efifb) just before the card's FLR, and nothing is shown again
until nvidia-drm loads. On Ubuntu the prebuilt nvidia modules
(
linux-modules-nvidia-*, underkernel/nvidia-*) are not in theinitramfs, so nvidia-drm only loads from the root filesystem.
With an encrypted root, the LUKS passphrase prompt comes before that, on a
blank screen. The boot looks hung, and nothing reaches the journal because
the root filesystem is never mounted. Typing the passphrase blind does
boot, with the card unlocked.
Seen on Ubuntu 26.04, kernel 7.0.0-38, nvidia-driver-595-open, RTX 3080
(
10de:2206) as the only card, LUKS + LVM root.Change
/usr/share/initramfs-tools/hooks/gpu-unlock: for a kernelthat has both gpu_unlock and nvidia, adds
nvidia_drm(and with itnvidia_modeset,nvidiaand their firmware) to the image, andblacklists the three modules in
etc/modprobe.d/gpu-unlock.confinsidethe image only. udev's coldplug in
init-topruns before/conf/modulesis read and would otherwise loadnvidia/nvidia_drmby their PCI aliases, binding the card before gpu_unlock sees it.
/usr/share/initramfs-tools/scripts/init-premount/gpu-unlock:loads
nvidia_drm.init-premountruns afterload_modules(wheregpu_unlock runs) and before
local-top/cryptrootasks for thepassphrase.
/conf/modules:/initexportsMODPROBE_OPTIONS="-qb", so every modprobe in the initramfs appliesthe blacklist and fails without a message. The script unsets
MODPROBE_OPTIONSfirst.*** buffer overflow detected ***on an emptyMODPROBE_OPTIONS.for a kernel without nvidia.
mkinitcpio and dracut, which this PR does not change.
nvidia_drm, writes the blacklist and leaves/conf/modulesalone; the script loadsnvidia_drmwithoutMODPROBE_OPTIONSwhen run with-qb, and does nothing without theblacklist; both are installed executable.
Only the Debian package uses initramfs-tools; RPM (dracut) and Arch
(mkinitcpio) packaging is unchanged.
Cost
Each initramfs grows by about 90 MB (165 MB to 256 MB here), most of it
the driver's GSP firmware (
gsp_ga10x.bin,gsp_tu10x.bin). Check thefree space on
/boot.Testing
make testmkinitramfsand checked it: the nvidia modulesand firmware are in it, the blacklist is in
etc/modprobe.d, and thescript is in
init-premount/ORDERMODPROBE_OPTIONS=-qbas at boot:modprobe nvidia_drmloads nothing (reproduces the original failure),and the script loads
nvidia→nvidia-modeset→nvidia-drm modeset=1the initramfs (kernel log and
/run/initramfs/initramfs.debug)unlock, and
journalctl -k -b | grep gpu_unlockshowsunlocked🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.