From patchwork Sat Oct 13 00:26:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 191271 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id DC24A2C008A for ; Sat, 13 Oct 2012 11:27:44 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0A36D4A255; Sat, 13 Oct 2012 02:27:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iF-c+Hjnn29p; Sat, 13 Oct 2012 02:27:30 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D664B4A214; Sat, 13 Oct 2012 02:27:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0646B4A1F9 for ; Sat, 13 Oct 2012 02:26:55 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8iHtQ0GgV2pA for ; Sat, 13 Oct 2012 02:26:54 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-vb0-f74.google.com (mail-vb0-f74.google.com [209.85.212.74]) by theia.denx.de (Postfix) with ESMTPS id B98F44A1AE for ; Sat, 13 Oct 2012 02:26:47 +0200 (CEST) Received: by mail-vb0-f74.google.com with SMTP id s24so394332vbi.3 for ; Fri, 12 Oct 2012 17:26:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=mpNBQjKM1fY0ErXRqhPP5ykqy1OaQPrpeDaWs47KFXo=; b=kZ3P5480c5VbZ2C1a5hRWHa9x8BdDL6qAjC4g8nvgvRerg30B/BYWy2IIS36R0EHY0 4eUqGY6YgGDJKRG5G+sbTzhJ8S9wGuoOLqzbkh3M4AI+KDFY/gRtsd8iROf+I46me/oR ayfvUCkHRoLVFzBJEgMCyQT+AjDqUSGRPuLCeDzzZTMWYzGs8YAfdFWiFjMtEbeB1E0N hWUqahcBI5JhH0Rt+3tHh/Lb9VpCoTNRLJrQa+UkyC0mnM8U0+aBBoajLfuwEA1HqC4Z 9MeEi3atSK7kZYWy8QlSlMvc13i7C2FjY4Rpu8WoZ0nmCU9dHxwIi3qo/N9Nq24XHUxg Vhzg== Received: by 10.236.102.231 with SMTP id d67mr3928161yhg.6.1350088006483; Fri, 12 Oct 2012 17:26:46 -0700 (PDT) Received: from wpzn4.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id g7si405677anp.1.2012.10.12.17.26.46 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 12 Oct 2012 17:26:46 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by wpzn4.hot.corp.google.com (Postfix) with ESMTP id 60EFA1E0048; Fri, 12 Oct 2012 17:26:46 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 10F6C16106D; Fri, 12 Oct 2012 17:26:46 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Fri, 12 Oct 2012 17:26:10 -0700 Message-Id: <1350087972-1581-5-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1350087972-1581-1-git-send-email-sjg@chromium.org> References: <1350087972-1581-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQm+Ux5dQ/ezSNwNAzYd+Nsrq9Jv0hX+bc5ZXs0xYVgj4u+r9uwbm0kHFQD46BSyT1weXcJMYvn9VGJt7jOkCciZsZvrkumU9YDjwF/K78SDD/OuLSEOrcTcdZQZ47GOS1NGOWaEuGRraMNzji0UGD5+m5DEHP52VWXzHOPLDgloj7n0MJmxKFGpg4V/TmkFtYsANxtp Cc: Tom Rini , Stefan Reinauer Subject: [U-Boot] [PATCH 5/7] disk: Allow alternate EFI partition signature X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Stefan Reinauer ChromeOS uses a GPT partition table to partition the disk. However, Windows will refuse to install on a GPT partitioned disk if there is no EFI available (Even if there is an MBR, too) To hide the GPT partition table from Windows, we need to write it with a header magic other than "EFI PART". To support old and new systems, Check for the magic string "CHROMEOS" too. Signed-off-by: Stefan Reinauer Signed-off-by: Simon Glass --- disk/part_efi.c | 3 ++- disk/part_efi.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/disk/part_efi.c b/disk/part_efi.c index 22a1dad..f2a2445 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -307,7 +307,8 @@ static int is_gpt_valid(block_dev_desc_t * dev_desc, unsigned long long lba, } /* Check the GPT header signature */ - if (le64_to_int(pgpt_head->signature) != GPT_HEADER_SIGNATURE) { + if ((le64_to_int(pgpt_head->signature) != GPT_HEADER_SIGNATURE) && + (le64_to_int(pgpt_head->signature) != GPT_HEADER_SIGNATURE2)) { printf("GUID Partition Table Header signature is wrong:" "0x%llX != 0x%llX\n", (unsigned long long)le64_to_int(pgpt_head->signature), diff --git a/disk/part_efi.h b/disk/part_efi.h index 5903e7c..07e590d 100644 --- a/disk/part_efi.h +++ b/disk/part_efi.h @@ -37,7 +37,9 @@ #define EFI_PMBR_OSTYPE_EFI_GPT 0xEE #define GPT_BLOCK_SIZE 512 -#define GPT_HEADER_SIGNATURE 0x5452415020494645ULL +#define GPT_HEADER_SIGNATURE 0x5452415020494645ULL +#define GPT_HEADER_SIGNATURE2 0x534f454d4f524843ULL + #define GPT_HEADER_REVISION_V1 0x00010000 #define GPT_PRIMARY_PARTITION_TABLE_LBA 1ULL #define GPT_ENTRY_NAME "gpt"