Install FreeBSD 10.1 On DreamPlug

U-Boot MultiBoot

This setup will allow you to boot off usb/esata/external-sd/internal-sd. 
It will auto test all 4 in order of sdd >> sdc >> sdb >> sda

currently when it hits the go 0x00900000 it will hang.

This is due to the fact go is a cmd statement telling it to load a specific Memory segment.

We are working to get ukernels working. so then the multi boot for uboot will work correctly.

Enter the following lines to enable multiboot:


Clear existing settings
setenv bootargs
setenv bootcmd
setenv x_bootcmd_usb
setenv x_bootcmd_kernel
setenv x_bootcmd_ethernet

Now Set new values: sda = internal linux sd / da0 = internal Freebsd
                    da1 = external FreeBSD sd
                    da2 = 1st external FreeBSD usb drive or esata
                    da3 = 1st external Freebsd usb drive or esata if drive da2 is plugged into usb

setenv bootdelay 3
setenv bootcmd_eth 'setenv ethact egiga0; ${x_b_e}; setenv ethact egiga1; ${x_b_e};'
setenv ethact egiga0
setenv clr_k 'echo Purging kernel; mw 0x6400000 0x0 0x300000'
setenv x_b_e ping ip.of.your.router
setenv x_b_u usb start
setenv x_b 'console=ttyS0,115200'
setenv x_ba 'root=/dev/sda2 panic=10 rootwait'
setenv x_bb 'root=/dev/da1s2 panic=10 rootwait'
setenv x_bc 'root=/dev/da2s2 panic=10 rootwait'
setenv x_bd 'root=/dev/da3s2 panic=10 rootwait'
setenv x_fa 'ex2load usb 0 0x6400000 uImage'
setenv x_fb 'fatload usb 1 0x00900000 kernel.bin'
setenv x_fc 'fatload usb 2 0x64000000 ukernel'
setenv x_fd 'fatload usb 3 0x64000000 ukernel'
setenv x_bma 'bootm 0x6400000'
setenv x_bmb 'go 0x00900000'
setenv x_bmc 'bootm 0x6400000'
setenv x_bmd 'bootm 0x6400000'
setenv boot_sda 'echo ** sda/usb/intsd 0 **; ${x_b_u}; setenv bootargs ${x_b} ${x_ba}; ${x_fa}; ${x_bma};'
setenv boot_sdb 'echo ** sdb/usb/extsd 1 **; ${x_b_u}; setenv bootargs ${x_b} ${x_bb}; ${x_fb}; ${x_bmb};'
setenv boot_sdc 'echo ** sdc/usb/eSata 2 **; ${x_b_u}; setenv bootargs ${x_b} ${x_bc}; ${x_fc}; ${x_bmc};'
setenv boot_sdd 'echo ** sdd/usb/eSata 3 **; ${x_b_u}; setenv bootargs ${x_b} ${x_bd}; ${x_fd}; ${x_bmd};'
setenv bootcmd 'run clr_k; run boot_sdd; run boot_sdb; run boot_sdc; run boot_sda'
saveenv
 

Build Script for 10.1-RELEASE:

 

#
#Version : 9
#date Julu 9, 2012
#writen By RNeese ([email protected])
#

set -eu                                 # reports errors in the script

###### Edit only these lines ######
DEVICE_NAME="dreamplug"                 # Device base name
DEVICE_ARCH="arm"                       # Device Archutecture
DEVICE_KERNEL="DREAMPLUG"               # ls /usr/src/sys/conf and find your cpu
export DRIVE=da0                        # da0/da1/da2/da3
######### DO NOT EDIT ############### Envirmental settings for build ################
OBJDIR="/usr/obj/${DEVICE_ARCH}.${DEVICE_ARCH}/usr/"
kernel="/mnt/1"
export DESTDIR="/mnt/2"
#####################################################################################

####Build SD/HD########
dd if=/dev/zero of=/dev/da0 bs=512 count=1
gpart create -s mbr da0
gpart add -s32m -t \!14 da0
gpart set -a active -i 1 da0
gpart add -t freebsd da0
newfs_msdos -F 16 /dev/da0s1
newfs /dev/da0s2
mount -t msdosfs /dev/da0s1 /mnt/1
mount /dev/da0s2 /mnt/2

######## port checking script ########
port_is_installed(){
[ -x "/usr/local/bin/$1" ] || pkg_add -r $1
}

#check to see needed pkgs are installed
#Add svn
[ -x "/usr/local/bin/svn" ] || pkg_add -r subversion

####### fetch/update /usr/src dir ###########
fetch_src-head(){
svn co http://svn.freebsd.org/base/head /usr/src-head
}
[ -e "/usr/src-head/Makefile" ] || fetch_src-head

cd /usr/src
make clean
make ARCH=arm TARGET_ARCH=arm kernel-toolchain
make -j 8 buildworld TARGET_ARCH="${DEVICE_ARCH}"
make installworld TARGET_ARCH="${DEVICE_ARCH}"
make distrib-dirs TARGET_ARCH="${DEVICE_ARCH}"
make distribution TARGET_ARCH="${DEVICE_ARCH}"

cd /usr/src-head
make buildkernel TARGET_ARCH=${DEVICE_ARCH} KERNCONF=${DEVICE_KERNEL}
cp "${OBJDIR}/src-head/sys/${DEVICE_KERNEL}/kernel.bin" "${kernel}"
}

echo '/dev/da0s2 / ufs rw,noclusterr,noclusterw 0 0' >> $DESTDIR/etc/fstab

#### Add Daemons to the devices /etc/rc.conf for startup ########
cat << EOF > "$DESTDIR/etc/rc.conf"
hostname="dreamplug"
ifconfig_mge0="DHCP"
sshd_enable="YES"
ntpd_enable="YES"
ntpd_sync_on_start="YES"
dumpdev="NO"
fsck_y_enable="YES"
background_fsck="NO"
force_fsck="YES"
force_fsck_list="/"
EOF
}
echo 'WITHOUT_X11=yes' >> $DESTDIR/etc/make.conf