Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
dfef770
.gitignore: update after renaming generated files
anbe42 Jan 22, 2025
c9a95f2
Makefile: enumerate generated files only once
anbe42 Jan 21, 2025
d314057
dkms_autoinstaller: drop unused lsb function remainders etc.
anbe42 Jan 21, 2025
0a47034
dkms_autoinstaller: flatten kernel header test
anbe42 Jan 21, 2025
0d6551c
run_test.sh: test 'dkms add by config file'
anbe42 Jan 17, 2025
39e4832
run_test.sh: shuffle 'dkms add by version' tests
anbe42 Jan 17, 2025
65b1ccf
run_test.sh: split off a section for autoinstall etc. tests
anbe42 Jan 16, 2025
39f32be
run_test.sh: move the noautoinstall tests
anbe42 Jan 16, 2025
f7cfbda
run_test.sh: test 'dkms kernel_postinst/prerm' with a noautoinstall m…
anbe42 Jan 20, 2025
9f403ca
run_test.sh: test 'dkms autoinstall' without modules
anbe42 Jan 16, 2025
340946a
run_test.sh: test 'dkms kernel_postinst/prerm' without modules
anbe42 Jan 20, 2025
b210ad5
run_test.sh: test 'dkms_autoinstaller' without modules
anbe42 Jan 20, 2025
37be22b
run_test.sh: test 'dkms kernel_postinst/prerm' without headers
anbe42 Jan 20, 2025
849aa77
run_test.sh: test 'dkms_autoinstaller' without headers
anbe42 Jan 20, 2025
e12e80b
run_test.sh: test 'dkms kernel_postinst/prerm' with /etc/dkms/no-auto…
anbe42 Jan 20, 2025
637f00a
run_test.sh: test 'dkms_autoinstaller' with /etc/dkms/no-autoinstall
anbe42 Jan 20, 2025
bc94ddd
run_test.sh: test 'dkms_autoinstaller' with a normal module
anbe42 Jan 21, 2025
145e953
run_test.sh: test 'dkms_autoinstaller' with a noautoinstall module
anbe42 Jan 21, 2025
eb37532
run_test.sh: test 'dkms autoinstall' with a failing module
anbe42 Jan 21, 2025
fef95ab
run_test.sh: test 'dkms kernel_postinst' with a failing module
anbe42 Jan 21, 2025
262626b
run_test.sh: test 'dkms_autoinstaller' with a failing module
anbe42 Jan 21, 2025
1ac2e7d
dkms_autoinstaller: restore error propagation
anbe42 Jan 21, 2025
98ae421
run_test.sh: split off a section for signing tests
anbe42 Jan 17, 2025
fc43309
run_test.sh: split basic tests from signing tests
anbe42 Jan 22, 2025
ec8fa30
run_test.sh: the whole signing section needs signing enabled
anbe42 Jan 19, 2025
e402125
run_test.sh: use SIGNING_PROLOGUE_tmp_key_cert
anbe42 Jan 19, 2025
7e1f478
run_test.sh: simplify signing tests
anbe42 Jan 22, 2025
0143229
run_test.sh: reindent the signing tests section
anbe42 Jan 22, 2025
37da2f3
run_test.sh: test 'dkms autoinstall --all'
anbe42 Jan 23, 2025
a1aa4b7
dkms: forbid 'dkms autoinstall --all' which has never worked
anbe42 Jan 23, 2025
a1b3456
dkms: have_one_kernel: test check_all_is_banned first
anbe42 Jan 24, 2025
ffc58ac
dkms: also forbid 'dkms autoinstall -k <KVER1> -k <KVER2>'
anbe42 Jan 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
/dist
dkms
dkms.8
dkms.bash-completion
dkms.zsh-completion
dkms_framework.conf
dkms_autoinstaller
dkms.service
kernel_install.d_dkms
kernel_postinst.d_dkms
dkms_common.postinst
debian_kernel_install.d
debian_kernel_postinst.d
debian_kernel_prerm.d
redhat_kernel_install.d

test_cmd_expected_output.log
test_cmd_output.log
17 changes: 4 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SED_SUBSTITUTIONS = \
%: %.in
$(SED) $(SED_SUBSTITUTIONS) $< > $@

all: \
GENERATED= \
dkms \
dkms.8 \
dkms_autoinstaller \
Expand All @@ -43,20 +43,11 @@ all: \
debian_kernel_prerm.d \
redhat_kernel_install.d

all: $(GENERATED)

clean:
-rm -rf dist/
-rm -f dkms
-rm -f dkms.8
-rm -f dkms_autoinstaller
-rm -f dkms.bash-completion
-rm -f dkms.zsh-completion
-rm -f dkms_common.postinst
-rm -f dkms_framework.conf
-rm -f dkms.service
-rm -f debian_kernel_install.d
-rm -f debian_kernel_postinst.d
-rm -f debian_kernel_prerm.d
-rm -f redhat_kernel_install.d
$(RM) $(GENERATED)

install: all
$(if $(strip $(VAR)),$(error Setting VAR is not supported))
Expand Down
3 changes: 2 additions & 1 deletion dkms.in
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,11 @@ check_all_is_banned()

# A little test function for DKMS commands that only work on one kernel.
have_one_kernel() {
check_all_is_banned $1
if (( ${#kernelver[@]} != 1 )); then
[[ $1 =~ kernel_(postinst|prerm) ]] && die 4 "The action $1 requires exactly one kernel version parameter on the command line."
die 4 "The action $1 does not support multiple kernel version parameters on the command line."
fi
check_all_is_banned $1
}

# Set up the kernelver and arch arrays. You must have a 1:1 correspondence --
Expand Down Expand Up @@ -2956,6 +2956,7 @@ add | build | install)
${action}_module
;;
autoinstall)
have_one_kernel $action
check_root && autoinstall
;;
match)
Expand Down
27 changes: 3 additions & 24 deletions dkms_autoinstaller.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,24 @@
### END INIT INFO


if [ -f /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
elif [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
fi

exec="@SBINDIR@/dkms"
prog=${exec##*/}
MODDIR="@MODDIR@"

test -f $exec || exit 0

[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog

uname_s=$(uname -s)

_get_kernel_dir() {
KVER=$1
DIR="@MODDIR@/$KVER/build"
echo $DIR
}

_check_kernel_dir() {
DIR=$(_get_kernel_dir $1)
test -e $DIR/include
return $?
}

case "$1" in
start)
if [ -n "$2" ]; then
kernel="$2"
else
kernel=$(uname -r)
fi
if ! _check_kernel_dir $kernel; then
if [ ! -d "$MODDIR/$kernel/build/include" ]; then
echo "Automatic installation of modules for kernel $kernel was skipped since the kernel headers for this kernel do not seem to be installed."
else
dkms autoinstall --kernelver $kernel
res=$?
test $res = 0
fi
;;
stop|restart|force-reload|status|reload)
Expand Down
Loading