1 |
commit: 5d853732df20b4d41985231a5bbd510709470066 |
2 |
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Nov 20 00:02:56 2022 +0000 |
4 |
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 22 21:19:03 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=5d853732 |
7 |
|
8 |
targets: Fix CHOST vs `uname -m` confusion |
9 |
|
10 |
We've had difficulties keeping straight CHOST (e.g. "hppa") vs `uname |
11 |
-m` output in the past, and I suspect I've made it worse over time. |
12 |
|
13 |
Fix the issues I spotted, and add a catch-all for architectures we are |
14 |
missing support for, so if ISO/netboot/etc creation doesn't silently |
15 |
fail. |
16 |
|
17 |
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org> |
18 |
|
19 |
targets/support/bootloader-setup.sh | 13 +++++++------ |
20 |
targets/support/create-iso.sh | 30 ++++++++++++++++-------------- |
21 |
targets/support/netboot-final.sh | 8 ++++++-- |
22 |
targets/support/pre-kmerge.sh | 2 +- |
23 |
4 files changed, 30 insertions(+), 23 deletions(-) |
24 |
|
25 |
diff --git a/targets/support/bootloader-setup.sh b/targets/support/bootloader-setup.sh |
26 |
index 08d25b59..6ca3e38a 100755 |
27 |
--- a/targets/support/bootloader-setup.sh |
28 |
+++ b/targets/support/bootloader-setup.sh |
29 |
@@ -56,10 +56,7 @@ case ${clst_hostarch} in |
30 |
((bctr=${bctr}+1)) |
31 |
done |
32 |
;; |
33 |
- arm) |
34 |
- # NO SOFTLEVEL SUPPORT YET |
35 |
- ;; |
36 |
- hppa) |
37 |
+ hppa*) |
38 |
# NO SOFTLEVEL SUPPORT YET |
39 |
mkdir -p $1/boot |
40 |
|
41 |
@@ -81,7 +78,7 @@ case ${clst_hostarch} in |
42 |
echo "--recoverykernel=boot/${x}" >> ${icfg} |
43 |
done |
44 |
;; |
45 |
- amd64|arm64|ia64|ppc*|powerpc*|sparc*|x86) |
46 |
+ aarch64*|amd64|ia64|ppc*|powerpc*|sparc*|x86) |
47 |
kern_subdir=/boot |
48 |
iacfg=$1/boot/grub/grub.cfg |
49 |
mkdir -p $1/boot/grub |
50 |
@@ -119,7 +116,7 @@ case ${clst_hostarch} in |
51 |
echo "" >> ${iacfg} |
52 |
done |
53 |
;; |
54 |
- mips) |
55 |
+ mips*) |
56 |
# NO SOFTLEVEL SUPPORT YET |
57 |
|
58 |
# Mips is an interesting arch -- where most archs will |
59 |
@@ -179,5 +176,9 @@ case ${clst_hostarch} in |
60 |
[ -e "${1}/sash64" ] && mv ${1}/sash64 ${scratch}/arcload |
61 |
[ -e "${1}/arc.cf" ] && mv ${1}/arc.cf ${scratch}/arcload |
62 |
;; |
63 |
+ *) |
64 |
+ echo "Boot loader support for ${clst_hostarch} is unimplemented" |
65 |
+ exit 1 |
66 |
+ ;; |
67 |
esac |
68 |
exit $? |
69 |
|
70 |
diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh |
71 |
index 8eada6a7..8412f6fb 100755 |
72 |
--- a/targets/support/create-iso.sh |
73 |
+++ b/targets/support/create-iso.sh |
74 |
@@ -10,7 +10,7 @@ case ${clst_hostarch} in |
75 |
cdmaker="xorriso" |
76 |
cdmakerpkg="dev-libs/libisoburn" |
77 |
;; |
78 |
- mips) |
79 |
+ mips*) |
80 |
cdmaker="sgibootcd" |
81 |
cdmakerpkg="sys-boot/sgibootcd" |
82 |
;; |
83 |
@@ -18,7 +18,7 @@ case ${clst_hostarch} in |
84 |
cdmaker="grub-mkrescue" |
85 |
cdmakerpkg="dev-libs/libisoburn and sys-boot/grub:2" |
86 |
;; |
87 |
- amd64|arm64|ia64|x86) |
88 |
+ aarch64*|amd64|ia64|x86) |
89 |
cdmaker="grub-mkrescue" |
90 |
# grub-mkrescue requires: |
91 |
# xorriso from libisoburn |
92 |
@@ -49,28 +49,28 @@ then |
93 |
amd64) |
94 |
clst_iso_volume_id="Gentoo Linux - AMD64" |
95 |
;; |
96 |
- arm) |
97 |
+ arm*) |
98 |
clst_iso_volume_id="Gentoo Linux - ARM" |
99 |
;; |
100 |
- arm64) |
101 |
+ aarch64*) |
102 |
clst_iso_volume_id="Gentoo Linux - ARM64" |
103 |
;; |
104 |
- hppa) |
105 |
- clst_iso_volume_id="Gentoo Linux - HPPA" |
106 |
- ;; |
107 |
ia64) |
108 |
clst_iso_volume_id="Gentoo Linux - IA64" |
109 |
;; |
110 |
m68k) |
111 |
clst_iso_volume_id="Gentoo Linux - M68K" |
112 |
;; |
113 |
- mips) |
114 |
+ mips*) |
115 |
clst_iso_volume_id="Gentoo Linux - MIPS" |
116 |
;; |
117 |
+ hppa*) |
118 |
+ clst_iso_volume_id="Gentoo Linux - HPPA" |
119 |
+ ;; |
120 |
ppc*|powerpc*) |
121 |
clst_iso_volume_id="Gentoo Linux - PowerPC" |
122 |
;; |
123 |
- s390) |
124 |
+ s390*) |
125 |
clst_iso_volume_id="Gentoo Linux - S390" |
126 |
;; |
127 |
sh) |
128 |
@@ -126,16 +126,14 @@ case ${clst_hostarch} in |
129 |
echo ">> xorriso -as genisofs -alpha-boot boot/bootlx -R -l -J -V \"${clst_iso_volume_id}\" -o \"${1}\" \"${clst_target_path}\"" |
130 |
xorriso -as genisofs -alpha-boot boot/bootlx -R -l -J -V "${clst_iso_volume_id}" -o "${1}" "${clst_target_path}" || die "Cannot make ISO image" |
131 |
;; |
132 |
- arm) |
133 |
- ;; |
134 |
- hppa) |
135 |
+ hppa*) |
136 |
echo ">> Running mkisofs to create iso image...." |
137 |
run_mkisofs -R -l -J -V "${clst_iso_volume_id}" -o "${1}" "${clst_target_path}"/ |
138 |
pushd "${clst_target_path}/" |
139 |
palo -f boot/palo.conf -C "${1}" |
140 |
popd |
141 |
;; |
142 |
- mips) |
143 |
+ mips*) |
144 |
if [[ ${clst_fstype} != squashfs ]]; then |
145 |
die "SGI LiveCD(s) only support the 'squashfs' fstype!" |
146 |
fi |
147 |
@@ -191,7 +189,7 @@ case ${clst_hostarch} in |
148 |
# o= output image (burnable to CD; readable by fdisk) |
149 |
/usr/bin/sgibootcd c=${cfg} o=${clst_iso} |
150 |
;; |
151 |
- amd64|arm64|ia64|ppc*|powerpc*|sparc*|x86) |
152 |
+ aarch64*|amd64|ia64|ppc*|powerpc*|sparc*|x86) |
153 |
isoroot_checksum |
154 |
|
155 |
extra_opts=("-joliet" "-iso-level" "3") |
156 |
@@ -202,5 +200,9 @@ case ${clst_hostarch} in |
157 |
echo ">> Running grub-mkrescue to create iso image...." |
158 |
grub-mkrescue "${extra_opts[@]}" -o "${1}" "${clst_target_path}" |
159 |
;; |
160 |
+ *) |
161 |
+ echo "ISO support for ${clst_hostarch} is unimplemented" |
162 |
+ exit 1 |
163 |
+ ;; |
164 |
esac |
165 |
exit $? |
166 |
|
167 |
diff --git a/targets/support/netboot-final.sh b/targets/support/netboot-final.sh |
168 |
index 7a26e0f4..3071f698 100755 |
169 |
--- a/targets/support/netboot-final.sh |
170 |
+++ b/targets/support/netboot-final.sh |
171 |
@@ -20,7 +20,7 @@ rmdir ${clst_target_path}/boot |
172 |
# Any post-processing necessary for each architecture can be done here. This |
173 |
# may include things like sparc's elftoaout, x86's PXE boot, etc. |
174 |
case ${clst_hostarch} in |
175 |
- hppa) |
176 |
+ hppa*) |
177 |
# Only one kernel should be there |
178 |
kname=${clst_boot_kernel[0]} |
179 |
rm -f ${clst_target_path}/${kname}-hppa.lif |
180 |
@@ -36,7 +36,7 @@ case ${clst_hostarch} in |
181 |
|
182 |
;; |
183 |
sparc*) |
184 |
- if [ "${clst_subarch}" == "sparc" ]; then |
185 |
+ if [[ ${clst_hostarch} == sparc* ]]; then |
186 |
piggyback=piggyback |
187 |
else |
188 |
piggyback=piggyback64 |
189 |
@@ -46,5 +46,9 @@ case ${clst_hostarch} in |
190 |
${piggyback} ${clst_target_path}/${x}-a.out ${clst_target_path}/kernels/misc/System-${x}.map ${clst_target_path}/kernels/misc/${x}.igz |
191 |
done |
192 |
;; |
193 |
+ *) |
194 |
+ echo "Netboot support for ${clst_hostarch} is unimplemented" |
195 |
+ exit 1 |
196 |
+ ;; |
197 |
esac |
198 |
exit $? |
199 |
|
200 |
diff --git a/targets/support/pre-kmerge.sh b/targets/support/pre-kmerge.sh |
201 |
index ed825f5f..6f05082e 100755 |
202 |
--- a/targets/support/pre-kmerge.sh |
203 |
+++ b/targets/support/pre-kmerge.sh |
204 |
@@ -4,7 +4,7 @@ RUN_DEFAULT_FUNCS="yes" |
205 |
|
206 |
source /tmp/chroot-functions.sh |
207 |
|
208 |
-if [[ ${clst_hostarch} == hppa ]]; then |
209 |
+if [[ ${clst_hostarch} == hppa* ]]; then |
210 |
for i in ${clst_boot_kernel}; do |
211 |
case ${i} in |
212 |
*32) |