Browse Source

usrmount/mount-usr.sh: give emergency_shell if /usr mount failed

master
Harald Hoyer 13 years ago
parent
commit
f225f180e3
  1. 8
      modules.d/98usrmount/mount-usr.sh

8
modules.d/98usrmount/mount-usr.sh

@ -74,10 +74,9 @@ mount_usr()
if [ "0" != "${_passno:-0}" ]; then if [ "0" != "${_passno:-0}" ]; then
fsck_usr "$_dev" "$_fs" "$_opts" fsck_usr "$_dev" "$_fs" "$_opts"
_fsck_ret=$? _fsck_ret=$?
echo $_fsck_ret >/run/initramfs/usr-fsck [ $_fsck_ret -ne 255 ] && echo $_fsck_ret >/run/initramfs/usr-fsck
fi fi
fi fi
if [ $_fsck_ret -ne 255 ]; then
if getargbool 0 rd.usrmount.ro; then if getargbool 0 rd.usrmount.ro; then
info "Mounting /usr (read-only forced)" info "Mounting /usr (read-only forced)"
mount -r "$NEWROOT/usr" 2>&1 | vinfo mount -r "$NEWROOT/usr" 2>&1 | vinfo
@ -85,6 +84,11 @@ mount_usr()
info "Mounting /usr" info "Mounting /usr"
mount "$NEWROOT/usr" 2>&1 | vinfo mount "$NEWROOT/usr" 2>&1 | vinfo
fi fi
if ! ismounted /usr; then
warn "Mounting /usr to $NEWROOT/usr failed"
warn "*** Dropping you to a shell; the system will continue"
warn "*** when you leave the shell."
emergency_shell
fi fi
fi fi
} }

Loading…
Cancel
Save