Cubietruck

Cubieboard / Cubietruck Debian SD image

My goal is to build and maintain headless stable base to deploy various services (web, mail, samba, …). The images are compiled from scratch and sometimes patched if necessary. Images are suitable for any microSD card larger than 1G and can be installed to NAND or SATA. First boot takes longer time (around 2m) than usual (25s). It regenerates SSH keys, sets your MAC address, resizes partition to fit your SD card and downloads the package lists (apt-get update). It will reboot one time automatically on first boot to take effect for changes.

  • Debian Wheezy, Jessie or Ubuntu Trusty based
  • Kernel 3.4.107 and 3.19.6 with large hardware support, headers and some firmware included
  • Build ready – possible to compile external modules. Successfully tested with this wireless adapter
  • Ethernet adapter with DHCP and SSH server ready on default port (22) with regenerated keys @ first boot
  • Wireless adapter with DHCP ready but disabled (/etc/network/interfaces, WPA2: normal connect or AP mode)
  • Enabled audio devices: analog, HDMI, spdif and I2S
  • Advanced IR driver with RAW RX and TX (disabled by default / you need an IR diode)
  • PWM ready on pin PB2 (Cubietruck)
  • Bluetooth ready (working with on-board device / disabled by default – insserv brcm40183-patch)
  • I2C ready and tested with small 16×2 LCD. Basic i2c tools included.
  • SPI ready and tested with ILI9341 based 2.4″ TFT LCD display.
  • Drivers for small TFT LCD display modules.
  • Clustering / stacking
  • USB redirector – for sharing USB over TCP/IP (disabled by default /etc/init.d/rc.usbsrvd)
  • root file-system auto resize
  • Graphics desktop environment upgrade ready
  • NAND, SATA and USB install script included (/root)
  • Disabled LED blinking (/boot/script.bin)
  • Total memory is 2000Mb (disabled all memory reservations for GPU)
  • Serial console enabled
  • Enabled automatic security updating and ready for kernel apt-get updating
  • Login script shows Cubietruck / Cubieboard 2 auto MOTD with current PMU temp, hard drive temp, ambient temp from Temper if exits & actual free memory
  • MAC address from chip ID, manual optional
  • sunxi-tools included: fex2bin, bin2fex, nand-part
  • Performance tweaks:
    • /tmp & /log = RAM, ramlog app saves logs to disk daily and on shut-down (ramlog is only in Wheezy, others have 2nd best solution: busybox-syslogd)
    • automatic IO scheduler. (check /etc/init.d/armhwinfo)
    • journal data writeback enabled. (/etc/fstab)
    • commit=600 to flush data to the disk every 10 minutes (/etc/fstab)
    • optimized CPU frequency scaling 480-960Mhz with interactive governor (/etc/init.d/cpufrequtils)
    • eth0 interrupts are using dedicated core
  • Known bugs or limitations
    • No audio driver, IR, NAND, BT, HW video, I2C and SPI untested on 3.19.x
    • Some drivers compile successfully some breaks with fatal error
    • USB/SATA install fails on kernel 3.19.x
    • apt-get upgrade shows some error on Trusty. It’s safe to ignore. Will be fixed asap.
    • Gigabit ethernet transfer rate is around 50% of its theoretical max. rate (Allwinner problem)
    • On board Bluetooth works only on 3.4.x
    • NAND install (3.4.x only) script sometime fails. Dirty but working workaround – installing Lubuntu to NAND with Phoenix tools and run the nand-install again. Better solution is under development.
    • Proper shutdown only with kernel 3.19.x
    • Due to bad PCB placement, there is some crosstalk between Wifi and VGA in certain videomodes (Cubietruck)
FAQ - frequently asked questions


v3.6 / 29.4.2015
v3.5 / 18.4.2015
v3.4 / 28.3.2015
v3.3 / 28.2.2015
v3.2 / 24.1.2015
v3.1 / 16.1.2015
v3.0 / 29.12.2014
v2.9 / 3.12.2014
v2.8 / 17.10.2014
v2.7 / 1.10.2014
v2.6 / 22.8.2014
v2.5 / 2.8.2014
v2.4 / 11.7.2014
v2.3 / 2.7.2014
v2.2 / 26.6.2014
v2.1 / 13.6.2014
v2.0 / 2.6.2014
v1.9 / 27.4.2014
v1.8 / 27.3.2014
v1.7 / 26.2.2014
v1.6 / 9.2.2014
v1.52 / 7.2.2014
v1.5 / 22.1.2014
v1.4 / 12.1.2014
v1.3 / 3.1.2014
v1.23 / 1.1.2014
v1.2 / 26.12.2013
v1.0 / 24.12.2013

