From owner-freebsd-bugs@FreeBSD.ORG Sat Feb 23 12:20:01 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D030F16A404 for ; Sat, 23 Feb 2008 12:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9AD4E13C457 for ; Sat, 23 Feb 2008 12:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m1NCK1AX090998 for ; Sat, 23 Feb 2008 12:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m1NCK1D2090997; Sat, 23 Feb 2008 12:20:01 GMT (envelope-from gnats) Resent-Date: Sat, 23 Feb 2008 12:20:01 GMT Resent-Message-Id: <200802231220.m1NCK1D2090997@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Robert Millan Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BBDD16A400 for ; Sat, 23 Feb 2008 12:11:56 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 6E9AA13C442 for ; Sat, 23 Feb 2008 12:11:56 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m1NC9Ig8054769 for ; Sat, 23 Feb 2008 12:09:18 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m1NC9ILE054768; Sat, 23 Feb 2008 12:09:18 GMT (envelope-from nobody) Message-Id: <200802231209.m1NC9ILE054768@www.freebsd.org> Date: Sat, 23 Feb 2008 12:09:18 GMT From: Robert Millan To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/120990: [PATCH] support "BIOS Boot" partition type in gpt(8) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2008 12:20:01 -0000 >Number: 120990 >Category: bin >Synopsis: [PATCH] support "BIOS Boot" partition type in gpt(8) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Feb 23 12:20:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Robert Millan >Release: >Organization: >Environment: >Description: This patch adds support to gpt(8) partition editor for BIOS Boot Partition. This partition type is roughly equivalent to FreeBSD Boot; it is used by GRUB 2 and aimed at standarization. More details at: http://en.wikipedia.org/wiki/BIOS_Boot_Partition_(GPT) >How-To-Repeat: >Fix: Patch attached. Patch attached with submission follows: diff -ur src/sbin/gpt/gpt.c src.new/sbin/gpt/gpt.c --- src/sbin/gpt/gpt.c 2008-01-30 14:29:10.000000000 +0100 +++ src.new/sbin/gpt/gpt.c 2008-02-23 13:02:32.000000000 +0100 @@ -275,6 +275,12 @@ return (0); } break; + if (strcmp(s, "bios_boot") == 0) { + uuid_t bios_boot = GPT_ENT_TYPE_BIOS_BOOT; + *uuid = bios_boot; + return (0); + } + break; case 'e': if (strcmp(s, "efi") == 0) { uuid_t efi = GPT_ENT_TYPE_EFI; diff -ur src/sbin/gpt/show.c src.new/sbin/gpt/show.c --- src/sbin/gpt/show.c 2008-02-06 00:37:42.000000000 +0100 +++ src.new/sbin/gpt/show.c 2008-02-23 13:00:25.000000000 +0100 @@ -55,6 +55,7 @@ friendly(uuid_t *t) { static uuid_t boot = GPT_ENT_TYPE_FREEBSD_BOOT; + static uuid_t bios_boot = GPT_ENT_TYPE_BIOS_BOOT; static uuid_t efi_slice = GPT_ENT_TYPE_EFI; static uuid_t mslinux = GPT_ENT_TYPE_MS_BASIC_DATA; static uuid_t freebsd = GPT_ENT_TYPE_FREEBSD; @@ -75,6 +76,8 @@ return ("EFI System"); if (uuid_equal(t, &boot, NULL)) return ("FreeBSD boot"); + if (uuid_equal(t, &bios_boot, NULL)) + return ("BIOS boot"); if (uuid_equal(t, &swap, NULL)) return ("FreeBSD swap"); if (uuid_equal(t, &ufs, NULL)) diff -ur src/sys/sys/gpt.h src.new/sys/sys/gpt.h --- src/sys/sys/gpt.h 2007-10-24 23:32:56.000000000 +0200 +++ src.new/sys/sys/gpt.h 2008-02-23 13:00:25.000000000 +0100 @@ -120,4 +120,11 @@ #define GPT_ENT_TYPE_APPLE_HFS \ {0x48465300,0x0000,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} +/* + * Same functionality as GPT_ENT_TYPE_FREEBSD_BOOT. Used for others such as + * GRUB 2, but aimed at standarization. + */ +#define GPT_ENT_TYPE_BIOS_BOOT \ + {0x21686148,0x6449,0x6e6f,0x74,0x4e,{0x65,0x65,0x64,0x45,0x46,0x49}} + #endif /* _SYS_GPT_H_ */ >Release-Note: >Audit-Trail: >Unformatted: