Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
Date: Sat, 24 Mar 2018 18:03:44
Message-Id: 1521914553.c9943a36849687a41b3feec6d6a7de5dddd715da.floppym@gentoo
1 commit: c9943a36849687a41b3feec6d6a7de5dddd715da
2 Author: Alexander Tsoy <alexander <AT> tsoy <DOT> me>
3 AuthorDate: Fri Mar 23 14:45:25 2018 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sat Mar 24 18:02:33 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9943a36
7
8 sys-kernel/dracut: add upstream patches
9
10 Fixes the following issues:
11 - issues found by shellcheck
12 - broken plymouth directory detection
13
14 Closes: https://bugs.gentoo.org/651132
15
16 .../{dracut-047.ebuild => dracut-047-r1.ebuild} | 2 +
17 .../047-all-fix-issues-found-by-shellcheck.patch | 77 ++++++++++++++++++++++
18 ...mouth-fix-detection-of-plymouth-directory.patch | 31 +++++++++
19 3 files changed, 110 insertions(+)
20
21 diff --git a/sys-kernel/dracut/dracut-047.ebuild b/sys-kernel/dracut/dracut-047-r1.ebuild
22 similarity index 97%
23 rename from sys-kernel/dracut/dracut-047.ebuild
24 rename to sys-kernel/dracut/dracut-047-r1.ebuild
25 index b37520c7e9f..0ced6bdb8d9 100644
26 --- a/sys-kernel/dracut/dracut-047.ebuild
27 +++ b/sys-kernel/dracut/dracut-047-r1.ebuild
28 @@ -52,6 +52,8 @@ QA_MULTILIB_PATHS="usr/lib/dracut/.*"
29
30 PATCHES=(
31 "${FILESDIR}/045-systemdutildir.patch"
32 + "${FILESDIR}/047-all-fix-issues-found-by-shellcheck.patch"
33 + "${FILESDIR}/047-plymouth-fix-detection-of-plymouth-directory.patch"
34 )
35
36 src_configure() {
37
38 diff --git a/sys-kernel/dracut/files/047-all-fix-issues-found-by-shellcheck.patch b/sys-kernel/dracut/files/047-all-fix-issues-found-by-shellcheck.patch
39 new file mode 100644
40 index 00000000000..d5cbe042b63
41 --- /dev/null
42 +++ b/sys-kernel/dracut/files/047-all-fix-issues-found-by-shellcheck.patch
43 @@ -0,0 +1,77 @@
44 +From 3aa37cafde734719f2377600a17459fad30edfbc Mon Sep 17 00:00:00 2001
45 +From: Lukas Nykryn <lnykryn@××××××.com>
46 +Date: Fri, 2 Mar 2018 12:29:46 +0100
47 +Subject: [PATCH 06/14] all: fix issues found by shellcheck
48 +To: <initramfs@×××××××××××.org>
49 +
50 +Error: SHELLCHECK_WARNING:
51 +/usr/lib/dracut/dracut-init.sh:939:20: error: Argument to implicit -n is always true due to literal strings. [SC2157]
52 + 937| dracut_kernel_post() {
53 + 938| for _f in modules.builtin.bin modules.builtin modules.order; do
54 + 939|-> [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
55 + 940| done
56 + 941|
57 +
58 +Error: SHELLCHECK_WARNING:
59 +/usr/lib/dracut/modules.d/98syslog/parse-syslog-opts.sh:18:12: error: This expression is constant. Did you forget a $ somewhere? [SC2078]
60 + 16| elif [ -e /sbin/syslogd ]; then
61 + 17| syslogtype="syslogd"
62 + 18|-> elif [ /sbin/syslog-ng ]; then
63 + 19| syslogtype="syslog-ng"
64 + 20| else
65 +
66 +Error: SHELLCHECK_WARNING:
67 +/usr/lib/dracut/modules.d/90crypt/crypt-lib.sh:15:29: error: Since you double quoted this, it will not word split, and the loop will only run once. [SC2066]
68 + 13| strstr "$d" "${luks##luks-}" && return 0
69 + 14| if [ -n "$dev" ]; then
70 + 15|-> for _dev in "$(devnames $d)"; do
71 + 16| [ "$dev" -ef "$_dev" ] && return 0
72 + 17| done
73 +---
74 + dracut-init.sh | 2 +-
75 + modules.d/90crypt/crypt-lib.sh | 2 +-
76 + modules.d/98syslog/parse-syslog-opts.sh | 2 +-
77 + 3 files changed, 3 insertions(+), 3 deletions(-)
78 +
79 +diff --git a/dracut-init.sh b/dracut-init.sh
80 +index 53e6f13a..1278c638 100644
81 +--- a/dracut-init.sh
82 ++++ b/dracut-init.sh
83 +@@ -942,7 +942,7 @@ for_each_kmod_dep() {
84 +
85 + dracut_kernel_post() {
86 + for _f in modules.builtin.bin modules.builtin modules.order; do
87 +- [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
88 ++ [[ -e $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
89 + done
90 +
91 + # generate module dependencies for the initrd
92 +diff --git a/modules.d/90crypt/crypt-lib.sh b/modules.d/90crypt/crypt-lib.sh
93 +index 532b9a71..bbf485e0 100755
94 +--- a/modules.d/90crypt/crypt-lib.sh
95 ++++ b/modules.d/90crypt/crypt-lib.sh
96 +@@ -12,7 +12,7 @@ crypttab_contains() {
97 + strstr "${l##luks-}" "${luks##luks-}" && return 0
98 + strstr "$d" "${luks##luks-}" && return 0
99 + if [ -n "$dev" ]; then
100 +- for _dev in "$(devnames $d)"; do
101 ++ for _dev in $(devnames $d); do
102 + [ "$dev" -ef "$_dev" ] && return 0
103 + done
104 + fi
105 +diff --git a/modules.d/98syslog/parse-syslog-opts.sh b/modules.d/98syslog/parse-syslog-opts.sh
106 +index 50ec2759..9ec6ad47 100755
107 +--- a/modules.d/98syslog/parse-syslog-opts.sh
108 ++++ b/modules.d/98syslog/parse-syslog-opts.sh
109 +@@ -15,7 +15,7 @@ detect_syslog() {
110 + syslogtype="rsyslogd"
111 + elif [ -e /sbin/syslogd ]; then
112 + syslogtype="syslogd"
113 +- elif [ /sbin/syslog-ng ]; then
114 ++ elif [ -e /sbin/syslog-ng ]; then
115 + syslogtype="syslog-ng"
116 + else
117 + warn "Could not find any syslog binary although the syslogmodule is selected to be installed. Please check."
118 +--
119 +2.16.1
120 +
121
122 diff --git a/sys-kernel/dracut/files/047-plymouth-fix-detection-of-plymouth-directory.patch b/sys-kernel/dracut/files/047-plymouth-fix-detection-of-plymouth-directory.patch
123 new file mode 100644
124 index 00000000000..42f877292a7
125 --- /dev/null
126 +++ b/sys-kernel/dracut/files/047-plymouth-fix-detection-of-plymouth-directory.patch
127 @@ -0,0 +1,31 @@
128 +From fe6c7e0f06cde65effb3503a47c31ac39aceefb6 Mon Sep 17 00:00:00 2001
129 +From: Alexander Tsoy <alexander@××××.me>
130 +Date: Fri, 23 Mar 2018 11:52:27 +0300
131 +Subject: [PATCH 14/14] plymouth: fix detection of plymouth directory
132 +To: <initramfs@×××××××××××.org>
133 +
134 +Some distros have both /usr/lib/plymouth and /usr/libexec/plymouth
135 +directorirs, so we should check the existance of plymouth-populate-initrd
136 +script.
137 +
138 +Fixes: 421b46f8ae89cfe2b62e880a8a5079ee8c1b3aae
139 +---
140 + modules.d/50plymouth/module-setup.sh | 2 +-
141 + 1 file changed, 1 insertion(+), 1 deletion(-)
142 +
143 +diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh
144 +index 5fbca8b0..b51913e8 100755
145 +--- a/modules.d/50plymouth/module-setup.sh
146 ++++ b/modules.d/50plymouth/module-setup.sh
147 +@@ -6,7 +6,7 @@ pkglib_dir() {
148 + _dirs+=" /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/plymouth"
149 + fi
150 + for _dir in $_dirs; do
151 +- if [ -d $_dir ]; then
152 ++ if [ -x $_dir/plymouth-populate-initrd ]; then
153 + echo $_dir
154 + return
155 + fi
156 +--
157 +2.16.1
158 +