From owner-freebsd-hackers@freebsd.org Tue Mar 26 05:22:16 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 6DF1815637DC for ; Tue, 26 Mar 2019 05:22:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (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 0A5D376782 for ; Tue, 26 Mar 2019 05:22:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x830.google.com with SMTP id k2so13218865qtm.1 for ; Mon, 25 Mar 2019 22:22:16 -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=X6ZvhkB9+6S+YCbihFHP420W7UtaeGi612fLw1q7tR0=; b=IPHpogiLpTYksb8JDQALhLstJ5DvUpywNAQr3oiIxGenvlm+xCOLrGo2pOEfH3j8Ce 5I3DWZ719yPUVSuyD8oZG73FxYLJ8YLdBhKnu8+0iXQW69Eui6qGoTmBLfBtbIJjLQwg BcFN44sZhtqwwShtiD8yPdO90puwWzEXES9W4ov52//EsPhCL3Cgmrf++ANFOnEjWOt6 GLxzFMEjl45qci2YYNVZq7brzr1btDWo0ZuVXGkA6wGknDjkNd+y5A9HV1TZoV1ws2Dm T4cwjMUUWY7aMZrIY0oYqxQdGrDN9ROENMc6SI/QVwQATIg1nsdGJCwgfTOGoFeFgecz yULw== 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=X6ZvhkB9+6S+YCbihFHP420W7UtaeGi612fLw1q7tR0=; b=Q+hjt0pnQVyMvVKOX88Ip/EaxOBHk6SyqmHxtjeFX7VMw/1NM4KSkQfqWg2IxWwLfj yy+ghxNCYvV4T3cHhxMVRHqQkv6cFsvLfyVoRW6UxM8vpeV/wb8OZfiv7Uu3wuq2g0nE 6oz7iwZz0zBbmEv39XQsNbDPGTLsoGjj1tdf64SFz+ewn4MIi6f+3Y7hQe0UTmPgwaMm J1CODXHrIVgVBtDub9vM77d3XB72j1BVuxO0V+9r/KbiEThfv92ze/wMbYRxG9adcPCc vTrXfh1QP5xvKpi0vv78t4JItM8hlQxvrOsSxtMwoNbPYakeYfKiis98FFxcLcwh/Iuh qPAw== X-Gm-Message-State: APjAAAVUJpDUhCe8juJ4FqtJrburDJvGKNEEMBqbyOxCcjKqZ0bPaZTt NiSURORsAkhUFpYr4TSIYdk3tIGEM+WlMyYaGyV2yA== X-Google-Smtp-Source: APXvYqwd/33WqVXC3c/4hwUUnHuZZP+g4pEcbdAc8zGnzTp6dluOViAdJ4PkD/2Y865M91b1KD3i0Xjty8b0Fjkt6XM= X-Received: by 2002:a0c:9ba7:: with SMTP id o39mr23057951qve.153.1553577735560; Mon, 25 Mar 2019 22:22:15 -0700 (PDT) MIME-Version: 1.0 References: <201903260503.x2Q53Ydo083256@gndrsh.dnsmgr.net> In-Reply-To: <201903260503.x2Q53Ydo083256@gndrsh.dnsmgr.net> From: Warner Losh Date: Mon, 25 Mar 2019 23:22:03 -0600 Message-ID: Subject: Re: Adding a new efi-update-loader script: need help understanding Makefile.inc1 for "make installworld" To: "Rodney W. Grimes" Cc: Konstantin Belousov , "freebsd-arch@freebsd.org" , Rebecca Cran , FreeBSD Hackers X-Rspamd-Queue-Id: 0A5D376782 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,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-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: Tue, 26 Mar 2019 05:22:16 -0000 On Mon, Mar 25, 2019, 11:03 PM Rodney W. Grimes < freebsd-rwg@gndrsh.dnsmgr.net> wrote: > > On Mon, Mar 25, 2019, 9:48 PM Rodney W. Grimes < > > freebsd-rwg@gndrsh.dnsmgr.net> 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. > > > > > > Is there anyway to stash an easy to extract "version" in > > > loader.* so that a Makefile/.sh script could easily check > > > to see that your boot code is == `uname -KU` and just emit > > > a warning at the end of installworld? > > > > > > > No. There is no simple version we can check to make sure things are a > > matched set.. > > Then I would call that a pretty fatal flaw in design. There needs > to be a way to find out what version of "loader" /boot/loader.efi > is there. > > I was also not asking if we have a way now, I was asking if there > was a way to implement, and I doubt the answer to that question is > no. > I know. We've not needed it before, and I'm having trouble seeing it now how it is connected to uname -UK. The path forward isn't DWIM. There are too many variables. Without DWIM requirements, a tight, buttoned up version isn't needed. Warner > Warner > > > John Baldwin > > > Rod Grimes rgrimes@freebsd.org > > > 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 > Why does your mail client wrap my <70 column signature? > Ask Google. Warner > -- > Rod Grimes > rgrimes@freebsd.org >