On 02/11/14 at 08:32am, Vivek Goyal wrote:
On Tue, Feb 11, 2014 at 03:05:08PM +0800, Dave Young wrote:
[..]
> function start()
> {
> + local rc
> +
> check_config
> if [ $? -ne 0 ]; then
> echo "Starting kdump: [FAILED]"
> @@ -517,6 +555,13 @@ function start()
> return 1
> fi
>
> + check_kdump_feasibility
> + rc=$?
> + if [ $rc == 1 ]; then
> + echo "Secure boot is not supported in kdump yet. Please disable secure boot
and retry. [WARNING]"
- Let us use the string "Secure Boot" whereever we are referring to it.
Ok
- Remove "Please".
Will do
- This is FAILED message and not a WARNING message?
Agree. Actually except the "Kdump is already running, all other cases which return
non zero should be FAILED"
May be use following.
"Secure Boot is Enabled. Kdump service can't be started. Disable Secure
Boot and retry. [FAILED]"
Thinking more about it. How about we output two messages. First message
is displayed inside the function where actual check happened. That message
will be very specific and say what's wrong. Second check will be in top
level function and that will display the generic message. Something like
as follows.
check_kdump_feasibility()
{
if (secure_boot_enabled) {
"Secure Boot is Enabled. Kdump service can't be started. Disable Secure Boot
and retry"
return 1;
}
}
start() {
....
....
check_kdump_feasibility
rc = $?
if [ $rc -ne 0 ];then
echo "Kdump is not supported on this kernel: [WARNING]"
fi
That way we don't have to differentiate between return code 1 and 2.
Top level function says that we can't run kdump on this kernel. And
message inside the function gives more details what's exactly wrong with
this kernel.
I haved tried this but changed to current patch and feel it's cleanner
to put them together.
But I'm also fine with this way.
Thanks
Dave