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

Re: [PATCH initramfs-tools] panic: Do not return if reboot fails



On Fri, 2014-10-03 at 01:26 +0100, Ben Hutchings wrote:
> The panic function may be called from several places in the init
> script, not just at the end.  In some cases, the calling function will
> retry an action when it returns; for example, booting with
> 'root=/dev/nonexistent panic=1' currently leads to an infinite series
> of error messages.
> 
> In order to trigger a kernel panic reliably, we must use exit rather
> than return.
>
> Related to: #751488

I included this in the 0.118 release.

Ben.

> ---
>  scripts/functions | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/functions b/scripts/functions
> index 11e8a10..16b5187 100644
> --- a/scripts/functions
> +++ b/scripts/functions
> @@ -43,7 +43,7 @@ panic()
>  		echo "Rebooting automatically due to panic= boot argument"
>  		sleep ${panic}
>  		reboot
> -		return
> +		exit  # in case reboot fails, force kernel panic
>  	fi
>  	modprobe -v i8042 || true
>  	modprobe -v atkbd || true
> 

-- 
Ben Hutchings
One of the nice things about standards is that there are so many of them.

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: