From owner-freebsd-current@freebsd.org Mon Jul 13 14:50:06 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 33988999CEF for ; Mon, 13 Jul 2015 14:50:06 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id E9D1110EB for ; Mon, 13 Jul 2015 14:50:05 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id BDC3E94CA; Mon, 13 Jul 2015 14:50:04 +0000 (UTC) Message-ID: <55A3D01E.40102@freebsd.org> Date: Mon, 13 Jul 2015 10:50:06 -0400 From: Allan Jude User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Hans Ottevanger 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> <55A36FBE.1020206@beastielabs.net> In-Reply-To: <55A36FBE.1020206@beastielabs.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QKkruQfScuULlc5a37bJNVOTBPBRJgjlD" 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 14:50:06 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QKkruQfScuULlc5a37bJNVOTBPBRJgjlD Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2015-07-13 03:58, Hans Ottevanger wrote: > 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 worki= ng >>>> 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 mod= ify >>>> the pMBR for Lenovo machines, rather than modifying gpart. >>> >>> Hi, >>> >>> I think Lenovo's BIOS just think that your partition layout is MBR an= d >>> uses legacy boot. >>> >>> if (MBR_partition[0].type =3D=3D 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 =3D 0xe= e) >> 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 >> >> >=20 > Hi Allan, >=20 > I did some experiments with the newest memstick image you provided > (lenovofix_20150712-r285132.img). >=20 > 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: >=20 > No bootable device -- insert boot disk and press any key >=20 > This can be fixed by first modifying the image on the USB stick using >=20 > gpart recover da0 >=20 > (the stick is 8Gbyte and the image as copied on it is 1Gbyte, so the GP= T > seems corrupt), followed by the usual >=20 > gpart set -a active da0 >=20 > 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. >=20 > 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 register= s > (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. >=20 >=20 > Kind regards, >=20 > Hans Ottevanger >=20 > Eindhoven, Netherlands > www.beastielabs.net >=20 >=20 >=20 >=20 >=20 Needing the active flag set is indeed a different problem. I am working on a patch for bsdinstall that will allow the user to request the active bit be set as well. --=20 Allan Jude --QKkruQfScuULlc5a37bJNVOTBPBRJgjlD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJVo9AjAAoJEBmVNT4SmAt+wa0QAKdxxqcRyRAtokJKSowBXUMr 4gqOCaCC4zu8WivSRupcEfUQ9vS52YLYc6JNfWnLk5ol/3bhhbPtwc8VvCXj0Hrk 0/Xg+xRs/T4CWK2IhL2GQs3qyZGxU0UwXx/UsKeFmcLP9FMvO6ZcwxLFemhXOHRK 8XpNod6eHCjs6+2E2JE2JOiD5EsOZdHUigMicM5BoPUFDeaUYinNTJVBv6SrtDhe cDjFXeOZ7w6j8TzvaFsWAqzWo3BrfyHhZVeGavPxX8Vw7imAkStF0MwIDVcBGrfL KhcOGtLWz/irzlBu3I0wtymGqlh/5sZG1G/7YlwTzTZaWvVsnrZswy0W7PI+bsJq rjDzVkWvpOqpvv+szA7ktGD52TmVVmyxsYGhsIc2zjRFNoinoAylWNE9hfpmGge+ CVyFx14Bqz0LKuW1UKqqa0drZoFXl6PuZv0E8LaRd/2/0e7zTgTOQKHRpaA9b3ah BelE20bySBZsRJ5B4/bZhIOWqIGF0HQAO5S6NrdzGheouOMFrhldXqwHehoYXS+g ViHeD34+C1BBum3OUC3ouLIEt93drKNWahN8qv4Nep+COzLFAkcxquq+L+hUTkeV tl11Eqb2+eb6jf6enpXTvNenBVT/JuN/oSaZrtZYJJAPBESvxWARw3hnc2iYHW+M HytgsRWpqPwZtcAIMwWc =1v0c -----END PGP SIGNATURE----- --QKkruQfScuULlc5a37bJNVOTBPBRJgjlD--