Cubietruck

Installer image

Build the cubietruck installer image with bitbake.

bitbake cubietruck-installer-image

Install the image on a micro SD card:
Size of the card: min. 2GB)

The image can be found in the deployment folder of your yocto build facility.

Hint: check the device name of the micro SD Card with

 sudo fdisk -l

(let us assume it is: /dev/mmcblk0)

install the image on the micro SD Card with:

sudo dd if=core-image-minimal-installer-cubietruck.sunxi-sdimg of=/dev/mmcblk0

NAND Image

Build the image intended for the nand flash of the cubietruck.

(e.g. bitbake digitalstrom-devel-image )

Transfer the data

uImage
and
root.tar.gz
to the cubietruck installer image.
(The root image is in the deployment folder of the yocto build facility.
Look for something like
digitalstrom-devel-image-2014xxx-cubietruck.tar.gz
)

Transfer:
1. Mount the micro SD Card and transfer the data (uImage, root.tar.gz) to the

/home/root/Data
directory. The folder can be found on the second partition of the micro SD Card.

2. Alternatively you can start the cubietruck with the micro SD Card. The

uImage
and the
root.tar.gz
can be transferred via scp.

scp uImage root@<IP-ADDRESS>:/home/root/Data
scp digitalstrom-devel-image-2014xxx-cubietruck.tar.gz root@<IP-ADDRESS>:/home/root/Data/root.tar.gz

To find the <IP-ADDRESS> you should connect a serial to usb line converter to the UART0 connector of the cubietruck (115200, 8N1) and use the tty console.
(login as root, no password)

...
Poky (Yocto Project Reference Distro) 1.5.1 dSS-yocto /dev/ttyS0

dSS-yocto login: root
root@dSS-yocto:~# 
root@dSS-yocto:~# ifconfig
eth0      Link encap:Ethernet  HWaddr B2:C8:5D:47:AC:76  
          inet addr:192.168.4.157  Bcast:0.0.0.0  Mask:255.255.255.0
          inet6 addr: fe80::b0c8:5dff:fe47:ac76/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:195 errors:0 dropped:39 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:18511 (18.0 KiB)  TX bytes:1320 (1.2 KiB)
          Interrupt:117 Base address:0xc000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Program the NAND flash

Start the cubietruck with the prepared micro SD Card.
(login as root, no password)

Go to folder

/home/root/Setup
and call
./nand-install.sh

root@dSS-yocto:~/Setup# pwd
/home/root/Setup
root@dSS-yocto:~/Setup# ls
interfaces.in     nand-install.sh   nand_mbr.backup   network-setup.sh
root@dSS-yocto:~/Setup#
root@dSS-yocto:~/Setup#./nand-install.sh 

Follow the steps of the script.
The flashing process takes about 2-3 minutes.
At the end, the cubietruck will switch off all leds.
Remove the power and the micro SD Card and restart the board.

Set a fixed MAC address

In order to set a fixed MAC address for the network interface, you have to modify the kernel bootargs parameters. This can be done by editing the uEnv.txt u-boot environment configuration file which resides in the boot partition on /dev/nanda

You can either edit it from the installer image or you can edit it when you booted from the image that you flashed, both will work.

mount /dev/nanda /mnt
vi /mnt/uEnv.txt

You will see a line starting with extraargs, in my default configuration it is:

extraargs=console=ttyS0,115200 hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1280x720p50 rootwait panic=10 rootfstype=ext4 rootflags=discard

At the end of the line, append the parameter for the sunxi_gmac module and set the desired MAC there (substitute xx:xx with your MAC address), i.e. change the above line to:

extraargs=console=ttyS0,115200 hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1280x720p50 rootwait panic=10 rootfstype=ext4 rootflags=discard sunxi_gmac.mac_str="xx:xx:xx:xx:xx:xx" 

Save your changes, unmount the partition and reboot:

:wq <press enter in vi>
umount /mnt

Check your /etc/network/interfaces file, it is possible that some random MAC has been set there automatically, if this is the case: remove it.

Finally, reboot.