From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A0DF115800A for ; Tue, 1 Aug 2023 08:27:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CB25EE0D78; Tue, 1 Aug 2023 08:27:52 +0000 (UTC) Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C0B62E0D78 for ; Tue, 1 Aug 2023 08:27:52 +0000 (UTC) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4fe45da0a89so376825e87.1 for ; Tue, 01 Aug 2023 01:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690878471; x=1691483271; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=amZjknQ3MtWykauIDcBN/CxkZvgWOmHTwCB/5nHqmIc=; b=GxKaPUY3btqPYK4CiBHw5yiFP5s8cdEvizJU1ty2wSay33joUSRNt1VkRtEMfeArZY 7v373glr8Tja1jn/57xJ2dHGFmfYN0wrQ5bVt4jKJqxlXMvsnsqKi4s3XGUNfp6UZix/ 3AMJd5NiH7L8UzOFAvMQK6XNp4K6ozld3zketMEAT30dl4Sn4hWS8RDbZOzDyG8V31C1 sjSXp7Gc0mQkJPxAfcZUeRXchesmrVeZ9z9IAUwBMnTUav0KRwASRAoz+Bskd2JLpL7R 5QAIemRM2oeaMnPqTe4itjlZvZPXsDtZbXFbxNZGloB5O9G++oHqyAGuLbvYnlF24FL9 /kxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690878471; x=1691483271; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=amZjknQ3MtWykauIDcBN/CxkZvgWOmHTwCB/5nHqmIc=; b=Ne9ug4XnalVtxvYStzMoc0HetnTndo3xvuhOxNGZN3P/ZpaR9KGdSXEIACnzvpU5Rz W6UREqHxGtGFMnH5raU8qqjr6ILjmFhlcUd6P+Y4WXv61NfasCF9uYWBtkH9VS1t2owk TZu+TacTu6ta85MKvbe3OyYhyNKHuGt9Wj1LH4o+XxZ2ZLG/tyWyIj9Anp3/xNhxmiFC clzvNL3KxxE5uMRDfhE3+vDYVjNC0Sv2FBIDlrO8a4EGxY7NzznnHp8OVTc2/+GjNaSC L6f2190DeUkrwgpyfPmDx4M9j0/lnZf4rzAmkcjKFBRET/A9sUyqfB0B+ka0vDp0PTod 31ig== X-Gm-Message-State: ABy/qLb5E+EsL7xakhVjHQOWReu+NwglsSkkF3ke6YshB+xYDUikiHHe 5ZbLUeqY5McmiV/KcRTToHd5fFzv7CzqR1bl X-Google-Smtp-Source: APBJJlF7nZumxJMeFKpoa6MFeXKNMBpOpHbnvURPBVm7CdvnFu4MN2yk8BJzH/35MrvfLHW7gU2HQA== X-Received: by 2002:ac2:4301:0:b0:4fe:32cd:481f with SMTP id l1-20020ac24301000000b004fe32cd481fmr856772lfh.1.1690878470954; Tue, 01 Aug 2023 01:27:50 -0700 (PDT) Received: from icewind.auth.lfstrm.tv ([95.161.221.30]) by smtp.gmail.com with ESMTPSA id 13-20020ac2482d000000b004fdb9ac8563sm2466230lft.125.2023.08.01.01.27.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 01:27:50 -0700 (PDT) From: "Azamat H. Hackimov" To: gentoo-catalyst@lists.gentoo.org Cc: "Azamat H. Hackimov" Subject: [gentoo-catalyst] [PATCH] Introduce basearch settings Date: Tue, 1 Aug 2023 11:27:15 +0300 Message-ID: <20230801082723.22455-1-azamat.hackimov@gmail.com> X-Mailer: git-send-email 2.41.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 62b1b681-732a-4dd4-bdd2-6371b5b974a4 X-Archives-Hash: bd1a9684b6c4f8a6a82c47f2c0b9a506 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 --- 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