[PATCH] dkms: add PRE_INSTALL= dkms.conf directive
Michael E Brown
michael_e_brown at Dell.com
Wed Mar 15 21:46:55 CST 2006
On Wed, 2006-03-15 at 21:23 -0600, Matt Domsch wrote:
> @@ -945,6 +947,18 @@
>
> # Check this version against what is already in the kernel
> check_version_sanity "${kernelver_array[0]}" "${arch_array[0]}"
> +
> + # Run the pre_install script
> + if [ -n "$pre_install" ] && [ -x `echo
> "$dkms_tree/$module/$module_version/source/$pre_install" | sed
> 's/ .*//'` ]; then
why the complicated echo | sed thing here?
> + echo $""
Ok, maybe it is just me being dense, but I have never seen $"" syntax
before. Why are most of the echo args prefixed with "$"?
> + echo $"Running the pre_install script:"
> + $dkms_tree/$module/$module_version/source/$pre_install
Should the subcommand output be redirected somewhere?
> + if [ "$?" -ne 0 -a -z "$force" ]; then
> + echo $"pre_install failed, aborting install." >&2
The ">&2" is not good. If you have a script like this:
====
#!/bin/sh
exec > logfile 2>&1
echo "some stuff"
dkms command here
echo "other stuff"
====
If the dkms command fails, it truncates your log file and you lose "some
stuff" from the logs. This is a persistent problem throughout. Should be
">>&2" instead to fix this.
--
Michael
> + echo $"You may override by specifying --force." >&2
> + exit 101
> + fi
> + fi
>
> # Save the original_module if one exists, none have been saved
> before, and this is the first module for this kernel
> local lib_tree="$install_tree/${kernelver_array[0]}"
> Index: SOURCES/dkms.8
More information about the DKMS-devel
mailing list