summaryrefslogtreecommitdiff
path: root/scripts/local
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2017-02-19 00:07:08 +0000
committerBen Hutchings <ben@decadent.org.uk>2017-04-08 20:44:18 +0100
commitf3a61b36882cc19a2c39275a1d1f80bdddfab1c6 (patch)
treef360b4d981db972be89b4eae27b0c07b4c963d66 /scripts/local
parent033c948bb0e3ca8733fba3a52d95945c645c8548 (diff)
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 now. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'scripts/local')
-rw-r--r--scripts/local6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/local b/scripts/local
index 3707440..4ec926c 100644
--- a/scripts/local
+++ b/scripts/local
@@ -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_device_setup()
{
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
+ fi
echo "Gave up waiting for ${name} device. Common problems:"
echo " - Boot args (cat /proc/cmdline)"
echo " - Check rootdelay= (did the system wait long enough?)"