From owner-freebsd-hackers@freebsd.org Tue Dec 15 15:58:41 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 715C14BA71A for ; Tue, 15 Dec 2020 15:58:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4CwNGT1jr2z4WxS for ; Tue, 15 Dec 2020 15:58:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mailman.nyi.freebsd.org (Postfix) id 3AE014BA5F6; Tue, 15 Dec 2020 15:58:41 +0000 (UTC) Delivered-To: hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3AA834BA883 for ; Tue, 15 Dec 2020 15:58:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CwNGT131Lz4X2d for ; Tue, 15 Dec 2020 15:58:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf2c.google.com with SMTP id u16so9758034qvl.7 for ; Tue, 15 Dec 2020 07:58:40 -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=OMnTqPUarO1MtCaZcngFSkohSlEWrvZyHltsKcuAc/Y=; b=0eomBi/jX3L6O0VS2wki4Yv6Mt3XcfwGmD57PgpFw92WLDCohjS63KoVbRoAmqE+j0 Oo+DhElwq3rLxlljzg71xBC7492JOLpmMVmoydHB4hE+MCoSGXr8z0An7/LhWWLtlGFb 0vK7phsKxe/WBTGPstuFDaqBh6uF9HM3clD0z03/FeTmFUJksIea+7pmjNeU2wxp48Mw GXdJEZb+2IEoUf39901ywUQtkfdX6+2ymf168hPp7Xa1K9PWE4t1+OIlZ8+V2vkQPD0L EA5ILzNs0LQlGDQW8YIsfjY/EJEQJrkB2zIgdtO04UxpJPgMXFzQomS1pWV+oetibdjF PyGQ== 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=OMnTqPUarO1MtCaZcngFSkohSlEWrvZyHltsKcuAc/Y=; b=WpQQwDp3gX0ifOmHoYebjPd9DHlzof9q+GsmfdDwZraxZuahb6Faf4BU8ikRMTo7ua SE3FP9MKHfRkt2SzgUC9xydy2Ak2kwcwrujS3NNgLF8LhfvAJ96/WjwDcRMSII9GCNS6 Ov/y5+zWcIEPFroxFa5Tkfc86Wqy2Un/R71xFoQ/G3OOe2A5CMyQQQX/hV2mtFzKZF70 Z6QZ3StPKdzYfepUY4eLkCRYV2tQpOnCAeRbVZwT9R+wR008kyui55Yy0sLjybc8qsss jQgBtQ1I1s12f8uKTLN3NzVjNG8s04QqRdvD1DgFnda9/0q3MHWGy54Hru7Py3REGGcl Gfow== X-Gm-Message-State: AOAM530j5KJBG3vHHR2o9ohQTisWYzf5tePds9dcHm/3pW2kmDeDWHLT 701RGU2AQeyH/59ZgYK5MZO0/rY9otCLKNuiP/K5aVhV81xSGw== X-Google-Smtp-Source: ABdhPJyoyWHuvBoqwzCG6PffDZoFU7D3MHrEJ80DNopr+0xIQnKUWPMvE6rjahWqqp4ldkDWvW6KBjnc0FQ+b8DC3o4= X-Received: by 2002:a0c:bf0f:: with SMTP id m15mr38173133qvi.23.1608047919959; Tue, 15 Dec 2020 07:58:39 -0800 (PST) MIME-Version: 1.0 References: <25469.1608040822@critter.freebsd.dk> In-Reply-To: <25469.1608040822@critter.freebsd.dk> From: Warner Losh Date: Tue, 15 Dec 2020 08:58:29 -0700 Message-ID: Subject: Re: Should/does loader.efi respect the "bootme" GPT attribute ? To: Poul-Henning Kamp Cc: "freebsd-hackers@freebsd.org" X-Rspamd-Queue-Id: 4CwNGT131Lz4X2d X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2020 15:58:41 -0000 On Tue, Dec 15, 2020 at 7:00 AM Poul-Henning Kamp wrote: > It looks to me like the GPT attributes "bootme", "bootonce" and > "bootfailed" > are unknown to loader.efi ? > BIOS "loader" doesn't respect these flags either. That's done by gptboot. The equivalent in UEFI land is gptboot.efi. > Is this intentional or should it be fixed ? > It is intentional. UEFI really doesn't want you using non-standard partition flags to determine boot order. We provide a way to do it with gptboot.efi, but UEFI makes it hard to support. loader.efi is kinda late in the process anyway, and it's main loop makes supporting gptboot-like functionality hard due to the way things are ordered and how gptboot rewrites the GPT partition table at different points in the boot. UEFI has its own bootnext protocol, that works in conjunction with the EFI environment variables to have a more robust, less 'guess what I mean' approach. So all in all, it's hard, non-standard and doesn't play well with UEFI. I wrote gptboot.efi for USB sticks where we have two systems installed that travel from system to system. It's a bit hacky, but I needed something that worked in a mixed UEFI and BIOS environment that was in place at our system integrators. There's some times you gotta not play well, but this won't work everywhere :) Warner