From owner-freebsd-current@freebsd.org Sat Jan 19 02:32:31 2019 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C917B14913A3 for ; Sat, 19 Jan 2019 02:32:31 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B903A8984D; Sat, 19 Jan 2019 02:32:28 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from fortune.joker.local (123-48-17-11.dz.commufa.jp [123.48.17.11]) (authenticated bits=0) by dec.sakura.ne.jp (8.15.2/8.15.2/[SAKURA-WEB]/20080708) with ESMTPA id x0J1gMLR079040; Sat, 19 Jan 2019 10:42:22 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Sat, 19 Jan 2019 10:42:21 +0900 From: Tomoaki AOKI 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: <8DDD8F7A-40CA-48BB-9F71-56733100AFE0@me.com> <1a19320b-2211-129c-b213-96601814e0d0@FreeBSD.org> <1f45099e-6a37-3edb-6bd4-f92eb2c4fde8@FreeBSD.org> Reply-To: junchoon@dec.sakura.ne.jp Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: B903A8984D X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [4.41 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[junchoon@dec.sakura.ne.jp]; MV_CASE(0.50)[]; TO_DN_NONE(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; HAS_ORG_HEADER(0.00)[]; MX_GOOD(-0.01)[dec.sakura.ne.jp]; RCPT_COUNT_TWO(0.00)[2]; RECEIVED_SPAMHAUS_PBL(0.00)[11.17.48.123.zen.spamhaus.org : 127.0.0.10]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:9370, ipnet:210.188.224.0/19, country:JP]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.81)[0.810,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[sakura.ne.jp]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.91)[0.911,0]; IP_SCORE(0.37)[ipnet: 210.188.224.0/19(0.78), asn: 9370(1.15), country: JP(-0.08)]; NEURAL_SPAM_LONG(0.93)[0.928,0]; R_SPF_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 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: Sat, 19 Jan 2019 02:32:32 -0000 On Fri, 18 Jan 2019 22:44:28 +0300 Lev Serebryakov 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