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" +} +