]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-emergency: optionally print fs help 338/head
authorMark Fasheh <mfasheh@suse.de>
Fri, 24 Jun 2016 22:11:17 +0000 (15:11 -0700)
committerDaniel Molkentin <dmolkentin@suse.com>
Mon, 8 Jan 2018 13:14:05 +0000 (14:14 +0100)
Allow filesystem modules to install a fs-specific text file with
instructions on what to do when mount fails. This is printed when we go into
an emergency shell.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
dracut-init.sh
modules.d/98dracut-systemd/dracut-emergency.sh

index e8a705ec76421e6a562ac28117a27cb5e2eb4ec1..53e6f13a257d1b99a97682c09a1d61616533b85e 100644 (file)
@@ -261,6 +261,12 @@ inst_script() {
     (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-f} "$@" || :
 }
 
+inst_fsck_help() {
+    local _helper="/run/dracut/fsck/fsck_help_$1.txt"
+    $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" $_helper
+    (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-f} "$2" $_helper || :
+}
+
 mark_hostonly() {
     for i in "$@"; do
         echo "$i" >> "$initdir/lib/dracut/hostonly-files"
index 548f64b9b299b509ce20a4e41fce2b80e1327bd6..f17460a75f7dc5cfb9b4dc6728d74c3066d5dd10 100755 (executable)
@@ -14,6 +14,7 @@ export _rdshell_name="dracut" action="Boot" hook="emergency"
 _emergency_action=$(getarg rd.emergency)
 
 if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then
+    FSTXT="/run/dracut/fsck/fsck_help_$fstype.txt"
     source_hook "$hook"
     echo
     rdsosreport
@@ -25,6 +26,7 @@ if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then
     echo 'after mounting them and attach it to a bug report.'
     echo
     echo
+    [ -f "$FSTXT" ] && cat "$FSTXT"
     [ -f /etc/profile ] && . /etc/profile
     [ -z "$PS1" ] && export PS1="$_name:\${PWD}# "
     exec sh -i -l