[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH 1/2] panic(): print name of kernel module before loading it



On Wed, 02 Mar 2011, Timo Juhani Lindfors wrote:

> Loading a kernel can crash the system so it is useful that the user
> sees which module might be causing trouble.

ack on the statement.
 
> Signed-off-by: Timo Juhani Lindfors <timo.lindfors@iki.fi>
> 
> diff --git a/scripts/functions b/scripts/functions
> index 579696a..af49e45 100644
> --- a/scripts/functions
> +++ b/scripts/functions
> @@ -31,6 +31,12 @@ log_end_msg()
>  	_log_msg "done.\n"
>  }
>  
> +try_modprobe()
> +{
> +	echo "Attempting to load kernel module $1"
> +	modprobe $1
> +}
Well we don't attempt, but we do load the module.
I'd prefer the function to be named modprobe_verbose()
> +
>  panic()
>  {
>  	if command -v chvt >/dev/null 2>&1; then
> @@ -44,8 +50,8 @@ panic()
>  		sleep ${panic}
>  		reboot
>  	fi
> -	modprobe i8042
> -	modprobe atkbd
> +	try_modprobe i8042
> +	try_modprobe atkbd
why not using "-v" from modprobe,
the only argument against that would count is busybox support.
please check?

>  	REASON="$@" PS1='(initramfs) ' /bin/sh -i </dev/console >/dev/console 2>&1
>  }
>  
> -- 
> 1.7.2.3
> 
 

thank you.

-- 
maks


Reply to: