From owner-freebsd-current@freebsd.org Sat Mar 28 11:52:58 2020 Return-Path: Delivered-To: freebsd-current@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 0CFF4279535 for ; Sat, 28 Mar 2020 11:52:58 +0000 (UTC) (envelope-from f0andrey@gmail.com) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 48qHCb045Kz3Qk9 for ; Sat, 28 Mar 2020 11:52:42 +0000 (UTC) (envelope-from f0andrey@gmail.com) Received: by mail-wr1-x429.google.com with SMTP id d5so15002109wrn.2 for ; Sat, 28 Mar 2020 04:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=4/YtOdlM3Mx0Do/y/3D8rVYPeVHEWRajuBJOFZBxnGQ=; b=rOrc4jeZh/mSa/qmxFVfEeTmpGecyKPQvByyurbQ1au0N2aYVl4DvlDaS8eAzcgLlc 2O3K0rLp/5aWX9U2/z/PGOBAV8qzW4UKIGZ/ouoJGz8RciotGLSPONLypWYgNPuQ76LL 3c2Xh25lAYvZtNiTXeHAZMiGyA9BM/fmn0//GfUd23ZIkqr9vGcxhsKP0fmrEhCzmfFM 01zpKWUTuBlu4pWjlB5uFZ7mnCZlbTs2uMS9ThhmTC9FrV+uO+6BbLfx1jQJeCxVVY8h 86mOwlxUY2z8Cju61CGke149yAc4zpLKQJg5956abPFZ897UQKV7JOUn9Q7cyBo21ALU IOwA== 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:content-transfer-encoding; bh=4/YtOdlM3Mx0Do/y/3D8rVYPeVHEWRajuBJOFZBxnGQ=; b=eXxK223EYu6pce3GT2J5+VHQ7sg0hPvY5ujVeQNvOQaeFtURNhsgt/HynJBSNYCIkK PRnAJ3IXv5P+kgWRiiErTzW1J/BMY5FCbXZq3WKVz6GSMTlGT6mDPO6M8x9ccjBOcJO9 cJBI6dFJXWhBH2CNIkqylUL/BfBdbtk3v9GImZ0K7gnk9wtTd+joN5Idypi+hbOE0wBL gcf9Gv4rqBmeEIjv7bpBRSP5CV1L5WLn3zfN4rcVCy05qDBtRi9Z/HrSxIXqLShDKARa rET7tmvFz2PXfFlnbbASZ0awhztam9LXzRCUzPZx5bWFapwje+gMptJXFoDljZWEm7XR 9k/Q== X-Gm-Message-State: ANhLgQ3f1S7wW+/O2kGLzlcMxzM1Fp0tBK5bFa+yb73j0edW3Hein0Up tVs+2D7PHjdBnu9fSDrGdtmdqZfu1dQXV86ilX8= X-Google-Smtp-Source: ADFU+vuQL8GFvB+dyZMpSIgvLKy697bueiJzEEyuTjNVI2m7dLeJnQQcJO/P6RpBDacrnmdqjCchhPz0j5yxdqkPBPI= X-Received: by 2002:a05:6000:1251:: with SMTP id j17mr4644849wrx.228.1585396354209; Sat, 28 Mar 2020 04:52:34 -0700 (PDT) MIME-Version: 1.0 References: <4f8f3e359207b923a6a3e49a1405a832@udns.ultimatedns.net> <318FDBAF-448F-4C55-A9A8-69D71A73E43B@me.com> In-Reply-To: <318FDBAF-448F-4C55-A9A8-69D71A73E43B@me.com> From: Andrey Fesenko Date: Sat, 28 Mar 2020 14:52:23 +0300 Message-ID: Subject: Re: When will the FreeBSD (u)EFI work? To: Toomas Soome Cc: "bsd-lists@bsdforge.com" , freebsd-current Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 48qHCb045Kz3Qk9 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=rOrc4jeZ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of f0andrey@gmail.com designates 2a00:1450:4864:20::429 as permitted sender) smtp.mailfrom=f0andrey@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FREEMAIL_TO(0.00)[me.com]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-9.35), ipnet: 2a00:1450::/32(-2.38), asn: 15169(-0.47), country: US(-0.05)]; SUBJECT_ENDS_QUESTION(1.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[9.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Mar 2020 11:52:58 -0000 On Sat, Mar 28, 2020 at 12:14 PM Toomas Soome wrote: > > > > > On 28. Mar 2020, at 05:28, Chris wrote: > > > > On Fri, 27 Mar 2020 18:31:50 -0700 bsd-lists@BSDforge.com said > > > >> On Fri, 27 Mar 2020 17:27:27 -0600 Warner Losh imp@bsdimp.com said > >> > On Fri, Mar 27, 2020 at 4:54 PM Chris wrote= : > >> > > > On Sat, 28 Mar 2020 01:10:37 +0300 Andrey Fesenko f0andrey@gmail= .com said > >> > > > >> > > > On Sat, Mar 28, 2020 at 12:53 AM Chris = wrote: > >> > > > > > >> > > > > On an experiment of the FreeBSD EFI implementation. I installe= d > >> > > > > a copy of releng/12 from install media. Which left me with: > >> > > > > # gpart show ada0 > >> > > > > =3D> 40 312581728 ada0 GPT (149G) > >> > > > > 40 409600 1 efi (200M) > >> > > > > 409640 31047680 2 freebsd-ufs (15G) > >> > > > > 31457320 7680000 3 freebsd-swap (3.7G) > >> > > > > 74788904 237792864 - free - (141G) > >> > > > > > >> > > > > On this Intel based system, I can stab the F12 key to pick > >> > > > > my UEFI bootable OS, or let it boot according to the order > >> > > > > I setup in the BIOS. So far, so good. > >> > > > > I needed a copy of releng/13 to also work with. Installed a co= py > >> > > > > from install media. Which left me with: > >> > > > > # gpart show ada0 > >> > > > > =3D> 40 312581728 ada0 GPT (149G) > >> > > > > 40 409600 1 efi (200M) > >> > > > > 409640 31047680 2 freebsd-ufs (15G) > >> > > > > 31457320 7680000 3 freebsd-swap (3.7G) > >> > > > > 39137320 532480 4 efi (260M) > >> > > > > 39669800 35119104 5 freebsd-ufs (17G) > >> > > > > 74788904 237792864 - free - (113G) > >> > > > > I *assumed* that the install would activate the new install, a= nd I > >> > > > > would boot straight into it. But no. I am still on the previou= s > >> > > > > install, and worse, I can't get into the new install -- even i= f > >> > > > > picking it via stabbing the F12 key. I *still* end up in the p= revious > >> > > > > install. So looking at what might be causing it. I found the > >> > following: > >> > > > > # releng/12 > >> > > > > # mount -t msdosfs /dev/ada0p1 /mnt/ > >> > > > > > >> > > > > # ls /mnt/efi/boot/ > >> > > > > BOOTx64.efi > >> > > > > startup.nsh > >> > > > > > >> > > > > # cat /mnt/efi/boot/startup.nsh > >> > > > > BOOTx64.efi > >> > > > > > >> > > > > # umount /mnt/ > >> > > > > > >> > > > > releng/13 > >> > > > > # mount -t msdosfs /dev/ada0p4 /mnt/ > >> > > > > > >> > > > > # ls /mnt/EFI/freebsd/ > >> > > > > loader.efi > >> > > > > > >> > > > > Why the difference? When will FreeBSD (u)EFI work as expected? > >> > > > > > >> > > > > Thanks in advance for any insights! > >> > > > > > >> > > > > >> > > > Require only single efi part > >> > > > > >> > > > See > >> > > > > >> > > > >> > https://forums.freebsd.org/threads/two-freebsd-installations-and-efi= .73968/ > >> > > Thanks for they reply, and link, Andrey! > >> > > Well that confirms it. FreeBSD, unlike other OS implementations, w= ill not > >> > > permit booting your chosen "version" via EFI. > >> > > Firstly, *huge* thanks for your informative reply, Warner! > >> > It does today. If you use efibootmgr, you can boot exactly what you = want. I > >> > do it all the time... Though your BIOS may overwrite the EFI vars i= f you > >> > set too many (I'm looking at you supermicro). When you use the efi B= ootXXXX > >> > variables, it's possible to boot one of many different things on the > >> > system... Though I've not done 11, just 12 and current. > >> Well. That's the thing. I *am* on 12 && 13. Well *trying* to get into = 13. > >> When I started this whole thing, I had some 15 entries returned by > >> efibootmgr(8) -v. > >> So I trimmed the list down to the 2 my BIOS presents as UEFI: > >> Boot0015 UEFI: WDC WD1600JS-98MHB0 > >> PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0x0,0xffff,0x0)/HD(4,GPT,6688c5af-6f93= ... > >> Boot0011* UEFI: WDC WD1600JS-98MHB0 > >> PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0x0,0xffff,0x0)/HD(1,GPT,260d2df2-6a10= ... > >> another entry created when I installed releng/13: > >> Boot0014 FreeBSD (ada0p4) > >> HD(4,GPT,6688c5af-6f93-11ea-adbb-4c72b9f5e07f,0x2553028,0x82000)/File(= \EFI\free... > >> and a Windows reference (currently not installed). > >> I activated *both* Boot0015 and Boot0011: > >> efibootmgr -a 0015 0011. Output confirmed success. Bounced box, choose > >> Boot0015. Which booted > >> initial releng/12 install. Fail. OK Try something different; > >> efibootmgr -a 0014 -L FreeBSD-13. Output confirms the -L switch is bro= ken, > >> but 00114 is active. > >> Bounce box && choose 0014. Boots to initial releng/12 install. > >> Conclusion; FreeBSD EFI/ESP is not ready for prime time. :( > >> Thanks again for the reply, Warner! :) > >> --Chris > > > How loader is working is that it does search for *first* =E2=80=9Cusable= =E2=80=9D freebsd partition and will use it. Usable is defined as having /b= oot/loader.efi. > > Therefore, you may have 2 or more freebsd instances on the disk, it reall= y does not matter, only first is used. If you have multiple disks, you can = have different order on second disk. > > Why it is so? We do build loader.efi and we do copy it to the ESP, and cu= rrently there is no way to tell where is the root file system. > > How could we tell where from to load the OS? Well, there are few options = to think about: > > 1. record the hint into the loader.efi binary - this would need special i= nstaller and would break signing. > 2. record EFI variable - it should reflect OS instance version and that v= ersion should be bound with specific loader binary. Coordination is pain th= ere. > 3. record partition to loader.env file > > The current loader code is reading "/efi/freebsd/loader.env=E2=80=9D from= ESP. IMO this sounds most promising, but would need support from installer= or manual setup. Would work as is with multiple ESP instances. Would need = versioned /efi/freebsdXX directories for single shared ESP and installer up= date. > > 4. We still do have BE menu in loader, populated automatically from zfs s= napshots. It can be complemented with entries from file based index (I wrot= e about that idea already). This would allow to create simple switch to dif= ferent instance or initiate chain load of third party boot loader. > With ZFS may work set bootfs on zpool