Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Mar 2020 12:52:24 -0600 (MDT)
From:      Ross Alexander <rwa@athabascau.ca>
To:        bob prohaska <fbsd@www.zefox.net>
Cc:        Mark Millard <marklmi@yahoo.com>, freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: freebsd-arm Digest, Vol 724, Issue 3 (Answer: sysutils/u-boot-rpi3 and sysutils/u-boot-rpi4 have been updated)
Message-ID:  <alpine.BSF.2.22.395.2003171223490.54114@autopsy.pc.athabascau.ca>
In-Reply-To: <20200317173515.GA65926@www.zefox.net>
References:  <mailman.67.1584273601.57537.freebsd-arm@freebsd.org> <alpine.BSF.2.22.395.2003161327310.93374@autopsy.pc.athabascau.ca> <4DB90158-B77E-4D65-8E94-B6941D7D76DE@yahoo.com> <20200317173515.GA65926@www.zefox.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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=3D"3"
     umodem_load=3D"YES"

     # Disable the beastie menu and color                                  =
                               #
     beastie_disable=3D"YES"
     loader_color=3D"NO"

     # there's bitching about efi being only available console,
     # but this works anyhow.
     #
     console=3D"comconsole"
     comconsole_speed=3D"115200"
     boot_serial=3D"YES"

     # after kernel load, mount hierarchy from SSD
     #
     geom_label_load=3D"YES"                   # File system labels (see gl=
abel(8))
     vfs.root.mountfrom=3D"ufs:/dev/gpt/root1"

That last line is the key.  The gpart info for the SSD is

     rpi3:/root # gpart show -l da0
     =3D>       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

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
Ross Alexander, (780) 675-6823 desk / (780) 689-0749 cell, rwa@athabascau.c=
a
                         54.71593 N 113.30835 W

--
This communication is intended for the use of the recipient to whom it is a=
ddressed, and may contain confidential, personal, and or privileged informa=
tion. Please contact us immediately if you are not the intended recipient o=
f this communication, and do not copy, distribute, or take action relying o=
n it. Any communications received in error, or subsequent reply, should be =
deleted or destroyed.
---



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.22.395.2003171223490.54114>