mirror of
https://github.com/theupriser/steamify-cachyos-live-iso.git
synced 2026-10-02 15:10:26 +02:00
fix: Live power-off module: a fresh build folder per kernel, no clean in the same make (kbuild re-ran itself endlessly)
This commit is contained in:
1 parent
309b22f634
commit
abb534613e
1 file changed
+6
-4
@@ -12,19 +12,21 @@ src=archiso/airootfs/usr/local/share/steamify/steamify-fremont-poweroff.c
|
|||||||
[[ -f "$src" ]] || { echo "No $src: run steamify-prepare.sh first." >&2; exit 1; }
|
[[ -f "$src" ]] || { echo "No $src: run steamify-prepare.sh first." >&2; exit 1; }
|
||||||
|
|
||||||
pacman -S --needed --noconfirm base-devel clang llvm lld linux-cachyos-headers linux-cachyos-lts-headers >/dev/null
|
pacman -S --needed --noconfirm base-devel clang llvm lld linux-cachyos-headers linux-cachyos-lts-headers >/dev/null
|
||||||
|
for build in /usr/lib/modules/*/build; do
|
||||||
|
kver="$(basename "$(dirname "$build")")"
|
||||||
|
# A fresh folder per kernel: `make clean modules` in one call makes
|
||||||
|
# kbuild re-run itself endlessly for an external module.
|
||||||
work="$(mktemp -d)"
|
work="$(mktemp -d)"
|
||||||
cp "$src" "$work/"
|
cp "$src" "$work/"
|
||||||
echo 'obj-m += steamify-fremont-poweroff.o' > "$work/Makefile"
|
echo 'obj-m += steamify-fremont-poweroff.o' > "$work/Makefile"
|
||||||
for build in /usr/lib/modules/*/build; do
|
|
||||||
kver="$(basename "$(dirname "$build")")"
|
|
||||||
# CachyOS's kernels differ in compiler (linux-cachyos is clang-built):
|
# CachyOS's kernels differ in compiler (linux-cachyos is clang-built):
|
||||||
# build with the one the kernel was built with.
|
# build with the one the kernel was built with.
|
||||||
llvm=()
|
llvm=()
|
||||||
grep -q '^CONFIG_CC_IS_CLANG=y' "$build/.config" && llvm=(LLVM=1)
|
grep -q '^CONFIG_CC_IS_CLANG=y' "$build/.config" && llvm=(LLVM=1)
|
||||||
make -s -C "$build" M="$work" "${llvm[@]}" clean modules
|
make -s -C "$build" M="$work" "${llvm[@]}" modules
|
||||||
install -Dm644 "$work/steamify-fremont-poweroff.ko" \
|
install -Dm644 "$work/steamify-fremont-poweroff.ko" \
|
||||||
"archiso/airootfs/usr/lib/modules/$kver/extra/steamify-fremont-poweroff.ko"
|
"archiso/airootfs/usr/lib/modules/$kver/extra/steamify-fremont-poweroff.ko"
|
||||||
|
rm -rf "$work"
|
||||||
echo "Power-off fix built for $kver."
|
echo "Power-off fix built for $kver."
|
||||||
done
|
done
|
||||||
rm -rf "$work"
|
|
||||||
install -Dm644 /dev/stdin archiso/airootfs/etc/modules-load.d/steamify-fremont-poweroff.conf <<< 'steamify-fremont-poweroff'
|
install -Dm644 /dev/stdin archiso/airootfs/etc/modules-load.d/steamify-fremont-poweroff.conf <<< 'steamify-fremont-poweroff'
|
||||||
Reference in new issue
Block a user