[PR #90] [CLOSED] mkinitcpio: use plain gpu_unlock module name #143

Closed
opened 2026-10-26 16:41:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Zagitta/gpu-unlock/pull/90
Author: @xkeyC
Created: 10/25/2026
Status: ❌ Closed

Base: main ← Head: fix/mkinitcpio-systemd-modules-load


📝 Commits (1)

  • 7aa4a09 mkinitcpio: use plain gpu_unlock module name

📊 Changes

2 files changed (+6 additions, -4 deletions)

View changed files

📝 packaging/boot/mkinitcpio.conf (+4 -2)
📝 tests/test_packaging.py (+2 -2)

📄 Description

Problem

packaging/boot/mkinitcpio.conf adds the module as gpu_unlock?. The trailing ? is mkinitcpio's own "optional module" syntax and is stripped when mkinitcpio copies the module into the image, but the string stored in MODULES is used verbatim by the systemd hook:

# /usr/lib/initcpio/install/systemd
printf '%s\n' "${MODULES[@]}" | add_file - '/etc/modules-load.d/MODULES.conf' 644

systemd-modules-load then tries to load a module named gpu_unlock?, which is not a valid module name, and fails. The module and its firmware are in the initramfs, but gpu_unlock never runs: no FWSEC/FLR lines, no unlock, and the card stays at half rate. On Arch (and any image built with the systemd hook) this makes the package look broken while giving no useful error. The ? suffix was meant to tolerate a missing module at image build time, not at modules-load time.

Fix

Use the plain module name gpu_unlock in the drop-in, keep the optional handling when an existing entry is matched, add a comment explaining the constraint, and update the packaging test's expected result.

Validation

Arch Linux, kernel 7.2.8-zen1-2-zen, mkinitcpio 42.2, HOOKS contains systemd:

  • Before: the built image's /etc/modules-load.d/MODULES.conf contained gpu_unlock?; lsmod had no gpu_unlock after boot.
  • After: the built image contains gpu_unlock; the module loads at boot (refcount 0, inert without targets=).
  • Cold boot with gpu_unlock.targets=0000:01:00.0 on an RTX 3060 (10de:2504) completed the transaction: FWSEC: reading PROM, selector result: SS0=0x88888888 matched=1, PCIe FLR returned: result=0, gpu_unlock: unlocked; the RM getter reported fmla32/imla4 changing from 1 (half) to 0 (full).
  • python3 -m unittest tests.test_packaging passes; no other changes.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Zagitta/gpu-unlock/pull/90 **Author:** [@xkeyC](https://github.com/xkeyC) **Created:** 10/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/mkinitcpio-systemd-modules-load` --- ### 📝 Commits (1) - [`7aa4a09`](https://github.com/Zagitta/gpu-unlock/commit/7aa4a09b13f761e5f973920067a1ce75701d5cc7) mkinitcpio: use plain gpu_unlock module name ### 📊 Changes **2 files changed** (+6 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packaging/boot/mkinitcpio.conf` (+4 -2) 📝 `tests/test_packaging.py` (+2 -2) </details> ### 📄 Description ## Problem `packaging/boot/mkinitcpio.conf` adds the module as `gpu_unlock?`. The trailing `?` is mkinitcpio's own "optional module" syntax and is stripped when mkinitcpio copies the module into the image, but the string stored in `MODULES` is used verbatim by the systemd hook: ```bash # /usr/lib/initcpio/install/systemd printf '%s\n' "${MODULES[@]}" | add_file - '/etc/modules-load.d/MODULES.conf' 644 ``` systemd-modules-load then tries to load a module named `gpu_unlock?`, which is not a valid module name, and fails. The module and its firmware are in the initramfs, but `gpu_unlock` never runs: no FWSEC/FLR lines, no unlock, and the card stays at half rate. On Arch (and any image built with the systemd hook) this makes the package look broken while giving no useful error. The `?` suffix was meant to tolerate a missing module at image build time, not at modules-load time. ## Fix Use the plain module name `gpu_unlock` in the drop-in, keep the optional handling when an existing entry is matched, add a comment explaining the constraint, and update the packaging test's expected result. ## Validation Arch Linux, kernel `7.2.8-zen1-2-zen`, mkinitcpio 42.2, `HOOKS` contains `systemd`: - Before: the built image's `/etc/modules-load.d/MODULES.conf` contained `gpu_unlock?`; `lsmod` had no `gpu_unlock` after boot. - After: the built image contains `gpu_unlock`; the module loads at boot (refcount 0, inert without `targets=`). - Cold boot with `gpu_unlock.targets=0000:01:00.0` on an RTX 3060 (`10de:2504`) completed the transaction: `FWSEC: reading PROM`, `selector result: SS0=0x88888888 matched=1`, `PCIe FLR returned: result=0`, `gpu_unlock: unlocked`; the RM getter reported `fmla32`/`imla4` changing from 1 (half) to 0 (full). - `python3 -m unittest tests.test_packaging` passes; no other changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 16:41:14 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Zagitta/gpu-unlock#143
No description provided.