Skip to content

Commit

Permalink
improve Arch Linux install script
Browse files Browse the repository at this point in the history
* detect every dkms package in /var/lib/dkms & create symlinks accordingly

  - this fixes symlinks for zenpower3 & in theory every other out-of-tree module
  • Loading branch information
itoffshore committed Sep 4, 2024
1 parent 885d473 commit f744567
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions arch-sign-modules/arch-sign-modules.install
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#!/bin/sh

MODULES=$(find /var/lib/dkms -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)

post_install() {
local x= module_list="zfs nvidia lkrg"
local dkms_dir=/etc/dkms dkms_link=
local dkms_dir=/etc/dkms dkms_link= x=
local kernel_sign=${dkms_dir}/kernel-sign.conf

for x in $module_list; do
if modinfo $x &>/dev/null; then
dkms_link="$dkms_dir/$x.conf"
if [ ! -L $dkms_link ]; then
echo "Creating DKMS symlink: $kernel_sign => $dkms_link"
ln -sf $kernel_sign $dkms_link
fi
for x in $MODULES; do
dkms_link="$dkms_dir/$x.conf"
if [ ! -L $dkms_link ]; then
echo "Creating DKMS symlink: $kernel_sign => $dkms_link"
ln -sf $kernel_sign $dkms_link
fi
done
}
Expand All @@ -21,10 +20,9 @@ post_upgrade() {
}

post_remove() {
local x= module_list="zfs nvidia lkrg"
local dkms_dir=/etc/dkms dkms_link=
local dkms_dir=/etc/dkms dkms_link= x=

for x in $module_list; do
for x in $MODULES; do
dkms_link="$dkms_dir/$x.conf"
if [ -L $dkms_link ]; then
echo "Removing DKMS symlink: $dkms_link"
Expand Down

0 comments on commit f744567

Please sign in to comment.