A computer engineer poking at your cerebral cortex.

Cubieboard 2 (cb2) debian nand flash install



The newer cubieboard 2 (cb2) finally arrived about 3 weeks ago and started researching on how to use it. The problem is as you search for cb2 info you will come across tons of cb1 info. Also since this unit is fairly new you will see lots of conflicting info. After 3 full weeks of trying to figure out how to get debian on the flash drive I finally have it working. Below are the steps required to get yours working. Warning: This will erase android on your cubieboard. I’m assuming you are using debian/ubuntu based linux distro to install this.

1) download the 7z image http://cubian.org/downloads/

2) install the tools to extract it:

sudo apt-get install p7zip-full

3) extract the image

7za e ./Cubian-base-r1-arm-a20.img.7z

4) After you extract the image it is now time to write the image to a mini sd card. The mini sd card needs to be at least 1GB to fit the image. You also want to make sure your sd card isn’t mounted. Also figure out which /dev/ device your sd card is assigned to using fdisk -l. In this example my sd is assigned to /dev/sdb

sudo dd if=~/Downloads/Cubian-base-r1-arm-a20.img of=/dev/sdb bs=4096; sudo sync

5) Now put the sd card into your cb2 device and connect the power. Once the device boots you should see a login prompt. The username/password is cubie/cubie. Now use ifconfig to get the ip address of the unit. I immediately ssh into the unit because my hdmi monitor does not support the current resolution it is using. So almost everything is off the screen. If you know how to fix this please let me know.

6) Now ssh int your cb2 which also uses a non standard port of 36000.

ssh cubie@IpAddress -p 36000

7) now run patch your cb2 so it is fully up to date.

sudo apt-get update && sudo apt-get upgrade

8) Install all the cb2 tools.

wget -O - http://packages.cubian.org/cubian.gpg.key | apt-key add -
add deb http://packages.cubian.org/ wheezy main to file /etc/apt/sources.list
apt-get update && apt-get install cubian-update 

9) Now you want to upgrade the kernel to the lastest version. As of writing this kernel 3.4.43 is the latest version. For some reason it kept saying failed to download…are you connected to the inernet? To fix this I had to change some CPU settings I found on a forum post.

sudo -i
update-rc.d cpufrequtils disable
update-rc.d cubian-ondemandcpufreq disable
reboot

10) Log back into the cubieboard2 to install the kernel

cubian-update
reboot

11) After the reboot connect back to the cb2. Now we are going to install the tool to boot the debian instance onto the nand flash.

sudo apt-get update && sudo apt-get install cubian-nandinstall
cubian-nandinstall

12) Now there is one setting that isn’t going to work because the mount point for the filesystem wasn’t correct. So I had to fix this.

mkdir /mnt/nandc
mount /dev/nandc /mnt/nandc
now edit /mnt/nandc/boot/uEnv.txt and change /dev/nand3 to /dev/nandc
save and exit this file
cd to a directory not on the mount parition: cd /
umount the parition: umount /mnt/nandc

13) Now reboot the device and remove the sd card and the cb2 should boot from the nand flash.

14) Just incase run these commands to re enable CPU stuff:

sudo -i
update-rc.d cpufrequtils enable
update-rc.d cubian-ondemandcpufreq enable
reboot

15) There is another bug now where apt-get update won’t work on the nand due to the cubian mirror not having a key:

apt-get install debian-keyring # not 100% sure you need this but doesn't hurt.
wget -O - http://packages.cubian.org/cubian.gpg.key | apt-key add -

free space after install with Ruby and Rails installed: