NetBSD-current for openmoko GTA02

Peter Tworek tworaz666 at
Sat Dec 17 16:44:34 CET 2011

On 12/07/2011 06:27 AM, Timo Juhani Lindfors wrote:
> Peter Tworek <tworaz666 at> writes:
>> For some time now I've been spending some of my free time on getting
>> NetBSD running on my Freerunner.
> Interesting, do you have this work in some version control system?
> Would be nice to see all the steps :-)
It took me some time, but the source code of the port can be downloaded
from github:
Building the code should be straightforward if you have some experience
with NetBSD. Just checkout the sources somewhere, enter the directory
from command line and execute:
# ./ -N 1 -u -U -O ../obj-evbarm -T ../tools-evbarm -m evbarm -V
HAVE_GCC=45 build
# ./ -N 1 -u -U -O ../obj-evbarm -T ../tools-evbarm -m evbarm -V
HAVE_GCC=45 kernel=GTA02

Depending on your hardware this can take several hours to complete.
After it's done the kernel images should be available under
../obj-evbarm/sys/arch/evbarm/compile/GTA02/{netbsd, netbsd.ub,
netbsd.gz.ub}. Note however that this is just a kernel image without any
kind of ramdisk. The sources for the ramdisk I've used in my previous
image can be found here:
To build it just add tools-evbarm from kernel build process yo your
path, enter checked out ramdisk repository and run:
# ./

This should be much quicker to complete. The result of the build process
is ramdisk.fs file. To embed the ramdisk inside the kernel I use the
following shell script: (You'll have to change _WRKDIR value to make it



_MKUBOOTIMG_ARGS="-A arm -T kernel -a 0x30200000 -n NetBSD/gta02 -C gz"

echo -n "Removing old kernel: "
rm -f netbsd.gz.ub
echo "OK"

echo -n "Obtaining new binaries: "
cp $_OBJDIR/sys/arch/evbarm/compile/GTA02/netbsd .
cp $_WRKDIR/ramdisk-gta02/ramdisk.fs .
echo "OK"

echo -n "Preparing new kernel image: "
$_MDSETIMG netbsd ramdisk.fs
$_OBJCOPY -S -O binary netbsd netbsd.bin
gzip -c netbsd.bin > netbsd.bin.gz
$_MKUBOOTIMG $_MKUBOOTIMG_ARGS netbsd.bin.gz netbsd.gz.ub > /dev/null
echo "OK"

echo -n "Removing temporary files: "
rm -f ramdisk.fs
rm -f netbsd
rm -f netbsd.bin
rm -f netbsd.bin.gz
echo "OK"

_SIZE=`du -k netbsd.gz.ub| awk '{ print $1 }'`
echo "New Image Size: $_SIZE kB"

The final image should boot on the Freerunner using the procedure I've
described in my first email.


More information about the community mailing list