From owner-freebsd-current@freebsd.org Mon Jul 13 07:58:58 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 D0B9099B2B3 for ; Mon, 13 Jul 2015 07:58:58 +0000 (UTC) (envelope-from hans@beastielabs.net) Received: from testsoekris.hotsoft.nl (unknown [IPv6:2001:888:1227:0:200:24ff:fec9:5934]) (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 81EE11527; Mon, 13 Jul 2015 07:58:57 +0000 (UTC) (envelope-from hans@beastielabs.net) Received: from beastie.hotsoft.nl (beastie.hotsoft.nl [IPv6:2001:888:1227:0:219:d1ff:fee8:91eb]) by testsoekris.hotsoft.nl (8.14.7/8.14.7) with ESMTP id t6D7wsHj095238; Mon, 13 Jul 2015 09:58:54 +0200 (CEST) (envelope-from hans@beastielabs.net) Message-ID: <55A36FBE.1020206@beastielabs.net> Date: Mon, 13 Jul 2015 09:58:54 +0200 From: Hans Ottevanger User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Allan Jude CC: "Andrey V. Elsukov" , freebsd-current@freebsd.org Subject: Re: Lenovo BIOS boot fix References: <55A1FFD5.7080008@freebsd.org> <55A2030B.7010405@freebsd.org> <55A2835F.1030004@yandex.ru> <55A2ACDD.408@freebsd.org> In-Reply-To: <55A2ACDD.408@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed 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: Mon, 13 Jul 2015 07:58:58 -0000 On 07/12/15 20:07, Allan Jude wrote: > On 2015-07-12 11:10, Andrey V. Elsukov wrote: >> On 12.07.2015 09:02, Allan Jude wrote: >>> 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. >> >> Hi, >> >> I think Lenovo's BIOS just think that your partition layout is MBR and >> uses legacy boot. >> >> if (MBR_partition[0].type == 0xee && gpt_is_ok()) { >> UEFI_boot(); >> } else { >> MBR_boot(); >> } >> > > I am not sure what they actually do, but, by making it the > MBR_partition[1].type that is 0xee, FreeBSD is still perfectly happy, > and the Lenovo boots. > > Other non-lenovo machines I tested on also worked. > > Tested Platforms (in BIOS/non-UEFI mode): > > Lenovo X220 > Lenovo X230 (doesn't have the bug, boots fine with MBR[0].type = 0xee) > Lenovo T530 (also doesn't have the bug) > Asus Core2Duo > Asus i7 Nehalem desktop > Asus i5 Sandy bridge desktop > Gigabyte i5 Ivy bridge desktop > Intel Ivy bridge NUC > Intel Haswell NUC > Supermicro i7 Haswell workstation > > Hi Allan, I did some experiments with the newest memstick image you provided (lenovofix_20150712-r285132.img). On an oldish Q6600 based system using an INTEL DP965LT main-board (it only has BIOS mode) I first pulled the SATA connectors before trying to boot from the USB stick. It shows the same problem as always with a fresh install of FreeBSD 10.x: No bootable device -- insert boot disk and press any key This can be fixed by first modifying the image on the USB stick using gpart recover da0 (the stick is 8Gbyte and the image as copied on it is 1Gbyte, so the GPT seems corrupt), followed by the usual gpart set -a active da0 I think this issue manifests itself on a generation of older Intel and Foxconn main-boards and possibly differs from the problem that you try to solve with Lenovo hardware. I also tried the unmodified image on an even older T7200 based system having an Asus NL4VM-DH main-board and there it just dumps the registers (followed by "BTX Halted") very early in the boot process. This has happened before on several occasions with FreeBSD 10.x. The board is probably too rare to worry about too much, though it still runs OpenBSD 5.7 perfectly. Kind regards, Hans Ottevanger Eindhoven, Netherlands www.beastielabs.net