From owner-freebsd-arch@freebsd.org Mon Mar 25 00:49:32 2019 Return-Path: Delivered-To: freebsd-arch@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 19B01154AE12 for ; Mon, 25 Mar 2019 00:49:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 72B796FAFF for ; Mon, 25 Mar 2019 00:49:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mailman.ysv.freebsd.org (Postfix) id 2C013154AE0F; Mon, 25 Mar 2019 00:49:31 +0000 (UTC) Delivered-To: arch@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 02999154AE0E for ; Mon, 25 Mar 2019 00:49:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69D6F6FAFE for ; Mon, 25 Mar 2019 00:49:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x730.google.com with SMTP id z13so4367439qki.2 for ; Sun, 24 Mar 2019 17:49:30 -0700 (PDT) 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=jQ7anEgsKTXSI0JC0fK+0Sq6mGbkY0ArWO40A+8431Y=; b=jQPVDRq+JaCo9lorOxNXWLC9D7JaMXi64LhRkHboMdfrM4M+Sq7NC6C/3igpKPXq11 ZXo5EGtr5Mxz25guHcsNjFOeRtZgwvJMOM4yScD+Aj079HuyJNpzpziqq4ItbVavyrop K2VbH6Sblsg/49QpJ1QYhPsse05DFka/VXhapg73j2wAdoErEsZjPpTw0aRufyeL1N6x lpIwbssmZcbM4ifZ/AZ7WVdQsHjuhwZPU3FXUxp3crWDRptl/3dIv+tAPFZdrN8+34vR d6pTQRl5uQFOtME38TdAnRRUHlnuy7fxDTxLcOo8l+bklNX/zH1UDtYcXdSfJonyVRbZ L/8A== 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=jQ7anEgsKTXSI0JC0fK+0Sq6mGbkY0ArWO40A+8431Y=; b=NqrBeGjTANjwXs0vO0p+WJX1x7xFBTbQOY1DaCYfcFKZf1YqtmrywVH3tcMg6CVWU0 PGPyFP+2vATD7l8LhsaYI/Q/XGcxfnBf+IMCVBRmcVwwOjpTo3UXO5sFOyK/pFuBT2JX u3X20gGn8Mm9nkK0QDv4Hl9FtB/uvFDOTIOXPawfFRIihLHC7+3yoOTy5B+i3gWFTnaY 38RH5pHgMrJ5sdK7TSfGweEUyatkK8prUZilGuKpCBDAgBsaXEdE3tRGMGPqHHHtUeTZ s1meo7LbDbhKyRU3dX9b0aUdQNYlASe5Gh1ssl/lU4rpOO3P//gZVEkj0LSA7f3n9RK2 8ZMg== X-Gm-Message-State: APjAAAXoF/i52eBkgG2ImS2fR51urtzwDKKp2z8+5/OWQjUDUvX0J4GD 8/x3tpxVQ1bwENjZ7FB8YEFRvQxcD2feV1z6hsJMUQ== X-Google-Smtp-Source: APXvYqzWNCeSKZjMzbHcsL0yvKmJanpI11DGsFx5LHOlrWWHk4HYUpZXFfppkVdb89XLJzTT4QRtnjxYgmvIM3JlLYs= X-Received: by 2002:a37:bce:: with SMTP id 197mr18053852qkl.46.1553474969741; Sun, 24 Mar 2019 17:49:29 -0700 (PDT) MIME-Version: 1.0 References: <642fed43-0535-9ae3-6f01-a943650cd511@bluestop.org> <20190324090103.GO1923@kib.kiev.ua> <5cda4bb9-c10e-2b44-65db-5a9f29f498d8@bluestop.org> In-Reply-To: <5cda4bb9-c10e-2b44-65db-5a9f29f498d8@bluestop.org> From: Warner Losh Date: Sun, 24 Mar 2019 18:49:17 -0600 Message-ID: Subject: Re: Adding a new efi-update-loader script: need help understanding Makefile.inc1 for "make installworld" To: Rebecca Cran Cc: Konstantin Belousov , FreeBSD Hackers , "freebsd-arch@freebsd.org" X-Rspamd-Queue-Id: 69D6F6FAFE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Mar 2019 00:49:32 -0000 On Sun, Mar 24, 2019, 6:20 PM Rebecca Cran wrote: > On 3/24/19 5:57 PM, Warner Losh wrote: > > > He's asking for stopping doing a make install in src/stand. I'm thinking > that's a good thing. We should update the ESP's \efi\freebsd\loader.efi, > but leave the\efi\boot\bootXXXX.efi alone as part of this new installloader > phase. Again, only if the ESP is mounted, and we have a default spot for > it. For this script, I don't think hunting for the ESP is the right way to > go... which means we need to define a standard place for the ESP to be > mounted, which we should do before we turn on any of these features. > > We have the start of a generic script to update things in > src/tools/boot/install-boot.sh which was supposed to install boot blocks on > everything known to run FreeBSD. > > > Only updating \efi\freebsd\loader.efi is the wrong thing to do in my > opinion: there are situations like on ARM where EFI variables aren't > persistent, and we need \efi\boot\bootxxxx.efi for booting. What we could > do is check if QueryVariableInfo returns EFI_UNSUPPORTED, in which case we > know any changes to BootXXXX variables won't survive a reboot, and we need > BOOTxxxx.efi. > Systems that don't support variables are a super duper weird special case. Let's not let them drive the design. I want to get to (a) a standardized mount point and (b) drive people towards having the boot loader be in /efi/freebsd/loader.efi. our tooling should reflect that first and foremost. The weirdo, special cases that likely won't be updating from source are secondary. Let's get a good design flow down first for the most common case, one that encourages the most people to adopt the standard boot flow as possible. Is it safe to assume there's only a single ESP in the system? Is it not > normal for there to be one ESP per disk for mirrored configurations, in > which case each would need to be updated? > None of those are safe. We shouldn't look for the ESP to mount. It should be mounted and we should only update it if it is. DWIM will get us into a lot of trouble with the boot path, I believe. Do you envision src/tools/boot/install-boot.sh moving to /usr/sbin, or > remaining where it is? We'd also need to update the ESP for binary installs > using freebsd-update > Eventually, but it has a ways to go. Warner > -- > Rebecca Cran >