Date: Sat, 19 Jan 2019 10:42:21 +0900 From: Tomoaki AOKI <junchoon@dec.sakura.ne.jp> To: freebsd-current@freebsd.org Cc: lev@FreeBSD.org Subject: Re: GPT boot has less features than legacy MBR-based one (Was: UEFI, loader.efi and /boot.config) Message-ID: <20190119104221.406e7a7b71394a12c80e4e04@dec.sakura.ne.jp> In-Reply-To: <1f45099e-6a37-3edb-6bd4-f92eb2c4fde8@FreeBSD.org> References: <etPan.5c413a8a.7a8e2073.13b3@freebsd.org> <eb14f962-1c13-cc77-0e8c-575028f7c5d7@FreeBSD.org> <CA%2Bq%2BTcp2%2BsavH1g0q3b9YQ9SW76iXZ2PA6wvj2ok-cUOndZeWw@mail.gmail.com> <CACNAnaGm0AYmWO_T7yau1jYTxQE7i7LXceERDoHHBO1U%2BvTtSQ@mail.gmail.com> <b9223144-fd39-d84f-d310-d8d69f20561a@FreeBSD.org> <CANCZdfp_s1EhHGxd3BzviGV-s%2ByutCqF1csMJ56TZ1n6gtO1tA@mail.gmail.com> <d7829f9c-4526-144b-5eb6-93d2fe8b0376@FreeBSD.org> <8DDD8F7A-40CA-48BB-9F71-56733100AFE0@me.com> <1a19320b-2211-129c-b213-96601814e0d0@FreeBSD.org> <CANCZdfon0uV1t=dLE2gcnLRW9DGFmiPgQjtv0zgFE-a3nD2ZRA@mail.gmail.com> <1f45099e-6a37-3edb-6bd4-f92eb2c4fde8@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 18 Jan 2019 22:44:28 +0300 Lev Serebryakov <lev@FreeBSD.org> wrote: > On 18.01.2019 22:27, Warner Losh wrote: > > > > errm.. you press a key and enter device and or loader path. if it > > is not working - the code is there to be fixed. > > 〓And loader looks to "bootme" attribute and try to boot from partition > > which has one, even if it is loaded from other partition itself. > > Correct. > And system crashes, because "bootme" partition has broken installation. > > With MBR + boot0/boot0sio it is solved with one keypress. > > > > GPT does not have the concept of active partition. > > 〓It has "bootme" / "bootonce" attributes. And [zfs]gptboot doesn't have > > any tools to set these attributes, AFAIK. Same for UEFI boot code. > > > > gpart can set these. > You need live, booted system (at least single-user) to use gpart. > > > UEFI completely ignores them, though, because getting to that data is > > hard in the UEFI environment. But in UEFI, you're supposed to use > > BootXXXX and BootOrder/BootNext as managed by efibootmgr. > Again, you need booted system to use efibootmgr. > > boot0/boot0sio works before system and could switch boot partition in > case of MBR. It is why I write, that GPT/Legacy and GPT/UEFI miss > important feature which is present for MBR boot for ages. Which is sad & > funny at same time, as GPT/UEFI has much more code than 512 bytes of boot0. > > -- > // Lev Serebryakov > Hi. I should note that 512-bytes boot0 doesn't have that feature. What had it WAS larger boot0ext, which has already gone on stable/11 and later. IIRC, sysinstall let me select which to install on MBR. It could be larger than 512 bytes as no partition could be mapped on 1st cylinder because USUAL partition editors aligns partition by cylinder on ancient CHS days. But IIUC, it was trivial, NOT assured by any spec. So preparing 512-bytes (single sector) boot0 IS mandatory for MBR, while boot0ext is not. One good news is that boot1.efi having boot-time partition selection by Naomichi Nonaka exists on bugzilla.[1] The latest ones includes my quick and ugly hack to get back deleted but needed functions, though. "boot1.c patch rev4 for stable/11 after MFC of r332751" would be applicable to stable/11 (not tested recently), and "boot1.c patch rev4 for stable/12 and head after r332751" would be applicable to stable/12 and head. *I've uploaded long-forgotton ones just before this mail. They should be cleaned-up to use currently-available functions instead of re-adding deleted functions but I have not enough time to do, and Naomichi, the original auther of the patche, already switched to use grub and would not maintain it further. And a bad news is that [1] would never be committed, and non-UEFI GPT-based installation doesn't have any alternatives. [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207940 -- Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190119104221.406e7a7b71394a12c80e4e04>