Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Dec 2017 19:11:56 -0800
From:      Mark Millard <markmi@dsl-only.net>
To:        Freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: Fairly minimal sdcard content for booting kernel and world on an RPI2 V1.1 from a USB SSD instead of from the sdcard
Message-ID:  <72C5DCE8-2B63-4F23-94B4-5C74E47CF89C@dsl-only.net>
In-Reply-To: <96279C4C-C713-48E1-AD5F-178852C04B45@dsl-only.net>
References:  <96279C4C-C713-48E1-AD5F-178852C04B45@dsl-only.net>

next in thread | previous in thread | raw e-mail | index | archive | help
[The sdcard does not need the *.dtb files
in the UFS file system's boot/dtb/ .]

On 2017-Dec-15, at 1:21 AM, Mark Millard <markmi@dsl-only.net> wrote:

> For the following the sdcard can be removed
> after the kernel starts to load from the
> USB drive (in my context a USB SSD stick).
>=20
> =46rom gpart show (sdcard plugged in someplace
> else via USB):
>=20
> =3D>      63  62521281    da4  MBR  (30G)
>        63    102375  da4s1  !12  [active]  (50M)
>    102438  56623098  da4s2  freebsd  (27G)
>  56725536   5795808         - free -  (2.8G)
>=20
> =3D>       0  56623098   da4s2  BSD  (27G)
>         0        90          - free -  (45K)
>        90  56623008  da4s2a  freebsd-ufs  (27G)
>=20
> (I did not bother to shrink the ufs partition on s2a
> or s2 itself. But little space is needed.)
>=20
> For /media being where I mounted s1
> in order to show it:
>=20
> # du -Asm /media/*
> 1       /media/BOOTCODE.BIN
> 1       /media/CONFIG.TXT
> 1       /media/FIXUP.DAT
> 1       /media/FIXUP_CD.DAT
> 1       /media/FIXUP_X.DAT
> 1       /media/LICENCE.broadcom
> 1       /media/README
> 3       /media/START.ELF
> 1       /media/START_CD.ELF
> 4       /media/START_X.ELF
> 1       /media/U-BOOT.BIN
> 1       /media/fixup_db.dat
> 5       /media/start_db.elf
> 1       /media/ubldr.bin
>=20
> So. . .
> Ports based:
> sysutils/rpi-firmware content
> sysutils/u-boot-rpi2 content
>=20
> installworld copy based:
> boot/ubldr.bin copy
>=20
> # du -Asm /usr/local/share/rpi-firmware =
/usr/local/share/u-boot/u-boot-rpi2
> 12      /usr/local/share/rpi-firmware
> 1       /usr/local/share/u-boot/u-boot-rpi2
>=20
> (I do not repeat the port instructions here.)
>=20
> For /mnt being where I mounted s2a
> in order to show it:
>=20
> # du -Asm /mnt/*/*
> 1       /mnt/boot/beastie.4th
> 1       /mnt/boot/boot1.efi
> 1       /mnt/boot/boot1.efifat
> 1       /mnt/boot/brand-fbsd.4th
> 1       /mnt/boot/brand.4th
> 1       /mnt/boot/check-password.4th
> 1       /mnt/boot/color.4th
> 1       /mnt/boot/defaults
> 1       /mnt/boot/delay.4th
> 3       /mnt/boot/dtb
> 1       /mnt/boot/efi.4th
> 1       /mnt/boot/entropy
> 1       /mnt/boot/firmware
> 1       /mnt/boot/frames.4th
> 1       /mnt/boot/loader.4th
> 1       /mnt/boot/loader.conf
> 1       /mnt/boot/loader.efi
> 1       /mnt/boot/loader.help
> 1       /mnt/boot/loader.rc
> 1       /mnt/boot/logo-beastie.4th
> 1       /mnt/boot/logo-beastiebw.4th
> 1       /mnt/boot/logo-fbsdbw.4th
> 1       /mnt/boot/logo-orb.4th
> 1       /mnt/boot/logo-orbbw.4th
> 1       /mnt/boot/menu-commands.4th
> 1       /mnt/boot/menu.4th
> 1       /mnt/boot/menu.rc
> 1       /mnt/boot/menu.rc.sample
> 1       /mnt/boot/menusets.4th
> 1       /mnt/boot/modules
> 1       /mnt/boot/msdos
> 1       /mnt/boot/pcibios.4th
> 1       /mnt/boot/screen.4th
> 1       /mnt/boot/shortcuts.4th
> 1       /mnt/boot/support.4th
> 1       /mnt/boot/ubldr
> 1       /mnt/boot/ubldr.bin
> 1       /mnt/boot/version.4th
> 1       /mnt/boot/zfs
> 1       /mnt/etc/fstab
>=20
> (I'll not list all the dtb files in the
> dtb directory.)

The dtb files are not needed.

> # df -m /mnt
> Filesystem  1M-blocks Used Avail Capacity  Mounted on
> /dev/da4s2a     26763    5 24617     0%    /mnt

So, less space used in the UFS file system:

# df -m /mnt
Filesystem  1M-blocks  Used  Avail Capacity  Mounted on
/dev/da4s2a     26763     2  24619     0%    /mnt

> (So not much space needed.)
>=20
> # more /mnt/etc/fstab
> /dev/da0p1      /               ufs     rw,noatime      1 1
> /dev/da0p2      none            swap    sw              0 0
>=20
> fstab used notation for the root file system
> that ubldr.bin could interpret on its own.
>=20
> Of course, for the /dev/da0p1 and /dev/da0p2
> notation for the USB SSD, it can be important
> that other USB drives not be plugged in yet
> or the paths needed might be different.
>=20
> As for populating boot/ above:
>=20
> Having done an installkernel and installworld locally
> in order to copy selectively to the sdcard's s2a UFS
> partition:
>=20
> # du -Asm /usr/obj/DESTDIRs/clang-armv7-installworld/boot/* =
/usr/obj/DESTDIRs/clang-armv7-installkernel/boot/dtb | more
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/beastie.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/boot1.efi
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/boot1.efifat
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/brand-fbsd.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/brand.4th
> 1       =
/usr/obj/DESTDIRs/clang-armv7-installworld/boot/check-password.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/color.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/defaults
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/delay.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/dtb
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/efi.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/firmware
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/frames.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/kernel
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/loader.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/loader.efi
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/loader.help
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/loader.rc
> 1       =
/usr/obj/DESTDIRs/clang-armv7-installworld/boot/logo-beastie.4th
> 1       =
/usr/obj/DESTDIRs/clang-armv7-installworld/boot/logo-beastiebw.4th
> 1       =
/usr/obj/DESTDIRs/clang-armv7-installworld/boot/logo-fbsdbw.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/logo-orb.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/logo-orbbw.4th
> 1       =
/usr/obj/DESTDIRs/clang-armv7-installworld/boot/menu-commands.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/menu.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/menu.rc
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/menusets.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/modules
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/pcibios.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/screen.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/shortcuts.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/support.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/ubldr
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/ubldr.bin
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/version.4th
> 1       /usr/obj/DESTDIRs/clang-armv7-installworld/boot/zfs
> 3       /usr/obj/DESTDIRs/clang-armv7-installkernel/boot/dtb

/usr/obj/DESTDIRs/clang-armv7-installkernel/boot/dtb does not
need to be copied to the sdcard's UFS file system. So, imagine
it was not listed above.

> Copy (my paths are just examples):
>=20
> cp -ax /usr/obj/DESTDIRs/clang-armv7-installworld/boot /mnt/

Only the above copy is needed, not the below one.

> cp -ax /usr/obj/DESTDIRs/clang-armv7-installkernel/boot/dtb /mnt/boot/

So, both dtb/ and kernel/ can be empty on the sdcard's
file system.

> (Updates may mean cleaning out older directory/file names.)
> (A more selective copy should be possible but gets into
> tracking potential changes in what files are required more
> carefully.)
>=20
> [For UFS the mounts presume endian matching, here little endian.]
>=20
> [In my context, the USB SSD stick is on a powered hub that is
> plugged into the RPI2-B V1.1 .]

=3D=3D=3D
Mark Millard
markmi at dsl-only.net





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?72C5DCE8-2B63-4F23-94B4-5C74E47CF89C>