From owner-freebsd-arm@freebsd.org Fri Dec 15 09:21:17 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13666EA09E3 for ; Fri, 15 Dec 2017 09:21:17 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-97.reflexion.net [208.70.210.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C79086E5BC for ; Fri, 15 Dec 2017 09:21:16 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 16041 invoked from network); 15 Dec 2017 09:21:09 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 15 Dec 2017 09:21:09 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Fri, 15 Dec 2017 04:21:09 -0500 (EST) Received: (qmail 12713 invoked from network); 15 Dec 2017 09:21:09 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 15 Dec 2017 09:21:09 -0000 Received: from [192.168.1.25] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 68101EC9380 for ; Fri, 15 Dec 2017 01:21:08 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: 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: <96279C4C-C713-48E1-AD5F-178852C04B45@dsl-only.net> Date: Fri, 15 Dec 2017 01:21:07 -0800 To: Freebsd-arm X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Dec 2017 09:21:17 -0000 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). =46rom gpart show (sdcard plugged in someplace else via USB): =3D> 63 62521281 da4 MBR (30G) 63 102375 da4s1 !12 [active] (50M) 102438 56623098 da4s2 freebsd (27G) 56725536 5795808 - free - (2.8G) =3D> 0 56623098 da4s2 BSD (27G) 0 90 - free - (45K) 90 56623008 da4s2a freebsd-ufs (27G) (I did not bother to shrink the ufs partition on s2a or s2 itself. But little space is needed.) For /media being where I mounted s1 in order to show it: # 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 So. . . Ports based: sysutils/rpi-firmware content sysutils/u-boot-rpi2 content installworld copy based: boot/ubldr.bin copy # 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 (I do not repeat the port instructions here.) For /mnt being where I mounted s2a in order to show it: # 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 (I'll not list all the dtb files in the dtb directory.) # df -m /mnt Filesystem 1M-blocks Used Avail Capacity Mounted on /dev/da4s2a 26763 5 24617 0% /mnt (So not much space needed.) # more /mnt/etc/fstab /dev/da0p1 / ufs rw,noatime 1 1 /dev/da0p2 none swap sw 0 0 fstab used notation for the root file system that ubldr.bin could interpret on its own. 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. As for populating boot/ above: Having done an installkernel and installworld locally in order to copy selectively to the sdcard's s2a UFS partition: # 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 Copy (my paths are just examples): cp -ax /usr/obj/DESTDIRs/clang-armv7-installworld/boot /mnt/ cp -ax /usr/obj/DESTDIRs/clang-armv7-installkernel/boot/dtb /mnt/boot/ (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.) [For UFS the mounts presume endian matching, here little endian.] [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