commit: 0d3d82f639bb98457df670b6e12455f670887d0a
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 20 00:02:56 2022 +0000
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Mon Apr 10 19:48:49 2023 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=0d3d82f6
targets: Fix CHOST vs `uname -m` confusion
We've had difficulties keeping straight CHOST (e.g. "hppa") vs `uname
-m` output in the past, and I suspect I've made it worse over time.
Fix the issues I spotted, and add a catch-all for architectures we are
missing support for, so if ISO/netboot/etc creation doesn't silently
fail.
mattst88@bogsucker ~ $ uname -m
ppc64le
mattst88@bogsucker ~ $ linux32 uname -m
ppcle
mattst88@timberdoodle ~ $ uname -m
ppc64
mattst88@timberdoodle ~ $ linux32 uname -m
ppc
mattst88@guppy ~ $ uname -m
ia64
mattst88@catbus ~ $ uname -m
sparc64
mattst88@catbus ~ $ linux32 uname -m
sparc
mattst88@jiji ~ $ uname -m
aarch64
mattst88@jiji ~ $ linux32 uname -m
armv8l
mattst88@framework ~ % uname -m
x86_64
mattst88@framework ~ % linux32 uname -m
i686
mattst88@hake ~ $ uname -m
parisc
mattst88@lgentoo4 ~ $ uname -m
s390x
mattst88@lgentoo4 ~ $ linux32 uname -m
s390
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
targets/support/bootloader-setup.sh | 13 +++++++------
targets/support/create-iso.sh | 36 +++++++++++++++++++-----------------
targets/support/netboot-final.sh | 8 ++++++--
targets/support/pre-kmerge.sh | 2 +-
4 files changed, 33 insertions(+), 26 deletions(-)
diff --git a/targets/support/bootloader-setup.sh
b/targets/support/bootloader-setup.sh
index d6d5f96e..73854cb8 100755
--- a/targets/support/bootloader-setup.sh
+++ b/targets/support/bootloader-setup.sh
@@ -78,10 +78,7 @@ case ${clst_hostarch} in
((bctr=${bctr}+1))
done
;;
- arm)
- # NO SOFTLEVEL SUPPORT YET
- ;;
- hppa)
+ parisc)
# NO SOFTLEVEL SUPPORT YET
mkdir -p $1/boot
@@ -103,7 +100,7 @@ case ${clst_hostarch} in
echo "--recoverykernel=boot/${x}" >> ${icfg}
done
;;
- amd64|arm64|ia64|ppc*|powerpc*|sparc*|x86|i?86)
+ aarch64*|ia64|ppc*|sparc*|i?86|x86_64)
kern_subdir=/boot
iacfg=$1/boot/grub/grub.cfg
mkdir -p $1/boot/grub
@@ -142,7 +139,7 @@ case ${clst_hostarch} in
done
memtest_grub $1 >> ${iacfg}
;;
- mips)
+ mips*)
# NO SOFTLEVEL SUPPORT YET
# Mips is an interesting arch -- where most archs will
@@ -202,5 +199,9 @@ case ${clst_hostarch} in
[ -e "${1}/sash64" ] && mv ${1}/sash64 ${scratch}/arcload
[ -e "${1}/arc.cf" ] && mv ${1}/arc.cf ${scratch}/arcload
;;
+ *)
+ echo "Boot loader support for ${clst_hostarch} is unimplemented"
+ exit 1
+ ;;
esac
exit $?
diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh
index 74c24a1d..7c644bae 100755
--- a/targets/support/create-iso.sh
+++ b/targets/support/create-iso.sh
@@ -10,15 +10,15 @@ case ${clst_hostarch} in
cdmaker="xorriso"
cdmakerpkg="dev-libs/libisoburn"
;;
- mips)
+ mips*)
cdmaker="sgibootcd"
cdmakerpkg="sys-boot/sgibootcd"
;;
- ppc*|powerpc*|sparc*)
+ ppc*|sparc*)
cdmaker="grub-mkrescue"
cdmakerpkg="dev-libs/libisoburn and sys-boot/grub:2"
;;
- amd64|arm64|ia64|x86|i?86)
+ aarch64*|ia64|i?86|x86_64)
cdmaker="grub-mkrescue"
# grub-mkrescue requires:
# xorriso from libisoburn
@@ -49,28 +49,28 @@ then
amd64)
clst_iso_volume_id="Gentoo Linux -
AMD64"
;;
- arm)
+ arm*)
clst_iso_volume_id="Gentoo Linux - ARM"
;;
- arm64)
+ aarch64*)
clst_iso_volume_id="Gentoo Linux -
ARM64"
;;
- hppa)
- clst_iso_volume_id="Gentoo Linux - HPPA"
- ;;
ia64)
clst_iso_volume_id="Gentoo Linux - IA64"
;;
m68k)
clst_iso_volume_id="Gentoo Linux - M68K"
;;
- mips)
+ mips*)
clst_iso_volume_id="Gentoo Linux - MIPS"
;;
- ppc*|powerpc*)
+ parisc)
+ clst_iso_volume_id="Gentoo Linux - HPPA"
+ ;;
+ ppc*)
clst_iso_volume_id="Gentoo Linux -
PowerPC"
;;
- s390)
+ s390*)
clst_iso_volume_id="Gentoo Linux - S390"
;;
sh)
@@ -79,7 +79,7 @@ then
sparc*)
clst_iso_volume_id="Gentoo Linux -
SPARC"
;;
- x86)
+ i?86)
clst_iso_volume_id="Gentoo Linux - x86"
;;
*)
@@ -126,16 +126,14 @@ case ${clst_hostarch} in
echo ">> xorriso -as genisofs -alpha-boot boot/bootlx -R -l -J
-V \"${clst_iso_volume_id}\" -o \"${1}\" \"${clst_target_path}\""
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"
;;
- arm)
- ;;
- hppa)
+ parisc)
echo ">> Running mkisofs to create iso image...."
run_mkisofs -R -l -J -V "${clst_iso_volume_id}" -o "${1}"
"${clst_target_path}"/
pushd "${clst_target_path}/"
palo -f boot/palo.conf -C "${1}"
popd
;;
- mips)
+ mips*)
if [[ ${clst_fstype} != squashfs ]]; then
die "SGI LiveCD(s) only support the 'squashfs' fstype!"
fi
@@ -191,7 +189,7 @@ case ${clst_hostarch} in
# o= output image (burnable to CD; readable by fdisk)
/usr/bin/sgibootcd c=${cfg} o=${clst_iso}
;;
- amd64|arm64|ia64|ppc*|powerpc*|sparc*|x86|i?86)
+ aarch64*|ia64|ppc*|sparc*|i?86|x86_64)
isoroot_checksum
extra_opts=("-joliet" "-iso-level" "3")
@@ -202,5 +200,9 @@ case ${clst_hostarch} in
echo ">> Running grub-mkrescue to create iso image...."
grub-mkrescue "${extra_opts[@]}" -o "${1}" "${clst_target_path}"
;;
+ *)
+ echo "ISO support for ${clst_hostarch} is unimplemented"
+ exit 1
+ ;;
esac
exit $?
diff --git a/targets/support/netboot-final.sh b/targets/support/netboot-final.sh
index fc0de880..fbf0569c 100755
--- a/targets/support/netboot-final.sh
+++ b/targets/support/netboot-final.sh
@@ -20,7 +20,7 @@ rmdir ${clst_target_path}/boot
# Any post-processing necessary for each architecture can be done here. This
# may include things like sparc's elftoaout, x86's PXE boot, etc.
case ${clst_hostarch} in
- hppa)
+ parisc)
# Only one kernel should be there
kname=${clst_boot_kernel[0]}
rm -f ${clst_target_path}/${kname}-hppa.lif
@@ -36,7 +36,7 @@ case ${clst_hostarch} in
;;
sparc*)
- if [ "${clst_subarch}" == "sparc" ]; then
+ if [[ ${clst_hostarch} == sparc ]]; then
piggyback=piggyback
else
piggyback=piggyback64
@@ -46,5 +46,9 @@ case ${clst_hostarch} in
${piggyback} ${clst_target_path}/${x}-a.out
${clst_target_path}/kernels/misc/System-${x}.map
${clst_target_path}/kernels/misc/${x}.igz
done
;;
+ *)
+ echo "Netboot support for ${clst_hostarch} is unimplemented"
+ exit 1
+ ;;
esac
exit $?
diff --git a/targets/support/pre-kmerge.sh b/targets/support/pre-kmerge.sh
index ed825f5f..96be005e 100755
--- a/targets/support/pre-kmerge.sh
+++ b/targets/support/pre-kmerge.sh
@@ -4,7 +4,7 @@ RUN_DEFAULT_FUNCS="yes"
source /tmp/chroot-functions.sh
-if [[ ${clst_hostarch} == hppa ]]; then
+if [[ ${clst_hostarch} == parisc ]]; then
for i in ${clst_boot_kernel}; do
case ${i} in
*32)