From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1V0Kgt-0004ym-0A for mharc-grub-devel@gnu.org; Fri, 19 Jul 2013 20:06:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0Kgq-0004yd-8O for grub-devel@gnu.org; Fri, 19 Jul 2013 20:06:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0Kgo-0006ag-BA for grub-devel@gnu.org; Fri, 19 Jul 2013 20:06:24 -0400 Received: from mail-we0-x22d.google.com ([2a00:1450:400c:c03::22d]:33147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0Kgo-0006aQ-5d for grub-devel@gnu.org; Fri, 19 Jul 2013 20:06:22 -0400 Received: by mail-we0-f173.google.com with SMTP id x55so10173wes.32 for ; Fri, 19 Jul 2013 17:06:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=tpfdRmPNI4T04nOOOmOcHKOBu/faasbpaRX8NNXzUEE=; b=gwDxPftmJk67heCPn1CGCkE/WqKlaA5/W0Z8CelWxUql2klXeHEkEhu1EIcVRW6C6b +UYJI0s6PeXmucJPKTgA8mRkxRAVNzABC32PzTd1q7OSk/PpgRML5I7kkdT8z1xTjbMv bcV2PdzvM+z7TyZrg+UY0xjqwR7UB56oYEM0XlmVRHZKFF9R5epCypCpoIvlKGiaT1dR 34Gvl8laoKZzxmtIxUnaLZVg1wRqXaIgEXt9POPFWtHDAd4K5tQk7NLn+fDXlMqAj8C1 z3Tj+sJYvM7pT8qXxe1jsnMthbOIa7pN1ScaBhf5E8KbkkPFGD4FD7oZ5iwzxj3WwkIl HEcw== X-Received: by 10.194.121.65 with SMTP id li1mr14205659wjb.24.1374278781066; Fri, 19 Jul 2013 17:06:21 -0700 (PDT) Received: from [192.168.1.37] (c2433-1-88-160-112-182.fbx.proxad.net. [88.160.112.182]) by mx.google.com with ESMTPSA id u7sm45708348wiw.9.2013.07.19.17.06.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Jul 2013 17:06:20 -0700 (PDT) Message-ID: <51E9D47B.4050406@gmail.com> Date: Sat, 20 Jul 2013 02:06:19 +0200 From: =?ISO-8859-1?Q?Gr=E9goire_Sutre?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: The development of GNU GRUB Subject: [PATCH] NetBSD boot disk info Content-Type: multipart/mixed; boundary="------------070907090800060805070103" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::22d X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 00:06:25 -0000 This is a multi-part message in MIME format. --------------070907090800060805070103 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Hi, The attached patch improves knetbsd regarding boot disk info: - the boot disk info is filled unconditionally, - toplevel BSD disk labels are not ignored anymore. This makes knetbsd's behavior closer to that of the NetBSD native boot loader with respect to boot disk info. Grégoire --------------070907090800060805070103 Content-Type: text/x-patch; name="netbsd-bootdisk.diff" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="netbsd-bootdisk.diff" === modified file 'ChangeLog' --- ChangeLog 2013-07-18 15:59:14 +0000 +++ ChangeLog 2013-07-19 22:51:04 +0000 @@ -1,3 +1,8 @@ +2013-07-20 Grégoire Sutre + + * grub-core/loader/i386/bsd.c (grub_netbsd_add_boot_disk_and_wedge): + Always fill bootdisk info and improve check for NetBSD disklabel. + 2013-07-18 Leif Lindholm 2013-07-18 Francesco Lavra 2013-07-18 Vladimir Serbinenko === modified file 'grub-core/loader/i386/bsd.c' --- grub-core/loader/i386/bsd.c 2013-04-28 13:18:50 +0000 +++ grub-core/loader/i386/bsd.c 2013-07-19 22:44:12 +0000 @@ -1088,22 +1088,30 @@ grub_netbsd_add_boot_disk_and_wedge (voi grub_bsd_add_meta (NETBSD_BTINFO_BOOTWEDGE, &biw, sizeof (biw)); } - /* Fill bootdisk if this a NetBSD disk label. */ - if (part->partmap != NULL && - (grub_strcmp (part->partmap->name, "netbsd") == 0) && - buf.label.magic == grub_cpu_to_le32 (GRUB_PC_PARTITION_BSD_LABEL_MAGIC)) - { - struct grub_netbsd_btinfo_bootdisk bid; + /* Fill bootdisk. */ + { + struct grub_netbsd_btinfo_bootdisk bid; - grub_memset (&bid, 0, sizeof (bid)); - bid.labelsector = partmapsector; - bid.label.type = buf.label.type; - bid.label.checksum = buf.label.checksum; - memcpy (bid.label.packname, buf.label.packname, 16); - bid.biosdev = biosdev; - bid.partition = part->number; - grub_bsd_add_meta (NETBSD_BTINFO_BOOTDISK, &bid, sizeof (bid)); - } + grub_memset (&bid, 0, sizeof (bid)); + /* Check for a NetBSD disk label. */ + if (part->partmap != NULL && + (grub_strcmp (part->partmap->name, "netbsd") == 0 || + (part->parent == NULL && grub_strcmp (part->partmap->name, "bsd") == 0))) + { + bid.labelsector = partmapsector; + bid.label.type = buf.label.type; + bid.label.checksum = buf.label.checksum; + memcpy (bid.label.packname, buf.label.packname, 16); + } + else + { + bid.labelsector = -1; + } + bid.biosdev = biosdev; + bid.partition = part->number; + + grub_bsd_add_meta (NETBSD_BTINFO_BOOTDISK, &bid, sizeof (bid)); + } fail: if (dev) --------------070907090800060805070103--