From owner-freebsd-current@freebsd.org Sun Jul 12 08:45:01 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47A68999A10 for ; Sun, 12 Jul 2015 08:45:01 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from dec.sakura.ne.jp (dec.sakura.ne.jp [210.188.226.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7FEBDAD for ; Sun, 12 Jul 2015 08:45:00 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from fortune.joker.local (180-198-137-134.nagoya1.commufa.jp [180.198.137.134]) (authenticated bits=0) by dec.sakura.ne.jp (8.14.3/8.14.2/[SAKURA-WEB]/20080708) with ESMTP id t6C8ivfE008951 for ; Sun, 12 Jul 2015 17:44:58 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Sun, 12 Jul 2015 17:44:57 +0900 From: Tomoaki AOKI To: freebsd-current@freebsd.org Subject: Re: Lenovo BIOS boot fix Message-Id: <20150712174457.a47abe5bf03b19d8cd21b3b6@dec.sakura.ne.jp> In-Reply-To: <55A2030B.7010405@freebsd.org> References: <55A1FFD5.7080008@freebsd.org> <55A2030B.7010405@freebsd.org> Organization: Junchoon corps X-Mailer: Sylpheed 3.4.3 (GTK+ 2.24.27; amd64-portbld-freebsd10.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jul 2015 08:45:01 -0000 Hi. I'd have to chime in. ;-) There are at least 4 ways of workarounds, including yours (1). 1: Offset GPT entry in PMBR. (First posted by Chris Torek.) 2: Mimic ESP [use 0xEF instead of 0xEE] (Need patch for loader.) 3: Use UEFI loader. (Currently clean root-on-ZFS is NOT supported) 4: Use MBR instead of GPT. (No large disk support) My first solution was 2, but the patched loader possibly misbehave if separate ESP (EFI System Partition) exists. (Hybrid MBR case, not tested.) I've tested 3 only with memstick.img built with head. Not with actual HDD installation. (ThinkPad T420) The important thing is that some problematic computers other than Lenovo's can require the way other than 1. And some won't need anything above, but setting active flag with gpart. So, as you already mentioned, these workarounds should be optional. Ideally, prepare options for gpart, and menus for bsdinstall to choose whichever. Please see also my related page[1]. It includes loader patch for 2 (but not separate files). Newer entry on top. As I'm using solution 1 currently, the patch isn't tested for a long time. I'm testing if it's applicable to stable/10 or not (no build test), and now applicable with fuzz. [1]http://www.dec.sakura.ne.jp/~junchoon/machine/freebsd-e.html On Sun, 12 Jul 2015 02:02:51 -0400 Allan Jude wrote: > On 2015-07-12 01:49, Allan Jude wrote: > > I have spent my weekend researching why my Lenovo X220s refuse to boot > > from GPT partitioned disks. > > > > Based on this mailing list post: > > https://lists.freebsd.org/pipermail/freebsd-i386/2013-March/010437.html > > > > I have written a patch for gpart to change the way the PMBR is created. > > > > Instead of writing the 0xee partition in the first slot (offset 0), it > > writes it to the 2nd slot (offset 1). > > > > This resolves the issue on my Lenovo X220s, and the installed image > > boots fine on my T530, and various other non-lenovo amd64 machines at my > > house. > > > > If others could please test this image (it is a pre-installed system, so > > just dd it to a memory stick, and see if it boots. Can be safely done > > without touching your disks), that would be most helpful. > > > > compressed (193 MiB): > > http://www.allanjude.com/bsd/lenovofix_20150704-r285132.img.xz > > > > uncompressed (1 GiB): > > http://www.allanjude.com/bsd/lenovofix_20150704-r285132.img > > > > > > I forgot to include the link to the patch as well: > > http://www.allanjude.com/bsd/lenovofix_gpart.patch > > I will most likely make this patch optional, behind a flag to the 'gpart > create -s gpt' command, to avoid potentially breaking existing working > systems, but if using offset 1 works on all other hardware, having it as > the default would be nice. > > Another option would be to make a separate standalone program to modify > the pMBR for Lenovo machines, rather than modifying gpart. > > Thoughts? > > -- > Allan Jude > -- Tomoaki AOKI junchoon@dec.sakura.ne.jp