1 |
commit: 35826178e4096692dd254565c426a0eef8b0cc45 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jul 3 21:50:27 2021 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jul 4 20:48:13 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/releng.git/commit/?id=35826178 |
7 |
|
8 |
releases/portage/isos: add genkernel patch for ppc64 |
9 |
|
10 |
since it's still not fixed in genkernel, we can carry a |
11 |
local patch. |
12 |
|
13 |
patch is conditional for ppc64 only, it will affect only ppc64le |
14 |
iso for now. ppc64 installcd is ppc, not ppc64. |
15 |
|
16 |
Bug: https://bugs.gentoo.org/796272 |
17 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
18 |
|
19 |
releases/portage/isos/env/sys-kernel/genkernel | 35 ++++++++++++++++ |
20 |
.../portage/isos/patches/genkernel-ppc64-iso.patch | 47 ++++++++++++++++++++++ |
21 |
2 files changed, 82 insertions(+) |
22 |
|
23 |
diff --git a/releases/portage/isos/env/sys-kernel/genkernel b/releases/portage/isos/env/sys-kernel/genkernel |
24 |
new file mode 100644 |
25 |
index 00000000..67cb7b05 |
26 |
--- /dev/null |
27 |
+++ b/releases/portage/isos/env/sys-kernel/genkernel |
28 |
@@ -0,0 +1,35 @@ |
29 |
+post_src_unpack() { |
30 |
+ if use ppc64; then |
31 |
+ einfo "hooked by ${BASH_SOURCE[0]} in ${FUNCNAME[0]}" |
32 |
+ local patchfile |
33 |
+ patchfile="${PORTAGE_CONFIGROOT%/}/etc/portage/patches/genkernel-ppc64-iso.patch" |
34 |
+ if [[ -f ${patchfile} ]]; then |
35 |
+ einfo "found genkernel patch for bug https://bugs.gentoo.org/796272" |
36 |
+ cd "${S}" || die |
37 |
+ eapply "${patchfile}" |
38 |
+ else |
39 |
+ ewarn "no genkernel patch found, skipping hook" |
40 |
+ fi |
41 |
+ fi |
42 |
+} |
43 |
+ |
44 |
+post_pkg_postinst() { |
45 |
+ einfo "hooked by ${BASH_SOURCE[0]} in ${FUNCNAME[0]}" |
46 |
+ einfo "cleaning up bug https://bugs.gentoo.org/796272 workarounds" |
47 |
+ # cleanup after ourselves, we don't want workarounds shipped to users |
48 |
+ # and don't want updating all the spec files with new removal directives. |
49 |
+ local envfile patchfile |
50 |
+ envfile="${PORTAGE_CONFIGROOT%/}/etc/portage/env/sys-kernel/genkernel" |
51 |
+ patchfile="${PORTAGE_CONFIGROOT%/}/etc/portage/patches/genkernel-ppc64-iso.patch" |
52 |
+ |
53 |
+ local _x |
54 |
+ for _x in "${envfile}" "${patchfile}"; do |
55 |
+ if [[ -f ${_x} ]]; then |
56 |
+ rm -vf "${_x}" |
57 |
+ fi |
58 |
+ done |
59 |
+ rmdir -v --ignore-fail-on-non-empty "${PORTAGE_CONFIGROOT%/}/etc/portage/env/sys-kernel" |
60 |
+ rmdir -v --ignore-fail-on-non-empty "${PORTAGE_CONFIGROOT%/}/etc/portage/env" |
61 |
+ rmdir -v --ignore-fail-on-non-empty "${PORTAGE_CONFIGROOT%/}/etc/portage/patches" |
62 |
+} |
63 |
+ |
64 |
|
65 |
diff --git a/releases/portage/isos/patches/genkernel-ppc64-iso.patch b/releases/portage/isos/patches/genkernel-ppc64-iso.patch |
66 |
new file mode 100644 |
67 |
index 00000000..61c85942 |
68 |
--- /dev/null |
69 |
+++ b/releases/portage/isos/patches/genkernel-ppc64-iso.patch |
70 |
@@ -0,0 +1,47 @@ |
71 |
+From 628e1a30b384a900cf7095cf86441fed7a0300dc Mon Sep 17 00:00:00 2001 |
72 |
+From: Georgy Yakovlev <gyakovlev@g.o> |
73 |
+Date: Fri, 14 May 2021 22:05:33 -0700 |
74 |
+Subject: [PATCH] defaults/initrd.scripts: don't skip top level devices with |
75 |
+ partitions |
76 |
+ |
77 |
+ppc64 media should be mounted as /dev/sdX, not as /dev/sdX1 |
78 |
+this loop was skipping /dev/sdX if /dev/sdX1 is present. |
79 |
+ |
80 |
+Bug: https://bugs.gentoo.org/796272 |
81 |
+Signed-off-by: Georgy Yakovlev <gyakovlev@g.o> |
82 |
+--- |
83 |
+ defaults/initrd.scripts | 18 ------------------ |
84 |
+ 1 file changed, 18 deletions(-) |
85 |
+ |
86 |
+diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts |
87 |
+index 5ec8adb..bfc36cf 100644 |
88 |
+--- a/defaults/initrd.scripts |
89 |
++++ b/defaults/initrd.scripts |
90 |
+@@ -178,24 +178,6 @@ findmediamount() { |
91 |
+ # Check for a block device to mount |
92 |
+ if [ -b "${x}" ] |
93 |
+ then |
94 |
+- skip=0 |
95 |
+- bsn=$(basename "${x}") |
96 |
+- # |
97 |
+- # If disk and it has at least one partition, skip. |
98 |
+- # We use /sys/block/${bsn}/${bsn}[0-9]* to make sure that we |
99 |
+- # don't skip device mapper devices. Even the craziest scenario |
100 |
+- # deserves a fair chance. |
101 |
+- # |
102 |
+- # shellcheck disable=SC2045 |
103 |
+- for part in $(ls /sys/block/${bsn}/${bsn}*[0-9]* 2>/dev/null) |
104 |
+- do |
105 |
+- skip=1 |
106 |
+- break; |
107 |
+- done |
108 |
+- if [ ${skip} -eq 1 ] |
109 |
+- then |
110 |
+- continue |
111 |
+- fi |
112 |
+ good_msg "Attempting to mount media: ${x}" ${CRYPT_SILENT} |
113 |
+ |
114 |
+ CDROOT_TYPE=$(determine_fs "${x}" "${CDROOT_TYPE}") |
115 |
+-- |
116 |
+2.31.1 |
117 |
+ |