Well I got tired of using crochet as a crutch and I figured out how to cross compile for Beaglebone. At first I cheated and wrote to the microSD Card, but I buckled down and figured out how to manipulate a memory disk.
Then you have an image to dd.
Code:
[Copy Source to Build Dir]
mkdir /BBB
cp -vipr /usr/src /BBB/src
mkdir /mnt1
[Setup env]
setenv BASEDIR /BBB
setenv MAKEOBJDIRPREFIX $BASEDIR/obj
setenv TARGET arm
setenv TARGET_ARCH armv6
[Move to base dir and build world and kernel]
cd $BASEDIR/src
make -j8 buildworld TARGET=arm TARGET_ARCH=armv6 UBLDR_LOADADDR=0x88000000 -DWITH_FDT __MAKE_CONF=/dev/null SRCCONF=/dev/null
make buildkernel TARGET_ARCH=armv6 KERNCONF=BEAGLEBONE
[Create image file and format memory disk]
truncate -s 1500M /BBB/bbb.img
mdconfig -f /BBB/bbb.img -u md0
gpart create -s MBR md0
gpart add -t \!12 -s 10m md0
newfs_msdos -F12 -L 'MSDOSBOOT' /dev/md0s1
gpart set -a active -i 1 md0
[Mount Fat slice and copy uboot and ubldr]
mount_msdosfs /dev/md0s1 /mnt
cp -vipr /usr/local/share/u-boot/u-boot-beaglebone/ /mnt
cp /BBB/obj/arm.armv6/BBB/src/sys/boot/arm/uboot/ubldr /mnt
cp /BBB/obj/arm.armv6/BBB/src/sys/boot/arm/uboot/ubldr.bin /mnt
umount /mnt
[Partition freebsd]
gpart add -t freebsd md0
gpart create -s BSD md0s2
gpart add -t freebsd-ufs md0s2
newfs /dev/md0s2a
#tunefs -N enable -j enable -t enable /dev/md0s2a
mount /dev/md0s2a /mnt1
[Copying world and kernel to memory disk]
make installworld TARGET_ARCH=armv6 DESTDIR=/mnt1
make distribution TARGET_ARCH=armv6 DESTDIR=/mnt1
make installkernel TARGET_ARCH=armv6 KERNCONF=BEAGLEBONE DESTDIR=/mnt1
[Install Setup]
touch /mnt1/firstboot
mkdir /mnt1/boot/msdos
[Create an /etc/fstab for mounts]
ee /mnt1/etc/fstab
# Custom /etc/fstab for FreeBSD embedded images
/dev/mmcsd0s1 /boot/msdos msdosfs rw,noatime 0 0
/dev/mmcsd0s2a / ufs rw,noatime 1 1
[Create an /etc/rc.conf]
ee /mnt1/etc/rc.conf
hostname="beaglebone"
ifconfig_DEFAULT="DHCP"
sshd_enable="YES"
sendmail_enable="NONE"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
[Make links to dtb files]
ln /mnt1/boot/dtb/beaglebone.dtb /mnt1/boot/dtb/am335x-bone.dtb
ln /mnt1/boot/dtb/beaglebone-black.dtb /mnt1/boot/dtb/am335x-boneblack.dtb
[Complete setup by unmounting and shut down memory disk]
umount /mnt1
mdconfig -d -u0
Last edited: