1 |
commit: 449a46321dd855a52f7ce17cd486e43ff7ba6872 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 2 13:57:41 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 2 13:58:56 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=449a4632 |
7 |
|
8 |
sys-kernel/genkernel: fix {ROOT,SWAP}_KEYDEV usage |
9 |
|
10 |
Rev bump containing some post release fixes including a patch |
11 |
which will try to determine filesystem used for {ROOT,SWAP}_KEYDEV |
12 |
to trigger module autoloading in case used filesystem wasn't built |
13 |
into kernel. |
14 |
|
15 |
Package-Manager: Portage-3.0.4, Repoman-3.0.1 |
16 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
17 |
|
18 |
.../files/genkernel-4.1.2-post-release-fixes.patch | 190 +++++++++++++++++++++ |
19 |
...rnel-4.1.2.ebuild => genkernel-4.1.2-r1.ebuild} | 2 + |
20 |
2 files changed, 192 insertions(+) |
21 |
|
22 |
diff --git a/sys-kernel/genkernel/files/genkernel-4.1.2-post-release-fixes.patch b/sys-kernel/genkernel/files/genkernel-4.1.2-post-release-fixes.patch |
23 |
new file mode 100644 |
24 |
index 00000000000..1faa26d8b3e |
25 |
--- /dev/null |
26 |
+++ b/sys-kernel/genkernel/files/genkernel-4.1.2-post-release-fixes.patch |
27 |
@@ -0,0 +1,190 @@ |
28 |
+--- a/defaults/initrd.defaults |
29 |
++++ b/defaults/initrd.defaults |
30 |
+@@ -101,9 +101,11 @@ GK_UDEV_TIMEOUT=120 |
31 |
+ GK_USERINTERACTION_DISABLED_STATEFILE='/tmp/user-interaction.disabled' |
32 |
+ |
33 |
+ CRYPT_ENV_FILE='/etc/CRYPT_ENV.conf' |
34 |
+-CRYPT_KEYFILE_ROOT='/tmp/root.key' |
35 |
+-CRYPT_KEYFILE_SWAP='/tmp/swap.key' |
36 |
++CRYPT_ROOT_KEYDEV_FSTYPE='auto' |
37 |
++CRYPT_ROOT_KEYFILE='/tmp/root.key' |
38 |
+ CRYPT_ROOT_OPENED_LOCKFILE='/tmp/ROOT.opened' |
39 |
++CRYPT_SWAP_KEYDEV_FSTYPE='auto' |
40 |
++CRYPT_SWAP_KEYFILE='/tmp/swap.key' |
41 |
+ CRYPT_SWAP_OPENED_LOCKFILE='/tmp/SWAP.opened' |
42 |
+ |
43 |
+ ZFS_ENC_ENV_FILE='/etc/ZFS_ENC_ENV.conf' |
44 |
+--- a/defaults/initrd.scripts |
45 |
++++ b/defaults/initrd.scripts |
46 |
+@@ -1780,7 +1780,7 @@ openLUKS() { |
47 |
+ exit 1 |
48 |
+ fi |
49 |
+ |
50 |
+- case $1 in |
51 |
++ case ${1} in |
52 |
+ root) |
53 |
+ local TYPE=ROOT |
54 |
+ ;; |
55 |
+@@ -1789,8 +1789,12 @@ openLUKS() { |
56 |
+ ;; |
57 |
+ esac |
58 |
+ |
59 |
+- eval local LUKS_DEVICE='"${CRYPT_'${TYPE}'}"' LUKS_NAME="$1" LUKS_KEY='"${CRYPT_'${TYPE}'_KEY}"' |
60 |
+- eval local LUKS_KEYDEV='"${CRYPT_'${TYPE}'_KEYDEV}"' LUKS_TRIM='"${CRYPT_'${TYPE}'_TRIM}"' |
61 |
++ local LUKS_NAME="${1}" |
62 |
++ eval local LUKS_DEVICE='"${CRYPT_'${TYPE}'}"' |
63 |
++ eval local LUKS_KEY='"${CRYPT_'${TYPE}'_KEY}"' |
64 |
++ eval local LUKS_KEYDEV='"${CRYPT_'${TYPE}'_KEYDEV}"' |
65 |
++ eval local LUKS_KEYDEV_FSTYPE='"${CRYPT_'${TYPE}'_KEYDEV_FSTYPE}"' |
66 |
++ eval local LUKS_TRIM='"${CRYPT_'${TYPE}'_TRIM}"' |
67 |
+ eval local OPENED_LOCKFILE='"${CRYPT_'${TYPE}'_OPENED_LOCKFILE}"' |
68 |
+ local DEV_ERROR=0 KEY_ERROR=0 KEYDEV_ERROR=0 |
69 |
+ local mntkey="/mnt/key/" crypt_filter_ret= |
70 |
+@@ -1886,7 +1890,10 @@ openLUKS() { |
71 |
+ # At this point a device was recognized, now let's see if the key is there |
72 |
+ [ ! -d "${mntkey}" ] && mkdir -p "${mntkey}" >/dev/null 2>&1 |
73 |
+ |
74 |
+- if ! run mount -n -o ro ${REAL_LUKS_KEYDEV} ${mntkey} >/dev/null 2>&1 |
75 |
++ # determine fs -- 'auto' will not trigger module loading! |
76 |
++ LUKS_KEYDEV_FSTYPE=$(determine_fs "${REAL_LUKS_KEYDEV}" "${LUKS_KEYDEV_FSTYPE}") |
77 |
++ |
78 |
++ if ! run mount -n -t ${LUKS_KEYDEV_FSTYPE} -o ro ${REAL_LUKS_KEYDEV} ${mntkey} >/dev/null 2>&1 |
79 |
+ then |
80 |
+ KEYDEV_ERROR=1 |
81 |
+ bad_msg "Mounting of device ${REAL_LUKS_KEYDEV} failed." ${CRYPT_SILENT} |
82 |
+--- a/defaults/linuxrc |
83 |
++++ b/defaults/linuxrc |
84 |
+@@ -2,7 +2,7 @@ |
85 |
+ |
86 |
+ # shellcheck source=initrd.defaults |
87 |
+ . /etc/initrd.defaults |
88 |
+-# shellche2ck source=initrd.scripts |
89 |
++# shellcheck source=initrd.scripts |
90 |
+ . /etc/initrd.scripts |
91 |
+ |
92 |
+ # shellcheck source=/dev/null |
93 |
+@@ -257,6 +257,9 @@ do |
94 |
+ root_keydev=*) |
95 |
+ CRYPT_ROOT_KEYDEV=${x#*=} |
96 |
+ ;; |
97 |
++ root_keydev_fstype=*) |
98 |
++ CRYPT_ROOT_KEYDEV_FSTYPE=${x#*=} |
99 |
++ ;; |
100 |
+ root_trim=*) |
101 |
+ CRYPT_ROOT_TRIM=${x#*=} |
102 |
+ ;; |
103 |
+@@ -266,6 +269,9 @@ do |
104 |
+ swap_keydev=*) |
105 |
+ CRYPT_SWAP_KEYDEV=${x#*=} |
106 |
+ ;; |
107 |
++ swap_keydev_fstype=*) |
108 |
++ CRYPT_SWAP_KEYDEV_FSTYPE=${x#*=} |
109 |
++ ;; |
110 |
+ real_resume=*|resume=*) |
111 |
+ REAL_RESUME=${x#*=} |
112 |
+ ;; |
113 |
+--- a/defaults/login-remote.sh |
114 |
++++ b/defaults/login-remote.sh |
115 |
+@@ -24,10 +24,10 @@ fi |
116 |
+ receivefile() { |
117 |
+ case ${1} in |
118 |
+ root) |
119 |
+- file=${CRYPT_KEYFILE_ROOT} |
120 |
++ file=${CRYPT_ROOT_KEYFILE} |
121 |
+ ;; |
122 |
+ swap) |
123 |
+- file=${CRYPT_KEYFILE_SWAP} |
124 |
++ file=${CRYPT_SWAP_KEYFILE} |
125 |
+ ;; |
126 |
+ '') |
127 |
+ bad_msg "No keyfile specified." "${CRYPT_SILENT}" |
128 |
+--- a/defaults/unlock-luks.sh |
129 |
++++ b/defaults/unlock-luks.sh |
130 |
+@@ -43,8 +43,11 @@ main() { |
131 |
+ exit 1 |
132 |
+ fi |
133 |
+ |
134 |
+- eval local LUKS_DEVICE='"${CRYPT_'${TYPE}'}"' LUKS_NAME="${NAME}" LUKS_KEY='"${CRYPT_KEYFILE_'${TYPE}'}"' |
135 |
+- eval local LUKS_TRIM='"${CRYPT_'${TYPE}'_TRIM}"' OPENED_LOCKFILE='"${CRYPT_'${TYPE}'_OPENED_LOCKFILE}"' |
136 |
++ local LUKS_NAME="${NAME}" |
137 |
++ eval local LUKS_DEVICE='"${CRYPT_'${TYPE}'}"' |
138 |
++ eval local LUKS_KEY='"${CRYPT_'${TYPE}'_KEY}"' |
139 |
++ eval local LUKS_TRIM='"${CRYPT_'${TYPE}'_TRIM}"' |
140 |
++ eval local OPENED_LOCKFILE='"${CRYPT_'${TYPE}'_OPENED_LOCKFILE}"' |
141 |
+ |
142 |
+ while true |
143 |
+ do |
144 |
+--- a/doc/genkernel.8.txt |
145 |
++++ b/doc/genkernel.8.txt |
146 |
+@@ -646,6 +646,9 @@ recognized by the kernel itself. |
147 |
+ root_key. If unset while using root_key, it will automatically |
148 |
+ look for the device in every boot. |
149 |
+ |
150 |
++*root_keydev_fstype*=<...>:: |
151 |
++ Used filesystem for *root_keydev*. See *rootfstype* for more details. |
152 |
++ |
153 |
+ *root_trim*=(yes|no):: |
154 |
+ Enables TRIM support for a LUKS-based root device. Only useful |
155 |
+ with SSD setups. Have a look at 'https://en.wikipedia.org/wiki/TRIM' |
156 |
+@@ -657,6 +660,9 @@ recognized by the kernel itself. |
157 |
+ *swap_keydev*=<...>:: |
158 |
+ Same as root_keydev for swap. |
159 |
+ |
160 |
++*swap_keydev_fstype*=<...>:: |
161 |
++ Used filesystem for *swap_keydev*. See *rootfstype* for more details. |
162 |
++ |
163 |
+ *crypt_silent*:: |
164 |
+ Set this to silent all the output related to the cryptographic |
165 |
+ software, and in case your encrypted device isn't open with the |
166 |
+@@ -790,7 +796,8 @@ when not set. This will allow remote user to provide answer through |
167 |
+ *rootfstype*=<...>:: |
168 |
+ Specify the file system type to mount the real root filesystem as. |
169 |
+ This can be useful when support for ext2/ext3/ext4 are |
170 |
+- in competition. Default is "auto". |
171 |
++ in competition or used filesystem was not built into kernel. |
172 |
++ Default is "auto". |
173 |
+ |
174 |
+ *docache*:: |
175 |
+ *nocache*:: |
176 |
+--- a/gen_determineargs.sh |
177 |
++++ b/gen_determineargs.sh |
178 |
+@@ -415,7 +415,6 @@ determine_real_args() { |
179 |
+ set_config_with_override BOOL GENZIMAGE CMD_GENZIMAGE "no" |
180 |
+ set_config_with_override BOOL KEYMAP CMD_KEYMAP "yes" |
181 |
+ set_config_with_override BOOL DOKEYMAPAUTO CMD_DOKEYMAPAUTO "no" |
182 |
+- set_config_with_override STRING BUSYBOX_CONFIG CMD_BUSYBOX_CONFIG |
183 |
+ set_config_with_override STRING STRIP_TYPE CMD_STRIP_TYPE "modules" |
184 |
+ set_config_with_override BOOL INSTALL CMD_INSTALL "yes" |
185 |
+ set_config_with_override BOOL CLEANUP CMD_CLEANUP "yes" |
186 |
+--- a/gen_funcs.sh |
187 |
++++ b/gen_funcs.sh |
188 |
+@@ -1853,7 +1853,7 @@ check_disk_space_requirements() { |
189 |
+ gen_die "--check-free-disk-space-bootdir value '${CHECK_FREE_DISK_SPACE_BOOTDIR}' is not a valid number!" |
190 |
+ fi |
191 |
+ |
192 |
+- available_free_disk_space=$(unset POSIXLY_CORRECT && df -BM "${BOOTDIR}" | awk '$3 ~ /[0-9]+/ { print $4 }') |
193 |
++ available_free_disk_space=$(unset POSIXLY_CORRECT && LC_ALL="C" df -BM "${BOOTDIR}" | awk '$3 ~ /[0-9]+/ { print $4 }') |
194 |
+ if [ -n "${available_free_disk_space}" ] |
195 |
+ then |
196 |
+ print_info 2 '' 1 0 |
197 |
+@@ -1890,7 +1890,7 @@ check_disk_space_requirements() { |
198 |
+ gen_die "--check-free-disk-space-kerneloutputdir value '${CHECK_FREE_DISK_SPACE_KERNELOUTPUTDIR}' is not a valid number!" |
199 |
+ fi |
200 |
+ |
201 |
+- available_free_disk_space=$(unset POSIXLY_CORRECT && df -BM "${KERNEL_OUTPUTDIR}" | awk '$3 ~ /[0-9]+/ { print $4 }') |
202 |
++ available_free_disk_space=$(unset POSIXLY_CORRECT && LC_ALL="C" df -BM "${KERNEL_OUTPUTDIR}" | awk '$3 ~ /[0-9]+/ { print $4 }') |
203 |
+ if [ -n "${available_free_disk_space}" ] |
204 |
+ then |
205 |
+ print_info 2 '' 1 0 |
206 |
+--- a/genkernel.conf |
207 |
++++ b/genkernel.conf |
208 |
+@@ -378,7 +378,7 @@ DEFAULT_KERNEL_SOURCE="/usr/src/linux" |
209 |
+ # Compress generated initramfs |
210 |
+ #COMPRESS_INITRD="yes" |
211 |
+ |
212 |
+-# Types of compression: best, xz, lzma, bzip2, gzip, lzop, fastest |
213 |
++# Types of compression: best, xz, lzma, bzip2, gzip, lzop, lz4, zstd, fastest |
214 |
+ # "best" selects the best available compression method |
215 |
+ # "fastest" selects the fastest available compression method |
216 |
+ #COMPRESS_INITRD_TYPE="best" |
217 |
+ |
218 |
|
219 |
diff --git a/sys-kernel/genkernel/genkernel-4.1.2.ebuild b/sys-kernel/genkernel/genkernel-4.1.2-r1.ebuild |
220 |
similarity index 99% |
221 |
rename from sys-kernel/genkernel/genkernel-4.1.2.ebuild |
222 |
rename to sys-kernel/genkernel/genkernel-4.1.2-r1.ebuild |
223 |
index c48043e7994..a35eee96e20 100644 |
224 |
--- a/sys-kernel/genkernel/genkernel-4.1.2.ebuild |
225 |
+++ b/sys-kernel/genkernel/genkernel-4.1.2-r1.ebuild |
226 |
@@ -120,6 +120,8 @@ if [[ ${PV} == 9999* ]]; then |
227 |
DEPEND="${DEPEND} app-text/asciidoc" |
228 |
fi |
229 |
|
230 |
+PATCHES=( "${FILESDIR}"/${P}-post-release-fixes.patch ) |
231 |
+ |
232 |
src_unpack() { |
233 |
if [[ ${PV} == 9999* ]]; then |
234 |
git-r3_src_unpack |