From owner-freebsd-arm@freebsd.org Sat Dec 16 03:18:44 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 7C1A1E99456 for ; Sat, 16 Dec 2017 03:18:44 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-152.reflexion.net [208.70.210.152]) (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 3A6D173E92 for ; Sat, 16 Dec 2017 03:18:43 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 12448 invoked from network); 16 Dec 2017 03:11:57 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 16 Dec 2017 03:11:57 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Fri, 15 Dec 2017 22:11:57 -0500 (EST) Received: (qmail 5780 invoked from network); 16 Dec 2017 03:11:57 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 16 Dec 2017 03:11:57 -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 E28FCEC7848 for ; Fri, 15 Dec 2017 19:11:56 -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: Re: Fairly minimal sdcard content for booting kernel and world on an RPI2 V1.1 from a USB SSD instead of from the sdcard Date: Fri, 15 Dec 2017 19:11:56 -0800 References: <96279C4C-C713-48E1-AD5F-178852C04B45@dsl-only.net> To: Freebsd-arm In-Reply-To: <96279C4C-C713-48E1-AD5F-178852C04B45@dsl-only.net> Message-Id: <72C5DCE8-2B63-4F23-94B4-5C74E47CF89C@dsl-only.net> 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: Sat, 16 Dec 2017 03:18:44 -0000 [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 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