Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to boot in UEFI mode: practically no documentation



On Tue, May 29, 2018 at 08:15:43AM +0000, Thomas Mueller wrote:
> Where do I find documentation on how to boot NetBSD amd64 or possibly i386 in UEFI mode?

I'm working on a wiki page (and will change the NetBSD 8.0 install docs
to point to that).

I can't answer how to boot into alternative operating systems (haven't tried
that yet). But the basic installation goes like this:

 - You want to boot from the uefi usb install image. This requires "secure
   boot" to be disabled. Some firmwares require you to set a firmware
   password before allowing to disable that

Assuming you have a scratch disk (called wd0) you want to fully use for NetBSD you
do something like:

 gpt destroy wd0
 gpt create wd0
 gpt add -a 2m -l "EFI system" -t efi -s 128m wd0
 gpt add -a 2m -l NetBSD -t ffs -s 118g wd0		# replace 118g as needed
 gpt add -a 2m -l swap -t swap wd0	# this will use all remaining space
 dkctl wd0 listwedges

Now note which dk* is the EFI one and newfs it (also note the ffs one
for later, see below):

 newfs_msdos /dev/rdk3	# replace dk3 with proper device

Then make it bootable:

 mount -t msdos /dev/dk3 /mnt
 mkdir -p /mnt/EFI/boot
 cp /usr/mdec/*.efi /mnt/EFI/boot
 umount /mnt

I have sysinst changes that will allow the remaining part to be handled
by sysinst in NetBSD 8.0 (hope to finsih that soon).

But for now you will have to install manually. Check the dkctl output
for which dk* is the ffs one and newfs/mount it:

 newfs -O 2 dk4		# replace dk4 by approrpiate device, see above
 mount -o async /dev/dk4 /mnt
 cd /mnt

Now extract (with tar xpzf) all sets you want, including the appropriate
kernel. Also:

 cp /usr/mdec/boot .	# copy secondary bootloader (XXX is this needed for uefi)?
 cd dev
 sh MAKEDEV all
 vi /etc/fstab

A fstab could look like:

NAME=NetBSD	/	ffs	rw	1 1
NAME=swap	none	swap	sw,dp	0 0
kernfs		/kern	kernfs	rw
ptyfs		/dev/pts ptyfs	rw
procfs		/proc	procfs	rw
tmpfs /var/shm	      tmpfs   rw,-m1777,-sram%25

Finally set rc_configured=YES in /mnt/etc/rc.conf, plus add hostname=
and whatever settings you need.

Now reboot, remove install usb medium, and watch NetBSD boot from uefi.

Martin


Home | Main Index | Thread Index | Old Index