[Bug 207940] stand/efi/boot1: Add boot partition selection

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 07 Dec 2023 13:29:47 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207940

--- Comment #47 from Nicolas <nicolas@deffayet.com> ---
I don't understand why the partition menu display using boot1.efifat (so
FreeBSD 12 way) but not using boot1.efi + manual partition setup (so FreeBSD 13
and newer way).

Since FreeBSD 13.0 and newer, boot1.efifat didn't exist anymore, so I use the
following to write EFI partition of my disk:
# newfs_msdos -F 12 -L EFISYS /dev/<phydevice>p1 ;
# mount -t msdosfs /dev/<phydevice>p1 /mnt
# mkdir -p /mnt/efi/boot
# cp /boot/loader.efi /mnt/efi/boot/BOOTx64.efi
# echo "BOOTx64.efi" > /mnt/efi/boot/startup.nsh
# umount /mnt
But the partition menu is not shown.
I use the same newfs_msdos paramaters than
https://cgit.freebsd.org/src/plain/stand/efi/boot1/generate-fat.sh?h=releng/12.3
used to create boot1.efifat.

If I put /boot/boot1.efi from FreeBSD 14.0 into FreeBSD 12.3 system, the
partition menu is shown.

If I create manually a boot1.efifat on FreeBSD 14.0 (using FreeBSD 12 method
from
https://cgit.freebsd.org/src/plain/stand/efi/boot1/generate-fat.sh?h=releng/12.3
& https://cgit.freebsd.org/src/tree/stand/efi/boot1/Makefile?h=releng/12.3),
partition menu works.

mkdir /temp/boot1
cd /temp/boot1
dd if=/dev/zero of=fat-x64.tmpl bs=512 count=1600
mdconfig -a -f fat-x64.tmpl
newfs_msdos -F 12 -L EFISYS md0
mkdir stub
mount -t msdosfs /dev/md0 stub
mkdir -p stub/efi/boot
echo 'Boot1 START' | dd of=stub/efi/boot/BOOTx64.efi cbs=384k count=1
conv=block
echo BOOTx64.efi > stub/efi/boot/startup.nsh
umount stub
mdconfig -d -u md0
rmdir stub
xz -f fat-x64.tmpl
xz -d -c fat-x64.tmpl.xz > boot1.efifat
dd if=/boot/boot1.efi of=boot1.efifat seek=0x2d conv=notrunc
cp boot1.efifat /boot/boot1.efifat
dd if=/boot/boot1.efifat of=/dev/<phydevice>p1 ;

Did you know how get the partition menu working on FreeBSD 14.0 without using
boot1.efifat ?

-- 
You are receiving this mail because:
You are on the CC list for the bug.