From patchwork Tue Jul 1 10:23:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 366028 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id AE3EC1400B5 for ; Tue, 1 Jul 2014 20:23:59 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 20B2087F20; Tue, 1 Jul 2014 10:23:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7okqv94n7_27; Tue, 1 Jul 2014 10:23:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9338F86F66; Tue, 1 Jul 2014 10:23:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 4E22A1BF9D0 for ; Tue, 1 Jul 2014 10:23:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4A84E8308A for ; Tue, 1 Jul 2014 10:23:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id igfTpAy1XHSY for ; Tue, 1 Jul 2014 10:23:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lupi.sysmic.org (sysmic.org [62.210.89.17]) by whitealder.osuosl.org (Postfix) with ESMTPS id A5D8C82F3B for ; Tue, 1 Jul 2014 10:23:55 +0000 (UTC) Received: from localhost.localdomain (mal35-3-82-240-201-171.fbx.proxad.net [82.240.201.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jezz) by lupi.sysmic.org (Postfix) with ESMTPSA id 6E359409DA; Tue, 1 Jul 2014 12:23:53 +0200 (CEST) From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= To: buildroot@busybox.net Date: Tue, 1 Jul 2014 12:23:52 +0200 Message-Id: <1404210232-2185-1-git-send-email-jezz@sysmic.org> X-Mailer: git-send-email 2.0.0 MIME-Version: 1.0 Cc: Thomas Petazzoni , =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Subject: [Buildroot] [PATCH v2] grub2: Specify boot partition X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Since boot partition was not specified, grub tools try to detect it automatically. This patch add an option to force it. Signed-off-by: Jérôme Pouiller --- Notice I am not sure -p option is usefull when -c option is used. v1 -> v2: * Rewrite help for BR2_TARGET_GRUB2_BOOT_PARTITION option * Don't show BR2_TARGET_GRUB2_BOOT_PARTITION if EFI is selected * Rewrite log message boot/grub2/Config.in | 13 +++++++++++++ boot/grub2/grub2.mk | 10 ++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/boot/grub2/Config.in b/boot/grub2/Config.in index b37e024..74ff0ca 100644 --- a/boot/grub2/Config.in +++ b/boot/grub2/Config.in @@ -111,6 +111,19 @@ config BR2_TARGET_GRUB2_X86_64_EFI endchoice +if BR2_TARGET_GRUB2_I386_PC + +config BR2_TARGET_GRUB2_BOOT_PARTITION + string "boot partition" + default "(hd0,msdos1)" + help + Specify the partition where the /boot/grub/grub.cfg is located. + Use (hd0,msdos1) for the first partition of the first disk if + using a legacy partition table, or (hd0,gpt1) if using GPT + partition table. + +endif # BR2_TARGET_GRUB2_I386_PC + config BR2_TARGET_GRUB2_BUILTIN_MODULES string "builtin modules" default "boot linux ext2 fat part_msdos part_gpt normal biosdisk" if BR2_TARGET_GRUB2_I386_PC diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk index 50f93ee..a686b5d 100644 --- a/boot/grub2/grub2.mk +++ b/boot/grub2/grub2.mk @@ -11,9 +11,14 @@ GRUB2_LICENSE = GPLv3+ GRUB2_LICENSE_FILES = COPYING GRUB2_DEPENDENCIES = host-bison host-flex +GRUB2_BUILTIN_MODULES = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_MODULES)) +GRUB2_BUILTIN_CONFIG = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_CONFIG)) +GRUB2_BOOT_PARTITION = $(call qstrip,$(BR2_TARGET_GRUB2_BOOT_PARTITION)) + ifeq ($(BR2_TARGET_GRUB2_I386_PC),y) GRUB2_IMAGE = $(BINARIES_DIR)/grub.img GRUB2_CFG = $(TARGET_DIR)/boot/grub/grub.cfg +GRUB2_PREFIX = $(GRUB2_BOOT_PARTITION)/boot/grub GRUB2_TUPLE = i386-pc GRUB2_TARGET = i386 GRUB2_PLATFORM = pc @@ -33,9 +38,6 @@ GRUB2_TARGET = x86_64 GRUB2_PLATFORM = efi endif -GRUB2_BUILTIN_MODULES = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_MODULES)) -GRUB2_BUILTIN_CONFIG = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_CONFIG)) - # Grub2 is kind of special: it considers CC, LD and so on to be the # tools to build the native tools (i.e to be executed on the build # machine), and uses TARGET_CC, TARGET_CFLAGS, TARGET_CPPFLAGS to @@ -71,7 +73,7 @@ define GRUB2_IMAGE_INSTALLATION -d $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE) \ -O $(GRUB2_TUPLE) \ -o $(GRUB2_IMAGE) \ - $(if $(GRUB2_PREFIX),-p $(GRUB2_PREFIX)) \ + -p "$(GRUB2_PREFIX)" \ $(if $(GRUB2_BUILTIN_CONFIG),-c $(GRUB2_BUILTIN_CONFIG)) \ $(GRUB2_BUILTIN_MODULES) mkdir -p $(dir $(GRUB2_CFG))