Received: from list by lists.gnu.org with archive (Exim 4.86_2) id 1hmnAY-00076G-Lt for mharc-grub-devel@gnu.org; Sun, 14 Jul 2019 18:40:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52719) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmnAW-00076A-Ty for grub-devel@gnu.org; Sun, 14 Jul 2019 18:40:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmnAV-0006Yy-UQ for grub-devel@gnu.org; Sun, 14 Jul 2019 18:40:32 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:33928) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmnAV-0006Xx-Mr for grub-devel@gnu.org; Sun, 14 Jul 2019 18:40:31 -0400 Received: by mail-wr1-x441.google.com with SMTP id 31so15118676wrm.1 for ; Sun, 14 Jul 2019 15:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jrtc27.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cnZKcEDOu9u82WdHB7q5H/IImI5Ln7KQvBtpGr9ZWZo=; b=JPoukhzdgzUMMjqBG5CMYFTHDeC45MSLzKJhPOaspsqGxK0Emko7r7qqSLmEg2vUBL ESY2nEp7Er8w3lD7qvwXqZu5WjGuf2YdSxjiK2r5vfQMPJLGCMWTHL1kly8sXs/wyDWU cbGOeNVKnbUWhJ7jJC7mtMP1yetvif9XxEMTo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cnZKcEDOu9u82WdHB7q5H/IImI5Ln7KQvBtpGr9ZWZo=; b=iUtyf0mZnaySV8ilZpAvwpykniQEdM0jtYBCUR6e3ODA82hPZAlUwni17v28eE2nyu /6f9bWFT4CYFKtvNLpmXFMbpqkAosye5wYZnKCe/MK0AcgHTmgB3lXeHsDUgf2zCbJ6Z o9OtCXXendVeWySThNQMNxSqn7DzISaJsU+zbmWTvKXGk82pgyDNIglEEM3Y33rhrvYR EIFy/TuME5QC7JInWBRXETzXl7BX+aErZGulG1wNK8U3x0R7Jld0RPH2dTPFVm7XQU7Z Qa91jc/I2pWEHXOwYAQIpYEEFNGlkMkfSHw6hfXoPMOhPTUpjlz50itlYU1dJ/kxV/Yl tb4w== X-Gm-Message-State: APjAAAULo2ZxbfTe5cj/dF3hwjZaZ5vDgHCF68ufVAd4SNGTsUo7kYTq QG+ahlYFFJGnHobhgVgKJaUrmZHvu9o= X-Google-Smtp-Source: APXvYqxwo+I/xOHDMy5OG/vV17d5Y/9kc+MJUMQXb1dE9/PRs7wLvmCC6L2Grt7hHR3DQcZENwOtcQ== X-Received: by 2002:a5d:4ec1:: with SMTP id s1mr23133474wrv.19.1563144028863; Sun, 14 Jul 2019 15:40:28 -0700 (PDT) Received: from Jamess-MacBook.local (global-184-8.nat-1.net.cam.ac.uk. [131.111.184.8]) by smtp.gmail.com with ESMTPSA id g19sm16594550wmg.10.2019.07.14.15.40.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jul 2019 15:40:28 -0700 (PDT) Received: by Jamess-MacBook.local (Postfix, from userid 501) id 92E5020514FF39; Sun, 14 Jul 2019 23:40:27 +0100 (BST) From: James Clarke To: grub-devel@gnu.org Cc: James Clarke Subject: [PATCH] sparc64: Fix BIOS Boot Partition support Date: Sun, 14 Jul 2019 23:40:25 +0100 Message-Id: <20190714224025.22959-1-jrtc27@jrtc27.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 22:40:33 -0000 Currently, gpt_offset is uninitialised when using a BIOS Boot Partition but is used unconditionally inside save_blocklists. Instead, ensure it is always initialised to 0 (note that there is already separate code to do the equivalent adjustment after we call save_blocklists on this code path). This patch has been tested on a T5-2 LDOM. Signed-off-by: James Clarke --- util/setup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/setup.c b/util/setup.c index 6f88f3cc4..3be88aae1 100644 --- a/util/setup.c +++ b/util/setup.c @@ -270,6 +270,9 @@ SETUP (const char *dir, #ifdef GRUB_SETUP_BIOS bl.current_segment = GRUB_BOOT_I386_PC_KERNEL_SEG + (GRUB_DISK_SECTOR_SIZE >> 4); +#endif +#ifdef GRUB_SETUP_SPARC64 + bl.gpt_offset = 0; #endif bl.last_length = 0; @@ -730,7 +733,6 @@ unable_to_embed: #ifdef GRUB_SETUP_SPARC64 { grub_partition_t container = root_dev->disk->partition; - bl.gpt_offset = 0; if (grub_strstr (container->partmap->name, "gpt")) bl.gpt_offset = grub_partition_get_start (container); -- 2.20.1