Re: loader.efi of 13.1

From: Tomoaki AOKI <junchoon_at_dec.sakura.ne.jp>
Date: Wed, 31 Aug 2022 13:46:21 UTC
@



On Wed, 31 Aug 2022 14:39:02 +0900
masa@amogha.jp () wrote:

> @ 
> 
>  FreeBSD13.1
> loader.efi 
> 
> 
> 
> 
> FreeBSD 13.1  loader.efi 
>   13.1(amd, zfs on
>   UEFI) boot
>   
> 
> 
> 
> 1. FreeBSD-13.1-RELEASE-amd64-dvd1.iso dd  USB 
>   (/dev/da0)
>   USB (/dev/da1) FreeBSD13.1amdzfs 
>   
> 
> # gpart show da1
> =>      40  78140080  da1  GPT  (37G)
>         40    532480    1  efi  (260M)
>     532520      1024    2  freebsd-boot  (512K)
>     533544       984       - free -  (492K)
>     534528   4194304    3  freebsd-swap  (2.0G)
>    4728832  73410560    4  freebsd-zfs  (35G)
>   78139392       728       - free -  (364K)
> 
>  USB 
> 
> 
> 2.  
>   /dev/da0 
> 
> 3. (ada0, gpt)(
>   ada0p13) type freebsd-zfs da0p4zroot
> 
>   zpool create NEWPOOLNAME ada0p13
>   zfs send -R zroot@SNAPSHOT | zfs recv -F NEWPOOLNAME
> 
> 4. (ada0boot)
>   zpool set bootfs=NEWPOOLNAME/ROOT/default NEWPOOLNAME
>   () ada0  efi ( ada0p4)
>     EFI/Boot/bootx64.efi 
>   /boot/loader.efi  ada0  efi 
>     EFI/Boot/bootx64.efi 
>   zpool export NEWPOOLNAME
>   halt -p
> 
> 

zpool create
zpool.cache



zpool create -o cachefile=/tmp/zpool.cache NEWPOOLNAME /dev/ada0p13

poolexport/tmp/zpool.cacheNEWPOOL/etc/zfs


zpool create -R /mnt NEWPOOL /dev/ada0p13

NEWPOOL/mnt/

zfs sendzfs recv
zpool.cache/tmp


da0zpool.cache
da0

> 
> Consoles: EFI console
>     Reading loader vars from /efi/freebsd/loadef.env
> Setting currdev disk0p4:
> FreeBSD/amd64 EFI loader, Revision 1.1
> 
>    Command line arguments:
>    Image base: 0xd0998000
>    EFI version: 2.31
> 
> 
> 
> ERROR: cannot open /boot/lua/loader.lua: no such file or directory.
> 
> Type '?' for a list of commands,'help' for more detailed help.
> OK
> 
> 
> 
> OK lsdev
> 
>  ada0p12( FreeBSD zfs)  ada0p13(
> FreeBSD13.1 zfs)  zfs  zfs devices 
>  Google 
> 
> 	https://www.ish.org/blog/?p=968
> 
>  
> 
> OK set currdev=zfs:NEWPOOLNAME/ROOT/default:
> OK unload
> OK boot
> 
> 
> 
> 
> mountroot> 
> 
>  mountroot> 
>  mount 
> 
> Loader variables:
>   vfs.root.mountfrom=zfs:NEWPOOLNAME/default
> 
> (:)
> 
> mountroot> zfs:NEWPOOLNAME/ROOT/default:
> 
> 

:
vfs.root.mountfromzfs:NEWPOOLNAME/default
mountroot> 
:

ada0p12Root on ZFS
boot1.efiloader.efi

ada0




Bug 207940 [1]boot1.efi

ada0p12


NEWPOOLNAME/boot/loader.efi
vfs.root.mountfrom="zfs:NEWPOOLNAME/ROOT/default"
/



13.1boot1.efi
1.
/boot/loader.efiZFS
2./boot/loader.efi
UFS
3.UEFI
1.2.
4.
loader.efi
loader.efi



ada0p12/boot/loader.efi

/boot/lua/loader.lua
...releng/12.0loader.lua...
/
[2]

ada0p12
ada0p12/boot/loader.efi
loader.efibootfs



[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207940

[2] https://cgit.freebsd.org/src/tree/stand/lua/loader.lua?h=releng/12.0


> 
>  OK  ish.org 
> 
>   free-module-options
> 
>   start
> 
>  unknown command 12.x  13.1  loader.efi 
> 
> 
> 
> 
> --------
>    
>  masa@amogha.jp
> 


-- 
   [Tomoaki AOKI]    <junchoon@dec.sakura.ne.jp>