Gentoo Archives: gentoo-commits

From: Mikle Kolyada <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/f2fs-tools/, sys-fs/f2fs-tools/files/
Date: Mon, 03 Dec 2018 14:12:52
Message-Id: 1543846361.76ae45b316e09ec982a1f02d77017efbd5909d40.zlogene@gentoo
1 commit: 76ae45b316e09ec982a1f02d77017efbd5909d40
2 Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 3 14:12:19 2018 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 3 14:12:41 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76ae45b3
7
8 sys-fs/f2fs-tools: revbump to fix fsck on boot
9
10 Closes: https://bugs.gentoo.org/671786
11 Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
12 Package-Manager: Portage-2.3.51, Repoman-2.3.11
13
14 sys-fs/f2fs-tools/f2fs-tools-1.12.0-r1.ebuild | 37 ++++++++++++++
15 .../f2fs-tools/files/f2fs-tools-1.12.0-fsck.patch | 56 ++++++++++++++++++++++
16 2 files changed, 93 insertions(+)
17
18 diff --git a/sys-fs/f2fs-tools/f2fs-tools-1.12.0-r1.ebuild b/sys-fs/f2fs-tools/f2fs-tools-1.12.0-r1.ebuild
19 new file mode 100644
20 index 00000000000..523fddda177
21 --- /dev/null
22 +++ b/sys-fs/f2fs-tools/f2fs-tools-1.12.0-r1.ebuild
23 @@ -0,0 +1,37 @@
24 +# Copyright 1999-2018 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=7
28 +
29 +inherit autotools
30 +
31 +DESCRIPTION="Tools for Flash-Friendly File System (F2FS)"
32 +HOMEPAGE="https://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/about/"
33 +SRC_URI="https://dev.gentoo.org/~zlogene/distfiles/${CATEGORY}/${PN}/${P}.tar.gz"
34 +
35 +LICENSE="GPL-2"
36 +SLOT="0/6"
37 +KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86"
38 +IUSE="selinux"
39 +
40 +RDEPEND="selinux? ( sys-libs/libselinux )"
41 +DEPEND="${RDEPEND}"
42 +
43 +src_prepare() {
44 + eapply "${FILESDIR}"/${P}-fsck.patch
45 + default
46 + eautoreconf
47 +}
48 +
49 +src_configure() {
50 + #This is required to install to /sbin, bug #481110
51 + econf \
52 + --bindir="${EPREFIX}"/sbin \
53 + --disable-static \
54 + $(use_with selinux)
55 +}
56 +
57 +src_install() {
58 + default
59 + find "${D}" -name "*.la" -delete || die
60 +}
61
62 diff --git a/sys-fs/f2fs-tools/files/f2fs-tools-1.12.0-fsck.patch b/sys-fs/f2fs-tools/files/f2fs-tools-1.12.0-fsck.patch
63 new file mode 100644
64 index 00000000000..72d86fec465
65 --- /dev/null
66 +++ b/sys-fs/f2fs-tools/files/f2fs-tools-1.12.0-fsck.patch
67 @@ -0,0 +1,56 @@
68 +From a6160c3e21f43b89b49802cc4a956d1c4b65ae44 Mon Sep 17 00:00:00 2001
69 +From: Chao Yu <yuchao0@××××××.com>
70 +Date: Mon, 26 Nov 2018 18:53:37 +0800
71 +Subject: fsck.f2fs: allow to fsck readonly image w/ -f option
72 +
73 +To keep line with e2fsprogs, let's allow to fsck mounted image as
74 +readonly w/ -f option.
75 +
76 +Reported-by: Perfect Gentleman <perfect007gentleman@×××××.com>
77 +Signed-off-by: Chao Yu <yuchao0@××××××.com>
78 +---
79 + fsck/main.c | 1 +
80 + include/f2fs_fs.h | 1 +
81 + lib/libf2fs.c | 2 +-
82 + 3 files changed, 3 insertions(+), 1 deletion(-)
83 +
84 +diff --git a/fsck/main.c b/fsck/main.c
85 +index 675c603..bb79f6e 100644
86 +--- a/fsck/main.c
87 ++++ b/fsck/main.c
88 +@@ -249,6 +249,7 @@ void f2fs_parse_options(int argc, char *argv[])
89 + case 'f':
90 + case 'y':
91 + c.fix_on = 1;
92 ++ c.force = 1;
93 + MSG(0, "Info: Force to fix corruption\n");
94 + break;
95 + case 'q':
96 +diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
97 +index 65cc8fd..6eebb3a 100644
98 +--- a/include/f2fs_fs.h
99 ++++ b/include/f2fs_fs.h
100 +@@ -369,6 +369,7 @@ struct f2fs_configuration {
101 + void *private;
102 + int dry_run;
103 + int fix_on;
104 ++ int force;
105 + int defset;
106 + int bug_on;
107 + int alloc_failed;
108 +diff --git a/lib/libf2fs.c b/lib/libf2fs.c
109 +index cc335db..498f6c0 100644
110 +--- a/lib/libf2fs.c
111 ++++ b/lib/libf2fs.c
112 +@@ -821,7 +821,7 @@ int get_device_info(int i)
113 + return -1;
114 + }
115 +
116 +- if (S_ISBLK(stat_buf->st_mode))
117 ++ if (S_ISBLK(stat_buf->st_mode) && !c.force)
118 + fd = open(dev->path, O_RDWR | O_EXCL);
119 + else
120 + fd = open(dev->path, O_RDWR);
121 +--
122 +cgit 1.2-0.3.lf.el7
123 +