docs(kernel): Update README with module selection details
Expand documentation on selftest.sh behavior, module matching, and kernel compatibility. Clarify the auto-selection process based on `vermagic` and provide examples to guide users through fallback handling and manual overrides.
This commit is contained in:
parent
160f6bb799
commit
6e5ec9b84f
@ -20,14 +20,35 @@ before connecting the real bus (see PLAN.md §10).
|
|||||||
### Running it
|
### Running it
|
||||||
|
|
||||||
`selftest.sh` is non-persistent (nothing is installed into `/lib/modules`, no
|
`selftest.sh` is non-persistent (nothing is installed into `/lib/modules`, no
|
||||||
autoload): it checks vermagic, loads the module, runs the self-test, and always
|
autoload): it detects the running kernel, picks the matching module, loads it,
|
||||||
unloads it again.
|
runs the self-test, and always unloads it again.
|
||||||
|
|
||||||
|
A released package ships several kernel builds side by side:
|
||||||
|
|
||||||
|
```
|
||||||
|
comodore-iec-emu/
|
||||||
|
├── selftest.sh
|
||||||
|
└── modules/
|
||||||
|
├── iec_listener_1-6.12.93-1+rpt1.ko # built for 6.12.x (bookworm)
|
||||||
|
└── iec_listener_1-6.18.34-1+rpt1.ko # built for 6.18.x (trixie)
|
||||||
|
```
|
||||||
|
|
||||||
|
You don't pick the file yourself: the script reads `uname -r`, then scans
|
||||||
|
`modules/` (and a few fallback locations) and selects the `.ko` whose **vermagic**
|
||||||
|
matches the running kernel. Matching is by vermagic rather than filename because
|
||||||
|
the packaged name carries a Debian epoch/revision (`1:6.12.93-1+rpt1`) that
|
||||||
|
`uname -r` (`6.12.93+rpt-rpi-v8`) does not.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo ./selftest.sh # auto-finds ./ or ~/iec_listener.ko, address 4
|
sudo ./selftest.sh # auto-selects the matching module, address 4
|
||||||
sudo ./selftest.sh ~/iec_listener.ko --address 5 # runs with ~/iec_listener.ko, address 5
|
sudo ./selftest.sh --address 5 # same, address 5
|
||||||
|
sudo ./selftest.sh ~/iec_listener.ko --address 5 # force a specific module file
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If no module matches the running kernel, the script lists the modules it found
|
||||||
|
(with the kernel each was built for) and exits — rebuild for the current kernel,
|
||||||
|
or pass a path explicitly.
|
||||||
|
|
||||||
It exits non-zero unless the result is a full pass (`0x1F`), so it is usable in
|
It exits non-zero unless the result is a full pass (`0x1F`), so it is usable in
|
||||||
scripts/CI.
|
scripts/CI.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user