From owner-freebsd-current@freebsd.org Fri Jan 18 21:17:42 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 055D81482DCB for ; Fri, 18 Jan 2019 21:17:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D6F774825 for ; Fri, 18 Jan 2019 21:17:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x733.google.com with SMTP id c21so8863154qkl.6 for ; Fri, 18 Jan 2019 13:17:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=g2Ib9mpiEeB09KVus0b7x8IR9hgHSZZyO8BxZEG7vbY=; b=mfmbJ7TVpDcFIgxMlMhA9brSGyQ/RhPEQ0t58TYIevUohVuuOakEOzq1gp+Y9TU2De aEgbT8XNJ6BjtsHwczSimvE5yXgxsNeV2NiiWwfS+yrvFOSFRGjtHUWcoclcR6NAp/1j 0EN7aEzCnjkU6P0SG8AHXWpDmZQX2xw1V5KLCevu7NSVDDoDr9lOFGlBl1VvpK82j3nm Zff8PXVmka6zdERdFadaRQqeklQkukTRc4wTNRZHnaz96q2TVoCzPm84zLwP+cgfY1U1 SF5jHRhESN6X3B8NUxx3W7oyaBWlQYyrJOtamEZwRXjffDkFkLx9oj3i1KuxGFaYlfHt kudg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=g2Ib9mpiEeB09KVus0b7x8IR9hgHSZZyO8BxZEG7vbY=; b=hLoQxe0LlZKFdm5WX1oTnOVNLOGBL2CopGFF3UuU8jl5Whk1sSwGKHZL/sQevcDyaE IP+4Med4z3kQFt22q8MzcDIiE4hUdBtUIoPTBJddxGLEg2jopRNkiNkye+oVmQ6M0ayV blJszgmi5j79ar1HrEonXfbizqW0GaKUd6NEYuqbIPRrIkZwxCqnVsU5DcWOMwH/4dU+ bQLSecCCvuG/8MAiBsy311MYp1jtgWKHVvQ34m2wMnxvsIJqKQTY+Jxji+fCg/kfmwqY da120tsqefl4+lsKrLq1sI+1OHj/hrAYrYNooFNbAWo3htqi7a1xgTnA7xeA/zhcVWDi wbUg== X-Gm-Message-State: AJcUukcc1Yqh5ObS+KEl4gVGzlkVaasOzFAdy5BwYTNhjtWVhta0HxGD fwsDYAuREU0c2BDxstYneXxR6j+La8E8yJ1eG9w2aQ== X-Google-Smtp-Source: ALg8bN70CMYsVWQ7ot3LII09CzzBf3cXJ5cCDtBt7nC//Klu9ER1amahYZlItKBXNtpSh3Rp7hJpkrN/jjQ9W9u6uOc= X-Received: by 2002:a37:9201:: with SMTP id u1mr16885771qkd.258.1547846260631; Fri, 18 Jan 2019 13:17:40 -0800 (PST) MIME-Version: 1.0 References: <201901181935.x0IJZ4tX057034@pdx.rh.CN85.dnsmgr.net> <49056065-1e62-f0dc-c7a4-8c358de4266e@FreeBSD.org> <20190118221013.81c8729c7bf17038e1823b52@bidouilliste.com> In-Reply-To: <20190118221013.81c8729c7bf17038e1823b52@bidouilliste.com> From: Warner Losh Date: Fri, 18 Jan 2019 14:17:29 -0700 Message-ID: Subject: Re: GPT boot has less features than legacy MBR-based one (Was: UEFI, loader.efi and /boot.config) To: Emmanuel Vadot Cc: Lev Serebryakov , "Rodney W. Grimes" , FreeBSD Current X-Rspamd-Queue-Id: 1D6F774825 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=mfmbJ7TV X-Spamd-Result: default: False [-5.76 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[3.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; IP_SCORE(-2.79)[ip: (-9.68), ipnet: 2607:f8b0::/32(-2.37), asn: 15169(-1.83), country: US(-0.08)]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Fri, 18 Jan 2019 21:17:42 -0000 On Fri, Jan 18, 2019 at 2:11 PM Emmanuel Vadot wrote: > On Fri, 18 Jan 2019 22:50:31 +0300 > Lev Serebryakov wrote: > > > On 18.01.2019 22:35, Rodney W. Grimes 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. > > >> > > >>> 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. > > > > > > The gpart(8) command is used to set/unset these. > > gpart need booted system. NanoBSD typically have two "system" > > partitions, "old" (previous) and "new" (current). After upgrade they > > switched (new code is written to "previos" partition and bootable > > atteibute is set to it, "active" in case of MBR and "bootme" in case of > > GPT). > > > > If this new partition has problems and could not be booted, it is hard > > to boot from "old" (previous) one. MBR + boot0 could (interactively) > > change active partition before system is booted, and this problem could > > be solved with one keypress: you select old partition on boot. > > > > -- > > // Lev Serebryakov > > > > With UEFI Boot* variable you could do : > > - Update previous partition and set BootNext to it > - If it fail next boot will be on current partition due to BootOrder > - If it succeed, change the BootOrder to have the new partition first. > Also most UEFI BIOSes I've used (which isn't a lot) allow one to choose which BootXXXX variable to use to boot. Some will even create new BootXXXX variables that they use when you choose a raw device to boot from. There's other people that have efi programs that will pop up a menu for you to select a particular BootXXXX to use. They then set BootNext and exit. I've not used any of these personally. But this whole thread tells me we need to rewrite the boot section of our handbook. Warner