From d35c296ba391c4ef4be7c8f50ca6d340c8ba3ee5e21e5b451ffa2b5061286a00 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 29 Jan 2019 14:38:27 +0000 Subject: [PATCH] Accepting request 669361 from home:mfasheh:branches:filesystems - Advise user of fs recovery options when we fail to mount (fate#320443, bsc#1122539) * Add dracut-fsck-help.txt * Add module-setup.sh OBS-URL: https://build.opensuse.org/request/show/669361 OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=312 --- btrfsprogs.changes | 8 ++++++++ btrfsprogs.spec | 16 ++++++++++++++++ dracut-fsck-help.txt | 6 ++++++ module-setup.sh | 17 +++++++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 dracut-fsck-help.txt create mode 100644 module-setup.sh diff --git a/btrfsprogs.changes b/btrfsprogs.changes index 5ac90f3..0f08b0e 100644 --- a/btrfsprogs.changes +++ b/btrfsprogs.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Jan 24 04:00:34 UTC 2019 - mfasheh@suse.com + +- Advise user of fs recovery options when we fail to mount (fate#320443, + bsc#1122539) + * Add dracut-fsck-help.txt + * Add module-setup.sh + ------------------------------------------------------------------- Wed Jan 23 00:00:00 CET 2019 - dsterba@suse.cz diff --git a/btrfsprogs.spec b/btrfsprogs.spec index 8a43519..a0f3bd8 100644 --- a/btrfsprogs.spec +++ b/btrfsprogs.spec @@ -30,6 +30,8 @@ # the tarball contains prebuilt documentation %define build_docs 0 +%define _dracutmodulesdir %{_libexecdir}/dracut/modules.d + Name: btrfsprogs Version: 4.20.1 Release: 0 @@ -42,6 +44,8 @@ URL: https://btrfs.wiki.kernel.org/index.php/Main_Page Source: https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v%{version}.tar.gz # support for mkinitrd in < 13.1 Source1: boot-btrfs.sh +Source2: module-setup.sh +Source3: dracut-fsck-help.txt Source4: setup-btrfs.sh Source5: sles11-defaults.h @@ -52,6 +56,9 @@ BuildRequires: asciidoc %endif BuildRequires: autoconf BuildRequires: automake +%if 0%{?suse_version} > 1200 +BuildRequires: dracut +%endif BuildRequires: libattr-devel BuildRequires: libblkid-devel BuildRequires: libext2fs-devel @@ -240,6 +247,10 @@ rm -f %{buildroot}/%{_libdir}/*.a # bash completion install -m 0755 -d %{buildroot}/%{_datadir}/bash-completion/completions install -m 0644 btrfs-completion %{buildroot}/%{_datadir}/bash-completion/completions/btrfs +%if 0%{?suse_version} > 1200 +install -m 0755 -D %{SOURCE2} %{buildroot}/%{_dracutmodulesdir}/95suse-btrfs/module-setup.sh +cp %{SOURCE3} . +%endif %if 0%{!?for_debugging:1} DEBUG_FILES="/sbin/btrfs-find-root @@ -279,6 +290,11 @@ done %else %license COPYING %endif +%if 0%{?suse_version} > 1200 +%doc dracut-fsck-help.txt +%{_dracutmodulesdir}/95suse-btrfs/ +%{_dracutmodulesdir}/95suse-btrfs/module-setup.sh +%endif /sbin/fsck.btrfs # mkinitrd utils /sbin/btrfs diff --git a/dracut-fsck-help.txt b/dracut-fsck-help.txt new file mode 100644 index 0000000..c3d939e --- /dev/null +++ b/dracut-fsck-help.txt @@ -0,0 +1,6 @@ +Recovery of btrfs file systems is not automated. We suggest you use +'btrfs check --readonly' first to see the if there's any damage and +what's the scope. Logging the output is a recommended for later analysis. + +The option '--repair' must be used with care, be noted that it is +able to fix certain classes of errors but not all of them. diff --git a/module-setup.sh b/module-setup.sh new file mode 100644 index 0000000..cb99f55 --- /dev/null +++ b/module-setup.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# called by dracut +check() { + return 0 +} + +# called by dracut +depends() { + return 0 +} + +# called by dracut +install() { + inst_fsck_help "btrfs" "/usr/share/doc/packages/btrfsprogs/dracut-fsck-help.txt" +} +