1,109 thoughts on “Cubieboard / Cubietruck Debian SD image

  1. Hello Igor, may I copy your boot data for my proyect?
    Your *107 runs really well in my aRUNTU rootfs
    Thanks.

    Regards Isaac.
    PD. Hope you create your own armhf board for us to enjoy soon¡¡¡

  2. Now I’m running 3.4.106 on my cubietruck to have the possibility to compile a patched cp210x driver.

    when I run make with this makefile:
    obj-m = cp210x.o
    KVERSION = $(shell uname -r)
    all:
    make -C /lib/modules/$(KVERSION)/build M=$(shell pwd) modules
    clean:
    make -C /lib/modules/$(KVERSION)/build M=$(shell pwd) clean

    I got the following error:

    make -C /lib/modules/3.4.106-cubietruck/build M=/root/TreiberSourceCP210x modules
    make[1]: Entering directory ‘/usr/src/linux-headers-3.4.106-cubietruck’
    CC [M] /root/TreiberSourceCP210x/cp210x.o
    /bin/sh: 1: scripts/basic/fixdep: Input/output error
    scripts/Makefile.build:313: recipe for target ‘/root/TreiberSourceCP210x/cp210x.o’ failed
    make[2]: *** [/root/TreiberSourceCP210x/cp210x.o] Error 2
    Makefile:1367: recipe for target ‘_module_/root/TreiberSourceCP210x’ failed
    make[1]: *** [_module_/root/TreiberSourceCP210x] Error 2
    make[1]: Leaving directory ‘/usr/src/linux-headers-3.4.106-cubietruck’
    Makefile:4: recipe for target ‘all’ failed
    make: *** [all] Error 2

    Whats going wrong there ?
    I’m a newbie for compiling drivers and Linux

    1. There are no rules that your compilation finish successfully, sometimes you need to adjust driver sources … I tried this driver on latest 3.4.107 and also bump into errors – I haven’t dig in why it doesn’t work but successfully compiled two other drivers so the system generally works. Just one hint – if you have done kernel upgrading / switching sometimes help to recreate headers scripts, for example: cd /usr/src/linux-headers-$(uname -r) && make scripts

      1. No, I updated the complete system with a new image. Is it possible to send you the driversource ?

        because it is necessary to have this patched driver for all fhem and OWL users

      2. When I do a

        cd /usr/src/linux-headers-$(uname -r) && make scripts

        I also get an error:

        make[1]: *** /usr/src/linux-headers-3.4.106-cubietruck/scripts/basic/Makefile: Input/output error. Stop.
        Makefile:412: recipe for target ‘scripts_basic’ failed
        make: *** [scripts_basic] Error 2

        1. Get the latest kernel (3.4.107). I tested successfully “make scripts” on Orange and Cubietruck.

            1. I think you will solve the problem much faster. 3rd party drivers are lowest priority from my POW. I already tried to compile from here if this is the right one (?) but currently don’t have resources to go further.
              ADD: the driver is already in kernel: modprobe cp210x

  3. Hi Igor,
    thank you for the kernel-3.19-image, it’s really fast on a class10 microSD-card. :)
    One problem I’m having getting lirc to run is that there is no /dev/input/, rc-devices are not/cannot be registered as /dev/input/eventx. I’ve got VDR running with streamdev-server, working almost perfectly…lirc doesn’t work.

    s -la /dev/input/
    ls: cannot access /dev/input/: No such file or directory

    Remote Control runs via Sundtek DVBS-Stick, but can’t be assigned to /dev/input/eventx.

  4. Hi Igor,
    I downloaded your latest Cubietruck_Ubuntu_3.6_trusty_3.4.107.zip
    There are some minor issues:

    When I reboot with “init 6″ or “shutdown -r now” the boot scipt does a “firstboot”, replaces the server keys and does another reboot.
    While the second reboot is just a bit inconvenient, the replaced server-keys trigger warnings in SSH clients which is not optimal. ;)

    And there is an error message when I run apt-get dist-upgrade

    dpkg: error processing package linux-trusty-root-cubietruck (–configure):
    subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing: linux-trusty-root-cubietruck
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    and dist-upgrade complains about some cron settings
    insserv: warning: script ‘cron’ missing LSB tags and overrides
    insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cron’

    regards
    Andreas

    1. SSH warning in client is normal behavior because keys are changed. The rest – read bugs section.

  5. Hello,
    I have been using
    Mobile Internet with a ZTE MF60 UMTS-Hotspot
    plugged into USB of Cubietruck. It works fine. All drivers required
    eg. “cdc_ether.ko”
    are in 3.4.xxx
    ——-
    Today, upgrade
    to a Huawei LTE E5372 router failed, since the
    “huawei_cdc_ncm
    modules are missing.
    ——————–
    I have check out mainline 3.19.;
    There it is OK and running FINE!
    Because I rather would stick to 3.4-107 because of funtionallity….
    How to get the Huawei going there.
    Are the modules compatible, or is a 3.4.xx kernel rebuild required?
    Many thanks to you for providing the Downloads. They helped me a lot in getting my hardware up and running. Thanks!

    1. Modules are not compatible – you’ll need to compile your own from driver sources. They are usually accessible from manufacturer – my image is prepared that you should be able to do that without kernel recompile which is also an option if you fail with that. But you have to count that it’s also possible that you won’t be able to compile in kernel 3.4.xxx without major adjustments.

  6. Hey Igor,

    I need your help. I was running your image for a lon time and everything was fine.
    But yesterday I logged in via ssh and performed an apt-get upgrade.
    Suddenly the connection was closed and now I can’t access the cubietruck.
    I tried to connect it to a monitor (via VGA) but there is nothing.
    When I reboot it the LEDs are flashing…
    Could you help me out??

    Thanks
    Nils

      1. OK I handled to fix it.
        I flashed another SD card with debian and booted from this.
        Then I chrooted into the old sd (connected via usb) and ran “dpkg –configure -a”.
        Now it’s working again ^_^

  7. Igo Hello, how are you? My friend, your Images are fabulous! I have a difficult task, I have to compile a linux for Allwinner A31, then install the Hummingbird merrii card, I admit it’s not easy! I’m in a lot of trouble and I am unable to find the errors.
    I wonder if you can help me with this, I shall be very grateful with your help.

    My purpose and have a kernel that allows be to install java 8 and run graphical compatible with JavaFX.

    I hope your help?

    1. Thanks. I must disappoint you regarding A31 since it’s mainline Linux support is in infant development state. I was trying to build an image few months ago but no luck. A lot of things was missing at the low level so I abandon further involvement. There was some progress in the mean time so I’ll try to build a kernel / uboot again. Building an image based on old Android kernel is not an option for now.

      I don’t have any experiences with Java 8 / FX to comment on this. You have to know that in best case scenario you will end up with an non-accelerated graphical interface. At this state of development is quite possible that we don’t have an video (HDMI) console. Bottom up. A31 is currently worst case for such operations. Better to use any A20 since it’s support is much much better.

      1. Thanks for the answer, I believe I made a big mistake in wanting to work with the A31, on the site of Merrii http://www.merrii.com/en/pla_d.asp?id=172, The merrii promise to run android and Linux 3.3.

        I bought them A31 hummingbird with 10.1 screen sensitive to touch, but I’m afraid I could not entegrar my Atempo project, not hummingbird arrived from China yet, when you get’ll have little time !!!

        “I am suffering a drama by not choose the right thing …”

        With all if you have any news so one image to the A31 warns me? I’d be happy with that.

        Hugs Friend.

        1. If you can use your applications with Android you will be fine. Running Debian / Ubuntu with android kernel without major rework? I would say it’s possible – I just don’t know anyone that is doing that. You can check here how is A31 being integrated into mainline. Soon / maybe already is / will be possible to boot mainline kernel on A31. Most problematic thing here is touch screen driver in this combination … I’ll try to build A31 mainline kernel ASAP too see how far things are.

          1. Ok now, I understand well, in the latter case rodarei android in A31 hummingbird, the merrii developed Linux driver for the touch screen, I’m hoping to get here in the company to start testing.

            I’ll try to run Linux with merrii driver and if I can I’ll tell you.
            If you succeed porai sends me an e-amil. jcarvalhogo@gmail.com in any case, I will be following your site.

  8. Hi!

    I did “apt-get dist-upgrade” a few days ago and it did a reather large update. I did not notice anything really bad so far, but the LEDs are enabled again. How do I turn them off again?

    1. Download latest [R]oot file-system changes above, install them with dpkg -i xxxxxxxxxxxxxxxx.deb and reboot.

  9. A very comprehensive build. I am looking for an image for the Cubie2 which includes having the Line In and Headphone jacks working. Do you have any idea what that will take or perhaps when you might include that in your image?

    Mitch

  10. I have a few questions/requests:
    1. Is there any reason why the crypto user space api in mainline kernel builds is disabled?
    It is enabled in the 3.4.* images but not the 3.19.* images, so cryptsetup doesn’t work there.
    If not, please enable it. I think I saw a another request for this in the comments already.
    I have used your build script to build an 3.19.5 kernel based image with custom configuration and disk encryption seems to be working just fine.

    2. Now that jessie is stable, you may want to modify the sources.list to reflect this. Currently jessie will use testing and wheezy stable packages (which are actually jessie packages now).

  11. Hi Igor,
    I use your Image on my cubie. This time I use 3.4.103. But since the last apt-get upgrade and update my cubie says that it can’t update udev with this version and I have to upgrade the kernel. Now some of the programms don’t run. I saw that the newest kernel is 3.19.4. But I don’t understand how I can easy upgrade this new kernel, because it seems to be much different from the earlier versions. Excuse me for the stupid question. But how can I do the upgrade?

    1. Rather upgrade to 3.4.106, since 3.19.4 is limited in functionality (check details in bugs and limitations sections above). Both kernels are compatible with latest udev requirements. For upgrading – read FAQ. Everything is packed as .deb so you need to install all deb files located in kernel package. Since you come from an older image you will need to create boot script – how to? – FAQ.

      1. I tried it once again with the recommended version 3.4.107. And I do everything you wrote: Install all the debs in the tar, go to /boot and create the boot.src. I used your link above and changed the first line in accordance to the old uEnv.txt to:
        setenv bootargs console=ttyS0 nand_root=/dev/sda1 rootwait rootfstyp=ext4 sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_no_mali_mem_reserve sunxi_fb_mem_reserve=16 hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1280x720p60 panic=10 consoleblank=0 coherent_poot=2M

        But now? This is now on the ssd of the cubie under /boot. I tried to copy all to /dev/nand1 by
        mount /dev/nand1 /mnt/nand1
        but the link zImage can’t be copied. At least the cubie dont boot. If I copy the file vmlinuz-3.4.107-cubietruck to /mnt/nand1/zImage also the cubie don’t boot.

        I have the impression that I do something wrong. I also tried to copy the content of /boot to the sd-card abd start from there, but this also not boots the cubie.

        If I copy back the old content from the backup to nand1 the old version runs.

        1. This installation is a bit tricky since we can’t change NAND uboot but adjust other files. We need to have uEnv.txt and uImage, not boot.scr & zImage. Check my NAND-SATA-install script for details how to convert zImage to uImage, the rest you can also leave from old installation. I’ll automatize this process once.

          1. Thank you very much! I’ll try to understand your script and do so. This makes me understanding that all my trials last days (and nights) can’t result in success, as far as I see. I’ll reprot if it works.

      2. Hi!

        I understand that making the boot script for older images are in cases where system is installed on SD, but how do upgrade the kernel when I have system installed on NAND?

  12. Hi Igor! Could you tell me how to re-enable the leds in version 3.4.106? I can do them manually but as I understand you make them go blind again on boot. You mentioned a /etc/init.d/disable_led.sh script in the documentation but there is no script in my build so I figured that there is something else turning them off.

  13. Hi Igor,
    after I tried kernel 3.19.4 and Jessie, my Cubietruck doesn’t power off itself after shutdown (or init 0). I switched back to Wheezy and kernel 3.4.106 (upgrade from v3.4 to v3.5, installation of new over the old deb’s), but still poweroff does not work – it says
    [axp] send power-off command!
    [axp] set flag!
    [axp] reboot!
    in the console.
    What am i doing wrong?

      1. Thanks. I am not 100% sure – have to recheck – with mainline kernel proper power off (should) work only if you power via power socket only – regarding which distribution you use.

  14. Network interface does not work with this version (3.5). With image version 2.8 it works perfectly what I’m doing wrong?

      1. Cubietruck 3 PCB v1.0-0606

        Have just tried it with Cubieboard2 Ubuntu 3.19.4 3.5 trusty image and get an error:

        [5.732921] stmmac_hw_setup: DMA engine initialization failed
        [5.743096] stmmac_open: Hw setup failed

        with Cubieboard2_Debian_3.5_wheezy_3.4.106 image I get the error

        [18.371187] WARNING: at ner / sched / sch_generic.c: 256 dev_watchdog + 0x2dc / 0x2e8 ()
        [18.385626] NETDEV WATCHDOG: eth0 (sunix_emac): transmit queue 0 timed out

        1. Cubieboard 2 has different network card than Cubietruck (sometimes named Cubieboard 3). Choose proper image! Actually the only difference is Uboot which is loading a proper DTB file that contains hardware definitions.

  15. Just tried all images from this page and none of these are working with my Cubietruck.
    For example unzipped raw file from zip, dd if=Downloads/Cubietruck_Ubuntu_3.5_trusty_3.4.106.raw of=/dev/sdd
    3072000+0 records in
    3072000+0 records out
    1572864000 bytes (1,6 GB) copied, 698,661 s, 2,3 MB/s
    and started Cubietruck from card.
    All images with kernel 3.4.106 are restarting after “Starting kernel” and booting to Android (default at NAND).
    All images with kernel 3.19.4 are just hanging at “Starting kernel” and nothing is going on (waited 10 minutes).

    1. Check with some other SD card, create image on some other comp. All recent images are tested and they are 100% working.

      1. Just found from another site: If no working cubiuntu image for A20 was flashed previously in your sdcard, you may need to flash the bootloader on it.
        dd if=/dev/zero of=/dev/sdb bs=512 seek=1 count=2047 ; sync ; dd if=u-boot-cb2-ct-with-spl.bin of=/dev/sdb bs=1024 seek=8
        After these commands, I did’nt expect it to work but just tried before rewriting it with Cubiuntu, your image (still on the same card) booted without problems. I think my cards were not prepared somehow, not mentioned in this site here, and these commands and bootloader from another site made it work.

  16. 1st of all thanks for the effort you’re putting into the project.

    However since you changed you kernel updates from “tar” to “deb” (in tar) files I’m a bit lost how to update my system. So far I just had to cp the tar to “/”, unpack it, reboot and voila.

    But I’m hesitating to install the deb files as I think this will also require the uboot version of my system to be updated first, as it has to handle (the new way) with dtb files?!

    Is there a kind-of how-to switch the system to support the new way the kernel updates get offered?

    1. I’ll write the whole update procedure – hopefully during this week – from old images to make sure the process will finish safely. There is at least one problem which will occur – old images doesn’t have boot script which is necessary for latest u-boot. I need to attach this script to uboot deb.

    1. Don’t know if this is important for the mainline kernel that there exists a uEnv.txt, but at the end of the nand-install-script I get:

      sed: can’t read /boot/uEnv.txt: No such file or directory

      I assume this is the output of the sed command:
      sed -e ‘s,root=\/dev\/mmcblk0p1,root=/dev/'”$DESTPART”‘,g’ -i /boot/uEnv.txt

      1. Oh, seems like all is within boot.cmd/scr in recent releases. Ok, nevertheless, it simply does not boot from sata/usb after running the install script.

        PS:
        sdcard still inserted.

    2. With mainline kernel it doesn’t work – will be fixed asap. On 3.4 works in any combination / destination: sata, nand, usd, sd.

      1. Hello,
        really nice of of you!
        Can you please post here when a patch is available or the problem is known.
        Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *