alwaysInBeta Stable software is for the weak

Manually decompressing modules on Linux

2025-04-07

Today, I updated my laptop running postmarketOS, and it broke. To be fair, I knew what I was getting into when I ran edge, although the fact that this keeps happening rather motivates my other work into being able to roll back updates at will (see: previous posts on bootc, plus unpublished work on A/B roots, poking around porting NixOS to more hardware, experiments with ostree…).

Anyways.

To make a long story short, busybox’s modprobe can’t handle zstd compressed kernel modules, and owing to what I’m going to tentatively call a packaging error, I ended up with a system using busybox modprobe and zstd modules at the same time. Well, I say “using”… the weird thing is what did and didn’t break. Keyboard was fine. Graphics were fine. Any network interface but lo, totally gone. And while troubleshooting, I performed the following contortions and felt that it was worth recording:

doas su -
cp -r /lib/modules/6.12.21-mt8183 /lib/modules/6.12.21-mt8183.bak
mkdir modules-6.12.21  # temporary place to put things
find /lib/modules/6.12.21-mt8183/ -name \*.ko.zst -exec zstd --output-dir-mirror ./modules-6.12.21 -d {} \;
find modules-6.12.21/  # double-check that things look right
cp -r  ./modules-6.12.21/lib/modules/6.12.21-mt8183/* /lib/modules/6.12.21-mt8183/
find /lib/modules/6.12.21-mt8183/ -name \*.ko.zst -exec  rm {} \;
depmod  # without this, modprobe won't work
modprobe fuse  # or anything else to check that it worked
reboot