From owner-freebsd-arch@freebsd.org Mon Mar 25 19:27:37 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 EDDCD154AE71 for ; Mon, 25 Mar 2019 19:27:36 +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 4D2F58435D for ; Mon, 25 Mar 2019 19:27:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mailman.ysv.freebsd.org (Postfix) id 06A17154AE6D; Mon, 25 Mar 2019 19:27:36 +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 C017B154AE6B for ; Mon, 25 Mar 2019 19:27:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) (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 61BA284359 for ; Mon, 25 Mar 2019 19:27:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x835.google.com with SMTP id w5so11692826qtb.11 for ; Mon, 25 Mar 2019 12:27:35 -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=TV9WE/1CHx0uhsY0wUvZtlzys+nMywFvBDp7zNPrPNE=; b=CZm3Dd1b604cnUQ3yKbfWheMaVY2PLefzAvRxRoyd+smLYXSJZVnEsY0JkCBGV5gJU JXEynvk55a3LVAZi/La9U5LM9TNpvo61WiqrYYFhevGJuhwgbjr5feIiGGqtmWLPoNJl EV2SZglhyLklCb9QRzDzIExY8tyiiv6fX7YpldOggMM2qDLOgLnF4sIbfULZvE8Pvgre wUzngHI4CmMV9nI6FBN3TRWabWK7+YZA9t0ewgR0sIkjPZgLX0akRp7vlg7o+jqqKrKi JmfMNaqjNalW198l7rqjQgdSDTN4f6wPtnXLIUuG5tii40Y9fWVyrp6uUPG7R/4cgBNS DrLg== 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=TV9WE/1CHx0uhsY0wUvZtlzys+nMywFvBDp7zNPrPNE=; b=VKEVcycKXJ8QbSF4KY/OIsWM/DiLrGTQRsCWMQYNzUYQJNMjrWdEAzRe18vq0vd+PV sxvb+90+0N0leXlHrZQAT/S+bzdLtTn8keZaU+m9s39O6mDeeSfANnz/2LjrXENj1jAR 5YfjPUjPnFqRkMtbIgJoOP3s0T61ExlQohi1ohqP/XtwOlDMx4JeOJQsPgu2zBQ3rSi3 +FzijIn3UmqG/j/syLXVeefVQpnqPEDpY/zJfJtOCoM5fSGcZPizReFK/5B9ICCQoDVE PQPJ+nMfCtbGXKvAza0b1GYsQujTyyXUNPLLT+rMAWL8JEDQfTnmHsCilUTwEz6PvR8V hTrw== X-Gm-Message-State: APjAAAUFjxQbRem39w2I8/mWVdraSBjDZegk93vHtQJuOBKMTfCjPEVH PoQvhwa9kSJR9FHcmJbZeb8JzhhdaNY4L9JToq10Nw== X-Google-Smtp-Source: APXvYqwVR8xULRC2s3FfaOQK7Yg3u/ufj4hCrX0Htgjzu+JFwhmHj25ukrTCBvqgh5sHx8yZ40Ux1F5TLCXMtkQlWjM= X-Received: by 2002:ac8:1aec:: with SMTP id h41mr21143132qtk.345.1553542054660; Mon, 25 Mar 2019 12:27:34 -0700 (PDT) MIME-Version: 1.0 References: <20190324090103.GO1923@kib.kiev.ua> <201903250926.x2P9QgYK078736@gndrsh.dnsmgr.net> <2c1aef87-5408-7736-9039-7fc6a1214102@FreeBSD.org> In-Reply-To: <2c1aef87-5408-7736-9039-7fc6a1214102@FreeBSD.org> From: Warner Losh Date: Mon, 25 Mar 2019 13:27:21 -0600 Message-ID: Subject: Re: Adding a new efi-update-loader script: need help understanding Makefile.inc1 for "make installworld" To: John Baldwin Cc: "Rodney W. Grimes" , Konstantin Belousov , "freebsd-arch@freebsd.org" , FreeBSD Hackers , Rebecca Cran X-Rspamd-Queue-Id: 61BA284359 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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 19:27:37 -0000 On Mon, Mar 25, 2019, 12:34 PM John Baldwin wrote: > On 3/25/19 8:05 AM, Warner Losh wrote: > > We started installing /boot/loader with install world in FreeBSD -3.x and > > it has affected the boot ability that whole time... in the early days of > > loader, the kernel loader handoff protocol was immature enough to need a > > matched kernel. But that period lasted only a few months... loader has > > also been weird in other ways as well, since some embedded systems used > the > > one in its, while others needed an extra step. As UEFI support has > matured > > we're finding there are several issues around it as well where updating > the > > ESP needs to be tied to updating /boot for the system to work sometimes. > It > > has grown more complex over time, so we should separate. It's been a > little > > weird on all the non x86 platforms to different degrees, but now that our > > main platform is affected it's become clear we may need to change. > > > > But we need to do so carefully as this violates POLA in a huge way, as > well > > as needing doc changes in a bajillion places. > > I think we should treat files on the ESP the same way we treat other boot > blocks. installworld should continue to install the latest version into > /boot (e.g. /boot/boot that holds UFS boot1 + boot2), but then some other > tool is used by the user to copy the updated loader.efi into the ESP. > > I think the main difference here is that traditionally other boot blocks > didn't change very often, so no one really needed to update it them > post-install. loader.efi changes often enough we probably need to document > updating the ESP as an optional step in the upgrade process. I think > having an automagical script will probably go sideways, but standardizing > where to mounting the ESP (or ESPs when doing RAID mirroring, etc.) means > we can provide a script with defaults (or instructions) that work with > the standardized approach. > I think we need to have some automation in place. Something very specific and concrete. Otherwise we run the risk of updating the support files without updating loader.efi, possibly breaking boot if we wanted to add a new API to lua that the startup scripts call. Without an update of loader.efi, this generates an error. I view /efi/boot/* as boot blocks, for these purposes, bit /efi/freebsd as fair game to update. So there is some nuance here we need to take into account and avoid absolutes about the BSP. -- > John Baldwin >