From owner-freebsd-hackers@freebsd.org Mon Mar 25 19:27:35 2019 Return-Path: Delivered-To: freebsd-hackers@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 B303D154AE6A for ; Mon, 25 Mar 2019 19:27:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (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 53D9684357 for ; Mon, 25 Mar 2019 19:27:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82f.google.com with SMTP id v32so11714670qtc.10 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=DRf4SleGQWMaOC5m94eMwVCcnhRm2DJNNlRxSYIwAsOMLl5XlnyVoxptpw7Se6Vnkw +zsvkS5JWmZOSlilTX66biNQneoikXaJHIukXjjmpfTy3HwR3LX1TFe6QZ1k5VqI0omc hL1ugjfDbztVzPc0DF/XKxniwtxMDUn4MoI9vC0BIYmpzPME55BCcbuOjLu2QVn2I1ml tty0gpOrdtTQ7KNq4aSjt5/g8gSx83CF9eYKxmesZgoksz6CJ4pzPXYGvLOiLUaucJI4 m3LLHFMq+uTgmdbwzzIlfw9dp8FuKMvkYCFjHJLK/ByxzFxwOSbrsYUB8dAfCONUEOBO OG3w== X-Gm-Message-State: APjAAAXhohQaWqfSnoEUCu3em7QTfy6lyYJYf67CZyAkGhLTIQP6XhVg 6s4oBwPWgswKoCc+hC+UkBrw53+5ficmYBARLnFSrw== 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: 53D9684357 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]; 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-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Mar 2019 19:27:35 -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 >