dracut/0404-dracut-emergency-optionally-print-fs-help.patch
Thomas Renninger e7df022c61 Accepting request 416594 from home:trenn:branches:Base:System
- Fix DASD SSID handling (bsc#989313)
* Add 0501-dasd_fix_ssid_bigger_zero.patch

- Advise user of fs recovery options when we fail to mount (fate#320443)
 * Add 0404-dracut-emergency-optionally-print-fs-help.patch

OBS-URL: https://build.opensuse.org/request/show/416594
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=262
2016-08-02 16:36:01 +00:00

56 lines
2.1 KiB
Diff

From 7114191b77be2e979bc7d7a93ba040b91a72b5a9 Mon Sep 17 00:00:00 2001
From: Mark Fasheh <mfasheh@suse.de>
Date: Fri, 24 Jun 2016 15:11:17 -0700
Subject: [PATCH] dracut-emergency: optionally print fs help
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 | 6 ++++++
modules.d/98dracut-systemd/dracut-emergency.sh | 2 ++
2 files changed, 8 insertions(+)
diff --git a/dracut-init.sh b/dracut-init.sh
index fc35d7b..ae6352b 100644
--- a/dracut-init.sh
+++ b/dracut-init.sh
@@ -240,6 +240,12 @@ inst_script() {
(($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
}
+inst_fsck_help() {
+ local _helper="/usr/share/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"
diff --git a/modules.d/98dracut-systemd/dracut-emergency.sh b/modules.d/98dracut-systemd/dracut-emergency.sh
index 26be291..2d9ecd7 100755
--- a/modules.d/98dracut-systemd/dracut-emergency.sh
+++ b/modules.d/98dracut-systemd/dracut-emergency.sh
@@ -16,6 +16,7 @@ source_hook "$hook"
if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then
+ FSTXT="/usr/share/fsck/fsck_help_$fstype.txt"
echo
rdsosreport
echo
@@ -26,6 +27,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
--
2.1.4