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

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



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
---
 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
If God had intended Man to program,
we'd have been born with serial I/O ports.

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


Reply to: