From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com>
To: gentoo-catalyst@lists.gentoo.org
Cc: "Azamat H. Hackimov" <azamat.hackimov@gmail.com>
Subject: [gentoo-catalyst] [PATCH] Introduce basearch settings
Date: Tue, 1 Aug 2023 11:27:15 +0300 [thread overview]
Message-ID: <20230801082723.22455-1-azamat.hackimov@gmail.com> (raw)
When custom subarch is defined ("core2", for example), it will override hostarch, and all logic for creation bootloader entries and ISO image will be broken. Introduced basearch variable that may used for these cases.
Added some die statement in some case switches for default values to prevent silent failure.
Closes: https://bugs.gentoo.org/911536
Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com>
---
catalyst/base/stagebase.py | 2 ++
targets/support/bootloader-setup.sh | 5 ++++-
targets/support/create-iso.sh | 11 +++++++----
targets/support/netboot-final.sh | 2 +-
targets/support/pre-kmerge.sh | 2 +-
5 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 74d197b5..057d9960 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -130,6 +130,8 @@ class StageBase(TargetBase, ClearBase, GenBase):
for arch in [x for x in arch_config if x.startswith(name) and host in arch_config[x]]:
self.settings.update(arch_config[arch][host])
setarch = arch_config.get('setarch', {}).get(arch, {})
+ # Save basearch for bootloader/livecd creation
+ self.settings["basearch"] = arch
break
else:
# Didn't find a matching subarchitecture, keep searching
diff --git a/targets/support/bootloader-setup.sh b/targets/support/bootloader-setup.sh
index d6d5f96e..7fa3133f 100755
--- a/targets/support/bootloader-setup.sh
+++ b/targets/support/bootloader-setup.sh
@@ -55,7 +55,7 @@ memtest_grub() {
default_append_line=(${cmdline_opts[@]} cdroot)
-case ${clst_hostarch} in
+case ${clst_basearch} in
alpha)
# NO SOFTLEVEL SUPPORT YET
acfg=$1/etc/aboot.conf
@@ -202,5 +202,8 @@ case ${clst_hostarch} in
[ -e "${1}/sash64" ] && mv ${1}/sash64 ${scratch}/arcload
[ -e "${1}/arc.cf" ] && mv ${1}/arc.cf ${scratch}/arcload
;;
+ *)
+ die "Cannot create ISO image: unsupported ARCH=${clst_basearch}"
+ ;;
esac
exit $?
diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh
index 74c24a1d..2dbd8c66 100755
--- a/targets/support/create-iso.sh
+++ b/targets/support/create-iso.sh
@@ -5,7 +5,7 @@ source ${clst_shdir}/support/functions.sh
## START RUNSCRIPT
# Check for our CD ISO creation tools
-case ${clst_hostarch} in
+case ${clst_basearch} in
alpha)
cdmaker="xorriso"
cdmakerpkg="dev-libs/libisoburn"
@@ -42,7 +42,7 @@ if [ -z "${clst_iso_volume_id}" ]
then
case ${clst_livecd_type} in
gentoo-*)
- case ${clst_hostarch} in
+ case ${clst_basearch} in
alpha)
clst_iso_volume_id="Gentoo Linux - Alpha"
;;
@@ -119,7 +119,7 @@ run_mkisofs() {
}
# Here we actually create the ISO images for each architecture
-case ${clst_hostarch} in
+case ${clst_basearch} in
alpha)
isoroot_checksum
@@ -195,12 +195,15 @@ case ${clst_hostarch} in
isoroot_checksum
extra_opts=("-joliet" "-iso-level" "3")
- case ${clst_hostarch} in
+ case ${clst_basearch} in
sparc*) extra_opts+=("--sparc-boot") ;;
esac
echo ">> Running grub-mkrescue to create iso image...."
grub-mkrescue "${extra_opts[@]}" -o "${1}" "${clst_target_path}"
;;
+ *)
+ die "Cannot create ISO image: unsupported ARCH=${clst_basearch}"
+ ;;
esac
exit $?
diff --git a/targets/support/netboot-final.sh b/targets/support/netboot-final.sh
index fc0de880..a2d83008 100755
--- a/targets/support/netboot-final.sh
+++ b/targets/support/netboot-final.sh
@@ -19,7 +19,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
+case ${clst_basearch} in
hppa)
# Only one kernel should be there
kname=${clst_boot_kernel[0]}
diff --git a/targets/support/pre-kmerge.sh b/targets/support/pre-kmerge.sh
index ed825f5f..560590a2 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_basearch} == hppa ]]; then
for i in ${clst_boot_kernel}; do
case ${i} in
*32)
--
2.41.0
reply other threads:[~2023-08-01 8:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230801082723.22455-1-azamat.hackimov@gmail.com \
--to=azamat.hackimov@gmail.com \
--cc=gentoo-catalyst@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox