freebsd-arm Digest, Vol 724, Issue 3 (Answer: sysutils/u-boot-rpi3 and sysutils/u-boot-rpi4 have been updated)
Ross Alexander
rwa at athabascau.ca
Tue Mar 17 18:52:30 UTC 2020
On Tue, 17 Mar 2020, bob prohaska wrote:
> It looks like sysutils/u-boot-rpi3 builds and installs without
> error on a Pi3 reporting
> root at www:/boot/uboot # uname -KU
> 1300045 1300045
>
> with /usr/ports at Revision: 528581
>
> However, the make install clearly didn't touch /boot/msdos and
> I couldn't find any obvious instructions on what has to be done
> by hand (ISTR some brief directions from make install previously).
> Make install claims to build man pages, but man can't find them.
>
> In /usr/ports/sysutils/u-boot-rpi3/work/u-boot-2019.10 are found,
> among many other things, a series of files:
>
> -rwxr-xr-x 1 root wheel 4794232 Mar 17 10:07 u-boot
> -rwxr-xr-x 1 root wheel 500440 Mar 17 10:07 u-boot-nodtb.bin
> -rwxr-xr-x 1 root wheel 500440 Mar 17 10:07 u-boot.bin
> -rw-r--r-- 1 root wheel 9167 Mar 17 09:58 u-boot.cfg
> -rw-r--r-- 1 root wheel 5605 Mar 17 10:07 u-boot.cfg.configs
> -rw-r--r-- 1 root wheel 1348 Mar 17 09:59 u-boot.lds
> -rw-r--r-- 1 root wheel 480139 Mar 17 10:07 u-boot.map
> -rwxr-xr-x 1 root wheel 1438904 Mar 17 10:07 u-boot.srec
> -rw-r--r-- 1 root wheel 195715 Mar 17 10:07 u-boot.sym
I took the snapshot .img mentioned in my previous post, dd'd it to
an SD card, mounted the msdos partition on an x86 CURRENT workstation
and hand-copied in my tweaked
/usr/local/share/u-boot/u-boot-rpi3/u-boot.bin
over the snapshot's version. Then I booted from that.
All the cpus were correctly recognized.
Now, SD cards are slow and sectors rot out fast, so I have settled on
using a USB SSD (with it's own power; I use some random toaster gadget
and a Samsung 860 evo 250GB, it's at /dev/da0) as a system disk, and
the SD disk is only for booting.
So on the UFS partition of the SD card, I hacked /boot/loader.conf as
thus:
# Configure USB OTG; see usb_template(4).
hw.usb.template="3"
umodem_load="YES"
# Disable the beastie menu and color #
beastie_disable="YES"
loader_color="NO"
# there's bitching about efi being only available console,
# but this works anyhow.
#
console="comconsole"
comconsole_speed="115200"
boot_serial="YES"
# after kernel load, mount hierarchy from SSD
#
geom_label_load="YES" # File system labels (see glabel(8))
vfs.root.mountfrom="ufs:/dev/gpt/root1"
That last line is the key. The gpart info for the SSD is
rpi3:/root # gpart show -l da0
=> 40 488397088 da0 GPT (233G)
40 1024 1 (null) (512K)
1064 216 - free - (108K)
1280 8388608 2 root1 (4.0G)
8389888 8388608 3 swap1 (4.0G)
16778496 67108864 4 usr1 (32G)
83887360 67108864 5 local1 (32G)
150996224 67108864 6 obj1 (32G)
218105088 67108864 7 ports1 (32G)
285213952 33554432 8 src1 (16G)
318768384 8388608 9 u01 (4.0G)
327156992 8388608 10 var1 (4.0G)
335545600 2097152 11 tmp (1.0G)
337642752 150754376 - free - (72G)
and after booting, I end up with:
rpi3:/root # df
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/gpt/root1 4053308 1210732 2518312 32% /
devfs 1 1 0 100% /dev
/dev/gpt/tmp 1015324 30676 903424 3% /tmp
/dev/mmcsd0s1 51096 15068 36028 29% /boot/efi
/dev/mmcsd0s2a 14652572 1139332 12341036 8% /boot/ufs
/dev/gpt/var1 4053308 746568 2982476 20% /var
/dev/gpt/usr1 32487548 3471896 26416652 12% /usr
/dev/gpt/local1 32487548 1609928 28278620 5% /usr/local
/dev/gpt/obj1 32487548 13357716 16530832 45% /usr/obj
/dev/gpt/ports1 32487548 1017648 28870900 3% /usr/ports
/dev/gpt/src1 16233660 3168536 11766432 21% /usr/src
/dev/gpt/u01 4053308 13732 3715312 0% /u0
Notice that /boot/efi is the SD msdos filesys and /boot/ufs is
the SD card ufs filesys. When you
cd /usr/src ; make kernel ; make installkernel
you also need to clone the new /boot/kernel into /boot/ufs/boot/kernel.
That's the only tricky part, I've turned it into a script FWTW. I've
also set the swap partition to be /dev/gpt/swap1 - swap loads don't do
SD cards any good, and the poor things are slow.
The reason I forward this along is that while I don't know what
toolset(s) and/or pointyhat wizardry is involved in building the
snapshot SD msdos parition - yet - this way gives a bootable, working
system that can rebuild itself. Hope that helps, or at least gives
some clues.
If everyone else already knew this, please accept my apologies.
regards,
Ross
============================================================================
Ross Alexander, (780) 675-6823 desk / (780) 689-0749 cell, rwa at athabascau.ca
54.71593 N 113.30835 W
--
This communication is intended for the use of the recipient to whom it is addressed, and may contain confidential, personal, and or privileged information. Please contact us immediately if you are not the intended recipient of this communication, and do not copy, distribute, or take action relying on it. Any communications received in error, or subsequent reply, should be deleted or destroyed.
---
More information about the freebsd-arm
mailing list