Debian testing with 3D and CedarX (via libhybris) howto on CubieTruck (CubieBoard3)

I’ve successfully installed from scratch a Debian Testing on my CubieTruck, there is how to get it working.

The only thing which doesn’t seems to works, is 3D GL for games…


I’ve installed the Lubuntu Server with VGA or HDMI NAND image with live…thing tool.

Only to get a proper /dev/nanda bootloader partition, you should do the same, this howto asumes that.


1. Create SD-Card with Lubuntu linaro

Just follow this tutorial.

You can also chroot on the SD-Card rootfs and install OpenSSH Server.

2. Reboot with the SD-Card plugged in

Do a ssh on linaro@your_cubie, password is linaro.


3. Format the NAND properly

This will erase all the nand, so, do the following.

3.1 Backup

mkdir /mnt/{boot,rootfs}
mount /dev/nanda /mnt/boot/
mkdir ~/boot/
cp -r /mnt/boot/* ~/boot/

3.2 Partitions

umount /dev/nanda
sudo nand-part /dev/nand 32768 'bootloader 131072' 'rootfs 10584064'

if you run `sudo nand-part’ you will see something like that at the end :

2 partitions
partition 1: class = DISK, name = bootloader, partition start = 32768, partition size = 131072 user_type=0
partition 2: class = DISK, name = rootfs, partition start = 163840, partition size = 10584064 user_type=0

3.3 Format

Reboot, with the SD-Card plugged in, the NAND driver doesn’t support repartition on-the-fly.

Then, format the two partitions :

mkfs.ext2 /dev/nanda
mkfs.ext4 /dev/nandb

4. Installation

4.1 bootloader

mount /dev/nanda /mnt/boot
cp -r ~/boot/* /mnt/boot/
set « nand_root » to /dev/nandb in /boot/uEnv.txt

4.2 rootfs

sudo apt-get install debootstrap
mount /dev/nandb /mnt/rootfs
debootstrap --verbose --arch armhf --variant=minbase --foreign testing /mnt/rootfs
chroot /mnt/rootfs

Inside the chroot now:
/debootstrap/debootstrap --second-stage

cat <<END > /etc/apt/sources.list
deb testing main contrib non-free
deb-src testing main contrib non-free
deb testing-updates main contrib non-free
deb-src testing-updates main contrib non-free
deb testing/updates main contrib non-free
deb-src testing/updates main contrib non-free

apt-get update

export LANG=C
apt-get install apt-utils dialog locales
dpkg-reconfigure locales
# Choose en_US.UTF-8 for both prompts, or whatever you want.
export LANG=en_US.UTF-8

apt-get install dhcp3-client udev netbase ifupdown iproute openssh-server iputils-ping wget net-tools ntpdate ntp vim nano less tzdata console-tools module-init-tools mc

cat <<END > /etc/network/interfaces
auto lo eth0
allow-hotplug eth0
iface lo inet loopback
iface eth0 inet dhcp
echo debian > /etc/hostname

cat <<END > /etc/fstab
# /etc/fstab: static file system information.
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/nanda      /boot               ext2    noatime,noauto,errors=remount-ro 0 1

apt-get install openssh-server

echo "T0:2345:respawn:/sbin/getty -L ttyS0 115200 vt100" >> /etc/inittab

/etc/init.d/ntpd stop

normally, done.

Unplug SD-Card, reboot, should display a prompt or whatever.


5. Fresh debian

5.1 Install whole lot of things

As root, install sudo, and create an user

apt-get install sudo
adduser fluttershy
usermod -a -G video,sudo fluttershy
passwd fluttershy

Then you can re-log under fluttershy and do sudo things. youhou!

sudo apt-get install htop ssh smartmontools bash-completion screen wget mplayer2 mesa-utils

sudo apt-get install git-core build-essential \
libusb-1.0.0-dev pkg-config xorg-dev xutils-dev libdrm-dev autoconf gettext libtool automake libltdl-dev  x11proto-dri2-dev \


5.2 Clone whole lot of things

git clone
git clone
git clone git://
git clone
git clone
git clone

5.3 Tools

cd sunxi-tools
cd ../a10disp
cp ~/xf86-video-sunxifb/src/sunxi_disp_ioctl.h .
make clean

5.4 MALI X11 / 3D

echo sunxi_cedar_mod | sudo tee -a /etc/modules
cat <<END > /etc/udev/rules.d/50-mali.rules
KERNEL=="mali", MODE="0660", GROUP="video"
KERNEL=="ump", MODE="0660", GROUP="video"
KERNEL=="cedar_dev", MODE="0660", GROUP="video"
KERNEL=="disp", MODE="0660", GROUP="video"

cd ~/libdri2
sudo make install
cd ~/sunxi-mali
git submodule init
git submodule update
sudo make
sudo make install

cd ~/xf86-video-sunxifb
autoreconf -vi
./configure --prefix=/usr
sudo make install

sudo mkdir /usr/share/X11/xorg.conf.d/
sudo cp xorg.conf /usr/share/X11/xorg.conf.d/99-sunxifb.conf

mkdir ~/mesa_shit
mv /usr/lib/arm-linux-gnueabihf/libEGL.* ~/mesa_shit

# Only after a working X11
make test
DISPLAY=:0 ./test/test
# You should see something

5.5 VDPAU-Sunxi

This permits to decode h264, mpeg1 and mpeg2. The thing with libvde / libhybris and Android libs only works with a stripped-down vlc version, which doesn’t seems to build anymore…

cd ~/libvdpau-sunxi
sudo make install

5.x Remove useless things

sudo apt-get remove --purge libusb-1.0.0-dev pkg-config libdri2-dev xorg-dev xutils-dev libdrm-dev autoconf gettext libtool automake libltdl-dev  x11proto-dri2-dev \

6. Play videos

cat <<END > .mplayer/config
# Write your default config options here!


echo "VDPAU_DRIVER=sunxi" | sudo tee -a /etc/environment
echo "VDPAU_DRIVER=sunxi" | sudo tee -a /etc/X11/Xsession.d/10sunxi
echo "export VDPAU_DRIVER" | sudo tee -a /etc/X11/Xsession.d/10sunxi

7. XFCE4

sudo apt-get install xfce4 xfce4-goodies lightdm

8. Ressources used

4 comments to Debian testing with 3D and CedarX (via libhybris) howto on CubieTruck (CubieBoard3)

  • becario


    First of all, thanks a lot, I’ve following your tutorial to have a nice cubietruck, but I’ve had some problems and questions to ask.

    Could you please take a look to the post in the forum?,1134.0.html

    Merci beucoup! =)

  • Pat Wood

    Should be

    sudo nand-part /dev/nand …


    sudo nand-part /dev/nanda …

  • bob

    I think that your fstab is wrong too?

    # /etc/fstab: static file system information.
    proc /proc proc defaults 0 0
    /dev/nandb / ext4 noatime,errors=remount-ro 0 1
    /dev/nanda /boot vfat defaults 0 2

    works for me. I did not modify the /dev/nanda partition and so maybe this should say ext2 rather than vfat for the /boot partition

  • b0x

    Thanks, nice tutorial!

    When updating the kernel or whatever in the future, will there be a need to modify /boot manualy or can this install stay stable for long term use without any special intervention?

    Since you wrote this how to, has everything been working fine? (updates, etc)


Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>