Commit f3a61b36 authored by Ben Hutchings's avatar Ben Hutchings

scripts/local: Add option for local_device_setup to return failure

If the root or /usr filesystem is missing, we cannot continue
booting and must panic.  This is not true for the resume device,
and a missing resume device has not been a fatal error up until
Signed-off-by: default avatarBen Hutchings <>
parent 033c948b
......@@ -49,11 +49,13 @@ local_bottom()
# $1=device ID to mount
# $2=optionname (for root and etc)
# $3=panic if device is missing (true or false, default: true)
# Sets $DEV to the resolved device node
local dev_id="$1"
local name="$2"
local may_panic="${3:-true}"
local real_dev
local time_elapsed
local count
......@@ -133,6 +135,10 @@ local_device_setup()
# We've given up, but we'll let the user fix matters if they can
while ! real_dev=$(resolve_device "${dev_id}") ||
! get_fstype "${real_dev}" >/dev/null; do
if ! $may_panic; then
echo "Gave up waiting for ${name}"
return 1
echo "Gave up waiting for ${name} device. Common problems:"
echo " - Boot args (cat /proc/cmdline)"
echo " - Check rootdelay= (did the system wait long enough?)"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment