How to build working images for RPI
Karl Denninger
karl at denninger.net
Sun Dec 1 22:47:34 UTC 2019
On 12/1/2019 16:35, Mike Karels wrote:
> (Sorry, I'm using a UTF-8-challenged mailer at the moment...)
>
> Jose wrote:
>> Hi,
>> images built with crochet are not working (no boot,
>> no nothing) on RPI but images downloaded from
>> https://download.freebsd.org/ftp/snapshots/arm/armv6/ISO-IMAGES do
>> How do they build the downloadable images?
>> The wiki
>> https://wiki.freebsd.org/arm/Raspberry%20Pi
>> states that you can build your own images with crochet
>> but it does not state how THEY build the working images
>> that are on the FTP site.
>> I notice that the images built with crochet are VERY different
>> from the ones you download, for example:
>> md0 has the crochet image, md1 the downloaded one
>> crochet # gpart show md0
>> => 1 5859374 md0 MBR (2.8G)
>> 1 62 - free - (31K)
>> 63 34776 1 fat32lba [active] (17M)
>> 34839 1001 - free - (501K)
>> 35840 5823488 2 freebsd (2.8G)
>> 5859328 47 - free - (24K)
>> crochet # gpart show md1
>> => 63 6291393 md1 MBR (3.0G)
>> 63 1008 - free - (504K)
>> 1071 102312 1 fat32lba [active] (50M)
>> 103383 6188049 2 freebsd (3.0G)
>> 6291432 24 - free - (12K)
>> rochet # ll /mnt/md0/boot/msdos/
>> total 2448
>> -rwxr-xr-x 1 root wheel 765 Nov 23 15:53 README*
>> -rwxr-xr-x 1 root wheel 199 Nov 23 15:53 boot.scr*
>> -rwxr-xr-x 1 root wheel 75 Nov 23 15:53 config.txt*
>> -rwxr-xr-x 1 root wheel 37 Nov 23 15:53 metadata*
>> -rwxr-xr-x 1 root wheel 19602 Nov 23 15:53 rpi.dtb*
>> -rwxr-xr-x 1 root wheel 21186 Nov 23 15:53 rpi.dts*
>> -rwxr-xr-x 1 root wheel 465860 Nov 23 15:53 u-boot.bin*
>> -rwxr-xr-x 1 root wheel 0 Nov 23 15:53 uEnv.txt*
>> -rwxr-xr-x 1 root wheel 1586895 Nov 23 15:53 ubldr*
>> -rwxr-xr-x 1 root wheel 386184 Nov 23 15:53 ubldr.bin*
>> crochet # ll /mnt/md1/boot/msdos/
>> total 13460
>> drwxr-xr-x 1 root wheel 4096 Nov 21 04:55 EFI/
>> -rwxr-xr-x 1 root wheel 23315 Nov 12 2018 bcm2708-rpi-0-w.dtb*
>> -rwxr-xr-x 1 root wheel 23071 Nov 12 2018 bcm2708-rpi-b-plus.dtb*
>> -rwxr-xr-x 1 root wheel 22812 Nov 12 2018 bcm2708-rpi-b.dtb*
>> -rwxr-xr-x 1 root wheel 22589 Nov 12 2018 bcm2708-rpi-cm.dtb*
>> -rwxr-xr-x 1 root wheel 52116 Nov 12 2018 bootcode.bin*
>> -rwxr-xr-x 1 root wheel 89 Nov 21 03:11 config.txt*
>> drwxr-xr-x 1 root wheel 4096 Nov 21 04:55 dtb/
>> -rwxr-xr-x 1 root wheel 6666 Nov 12 2018 fixup.dat*
>> -rwxr-xr-x 1 root wheel 2621 Nov 12 2018 fixup_cd.dat*
>> -rwxr-xr-x 1 root wheel 9895 Nov 12 2018 fixup_db.dat*
>> -rwxr-xr-x 1 root wheel 9895 Nov 12 2018 fixup_x.dat*
>> drwxr-xr-x 1 root wheel 4096 Nov 21 04:55 overlays/
>> -rwxr-xr-x 1 root wheel 2857060 Nov 12 2018 start.elf*
>> -rwxr-xr-x 1 root wheel 678532 Nov 12 2018 start_cd.elf*
>> -rwxr-xr-x 1 root wheel 5120484 Nov 12 2018 start_db.elf*
>> -rwxr-xr-x 1 root wheel 4057956 Nov 12 2018 start_x.elf*
>> -rwxr-xr-x 1 root wheel 465868 Nov 21 03:06 u-boot.bin*
>> -r-xr-xr-x 1 root wheel 386408 Nov 21 04:48 ubldr.bin*
>> crochet # cat /mnt/md0/boot/msdos/config.txt
>> gpu_mem=32
>> device_tree=rpi.dtb
>> device_tree_address=0x100
>> kernel=u-boot.bin
>> crochet # cat /mnt/md1/boot/msdos/config.txt
>> init_uart_clock=3000000
>> enable_uart=1
>> kernel=u-boot.bin
>> kernel7=u-boot.bin
>> dtoverlay=mmc
>> I had to patch crochet to have the image built, but that's another
>> story.
>> Can anyone point me on how to build working images
>> for RPI?
> I'm not an expert, having done this for the first time yesterday, but
> the short answer is like this:
>
> cd ^/release/; ./release.sh -c arm64/RPI3.conf
>
> Note that this will build a complete chroot for the build system, including
> ports, with sources that it checks out, and then builds the target system.
> The chroot is built in /scratch. I built from head on amd64.
>
> Mike
> _______________________________________________
Depends on what you want.
Crochet builds a system that runs read-only off the SD card, leveraging
the "diskless" paradigm to pretend it's an NFS-mounted, tftp/bootp
loaded client. Except it isn't; the writeable bits are on a ramdisk.
This makes the resulting system exceptionally fault-tolerant but does
require that configuration changes and the like be "noticed" back (there
are tools in the root directory to copy them back)
If you want a "traditional" system then the above is how you build it.
But be aware that on the Pi specifically the SD controller is
usb-attached and slow.
I use Crochet all the time to build Pi-specific images and while there
have been small changes required from time to time it works fine for
12.x images at present. I have not (yet) tried building one with -HEAD.
--
Karl Denninger
karl at denninger.net <mailto:karl at denninger.net>
/The Market Ticker/
/[S/MIME encrypted email preferred]/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4897 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20191201/fa765de9/attachment.bin>
More information about the freebsd-arm
mailing list