From 6d683c528fdbe1ade267a95e69bebe8192ec55c3 Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Tue, 10 Sep 2024 08:23:55 +0200 Subject: [PATCH] Remove translation support --- dkms.in | 361 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 180 insertions(+), 181 deletions(-) diff --git a/dkms.in b/dkms.in index 28fc411..b31feec 100644 --- a/dkms.in +++ b/dkms.in @@ -121,19 +121,19 @@ invoke_command() error() ( exec >&2 echo "" - echo -n $"Error! " + echo -n "Error! " for s in "$@"; do echo "$s"; done ) warn() ( exec >&2 - echo -n $"Warning: " + echo -n "Warning: " for s in "$@"; do echo "$s"; done ) deprecated() ( exec >&2 - echo -n $"Deprecated feature: " + echo -n "Deprecated feature: " for s in "$@"; do echo "$s"; done ) @@ -160,23 +160,23 @@ diewarn() { mktemp_or_die() { local t t=$(mktemp "$@") && echo "$t" && return - [[ $* = *-d* ]] && die 1 $"Unable to make temporary directory" + [[ $* = *-d* ]] && die 1 "Unable to make temporary directory" die 1 "Unable to make temporary file." } show_usage() { - echo $"Usage: $0 [action] [options]" - echo $" [action] = { add | remove | build | unbuild | install | uninstall | match |" - echo $" autoinstall | mktarball | ldtarball | status | generate_mok }" - echo $" [options] = [-m module] [-v module-version] [-k kernel-version] [-a arch]" - echo $" [-c dkms.conf-location] [-q] [--force] [--force-version-override] [--all]" - echo $" [--templatekernel=kernel] [--directive='cli-directive=cli-value']" - echo $" [--config=kernel-.config-location] [--archive=tarball-location]" - echo $" [--kernelsourcedir=source-location] [--rpm_safe_upgrade]" - echo $" [--dkmstree path] [--sourcetree path] [--installtree path]" - echo $" [--binaries-only] [--source-only] [--verbose]" - echo $" [--no-depmod] [--modprobe-on-install] [-j number] [--version]" + echo "Usage: $0 [action] [options]" + echo " [action] = { add | remove | build | unbuild | install | uninstall | match |" + echo " autoinstall | mktarball | ldtarball | status | generate_mok }" + echo " [options] = [-m module] [-v module-version] [-k kernel-version] [-a arch]" + echo " [-c dkms.conf-location] [-q] [--force] [--force-version-override] [--all]" + echo " [--templatekernel=kernel] [--directive='cli-directive=cli-value']" + echo " [--config=kernel-.config-location] [--archive=tarball-location]" + echo " [--kernelsourcedir=source-location] [--rpm_safe_upgrade]" + echo " [--dkmstree path] [--sourcetree path] [--installtree path]" + echo " [--binaries-only] [--source-only] [--verbose]" + echo " [--no-depmod] [--modprobe-on-install] [-j number] [--version]" } VER() @@ -260,14 +260,14 @@ set_kernel_source_dir_and_kconfig() check_all_is_banned() { if [[ $all ]]; then - die 5 $"The action $1 does not support the --all parameter." + die 5 "The action $1 does not support the --all parameter." fi } # A little test function for DKMS commands that only work on one kernel. have_one_kernel() { if (( ${#kernelver[@]} != 1 )); then - die 4 $"The action $1 does not support multiple kernel version parameters 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 } @@ -308,7 +308,7 @@ setup_kernels_arches() fi fi if [[ ! $arch ]]; then - die 12 $"Could not determine architecture." + die 12 "Could not determine architecture." fi fi @@ -355,7 +355,7 @@ do_depmod() # no longer installed kernel $1, so do not leave stale depmod files around rm -fv $install_tree/$1/modules.{alias,dep,devname,softdep,symbols,weakdep,*.bin} rmdir --ignore-fail-on-non-empty $install_tree/$1 - [[ -d $install_tree/$1 ]] || echo $"removed directory $install_tree/$1" + [[ -d $install_tree/$1 ]] || echo "removed directory $install_tree/$1" fi } @@ -378,7 +378,7 @@ distro_version() return fi done - die 4 $"System is missing os-release file." + die 4 "System is missing os-release file." } override_dest_module_location() @@ -471,8 +471,8 @@ read_conf() [[ $conf ]] && read_conf_file="$conf" [[ $3 ]] && read_conf_file="$3" - [[ -r $read_conf_file ]] || die 4 $"Could not locate dkms.conf file." \ - $"File: $read_conf_file does not exist." + [[ -r $read_conf_file ]] || die 4 "Could not locate dkms.conf file." \ + "File: $read_conf_file does not exist." [[ $last_mvka = $module/$module_version/$1/$2 && \ $last_mvka_conf = $(readlink -f $read_conf_file) ]] && return @@ -497,7 +497,7 @@ read_conf() directive_name=${directive%%=*} directive_value=${directive#*=} export $directive_name="$directive_value" - echo $"DIRECTIVE: $directive_name=\"$directive_value\"" + echo "DIRECTIVE: $directive_name=\"$directive_value\"" done # Set variables @@ -514,13 +514,13 @@ read_conf() # Fail if no PACKAGE_NAME if [[ ! $package_name ]]; then - echo $"dkms.conf: Error! No 'PACKAGE_NAME' directive specified.">&2 + echo "dkms.conf: Error! No 'PACKAGE_NAME' directive specified.">&2 return_value=1 fi # Fail if no PACKAGE_VERSION if [[ ! $package_version ]]; then - echo $"dkms.conf: Error! No 'PACKAGE_VERSION' directive specified.">&2 + echo "dkms.conf: Error! No 'PACKAGE_VERSION' directive specified.">&2 return_value=1 fi @@ -562,14 +562,14 @@ read_conf() # FAIL if no built_module_name if [[ ! ${built_module_name[$index]} ]]; then - echo $"dkms.conf: Error! No 'BUILT_MODULE_NAME' directive specified for record #$index." >&2 + echo "dkms.conf: Error! No 'BUILT_MODULE_NAME' directive specified for record #$index." >&2 return_value=1 fi # FAIL if built_module_name ends in .o or .ko case ${built_module_name[$index]} in *.o|*.ko) - echo $"dkms.conf: Error! 'BUILT_MODULE_NAME' directive ends in '.o' or '.ko' in record #$index." >&2 + echo "dkms.conf: Error! 'BUILT_MODULE_NAME' directive ends in '.o' or '.ko' in record #$index." >&2 return_value=1 ;; esac @@ -577,7 +577,7 @@ read_conf() # FAIL if dest_module_name ends in .o or .ko case ${dest_module_name[$index]} in *.o|*.ko) - echo $"dkms.conf: Error! 'DEST_MODULE_NAME' directive ends in '.o' or '.ko' in record #$index." >&2 + echo "dkms.conf: Error! 'DEST_MODULE_NAME' directive ends in '.o' or '.ko' in record #$index." >&2 return_value=1 ;; esac @@ -587,7 +587,7 @@ read_conf() # Fail if no DEST_MODULE_LOCATION if [[ ! ${DEST_MODULE_LOCATION[$index]} ]]; then - echo $"dkms.conf: Error! No 'DEST_MODULE_LOCATION' directive specified for record #$index.">&2 + echo "dkms.conf: Error! No 'DEST_MODULE_LOCATION' directive specified for record #$index.">&2 return_value=1 fi @@ -600,8 +600,8 @@ read_conf() /extra*) ;; *) - echo $"dkms.conf: Error! Directive 'DEST_MODULE_LOCATION' does not begin with">&2 - echo $"'/kernel', '/updates', or '/extra' in record #$index.">&2 + echo "dkms.conf: Error! Directive 'DEST_MODULE_LOCATION' does not begin with">&2 + echo "'/kernel', '/updates', or '/extra' in record #$index.">&2 return_value=1 ;; esac @@ -609,7 +609,7 @@ read_conf() # Warn if no modules are specified if ((array_size == 0)); then - echo $"dkms.conf: Warning! Zero modules specified." >&2 + echo "dkms.conf: Warning! Zero modules specified." >&2 fi # Get the correct make command @@ -768,10 +768,9 @@ check_version_sanity() if ((obsolete == 1)); then 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 - echo $"You may override by specifying --force." >&2 + echo "Module has been obsoleted due to being included in kernel $3." >&2 + echo "We will avoid installing for future kernels above $3." >&2 + echo "You may override by specifying --force." >&2 return 1 fi fi @@ -785,7 +784,7 @@ check_version_sanity() fi if [[ ${kernels_module[1]} ]]; then - warn $"Warning! Cannot do version sanity checking because multiple ${4}$module_suffix modules were found in kernel $1." + warn "Warning! Cannot do version sanity checking because multiple ${4}$module_suffix modules were found in kernel $1." return 0 fi local dkms_module=$(compressed_or_uncompressed "$dkms_tree/$module/$module_version/$1/$2/module/" "${4}") @@ -793,9 +792,9 @@ check_version_sanity() local cmp_res="$(compare_module_version "${kernels_module}" "${dkms_module}")" if [[ "${cmp_res}" = ">" ]]; then if [[ ! "$force" ]]; then - error $"Module version $(get_module_verinfo "${dkms_module}" | head -n 1) for $4${module_suffix}" \ - $"is not newer than what is already found in kernel $1 ($(get_module_verinfo "${kernels_module}" | head -n 1))." \ - $"You may override by specifying --force." + error "Module version $(get_module_verinfo "${dkms_module}" | head -n 1) for $4${module_suffix}" \ + "is not newer than what is already found in kernel $1 ($(get_module_verinfo "${kernels_module}" | head -n 1))." \ + "You may override by specifying --force." return 1 fi elif [[ "${cmp_res}" = "==" ]]; then @@ -803,7 +802,7 @@ check_version_sanity() # if the module has neither version nor srcversion/checksum, check the binary files instead local verinfo="$(get_module_verinfo "${dkms_module}")" if [[ "$(echo "$verinfo" | tr -d '[:space:]')" ]] || diff "${kernels_module}" "${dkms_module}" &>/dev/null; then - echo $"Module ${kernels_module} already installed at version $(echo "$verinfo" | head -n 1), override by specifying --force" >&2 + echo "Module ${kernels_module} already installed at version $(echo "$verinfo" | head -n 1), override by specifying --force" >&2 return 1 fi fi @@ -813,16 +812,16 @@ check_version_sanity() check_module_args() { [[ $module && $module_version ]] && return - die 1 $"Arguments and are not specified." \ - $"Usage: $1 / or" \ - $" $1 -m / or" \ - $" $1 -m -v " + die 1 "Arguments and are not specified." \ + "Usage: $1 / or" \ + " $1 -m / or" \ + " $1 -m -v " } read_conf_or_die() { read_conf "$@" && return - die 8 $"Bad conf file."\ - $"File: ${3:-$conf} does not represent a valid dkms.conf file." + die 8 "Bad conf file."\ + "File: ${3:-$conf} does not represent a valid dkms.conf file." } run_build_script() { @@ -841,14 +840,14 @@ run_build_script() { run="$dkms_tree/$module/$module_version/$script_type/$2" if [[ -x ${run%% *} ]]; then echo "" - echo $"Running the $1 script:" + echo "Running the $1 script:" ( cd "$dkms_tree/$module/$module_version/$script_type/" exec $run ) else echo "" - warn $"The $1 script is not executable." + warn "The $1 script is not executable." fi } @@ -879,23 +878,23 @@ add_module() # Check that this module-version hasn't already been added if is_module_added "$module" "$module_version"; then - die 3 $"DKMS tree already contains: $module-$module_version" \ - $"You cannot add the same module/version combo more than once." + die 3 "DKMS tree already contains: $module-$module_version" \ + "You cannot add the same module/version combo more than once." fi [[ $conf ]] || conf="$source_tree/$module-$module_version/dkms.conf" # Check that /usr/src/$module-$module_version exists if ! [[ -d $source_tree/$module-$module_version ]]; then - die 2 $"Could not find module source directory." \ - $"Directory: $source_tree/$module-$module_version does not exist." + die 2 "Could not find module source directory." \ + "Directory: $source_tree/$module-$module_version does not exist." fi # Check the conf file for sanity read_conf_or_die "$kernelver" "$arch" "$conf" # Create the necessary dkms tree structure - echo $"Creating symlink $dkms_tree/$module/$module_version/source -> $source_tree/$module-$module_version" + echo "Creating symlink $dkms_tree/$module/$module_version/source -> $source_tree/$module-$module_version" mkdir -p "$dkms_tree/$module/$module_version/build" ln -s "$source_tree/$module-$module_version" "$dkms_tree/$module/$module_version/source" @@ -915,8 +914,8 @@ prepare_kernel() # Check that kernel-source exists _check_kernel_dir "$1" || { - die 1 $"Your kernel headers for kernel $1 cannot be found at $install_tree/$1/build or $install_tree/$1/source." \ - $"Please install the linux-headers-$1 package or use the --kernelsourcedir option to tell DKMS where it's located." + die 1 "Your kernel headers for kernel $1 cannot be found at $install_tree/$1/build or $install_tree/$1/source." \ + "Please install the linux-headers-$1 package or use the --kernelsourcedir option to tell DKMS where it's located." } } @@ -1037,8 +1036,8 @@ prepare_build() # Check that the module has not already been built for this kernel [[ -d $base_dir ]] && die 3 \ - $"This module/version has already been built on: $kernelver" \ - $"Directory $base_dir already exists. Use the dkms remove function before trying to build again." + "This module/version has already been built on: $kernelver" \ + "Directory $base_dir already exists. Use the dkms remove function before trying to build again." # Read the conf file set_module_suffix "$kernelver" @@ -1046,15 +1045,15 @@ prepare_build() # Error out if build_exclude is set [[ $build_exclude ]] && diewarn 77 \ - $"The $base_dir/dkms.conf"\ - $"for module $module includes a BUILD_EXCLUSIVE directive"\ - $"which does not match this kernel/arch/config."\ - $"This indicates that it should not be built." + "The $base_dir/dkms.conf"\ + "for module $module includes a BUILD_EXCLUSIVE directive"\ + "which does not match this kernel/arch/config."\ + "This indicates that it should not be built." # Error out if source_tree is basically empty (binary-only dkms tarball w/ --force check) (($(ls $source_dir | wc -l | awk {'print $1'}) < 2)) && die 8 \ - $"The directory $source_dir does not appear to have module source located within it."\ - $"Build halted." + "The directory $source_dir does not appear to have module source located within it."\ + "Build halted." # Set up temporary build directory for build rm -rf "$build_dir" @@ -1066,11 +1065,11 @@ prepare_build() for p in "${patch_array[@]}"; do [[ ! -e $build_dir/patches/$p ]] && \ report_build_problem 5 \ - $" Patch $p as specified in dkms.conf cannot be" \ - $"found in $build_dir/patches/." + " Patch $p as specified in dkms.conf cannot be" \ + "found in $build_dir/patches/." invoke_command "patch -p1 < ./patches/$p" "applying patch $p" || \ - report_build_problem 6 $"Application of patch $p failed." \ - $"Check $build_dir for more information." + report_build_problem 6 "Application of patch $p failed." \ + "Check $build_dir for more information." done if [[ -f $kernel_source_dir/.kernelvariables ]]; then @@ -1118,22 +1117,22 @@ actual_build() echo "" invoke_command "$clean" "Cleaning build area" '' background - echo $"DKMS make.log for $module-$module_version for kernel $kernelver ($arch)" >> "$build_log" + echo "DKMS make.log for $module-$module_version for kernel $kernelver ($arch)" >> "$build_log" date >> "$build_log" local the_make_command="${make_command/#make/make -j$parallel_jobs KERNELRELEASE=$kernelver}" invoke_command "$the_make_command" "Building module(s)" "$build_log" background || \ - report_build_problem 10 $"Bad return status for module build on kernel: $kernelver ($arch)" \ - $"Consult $build_log for more information." + report_build_problem 10 "Bad return status for module build on kernel: $kernelver ($arch)" \ + "Consult $build_log for more information." # Make sure all the modules built successfully for ((count=0; count < ${#built_module_name[@]}; count++)); do [[ -e ${built_module_location[$count]}${built_module_name[$count]}$module_uncompressed_suffix ]] && continue report_build_problem 7 \ - $" Build of ${built_module_name[$count]}$module_uncompressed_suffix failed for: $kernelver ($arch)" \ - $"Make sure the name of the generated module is correct and at the root of the" \ - $"build directory, or consult make.log in the build directory" \ - $"$build_dir for more information." + " Build of ${built_module_name[$count]}$module_uncompressed_suffix failed for: $kernelver ($arch)" \ + "Make sure the name of the generated module is correct and at the root of the" \ + "build directory, or consult make.log in the build directory" \ + "$build_dir for more information." done cd - >/dev/null @@ -1247,15 +1246,15 @@ do_install() fi # Make sure that kernel exists to install into [[ -e $install_tree/$kernelver ]] || die 6 \ - $"The directory $install_tree/$kernelver doesn't exist." \ - $"You cannot install a module onto a non-existant kernel." + "The directory $install_tree/$kernelver doesn't exist." \ + "You cannot install a module onto a non-existant kernel." # Read the conf file read_conf_or_die "$kernelver" "$arch" # Check that its not already installed (kernel symlink) is_module_installed "$module" "$module_version" "$kernelver" "$arch" && die 5 \ - $"This module/version combo is already installed for kernel $kernelver ($arch)." + "This module/version combo is already installed for kernel $kernelver ($arch)." # If upgrading using rpm_safe_upgrade, go ahead and force the install # else we can wind up with the first half of an upgrade failing to install anything, @@ -1274,8 +1273,8 @@ do_install() check_version_sanity "$kernelver" "$arch" "$obsolete_by" "${dest_module_name[$count]}" || continue if ((count == 0)) && ! run_build_script pre_install "$pre_install" && ! [[ $force ]]; then - die 101 $"pre_install failed, aborting install." \ - $"You may override by specifying --force." + die 101 "pre_install failed, aborting install." \ + "You may override by specifying --force." fi local m=${dest_module_name[$count]} local installed_modules=$(find_module "$lib_tree" "$m") @@ -1283,7 +1282,7 @@ do_install() local original_copy=$(compressed_or_uncompressed "$dkms_tree/$module/original_module/$kernelver/$arch" "$m") if [[ -L $dkms_tree/$module/kernel-$kernelver-$arch && -n "$original_copy" ]]; then - echo $"An original module was already stored during a previous install" + echo "An original module was already stored during a previous install" elif ! [[ -L $dkms_tree/$module/kernel-$kernelver-$arch ]]; then local archive_pref1=$(compressed_or_uncompressed "$lib_tree/extra" "$m") local archive_pref2=$(compressed_or_uncompressed "$lib_tree/updates" "$m") @@ -1294,20 +1293,20 @@ do_install() local found_orginal="" for original_module in $archive_pref1 $archive_pref2 $archive_pref3 $archive_pref4; do [[ -f $original_module ]] || continue - echo $"Found pre-existing $original_module, archiving for uninstallation" + echo "Found pre-existing $original_module, archiving for uninstallation" mkdir -p "$dkms_tree/$module/original_module/$kernelver/$arch" mv -f "$original_module" "$dkms_tree/$module/original_module/$kernelver/$arch/" found_original="yes" break done if [[ ! $found_original ]] && ((module_count > 1)); then - echo $"Multiple original modules exist, so none will be put back in place during a later uninstall" - echo $"All instances will be stored for reference purposes in $dkms_tree/$module/original_module/$kernelver/$arch/collisions/" + echo "Multiple original modules exist, so none will be put back in place during a later uninstall" + echo "All instances will be stored for reference purposes in $dkms_tree/$module/original_module/$kernelver/$arch/collisions/" fi fi if ((module_count > 1)); then - echo $"Multiple same named modules! $module_count named $m$module_suffix in $lib_tree/" + echo "Multiple same named modules! $module_count named $m$module_suffix in $lib_tree/" for module_dup in $(find_module "$lib_tree" "$m"); do dup_tree="${module_dup#$lib_tree}"; dup_name="${module_dup##*/}" @@ -1318,7 +1317,7 @@ do_install() fi # Copy module to its location - echo $"Installing $install_tree/$kernelver${dest_module_location[$count]}/${dest_module_name[$count]}$module_suffix" + echo "Installing $install_tree/$kernelver${dest_module_location[$count]}/${dest_module_name[$count]}$module_suffix" mkdir -p $install_tree/$kernelver${dest_module_location[$count]} [[ $symlink_modules ]] && symlink="-s" local toinstall=$(compressed_or_uncompressed "$base_dir/module" "$m") @@ -1328,7 +1327,7 @@ do_install() done if ((${#built_module_name[@]} > 0)) && [[ ! "${any_module_installed}" ]]; then - die 6 $"Installation aborted." + die 6 "Installation aborted." fi # Create the kernel- symlink to designate this version as active @@ -1338,7 +1337,7 @@ do_install() # Add to kabi-tracking if [[ -z $NO_WEAK_MODULES ]]; then if [[ ${weak_modules} ]]; then - echo $"Adding any weak-modules" + echo "Adding any weak-modules" list_each_installed_module "$module" "$kernelver" "$arch" | ${weak_modules} ${weak_modules_no_initrd} --add-modules fi fi @@ -1348,8 +1347,8 @@ do_install() invoke_command "do_depmod $kernelver" "Running depmod" '' background || { do_uninstall "$kernelver" "$arch" - die 6 $"Problems with depmod detected. Automatically uninstalling this module." \ - $"Install Failed (depmod problems). Module rolled back to built state." + die 6 "Problems with depmod detected. Automatically uninstalling this module." \ + "Install Failed (depmod problems). Module rolled back to built state." exit 6 } @@ -1429,7 +1428,7 @@ is_module_installed() { is_module_built "$@" && _is_module_installed "$@"; } maybe_add_module() ( is_module_added "$1" "$2" && { - echo $"Module $1/$2 already added." + echo "Module $1/$2 already added." return 0 } module="$1" module_version="$2" add_module @@ -1440,8 +1439,8 @@ maybe_build_module() ( if [[ "$force" = "true" ]]; then do_unbuild "$3" "$4" else - echo $"Module $1/$2 already built for kernel $3 ($4), skip." \ - $"You may override by specifying --force." + echo "Module $1/$2 already built for kernel $3 ($4), skip." \ + "You may override by specifying --force." return 0 fi } @@ -1453,8 +1452,8 @@ maybe_install_module() ( if [[ "$force" = "true" ]]; then do_uninstall "$3" "$4" else - echo $"Module $1/$2 already installed on kernel $3 ($4), skip." \ - $"You may override by specifying --force." + echo "Module $1/$2 already installed on kernel $3 ($4), skip." \ + "You may override by specifying --force." return 0 fi } @@ -1520,7 +1519,7 @@ do_uninstall() # $2 = arch echo "" - echo $"Module $module-$module_version for kernel $1 ($2):" + echo "Module $module-$module_version for kernel $1 ($2):" set_module_suffix "$1" @@ -1530,11 +1529,11 @@ do_uninstall() local real_dest_module_location if [[ $kernel_symlink = $dkms_tree/$module/$module_version/$1/$2 ]]; then was_active="true" - echo $"Before uninstall, this module version was ACTIVE on this kernel." + echo "Before uninstall, this module version was ACTIVE on this kernel." # remove kabi-tracking if last instance removed if [[ -z $NO_WEAK_MODULES ]]; then if [[ ${weak_modules} ]] && (module_status_built $module $module_version |grep -q "installed"); then - echo $"Removing any linked weak-modules" + echo "Removing any linked weak-modules" list_each_installed_module "$module" "$1" "$2" | ${weak_modules} ${weak_modules_no_initrd} --remove-modules fi fi @@ -1543,7 +1542,7 @@ do_uninstall() real_dest_module_location="$(find_actual_dest_module_location $module $count $1 $2)" if [[ ${real_dest_module_location} ]]; then - echo $"Deleting $install_tree/$1${real_dest_module_location}/${dest_module_name[$count]}$module_suffix" + echo "Deleting $install_tree/$1${real_dest_module_location}/${dest_module_name[$count]}$module_suffix" rm -f "$install_tree/$1${real_dest_module_location}/${dest_module_name[$count]}$module_uncompressed_suffix"* dir_to_remove="${real_dest_module_location#/}" while [[ ${dir_to_remove} != ${dir_to_remove#/} ]]; do @@ -1551,18 +1550,18 @@ do_uninstall() done (if cd "$install_tree/$1"; then rpm -qf "${dir_to_remove}" >/dev/null 2>&1 || rmdir -p --ignore-fail-on-non-empty "${dir_to_remove}"; fi || true) else - echo $"Module was not found within $install_tree/$1/" + echo "Module was not found within $install_tree/$1/" fi local origmod=$(compressed_or_uncompressed "$dkms_tree/$module/original_module/$1/$2" "${dest_module_name[$count]}") if [[ -n $origmod ]]; then - echo $"Restoring archived original module" + echo "Restoring archived original module" mkdir -p "$install_tree/$1${DEST_MODULE_LOCATION[$count]}/" mv -f "$origmod" "$install_tree/$1${DEST_MODULE_LOCATION[$count]}/" 2>/dev/null fi done rm -f "$dkms_tree/$module/kernel-$1-$2" else - echo $"This module version was INACTIVE for this kernel." + echo "This module version was INACTIVE for this kernel." fi # Run the post_remove script @@ -1574,35 +1573,35 @@ 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 $"Removing original_module from DKMS tree for kernel $1 ($2)" + 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 $"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." + 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." fi [[ $(find $dkms_tree/$module/original_module/* -maxdepth 0 -type d 2>/dev/null) ]] || rm -rf "$dkms_tree/$module/original_module" } module_is_broken_and_die() { - is_module_broken "$module" "$module_version" && die 4 $"$module/$module_version is broken!"\ - $"Missing the source directory or the symbolic link pointing to it."\ - $"Manual intervention is required!" + is_module_broken "$module" "$module_version" && die 4 "$module/$module_version is broken!"\ + "Missing the source directory or the symbolic link pointing to it."\ + "Manual intervention is required!" } module_is_added_or_die() { is_module_added "$module" "$module_version" || die 3 \ - $"The module/version combo: $module-$module_version is not located in the DKMS tree." + "The module/version combo: $module-$module_version is not located in the DKMS tree." } maybe_unbuild_module() { is_module_built "$module" "$module_version" "$1" "$2" || { - echo $"Module $module $module_version is not built for kernel $1 ($2)."\ - $"Skipping..." + echo "Module $module $module_version is not built for kernel $1 ($2)."\ + "Skipping..." return 0 } @@ -1612,8 +1611,8 @@ maybe_unbuild_module() maybe_uninstall_module() { is_module_installed "$module" "$module_version" "$1" "$2" || { - echo $"Module $module $module_version is not installed for kernel $1 ($2)."\ - $"Skipping..." + echo "Module $module $module_version is not installed for kernel $1 ($2)."\ + "Skipping..." return 0 } do_uninstall "$1" "$2" @@ -1659,7 +1658,7 @@ remove_module() lock_tail=$(tail -n 1 $lock_file 2>/dev/null) [[ $lock_head = $module-$module_version && $time_stamp && $lock_tail = $time_stamp ]] || continue rm -f $lock_file - die 0 $"Remove cancelled because --rpm_safe_upgrade scenario detected." + die 0 "Remove cancelled because --rpm_safe_upgrade scenario detected." done fi @@ -1672,7 +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." + echo "Deleting module $module-$module_version completely from the DKMS tree." rm -rf "$dkms_tree/$module/$module_version" fi @@ -1817,8 +1816,8 @@ do_status() { case $status in broken) echo "$m/$v: $status" - error $"$m/$v: Missing the module source directory or the symbolic link pointing to it."\ - $"Manual intervention is required!" + error "$m/$v: Missing the module source directory or the symbolic link pointing to it."\ + "Manual intervention is required!" ;; added) echo "$m/$v: $status" @@ -1867,8 +1866,8 @@ make_tarball() local -r temp_module_dir="$temp_dir_name/dkms_main_tree/${kernelver[$i]}" if ! [[ -d "$intree_module_dir" ]]; then - die 6 $"No modules built for ${kernelver[$i]} (${arch[$i]})." \ - $"Modules must already be in the built state before using mktarball." + die 6 "No modules built for ${kernelver[$i]} (${arch[$i]})." \ + "Modules must already be in the built state before using mktarball." fi set_module_suffix "${kernelver[$i]}" @@ -1891,7 +1890,7 @@ make_tarball() local -r binary_only_dir="$temp_dir_name/dkms_binaries_only" echo "" - echo $"Creating tarball structure to specifically accomodate binaries." + echo "Creating tarball structure to specifically accomodate binaries." mkdir "$binary_only_dir" echo "$module" > "$binary_only_dir/PACKAGE_NAME" @@ -1900,7 +1899,7 @@ make_tarball() cp -f $conf "$binary_only_dir/" 2>/dev/null else echo "" - echo $"Marking $source_dir for archiving..." + echo "Marking $source_dir for archiving..." mkdir -p $temp_dir_name/dkms_source_tree cp -rf $source_dir/* $temp_dir_name/dkms_source_tree fi @@ -1920,18 +1919,18 @@ make_tarball() fi echo "" - echo $"Tarball location: $tarball_dest/$tarball_name" + echo "Tarball location: $tarball_dest/$tarball_name" if [[ ! -d $tarball_dest ]]; then if ! mkdir -p "$tarball_dest" 2>/dev/null; then - die 9 $"Missing write permissions for $tarball_dest." + die 9 "Missing write permissions for $tarball_dest." fi fi - [[ -w $tarball_dest ]] || die 9 $"Missing write permissions for $tarball_dest." + [[ -w $tarball_dest ]] || die 9 "Missing write permissions for $tarball_dest." if ! tar -C $temp_dir_name -caf $tarball_dest/$tarball_name . 2>/dev/null; then - die 6 $"Failed to make tarball." + die 6 "Failed to make tarball." fi } @@ -1949,7 +1948,7 @@ load_tarball() { # Error out if $archive_location does not exist if [[ ! -e $archive_location ]]; then - die 2 $"$archive_location does not exist." + die 2 "$archive_location does not exist." fi # If it is an .rpm file. install it with rpm, run an autoinstall, and then exit. @@ -1958,8 +1957,8 @@ load_tarball() autoinstall exit $? else - die 9 $"Unable to install $archive_location using rpm." \ - $"Check to ensure that your system can install .rpm files." + die 9 "Unable to install $archive_location using rpm." \ + "Check to ensure that your system can install .rpm files." fi fi @@ -1973,7 +1972,7 @@ load_tarball() # Just find the dkms.conf file and load the source. conf=$(find $temp_dir_name/ -name dkms.conf 2>/dev/null | head -n 1) if [[ ! $conf ]]; then - die 3 $"Tarball does not appear to be a correctly formed DKMS archive. No dkms.conf found within it." + die 3 "Tarball does not appear to be a correctly formed DKMS archive. No dkms.conf found within it." fi add_source_tree "${conf%dkms.conf}" return @@ -1983,20 +1982,20 @@ load_tarball() # directories we test for. for loc in dkms_source_tree dkms_binaries_only ''; do if [[ ! $loc ]]; then - die 7 $"No valid dkms.conf in dkms_source_tree or dkms_binaries_only." \ - $"$archive_location is not a valid DKMS tarball." + die 7 "No valid dkms.conf in dkms_source_tree or dkms_binaries_only." \ + "$archive_location is not a valid DKMS tarball." fi local conf="$temp_dir_name/$loc/dkms.conf" [[ -f $conf ]] || continue if ! get_pkginfo_from_conf "$conf"; then echo >&2 - echo $"Malformed dkms.conf, refusing to load." >&2 + echo "Malformed dkms.conf, refusing to load." >&2 continue fi if is_module_added "$PACKAGE_NAME" "$PACKAGE_VERSION" && \ [[ ! $force ]]; then - die 8 $"$PACKAGE_NAME-$PACKAGE_VERSION is already added!" \ - $"Aborting." + die 8 "$PACKAGE_NAME-$PACKAGE_VERSION is already added!" \ + "Aborting." fi # Success! break @@ -2004,7 +2003,7 @@ load_tarball() module="$PACKAGE_NAME"; module_version="$PACKAGE_VERSION" echo "" - echo $"Loading tarball for $module-$module_version" + echo "Loading tarball for $module-$module_version" case $loc in dkms_source_tree) add_source_tree "$temp_dir_name/dkms_source_tree" @@ -2014,9 +2013,9 @@ load_tarball() if [[ ! -d $source_tree/$module-$module_version ]]; then local -r source_dir="$dkms_tree/$module/$module_version/source" - echo $"Creating $source_dir" + echo "Creating $source_dir" mkdir -p "$source_dir" - echo $"Copying dkms.conf to $source_dir ..." + echo "Copying dkms.conf to $source_dir ..." cp -rf "$temp_dir_name/dkms_binaries_only/dkms.conf" "$source_dir" fi ;; @@ -2034,9 +2033,9 @@ load_tarball() local -r dkms_dir_location="$dkms_tree/$module/$module_version/$kernel_arch_to_load" if [[ -d $dkms_dir_location && ! $force ]]; then - warn $"$dkms_dir_location already exists. Skipping..." + warn "$dkms_dir_location already exists. Skipping..." else - echo $"Loading $dkms_dir_location..." + echo "Loading $dkms_dir_location..." rm -rf $dkms_dir_location mkdir -p $dkms_dir_location cp -rf $directory/* $dkms_dir_location/ @@ -2052,14 +2051,14 @@ run_match() # Error if $template_kernel is unset if [[ ! $template_kernel ]]; then - die 1 $"Invalid number of parameters passed." \ - $"Usage: match --templatekernel= -k " \ - $" or: match --templatekernel= -k " + die 1 "Invalid number of parameters passed." \ + "Usage: match --templatekernel= -k " \ + " or: match --templatekernel= -k " fi # Error out if $template_kernel = $kernel_version if [[ $template_kernel = $kernelver ]]; then - die 2 $"The templatekernel and the specified kernel version are the same." + die 2 "The templatekernel and the specified kernel version are the same." fi # Read in the status of template_kernel @@ -2069,19 +2068,19 @@ run_match() if [[ $module ]]; then # Make sure that its installed in the first place if ! [[ -d $dkms_tree/$module/ ]]; then - die 3 $"The module: $module is not located in the DKMS tree." + die 3 "The module: $module is not located in the DKMS tree." fi template_kernel_status=$(echo "$template_kernel_status" | grep "^$module,") fi echo "" - echo $"Matching modules in kernel: $kernelver ($arch)" - echo $"to the configuration of kernel: $template_kernel ($arch)" + 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 $"There is nothing to be done for this match." + echo "There is nothing to be done for this match." return 0 fi @@ -2093,14 +2092,14 @@ run_match() template_version=$(echo "$template_line" | awk {'print $2'} | sed 's/,$//') # Print out a match header - echo $"Module: $template_module" - echo $"Version: $template_version" + echo "Module: $template_module" + echo "Version: $template_version" # Continue if the status is broken, as there is nothing we can do if is_module_broken "$template_module" "$template_version"; then - error $"$template_module/$template_version is broken!"\ - $"Missing the source directory or the symbolic link pointing to it."\ - $"Manual intervention is required!" + error "$template_module/$template_version is broken!"\ + "Missing the source directory or the symbolic link pointing to it."\ + "Manual intervention is required!" continue fi maybe_build_module "$template_module" "$template_version" "$kernelver" "$arch" @@ -2166,12 +2165,12 @@ parse_moduleversion(){ check_root() { [[ $(id -u) = 0 ]] && return - die 1 $"You must be root to use this command." + die 1 "You must be root to use this command." } check_rw_dkms_tree() { [[ -w "$dkms_tree" ]] && return - die 1 $"No write access to DKMS tree at ${dkms_tree}" + die 1 "No write access to DKMS tree at ${dkms_tree}" } # Add a passed source tree to the default source location. @@ -2180,18 +2179,18 @@ check_rw_dkms_tree() { add_source_tree() { local from=$(readlink -f $1) if ! [[ $from && -f $from/dkms.conf ]]; then - die 9 $"$1 must contain a dkms.conf file!" + die 9 "$1 must contain a dkms.conf file!" fi check_root setup_kernels_arches if ! get_pkginfo_from_conf "$from/dkms.conf" ; then - die 10 $"Malformed dkms.conf file. Cannot load source tree." + die 10 "Malformed dkms.conf file. Cannot load source tree." fi module="$PACKAGE_NAME" module_version="$PACKAGE_VERSION" if [[ $force && -d $source_tree/$module-$module_version ]]; then echo >&2 - echo $"Forcing install of $module-$module_version" + echo "Forcing install of $module-$module_version" rm -rf "$source_tree/$module-$module_version" fi @@ -2233,8 +2232,8 @@ autoinstall() { IFS='/' read m v k a <<< "$mvka" # If the module status is broken there is nothing that can be done if [[ $status = broken ]]; then - error $"$m/$v is broken! Missing the source directory or the symbolic link pointing to it."\ - $"Manual intervention is required!" + error "$m/$v is broken! Missing the source directory or the symbolic link pointing to it."\ + "Manual intervention is required!" continue fi if [[ -z ${latest[$m]} ]]; then @@ -2336,8 +2335,8 @@ autoinstall() { done if (( ${#failed_modules[@]} > 0 || ${#to_install[@]} > 0 )); then - die 11 $"One or more modules failed to install during autoinstall." \ - $"Refer to previous errors for more information." + die 11 "One or more modules failed to install during autoinstall." \ + "Refer to previous errors for more information." fi } @@ -2369,7 +2368,7 @@ symlink_modules="" tmpfile=$(mktemp_or_die) echo "Hello, DKMS!" > "$tmpfile" if [[ "$(cat "$tmpfile")" != "Hello, DKMS!" ]]; then - warn $"dkms will not function properly without some free space in \$TMPDIR ($tmp_location)." + warn "dkms will not function properly without some free space in \$TMPDIR ($tmp_location)." fi rm -f "$tmpfile" @@ -2438,20 +2437,20 @@ while (($# > 0)); do exec >/dev/null 2>&1 ;; --version|-V) - echo $"@RELEASE_STRING@" + echo "@RELEASE_STRING@" exit 0 ;; --no-initrd) # This is an old option, consume and warn - deprecated $"--no-initrd" + deprecated "--no-initrd" ;; --no-clean-kernel) # This is an old option, consume and warn - deprecated $"--no-clean-kernel" + deprecated "--no-clean-kernel" ;; --no-prepare-kernel) # This is an old option, consume and warn - deprecated $"--no-prepare-kernel" + deprecated "--no-prepare-kernel" ;; --binaries-only) binaries_only="binaries-only" @@ -2519,13 +2518,13 @@ while (($# > 0)); do read_arg parallel_jobs "$1" "$2" || shift ;; -*) - error $" Unknown option: $1" + error " Unknown option: $1" show_usage exit 2 ;; *) if [[ $1 =~ $action_re ]]; then - [[ $action ]] && die 4 $"Cannot specify more than one action." + [[ $action ]] && die 4 "Cannot specify more than one action." action="$1" # Add actions to the action list elif [[ -f $1 && $1 = *dkms.conf ]]; then try_source_tree="${1%dkms.conf}./" # Flag as a source tree @@ -2536,7 +2535,7 @@ while (($# > 0)); do elif [[ ! $module ]]; then parse_moduleversion "$1" # Assume it is a module/version pair. else - warn $"I do not know how to handle $1." + warn "I do not know how to handle $1." fi ;; esac @@ -2548,32 +2547,32 @@ done # The <(cmd) idiom does not work if /proc is not mounted read line < <(echo "Hello, DKMS!") if [[ $line != "Hello, DKMS!" ]]; then - warn $"dkms will not function properly if /proc is not mounted." + warn "dkms will not function properly if /proc is not mounted." fi # Error out if binaries-only is set and source-only is set if [[ $binaries_only && $source_only ]]; then - die 8 $" You have specified both --binaries-only and --source-only." \ - $"You cannot do this." + die 8 " You have specified both --binaries-only and --source-only." \ + "You cannot do this." fi # Error if # of arches doesn't match # of kernels if (( ${#kernelver[@]} != ${#arch[@]} && \ ${#arch[@]} > 1 )); then - die 1 $" If more than one arch is specified on the command line, then there" \ - $"must be an equal number of kernel versions also specified (1:1 relationship)." + die 1 " If more than one arch is specified on the command line, then there" \ + "must be an equal number of kernel versions also specified (1:1 relationship)." fi # Check that kernel version and all aren't both set simultaneously if [[ $kernelver && $all ]]; then - die 2 $" You cannot specify a kernel version and also specify" \ - $"--all on the command line." + die 2 " You cannot specify a kernel version and also specify" \ + "--all on the command line." fi # Check that arch and all aren't both set simultaneously if [[ $arch && $all ]]; then - die 3 $" You cannot specify an arch and also specify" \ - $"--all on the command line." + die 3 " You cannot specify an arch and also specify" \ + "--all on the command line." fi # Since initramfs/initrd rebuild is not requested, skip it with Redhat's weak-modules @@ -2619,7 +2618,7 @@ status) ;; ldtarball) # Make sure they're root if we're using --force if [[ $(id -u) != 0 ]] && [[ $force = true ]]; then - die 1 $"You must be root to use this command with the --force option." + die 1 "You must be root to use this command with the --force option." fi load_tarball && add_module ;; @@ -2628,7 +2627,7 @@ generate_mok) prepare_mok ;; *) - error $"Unknown action specified: \"$action\"" + error "Unknown action specified: \"$action\"" show_usage ;; esac