From owner-freebsd-arm@freebsd.org Sat Jul 11 20:39:35 2015 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 C44559970F3 for ; Sat, 11 Jul 2015 20:39:35 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (kientzle.com [142.254.26.11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96F82CA for ; Sat, 11 Jul 2015 20:39:34 +0000 (UTC) (envelope-from tim@kientzle.com) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id t6BKZ6cJ080731; Sat, 11 Jul 2015 20:35:06 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.100] (192.168.1.101 [192.168.1.101]) by kientzle.com with SMTP id n2vktjj4xj7c79idfwcbzyqjyw; Sat, 11 Jul 2015 20:35:06 +0000 (UTC) (envelope-from tim@kientzle.com) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: How to Xbuild to BBB? From: Tim Kientzle In-Reply-To: <1436542993.46776.YahooMailBasic@web120803.mail.ne1.yahoo.com> Date: Sat, 11 Jul 2015 13:34:51 -0700 Cc: freebsd-arm Content-Transfer-Encoding: quoted-printable Message-Id: <19291C97-5A51-42D2-AC08-6B067AB8D2BD@kientzle.com> References: <1436542993.46776.YahooMailBasic@web120803.mail.ne1.yahoo.com> To: Leonardo Fogel X-Mailer: Apple Mail (2.2102) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jul 2015 20:39:36 -0000 > I'd also tried different instructions that Google had suggested. = They'd all failed too. Please, could you kindly point me to right = instructions on how to cross-build to BBB? =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 1. If you just want a working system, start with the official snapshot = images which can just be copied onto an SD card and booted: ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/arm/armv6/ISO-IMAGES/11.0 ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/arm/armv6/ISO-IMAGES/10.0 After you=E2=80=99ve booted from there, you can do a native upgrade from = source using the same instructions as for i386 or any other FreeBSD = platform. (This requires some patience: native source upgrades on BBB = take about 40 hours.) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 2. If you want to build a semi-custom image, you might look at Crochet: https://github.com/freebsd/crochet =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 3. If you really want the thrill of doing it yourself from scratch, = here=E2=80=99s the outline. (This is based on how Crochet does it; = there are many variations.) Note that the hard part here is getting the = boot bits (U-Boot and ubldr) right. Actually cross-building FreeBSD and = installing it on the SD card is quite straightforward. Caveat: It is *essential* that you have a working serial console cable = such as Adafruit 954. Without this, it is practically impossible to = diagnose boot problems. 1) Cross-build the system and kernel: $ cd /usr/src $ make TARGET=3Darm TARGET_ARCH=3Darmv6 buildworld $ make TARGET=3Darm TARGET_ARCH=3Darmv6 KERNCONF=3DBEAGLEBONE = buildkernel 2) Get a suitable version of U-Boot. The easiest way to do this is from = ports: sysutils/u-boot-beaglebone (Building U-Boot from source is more complicated; you=E2=80=99ll have to = set up a suitable cross-compiler and track down the necessary patches.) 3) Build a suitable ubldr $ cd /usr/src $ make TARGET=3Darm TARGET_ARCH=3Darmv6 buildenv # Above command starts a new shell with the appropriate ARM build = environment $ cd sys/boot $ make UBLDR_LOADADDR=3D0x88000000 -m /usr/src/share/mk all $ exit 4) Format your SD card appropriately with MBR, a 2-megabyte FAT = partition, and the rest as UFS. Mount it as /mnt. 5) Here is a somewhat outdated description of the BeagleBone boot file = layout that you can use to populate the FAT partition (note that the old = BeagleBone and the new BBB work the same way): https://wiki.freebsd.org/FreeBSD/arm/BeagleBone If you=E2=80=99re using the U-Boot port, just copy all of the files from = /usr/local/share/u-boot/u-boot-beaglebone onto the FAT partition to = start. The Wiki page is outdated in the sense that: * The =E2=80=98BB=E2=80=99 prefix on ubldr, uboot.img and uEnv.txt is = the old Crochet convention; if you=E2=80=99re using U-Boot from ports, = omit that. * The new convention is to put the DTB on the UFS partition, though I = don=E2=80=99t recall the exact layout offhand. (Hopefully someone knowledgable will update that page with more current = information.) 6) install FreeBSD onto the SD card UFS partition (be *very* certain = that you get the DESTDIR argument right here!). $ cd /usr/src $ make TARGET=3Darm TARGET_ARCH=3Darmv6 DESTDIR=3D/mnt installworld $ make TARGET=3Darm TARGET_ARCH=3Darmv6 DESTDIR=3D/mnt distrib-dirs $ make TARGET=3Darm TARGET_ARCH=3Darmv6 DESTDIR=3D/mnt distribution $ make TARGET=3Darm TARGET_ARCH=3Darmv6 DESTDIR=3D/mnt installkernel $ echo =E2=80=9CKERNCONF=3DBEAGLEBONE=E2=80=9D > /mnt/etc/src.conf $ touch /mnt/firstboot 7) Customize the UFS setup as you wish. This might include tweaking = rc.conf or changing any other configuration settings of interest.