From 2d14897af9d9bbfe26a79ab6d2d8f6d425982e6a Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Sat, 7 Sep 2024 18:56:52 +0200 Subject: [PATCH] Second round of output cleaning --- dkms.in | 46 ++++++------ dkms_autoinstaller.in | 17 +---- run_test.sh | 166 +++++++++++++----------------------------- 3 files changed, 74 insertions(+), 155 deletions(-) diff --git a/dkms.in b/dkms.in index 98ac8e5d..e9819d43 100644 --- a/dkms.in +++ b/dkms.in @@ -120,7 +120,7 @@ invoke_command() error() ( exec >&2 - echo $"" + echo "" echo -n $"Error! " for s in "$@"; do echo "$s"; done ) @@ -767,7 +767,7 @@ check_version_sanity() fi if ((obsolete == 1)); then - echo $"" >&2 + echo "" >&2 echo $"Module has been obsoleted due to being included" >&2 echo $"in kernel $3. We will avoid installing" >&2 echo $"for future kernels above $3." >&2 @@ -840,14 +840,14 @@ run_build_script() { esac run="$dkms_tree/$module/$module_version/$script_type/$2" if [[ -x ${run%% *} ]]; then - echo $"" + echo "" echo $"Running the $1 script:" ( cd "$dkms_tree/$module/$module_version/$script_type/" exec $run ) else - echo $"" + echo "" warn $"The $1 script is not executable." fi } @@ -1012,6 +1012,7 @@ prepare_signing() sign_file="$install_tree/$kernelver/build/scripts/sign-file" fi fi + echo "" echo "Sign command: $sign_file" if [[ ! -f ${sign_file} || ! -x ${sign_file} ]]; then @@ -1114,7 +1115,7 @@ actual_build() local -r build_dir="$dkms_tree/$module/$module_version/build" local -r build_log="$build_dir/make.log" - echo $"" + echo "" invoke_command "$clean" "Cleaning build area" '' background echo $"DKMS make.log for $module-$module_version for kernel $kernelver ($arch)" >> "$build_log" @@ -1267,7 +1268,7 @@ do_install() local any_module_installed local count - echo $"" + echo "" for ((count=0; count < ${#built_module_name[@]}; count++)); do # Check this version against what is already in the kernel check_version_sanity "$kernelver" "$arch" "$obsolete_by" "${dest_module_name[$count]}" || continue @@ -1326,8 +1327,6 @@ do_install() done - echo $"" - if ((${#built_module_name[@]} > 0)) && [[ ! "${any_module_installed}" ]]; then die 6 $"Installation aborted." fi @@ -1520,7 +1519,8 @@ do_uninstall() # $1 = kernel version # $2 = arch - echo $"Module $module-$module_version for kernel $1 ($2)." + echo "" + echo $"Module $module-$module_version for kernel $1 ($2):" set_module_suffix "$1" @@ -1539,7 +1539,6 @@ do_uninstall() fi fi - echo $"" for ((count=0; count < ${#built_module_name[@]}; count++)); do real_dest_module_location="$(find_actual_dest_module_location $module $count $1 $2)" @@ -1562,8 +1561,6 @@ do_uninstall() fi done rm -f "$dkms_tree/$module/kernel-$1-$2" - - echo $"" else echo $"This module version was INACTIVE for this kernel." fi @@ -1576,12 +1573,12 @@ do_uninstall() # Delete the original_module if nothing for this kernel is installed anymore if [[ $was_active && -d $dkms_tree/$module/original_module/$1/$2 && ! -d $dkms_tree/$module/original_module/$1/$2/collisions ]]; then - echo $"" + echo "" echo $"Removing original_module from DKMS tree for kernel $1 ($2)" rm -rf "$dkms_tree/$module/original_module/$1/$2" 2>/dev/null [[ $(find $dkms_tree/$module/original_module/$1/* -maxdepth 0 -type d 2>/dev/null) ]] || rm -rf "$dkms_tree/$module/original_module/$1" elif [[ $was_active && -d $dkms_tree/$module/original_module/$1/$2/collisions ]]; then - echo $"" + echo "" echo $"Keeping directory $dkms_tree/$module/original_module/$1/$2/collisions/" echo $"for your reference purposes. Your kernel originally contained multiple" echo $"same-named modules and this directory is now where these are located." @@ -1674,6 +1671,7 @@ remove_module() # Delete the $module_version part of the tree if no other $module_version/$kernel_version dirs exist if ! find $dkms_tree/$module/$module_version/* -maxdepth 0 -type d 2>/dev/null | grep -Eqv "(build|tarball|driver_disk|rpm|deb|source)$"; then + echo "" echo $"Deleting module $module-$module_version completely from the DKMS tree." rm -rf "$dkms_tree/$module/$module_version" fi @@ -1892,7 +1890,7 @@ make_tarball() if [[ $binaries_only ]]; then local -r binary_only_dir="$temp_dir_name/dkms_binaries_only" - echo $"" + echo "" echo $"Creating tarball structure to specifically accomodate binaries." mkdir "$binary_only_dir" @@ -1901,7 +1899,7 @@ make_tarball() [[ ! $conf ]] && conf="$source_dir/dkms.conf" cp -f $conf "$binary_only_dir/" 2>/dev/null else - echo $"" + echo "" echo $"Marking $source_dir for archiving..." mkdir -p $temp_dir_name/dkms_source_tree cp -rf $source_dir/* $temp_dir_name/dkms_source_tree @@ -1921,7 +1919,7 @@ make_tarball() fi fi - echo $"" + echo "" echo $"Tarball location: $tarball_dest/$tarball_name" if [[ ! -d $tarball_dest ]]; then @@ -2005,7 +2003,7 @@ load_tarball() done module="$PACKAGE_NAME"; module_version="$PACKAGE_VERSION" - echo $"" + echo "" echo $"Loading tarball for $module-$module_version" case $loc in dkms_source_tree) @@ -2076,13 +2074,13 @@ run_match() template_kernel_status=$(echo "$template_kernel_status" | grep "^$module,") fi - echo $"" + echo "" echo $"Matching modules in kernel: $kernelver ($arch)" echo $"to the configuration of kernel: $template_kernel ($arch)" # Prepare the kernel just once but only if there is actual work to do if [[ ! $template_kernel_status ]]; then - echo $"" + echo "" echo $"There is nothing to be done for this match." return 0 fi @@ -2321,20 +2319,20 @@ autoinstall() { done if (( ${#installed_modules[@]} > 0 )); then - echo "dkms autoinstall on $kernelver/$arch succeeded for ${installed_modules[@]}" + echo "Autoinstall on $kernelver succeeded for module(s) ${installed_modules[@]}." fi if (( ${#skipped_modules[@]} > 0 )); then - echo "dkms autoinstall on $kernelver/$arch was skipped for ${skipped_modules[@]}" + echo "Autoinstall on $kernelver was skipped for module(s) ${skipped_modules[@]}." fi if (( ${#failed_modules[@]} > 0 )); then - echo "dkms autoinstall on $kernelver/$arch failed for ${failed_modules[@]}" + echo "Autoinstall on $kernelver failed for module(s) ${failed_modules[@]}." fi for mv in "${to_install[@]}"; do IFS=/ read m v <<< "$mv" - echo "$m/$v autoinstall failed due to missing dependencies: ${build_depends[$m]}" + echo "$m/$v Autoinstall failed due to missing dependencies: ${build_depends[$m]}." done if (( ${#failed_modules[@]} > 0 || ${#to_install[@]} > 0 )); then diff --git a/dkms_autoinstaller.in b/dkms_autoinstaller.in index 8dcfe82a..81e55ae4 100755 --- a/dkms_autoinstaller.in +++ b/dkms_autoinstaller.in @@ -23,21 +23,11 @@ elif [ -f /etc/rc.d/init.d/functions ]; then . /etc/rc.d/init.d/functions fi -# We only have these functions on Debian/Ubuntu -# so on other distros just stub them out -if [ ! -f /etc/debian_version ]; then - alias log_daemon_msg='/bin/echo -n' - log_end_msg() { if [ "$1" = "0" ]; then echo " Done. "; else echo " Failed. "; fi; } - alias log_action_msg=/bin/echo -fi - exec="@SBINDIR@/dkms" prog=${exec##*/} test -f $exec || exit 0 -[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog - uname_s=$(uname -s) _get_kernel_dir() { @@ -67,15 +57,12 @@ case "$1" in kernel=$(uname -r) fi if [ -f /etc/dkms/no-autoinstall ]; then - log_action_msg "$prog: autoinstall for dkms modules has been disabled" + log_action_msg "Automatic installation of modules has been disabled." elif ! _check_kernel_dir $kernel; then - log_action_msg "$prog: autoinstall for kernel $kernel was skipped since the kernel headers for this kernel do not seem to be installed" + log_action_msg "Automatic installation of modules for kernel $kernel was skipped since the kernel headers for this kernel do not seem to be installed" else - log_action_msg "$prog: running auto installation service for kernel $kernel" dkms autoinstall --kernelver $kernel res=$? - log_daemon_msg "$prog: autoinstall for kernel" "$kernel" - log_end_msg $res fi ;; stop|restart|force-reload|status|reload) diff --git a/run_test.sh b/run_test.sh index b8fbb731..93e3b3c1 100755 --- a/run_test.sh +++ b/run_test.sh @@ -189,7 +189,8 @@ generalize_expected_output() { # Apport related error that can occur in the CI. Drop from the output to be more generic sed -i "/^python3: can't open file '\/usr\/share\/apport\/package-hooks\/dkms_packages.py'\: \[Errno 2\] No such file or directory$/d" ${output_log} sed -i "/^ERROR (dkms apport): /d" ${output_log} - + # Drop empty lines + sed -i "/^$/d" ${output_log} # Swap any CC/LD/... flags (if set) with a placeholder message sed -i "s|\(make -j1 KERNELRELEASE=${KERNEL_VER} all\).*|\1 |" ${output_log} } @@ -296,7 +297,6 @@ rm /etc/dkms/framework.conf.d/dkms_test_framework.conf echo 'Adding the test module by version (expected error)' run_with_expected_error 2 dkms add -m dkms_test -v 1.0 << EOF - Error! Could not find module source directory. Directory: /usr/src/dkms_test-1.0 does not exist. EOF @@ -315,14 +315,12 @@ fi echo 'Adding the test module again (expected error)' run_with_expected_error 3 dkms add test/dkms_test-1.0 << EOF - Error! DKMS tree already contains: dkms_test-1.0 You cannot add the same module/version combo more than once. EOF echo 'Adding the test module by version (expected error)' run_with_expected_error 3 dkms add -m dkms_test -v 1.0 << EOF - Error! DKMS tree already contains: dkms_test-1.0 You cannot add the same module/version combo more than once. EOF @@ -330,7 +328,6 @@ EOF echo 'Building the test module' set_signing_message "dkms_test" "1.0" run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. @@ -352,7 +349,6 @@ if (( NO_SIGNING_TOOL == 0 )); then cp test/framework/bad_sign_file_path.conf /etc/dkms/framework.conf.d/dkms_test_framework.conf run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 --force << EOF Binary /no/such/file not found, modules won't be signed - Cleaning build area... done. Building module(s)... done. Cleaning build area... done. @@ -362,7 +358,6 @@ EOF cp test/framework/bad_key_file_path.conf /etc/dkms/framework.conf.d/dkms_test_framework.conf run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 --force << EOF Key file /no/such/path.key not found and can't be generated, modules won't be signed - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. @@ -372,7 +367,6 @@ EOF cp test/framework/bad_cert_file_path.conf /etc/dkms/framework.conf.d/dkms_test_framework.conf run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 --force << EOF Certificate file /no/such/path.crt not found and can't be generated, modules won't be signed - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. @@ -383,7 +377,6 @@ EOF mkdir "/tmp/dkms_test_dir_${KERNEL_VER}/" cp test/framework/variables_in_path.conf /etc/dkms/framework.conf.d/dkms_test_framework.conf run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 --force << EOF - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. @@ -408,7 +401,6 @@ EOF fi echo "CONFIG_MODULE_SIG_HASH=\"${ALTER_HASH}\"" > /tmp/dkms_test_kconfig run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 --config /tmp/dkms_test_kconfig --force << EOF - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. @@ -426,7 +418,6 @@ cp test/framework/temp_key_cert.conf /etc/dkms/framework.conf.d/dkms_test_framew echo 'Building the test module again by force' run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 --force << EOF - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. @@ -442,9 +433,7 @@ fi echo 'Installing the test module' run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF - Installing /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_test' << EOF @@ -465,15 +454,11 @@ fi echo 'Installing the test module again by force' run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_test -v 1.0 --force << EOF -Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). +Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}): Before uninstall, this module version was ACTIVE on this kernel. - Deleting /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} - Running depmod... done. - Installing /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_test' << EOF @@ -509,11 +494,9 @@ fi echo 'Uninstalling the test module' run_with_expected_output dkms uninstall -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF -Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). +Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}): Before uninstall, this module version was ACTIVE on this kernel. - Deleting /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_test' << EOF @@ -580,13 +563,10 @@ EOF echo 'Installing the test module by version (combining add, build, install)' run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF Creating symlink /var/lib/dkms/dkms_test/1.0/source -> /usr/src/dkms_test-1.0 - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. - Installing /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_test' << EOF @@ -627,11 +607,9 @@ fi echo 'Removing the test module with --all' run_with_expected_output dkms remove --all -m dkms_test -v 1.0 << EOF -Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). +Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}): Before uninstall, this module version was ACTIVE on this kernel. - Deleting /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} - Running depmod... done. Deleting module dkms_test-1.0 completely from the DKMS tree. EOF @@ -648,7 +626,6 @@ rm -r /usr/src/dkms_test-1.0 echo 'Building the test module by config file (combining add, build)' run_with_expected_output dkms build -k "${KERNEL_VER}" test/dkms_test-1.0/dkms.conf << EOF Creating symlink /var/lib/dkms/dkms_test/1.0/source -> /usr/src/dkms_test-1.0 - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. @@ -659,11 +636,9 @@ EOF echo "Running dkms autoinstall" run_with_expected_output dkms autoinstall -k "${KERNEL_VER}" << EOF - Installing /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} - Running depmod... done. -dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} succeeded for dkms_test +Autoinstall on ${KERNEL_VER} succeeded for module(s) dkms_test. EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed @@ -671,22 +646,18 @@ EOF echo "Running dkms autoinstall for a kernel without headers installed (expected error)" run_with_expected_error 11 dkms autoinstall -k "${KERNEL_VER}-noheaders" << EOF - Error! Your kernel headers for kernel ${KERNEL_VER}-noheaders cannot be found at /lib/modules/${KERNEL_VER}-noheaders/build or /lib/modules/${KERNEL_VER}-noheaders/source. Please install the linux-headers-${KERNEL_VER}-noheaders package or use the --kernelsourcedir option to tell DKMS where it's located. -dkms autoinstall on ${KERNEL_VER}-noheaders/${KERNEL_ARCH} failed for dkms_test(1) - +Autoinstall on ${KERNEL_VER}-noheaders failed for module(s) dkms_test(1). Error! One or more modules failed to install during autoinstall. Refer to previous errors for more information. EOF echo 'Removing the test module with --all' run_with_expected_output dkms remove --all -m dkms_test -v 1.0 << EOF -Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). +Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}): Before uninstall, this module version was ACTIVE on this kernel. - Deleting /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} - Running depmod... done. Deleting module dkms_test-1.0 completely from the DKMS tree. EOF @@ -731,7 +702,6 @@ EOF echo 'Building the noautoinstall test module' set_signing_message "dkms_noautoinstall_test" "1.0" run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_noautoinstall_test -v 1.0 << EOF - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. @@ -742,9 +712,7 @@ EOF echo 'Installing the noautoinstall test module' run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_noautoinstall_test -v 1.0 << EOF - Installing /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_noautoinstall_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_noautoinstall_test' << EOF @@ -753,11 +721,9 @@ EOF echo 'Uninstalling the noautoinstall test module' run_with_expected_output dkms uninstall -k "${KERNEL_VER}" -m dkms_noautoinstall_test -v 1.0 << EOF -Module dkms_noautoinstall_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). +Module dkms_noautoinstall_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}): Before uninstall, this module version was ACTIVE on this kernel. - Deleting /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_noautoinstall_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_noautoinstall_test' << EOF @@ -803,7 +769,6 @@ abspwd=$(readlink -f $(pwd)) echo 'Testing dkms add of source tree without dkms.conf (expected error)' run_with_expected_error 1 dkms add ${abspwd}/test/dkms_conf_test_no_conf << EOF - Error! Arguments and are not specified. Usage: add / or add -m / or @@ -815,7 +780,6 @@ run_with_expected_error 8 dkms add test/dkms_conf_test_empty << EOF dkms.conf: Error! No 'PACKAGE_NAME' directive specified. dkms.conf: Error! No 'PACKAGE_VERSION' directive specified. dkms.conf: Warning! Zero modules specified. - Error! Bad conf file. File: ${abspwd}/test/dkms_conf_test_empty/dkms.conf does not represent a valid dkms.conf file. EOF @@ -830,7 +794,6 @@ dkms.conf: Error! 'BUILT_MODULE_NAME' directive ends in '.o' or '.ko' in record dkms.conf: Error! No 'DEST_MODULE_LOCATION' directive specified for record #1. dkms.conf: Error! Directive 'DEST_MODULE_LOCATION' does not begin with '/kernel', '/updates', or '/extra' in record #1. - Error! Bad conf file. File: ${abspwd}/test/dkms_conf_test_invalid/dkms.conf does not represent a valid dkms.conf file. EOF @@ -855,12 +818,9 @@ echo 'Testing add/build/install of a test module building zero kernel modules' run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_conf_test -v 1.0 << EOF dkms.conf: Warning! Zero modules specified. Creating symlink /var/lib/dkms/dkms_conf_test/1.0/source -> /usr/src/dkms_conf_test-1.0 - Cleaning build area... done. Building module(s)... done. Cleaning build area... done. - - Running depmod... done. EOF run_status_with_expected_output 'dkms_conf_test' << EOF @@ -871,10 +831,8 @@ EOF run_with_expected_output dkms remove --all -m dkms_conf_test -v 1.0 << EOF dkms.conf: Warning! Zero modules specified. dkms.conf: Warning! Zero modules specified. -Module dkms_conf_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). +Module dkms_conf_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}): Before uninstall, this module version was ACTIVE on this kernel. - - Running depmod... done. Deleting module dkms_conf_test-1.0 completely from the DKMS tree. EOF @@ -889,7 +847,6 @@ EOF echo 'Building test module without source (expected error)' run_with_expected_error 8 dkms build -k "${KERNEL_VER}" -m dkms_conf_test -v 1.0 << EOF - Error! The directory /var/lib/dkms/dkms_conf_test/1.0/source does not appear to have module source located within it. Build halted. EOF @@ -937,7 +894,6 @@ fi echo 'Building the multiver test modules' set_signing_message "dkms_multiver_test" "1.0" run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_multiver_test -v 1.0 << EOF - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. @@ -962,7 +918,6 @@ echo 'Installing the multiver test modules' run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_multiver_test -v 1.0 << EOF Installing /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_multiver_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_multiver_test' << EOF @@ -972,7 +927,6 @@ EOF run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_multiver_test -v 2.0 << EOF Installing /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_multiver_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_multiver_test' << EOF @@ -980,13 +934,9 @@ dkms_multiver_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built dkms_multiver_test/2.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed EOF run_with_expected_error 6 dkms install -k "${KERNEL_VER}" -m dkms_multiver_test -v 1.0 << EOF - - Error! Module version 1.0 for dkms_multiver_test.ko${mod_compression_ext} is not newer than what is already found in kernel ${KERNEL_VER} (2.0). You may override by specifying --force. - - Error! Installation aborted. EOF run_status_with_expected_output 'dkms_multiver_test' << EOF @@ -1003,11 +953,10 @@ dkms_multiver_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built dkms_multiver_test/2.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed EOF run_with_expected_output dkms uninstall -k "${KERNEL_VER}" -m dkms_multiver_test -v 2.0 << EOF -Module dkms_multiver_test-2.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). -Before uninstall, this module version was ACTIVE on this kernel. +Module dkms_multiver_test-2.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}): +Before uninstall, this module version was ACTIVE on this kernel. Deleting /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_multiver_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_multiver_test' << EOF @@ -1039,6 +988,7 @@ echo 'Removing the multiver test modules' run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_multiver_test -v 1.0 << EOF Module dkms_multiver_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_multiver_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... + Deleting module dkms_multiver_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_multiver_test' << EOF @@ -1047,6 +997,7 @@ EOF run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_multiver_test -v 2.0 << EOF Module dkms_multiver_test 2.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_multiver_test 2.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... + Deleting module dkms_multiver_test-2.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_multiver_test' << EOF @@ -1087,7 +1038,6 @@ fi echo 'Building the nover/emptyver test modules' set_signing_message "dkms_nover_test" "1.0" run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_nover_test -v 1.0 << EOF - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. @@ -1097,7 +1047,6 @@ dkms_nover_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF set_signing_message "dkms_emptyver_test" "1.0" run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_emptyver_test -v 1.0 << EOF - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. @@ -1108,9 +1057,7 @@ EOF echo 'Installing the nover/emptyver test modules' run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_nover_test -v 1.0 << EOF - Installing /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_nover_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_nover_test' << EOF @@ -1119,7 +1066,6 @@ EOF run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_emptyver_test -v 1.0 << EOF Installing /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_emptyver_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_emptyver_test' << EOF @@ -1128,11 +1074,10 @@ EOF echo 'Uninstalling the nover/emptyver test modules' run_with_expected_output dkms uninstall -k "${KERNEL_VER}" -m dkms_nover_test -v 1.0 << EOF -Module dkms_nover_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). -Before uninstall, this module version was ACTIVE on this kernel. +Module dkms_nover_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}): +Before uninstall, this module version was ACTIVE on this kernel. Deleting /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_nover_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_nover_test' << EOF @@ -1143,11 +1088,10 @@ if [[ -e "/lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_nover_test.ko${mo exit 1 fi run_with_expected_output dkms uninstall -k "${KERNEL_VER}" -m dkms_emptyver_test -v 1.0 << EOF -Module dkms_emptyver_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). -Before uninstall, this module version was ACTIVE on this kernel. +Module dkms_emptyver_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}): +Before uninstall, this module version was ACTIVE on this kernel. Deleting /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_emptyver_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_emptyver_test' << EOF @@ -1176,6 +1120,7 @@ echo 'Removing the nover/emptyver test modules' run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_nover_test -v 1.0 << EOF Module dkms_nover_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_nover_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... + Deleting module dkms_nover_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_nover_test' << EOF @@ -1183,6 +1128,7 @@ EOF run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_emptyver_test -v 1.0 << EOF Module dkms_emptyver_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_emptyver_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... + Deleting module dkms_emptyver_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_emptyver_test' << EOF @@ -1207,13 +1153,10 @@ fi echo 'Installing the nover update test 1.0 modules' set_signing_message "dkms_nover_update_test" "1.0" run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_nover_update_test -v 1.0 << EOF - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. - Installing /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_nover_update_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_nover_update_test' << EOF @@ -1236,13 +1179,10 @@ fi echo 'Installing the nover update test 2.0 modules' set_signing_message "dkms_nover_update_test" "2.0" run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_nover_update_test -v 2.0 << EOF - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. - Installing /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_nover_update_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_nover_update_test' << EOF @@ -1267,7 +1207,6 @@ fi echo 'Building the nover update test 3.0 modules' set_signing_message "dkms_nover_update_test" "3.0" run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_nover_update_test -v 3.0 << EOF - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. @@ -1303,19 +1242,21 @@ fi echo 'Removing the nover update test modules' run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_nover_update_test -v 3.0 << EOF Module dkms_nover_update_test 3.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... + Deleting module dkms_nover_update_test-3.0 completely from the DKMS tree. EOF run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_nover_update_test -v 2.0 << EOF -Module dkms_nover_update_test-2.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). -Before uninstall, this module version was ACTIVE on this kernel. +Module dkms_nover_update_test-2.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}): +Before uninstall, this module version was ACTIVE on this kernel. Deleting /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_nover_update_test.ko${mod_compression_ext} - Running depmod... done. + Deleting module dkms_nover_update_test-2.0 completely from the DKMS tree. EOF run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_nover_update_test -v 1.0 << EOF Module dkms_nover_update_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... + Deleting module dkms_nover_update_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_nover_update_test' << EOF @@ -1339,14 +1280,13 @@ Creating symlink /var/lib/dkms/dkms_failing_test/1.0/source -> /usr/src/dkms_fai EOF echo 'Running autoinstall with failing test module (expected error)' run_with_expected_error 11 dkms autoinstall -k "${KERNEL_VER}" << EOF - Cleaning build area... done. Building module(s)...(bad exit status: 2) Failed command: make -j1 KERNELRELEASE=${KERNEL_VER} all Error! Bad return status for module build on kernel: ${KERNEL_VER} (${KERNEL_ARCH}) Consult /var/lib/dkms/dkms_failing_test/1.0/build/make.log for more information. -dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} failed for dkms_failing_test(10) +Autoinstall on ${KERNEL_VER} failed for module(s) dkms_failing_test(10). Error! One or more modules failed to install during autoinstall. Refer to previous errors for more information. @@ -1358,14 +1298,13 @@ Creating symlink /var/lib/dkms/dkms_dependencies_test/1.0/source -> /usr/src/dkm EOF echo 'Running autoinstall with failing test module and test module with dependencies on the failing module (expected error)' run_with_expected_error 11 dkms autoinstall -k "${KERNEL_VER}" << EOF - Cleaning build area... done. Building module(s)...(bad exit status: 2) Failed command: make -j1 KERNELRELEASE=${KERNEL_VER} all Error! Bad return status for module build on kernel: ${KERNEL_VER} (${KERNEL_ARCH}) Consult /var/lib/dkms/dkms_failing_test/1.0/build/make.log for more information. -dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} failed for dkms_failing_test(10) +Autoinstall on ${KERNEL_VER} failed for module(s) dkms_failing_test(10). dkms_dependencies_test/1.0 autoinstall failed due to missing dependencies: dkms_failing_test Error! One or more modules failed to install during autoinstall. @@ -1376,6 +1315,7 @@ echo 'Removing failing test module' run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_failing_test -v 1.0 << EOF Module dkms_failing_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_failing_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... + Deleting module dkms_failing_test-1.0 completely from the DKMS tree. EOF echo 'Removing /usr/src/dkms_failing_test-1.0' @@ -1393,6 +1333,7 @@ echo 'Removing test module with dependencies' run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_dependencies_test -v 1.0 << EOF Module dkms_dependencies_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_dependencies_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... + Deleting module dkms_dependencies_test-1.0 completely from the DKMS tree. EOF echo 'Removing /usr/src/dkms_dependencies_test-1.0' @@ -1438,7 +1379,7 @@ Warning: The /var/lib/dkms/dkms_build_exclusive_test/1.0/${KERNEL_VER}/${KERNEL_ for module dkms_build_exclusive_test includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch/config. This indicates that it should not be built. -dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} was skipped for dkms_build_exclusive_test +Autoinstall on ${KERNEL_VER} was skipped for dkms_build_exclusive_test. EOF run_status_with_expected_output 'dkms_build_exclusive_test' << EOF dkms_build_exclusive_test/1.0: added @@ -1458,16 +1399,13 @@ Warning: The /var/lib/dkms/dkms_build_exclusive_test/1.0/${KERNEL_VER}/${KERNEL_ for module dkms_build_exclusive_test includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch/config. This indicates that it should not be built. - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. - Installing /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} - Running depmod... done. -dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} succeeded for dkms_test -dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} was skipped for dkms_build_exclusive_test +Autoinstall on ${KERNEL_VER} succeeded for module(s) dkms_test. +Autoinstall on ${KERNEL_VER} was skipped for dkms_build_exclusive_test. EOF run_status_with_expected_output 'dkms_build_exclusive_test' << EOF dkms_build_exclusive_test/1.0: added @@ -1478,11 +1416,9 @@ EOF echo 'Unbuilding the test module' run_with_expected_output dkms unbuild -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF -Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). +Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}): Before uninstall, this module version was ACTIVE on this kernel. - Deleting /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} - Running depmod... done. EOF run_status_with_expected_output 'dkms_test' << EOF @@ -1500,24 +1436,20 @@ Warning: The /var/lib/dkms/dkms_build_exclusive_test/1.0/${KERNEL_VER}/${KERNEL_ for module dkms_build_exclusive_test includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch/config. This indicates that it should not be built. - Cleaning build area... done. Building module(s)...(bad exit status: 2) Failed command: make -j1 KERNELRELEASE=${KERNEL_VER} all Error! Bad return status for module build on kernel: ${KERNEL_VER} (${KERNEL_ARCH}) Consult /var/lib/dkms/dkms_failing_test/1.0/build/make.log for more information. - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. - Installing /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} - Running depmod... done. -dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} succeeded for dkms_test -dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} was skipped for dkms_build_exclusive_test -dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} failed for dkms_failing_test(10) +Autoinstall on ${KERNEL_VER} succeeded for module(s) dkms_test. +Autoinstall on ${KERNEL_VER} was skipped for dkms_build_exclusive_test. +Autoinstall on ${KERNEL_VER} failed for module(s) dkms_failing_test(10). Error! One or more modules failed to install during autoinstall. Refer to previous errors for more information. @@ -1527,6 +1459,7 @@ echo 'Removing failing test module' run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_failing_test -v 1.0 << EOF Module dkms_failing_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_failing_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... + Deleting module dkms_failing_test-1.0 completely from the DKMS tree. EOF echo 'Removing /usr/src/dkms_failing_test-1.0' @@ -1534,12 +1467,12 @@ rm -r /usr/src/dkms_failing_test-1.0 echo 'Removing the test module' run_with_expected_output dkms remove --all -m dkms_test -v 1.0 << EOF -Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). -Before uninstall, this module version was ACTIVE on this kernel. +Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}): +Before uninstall, this module version was ACTIVE on this kernel. Deleting /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} - Running depmod... done. + Deleting module dkms_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_test' << EOF @@ -1569,7 +1502,7 @@ Warning: The /var/lib/dkms/dkms_build_exclusive_dependencies_test/1.0/${KERNEL_V for module dkms_build_exclusive_dependencies_test includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch/config. This indicates that it should not be built. -dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} was skipped for dkms_build_exclusive_test dkms_build_exclusive_dependencies_test +Autoinstall on ${KERNEL_VER} was skipped for dkms_build_exclusive_test dkms_build_exclusive_dependencies_test. EOF run_status_with_expected_output 'dkms_build_exclusive_test' << EOF dkms_build_exclusive_test/1.0: added @@ -1580,6 +1513,7 @@ EOF echo 'Removing the build-exclusive dependencies test module' run_with_expected_output dkms remove --all -m dkms_build_exclusive_dependencies_test -v 1.0 << EOF + Deleting module dkms_build_exclusive_dependencies_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_build_exclusive_dependencies_test' << EOF @@ -1589,6 +1523,7 @@ rm -r /usr/src/dkms_build_exclusive_dependencies_test-1.0 echo 'Removing the build-exclusive test module' run_with_expected_output dkms remove --all -m dkms_build_exclusive_test -v 1.0 << EOF + Deleting module dkms_build_exclusive_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_build_exclusive_test' << EOF @@ -1646,6 +1581,7 @@ echo 'Removing dkms_test module' run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF Module dkms_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... + Deleting module dkms_test-1.0 completely from the DKMS tree. EOF echo "Removing /usr/src/dkms_test-1.0" @@ -1667,6 +1603,7 @@ echo 'Removing dkms_test module' run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF Module dkms_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... + Deleting module dkms_test-1.0 completely from the DKMS tree. EOF echo "Removing /usr/src/dkms_test-1.0" @@ -1794,7 +1731,6 @@ echo 'Adding and building the test module by directory' set_signing_message "dkms_test" "1.0" run_with_expected_output dkms build test/dkms_test-1.0 -k "${KERNEL_VER}" << EOF Creating symlink /var/lib/dkms/dkms_test/1.0/source -> /usr/src/dkms_test-1.0 - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. @@ -1804,7 +1740,6 @@ echo 'Adding and building the multiver test module 1.0 by directory' set_signing_message "dkms_multiver_test" "1.0" run_with_expected_output dkms build test/dkms_multiver_test/1.0 -k "${KERNEL_VER}" << EOF Creating symlink /var/lib/dkms/dkms_multiver_test/1.0/source -> /usr/src/dkms_multiver_test-1.0 - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. @@ -1817,7 +1752,6 @@ echo 'Adding and building the multiver test module 2.0 by directory' set_signing_message "dkms_multiver_test" "2.0" run_with_expected_output dkms build test/dkms_multiver_test/2.0 -k "${KERNEL_VER}" << EOF Creating symlink /var/lib/dkms/dkms_multiver_test/2.0/source -> /usr/src/dkms_multiver_test-2.0 - Cleaning build area... done. Building module(s)... done. ${SIGNING_MESSAGE}Cleaning build area... done. @@ -1830,9 +1764,8 @@ Error! dkms_multiver_test/1.0 is broken! Missing the source directory or the sym Manual intervention is required! Installing /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} - Running depmod... done. -dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} succeeded for dkms_test +Autoinstall on ${KERNEL_VER} succeeded for module(s) dkms_test. EOF run_with_expected_output dkms status << EOF dkms_multiver_test/1.0: broken @@ -1846,18 +1779,19 @@ EOF echo 'Removing all modules' echo ' Removing the test module' run_with_expected_output dkms remove dkms_test/1.0 -k "${KERNEL_VER}" << EOF -Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). -Before uninstall, this module version was ACTIVE on this kernel. +Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}): +Before uninstall, this module version was ACTIVE on this kernel. Deleting /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} - Running depmod... done. + Deleting module dkms_test-1.0 completely from the DKMS tree. EOF echo ' Removing the multi_ver_test 2.0 module' run_with_expected_output dkms remove -m dkms_multiver_test -v 2.0 -k "${KERNEL_VER}" << EOF Module dkms_multiver_test 2.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... + Deleting module dkms_multiver_test-2.0 completely from the DKMS tree. EOF