Using loader to switch kernel and root device on Pi2

bob prohaska <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <[email protected]>
An old Raspberry Pi2 v1.1 (so, armv7) has quit booting from USB when
using the "bootcode.bin" method (that file only on the MSDOS partition,
the usual layout on the USB disk). The machine gets stuck in a netboot
loop. 

However, it appears possible to boot using the microSD card, then load 
the kernel and mount the root filesystem from USB at the loader prompt:

Hit [Enter] to boot immediately, or any other key for command prompt.
Booting [/boot/kernel/kernel] in 10 seconds... 

Type '?' for a list of commands, 'help' for more detailed help.
OK lsdev
disk devices:
    disk0:    1953525168 X 512 blocks
      disk0s1: DOS/Windows
      disk0s2: FreeBSD
        disk0s2a: FreeBSD UFS
        disk0s2b: FreeBSD swap
        disk0s2d: FreeBSD UFS
    disk1:    125042688 X 512 blocks (removable)
      disk1s1: DOS/Windows
      disk1s2: FreeBSD
        disk1s2a: FreeBSD UFS
http: (unknown)
net devices:
    net0:
OK unload
OK show currdev
disk1s2a:
OK set currdev="disk0s2a"
OK show currdev
disk0s2a
OK load kernel
/boot/kernel/kernel text=0x1b4 text=0x6df178 text=0x1f9cb8 data=0xc37a8 data=0x0+0x254000 0x4+0xb1af0+0x4+0x134365|
OK set vfs.root.mountfrom="ufs:/dev/da0s2a"
OK boot -s
Using DTB provided by EFI at 0x39f23000.
Kernel entry at 0x33e00200...
Kernel args: -s
.....

The machine comes up with kernel and root from the USB disk, as desired.

It appears that the 
currdev="disk0s2a"
and 
vfs.root.mountfrom="ufs:/dev/da0s2a"

could be placed in /boot/loader.conf,
but where would the unload and load
commands go? Without them the machine
is stuck with the microSD's kernel.


Thanks for reading,

bob prohaska
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.