update: stop the linux package from wiping out-of-tree modules

Installing the linux package through pacman overwrote modules.dep with
the copy generated at kernel build time, which predates every
out-of-tree module: the joypad and the WiFi drivers vanished from the
index and the console booted with dead input and no network
(reproduced on real hardware). Two independent layers fix it: the repo
generator no longer ships any depmod-generated index inside packages
(modules.builtin*/order stay, they are kernel-owned depmod inputs),
and a new alpm hook rebuilds the index over the full overlay tree
after any transaction that touches kernel modules. linux goes to rel 3
so updated devices pick the clean package.
This commit is contained in:
Douglas Teles
2026-07-08 21:22:34 -03:00
parent 14db5f1ffb
commit faa9c6f6c4
4 changed files with 52 additions and 2 deletions
@@ -0,0 +1,11 @@
[Trigger]
Operation = Install
Operation = Upgrade
Operation = Remove
Type = Path
Target = usr/lib/kernel-overlays/*/lib/modules/*
[Action]
Description = Rebuilding the kernel module index (full tree)...
When = PostTransaction
Exec = /usr/bin/archr-depmod
+21
View File
@@ -0,0 +1,21 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2026-present ArchR (https://github.com/archr-linux/Arch-R)
#
# Regenerate the module dependency index over the FULL module tree after
# a pacman transaction touches kernel modules. The linux package used to
# ship the modules.dep generated at kernel build time, which predates
# every out-of-tree module (joypad, WiFi drivers); installing it wiped
# them from the index and the console came up with dead input and no
# WiFi. The repo no longer ships those index files, and this hook keeps
# the index honest on the device no matter what changed.
set -u
rc=0
for verdir in /usr/lib/kernel-overlays/*/lib/modules/*/; do
[ -d "${verdir}kernel" ] || continue
base="${verdir%/lib/modules/*}"
ver="$(basename "${verdir}")"
echo "archr-depmod: indexing ${ver} under ${base}"
depmod -a -b "${base}" "${ver}" || rc=1
done
exit ${rc}
+1 -1
View File
@@ -3,7 +3,7 @@
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="linux"
PKG_REV="2"
PKG_REV="3"
PKG_LICENSE="GPL"
PKG_SITE="http://www.kernel.org"
PKG_DEPENDS_HOST="ccache:host openssl:host"
+19 -1
View File
@@ -144,7 +144,25 @@ EOF
# /.image on every kernel update for nothing.
find . -mindepth 1 -maxdepth 1 -not -name '.PKGINFO' -not -name '.image' -printf '%P\n'
} > "${filelist}"
tar --zstd -cf "${outfile}" --owner=0 --group=0 -T "${filelist}"
# The depmod-generated indexes are stale by construction inside a
# package (the kernel builds them before any out-of-tree module
# exists); shipping them wiped the joypad and WiFi drivers from
# modules.dep on every linux update. The device rebuilds them via
# the archr-depmod hook; modules.builtin*/order stay (kernel-owned
# depmod inputs).
tar --zstd -cf "${outfile}" --owner=0 --group=0 \
--exclude='*/modules/*/modules.dep' \
--exclude='*/modules/*/modules.dep.bin' \
--exclude='*/modules/*/modules.alias' \
--exclude='*/modules/*/modules.alias.bin' \
--exclude='*/modules/*/modules.symbols' \
--exclude='*/modules/*/modules.symbols.bin' \
--exclude='*/modules/*/modules.devname' \
--exclude='*/modules/*/modules.softdep' \
--exclude='*/modules/*/modules.weakdep' \
--exclude='*/modules/*/modules.builtin.bin' \
--exclude='*/modules/*/modules.builtin.alias.bin' \
-T "${filelist}"
rm -f "${filelist}"
)
rm -f "${pkginfo}"