[PATCH] dkms: add PRE_INSTALL= dkms.conf directive
Matt Domsch
Matt_Domsch at dell.com
Wed Mar 15 22:20:14 CST 2006
On Wed, Mar 15, 2006 at 09:46:55PM -0600, Michael E Brown wrote:
> 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?
The actual value of $pre_install is "pre_install.sh arg1 arg2 arg3",
and the sed just hacks that to return the name of the script only, not
the args.
> > + 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 "$"?
Per 'man bash', it allows the strings to be automatically translated.
Where you put the translations though I don't know.
> > + echo $"Running the pre_install script:"
> > + $dkms_tree/$module/$module_version/source/$pre_install
>
> Should the subcommand output be redirected somewhere?
None of the other PRE_ or POST_ subcommands are.
> > + 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.
OK. I'll set that aside for this week, but will do a global fix on
it.
--
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
More information about the DKMS-devel
mailing list