My terrible, no-good, very bad non-guide to installing “Cubian” (Debian wheezy) on the Cubieboard 2

As well as my forest of Raspberry Pis, I have a different kind of single-board computer to experiment with, a Cubieboard 2.  tl;dr on the link: dual-core Allwinner A20 (ARMv7 vs Pi’s ARMv6) at a higher clock rate than RasPi; 1GB RAM; 4GB onboard flash; 1 SATA port; microSD slot.  It’s a wee bit more powerful than a Pi.  I got one shipped for $64.50, now it’s a few bucks less.  It’s sort of a China-designed, China-made answer to the Pi, in that it’s an open system: http://cubieboard.org/

Anyway, I was discussing tuning a particular app to the limitations of the Pi, and somebody suggested a Cubie 2 instead.  It’s faster, he said, and it runs straight Debian wheezy armhf, not this weird cross-compiled “Raspbian” stuff.

Well, I’ve crashed that poor little Cube-esque warrior enough times on Debian stable to dispel any notion that it, running Debian wheezy, is more stable than a Raspberry Pi running Raspbian.  In fact, the entire reason I’m making this crappy post with a half-assed summary of my install procedure: I need to blow away the installation and redo it.  So, the post is more of a slightly cleaned up version of my notes.  Not a guide.

Update 28 March 2014:  This post is also quite out of date.  It might still be helpful, but Debian on Cubie2 (A20) is still very bleeding-edge.  If and when I come up with a real guide that’s appropriate for the modern day (and not the Jurassic of August 2013), I’ll come back and post a link here.  Read on, but beware. End update.

Thus, the following poor-quality and incomplete non-guide on installing Cubian – I went with some guy’s flavor of Debian wheezy – on your Cubieboard 2.  In case you couldn’t tell from the above, this is a pretty bleeding-edge piece of hardware.  There are plenty of bugs, in Debian stable, right now.  So keep that in mind.  They’ll probably be mostly fixed soon though, and it blows the doors off the Pi for less than double the price – if you actually need more computer than the Pi for your task, anyway.

This following is missing steps and is incomplete.  Mine it for clues.  Following it step by step might make you sad.

I will post an updated, much better guide to doing some things with the Cubieboard 2 in the future.

  • download image – and note that in the 2 weeks since I installed mine, they’d updated the kernel and the installer, so this non-guide is already out of date!
  • write to SD card
  • boot it and install / to the internal NAND using ~/installnand/install.sh or whatever (note: using ext4 for the NAND is maybe not good? not sure if it’s a bare NAND chip or has wear leveling logic. but either way, if you boot from NAND your system cannot fsck itself without a rescue boot microSD, because reasons.)
  • somehow resize the partition so that / was taking up the whole 4GB internal flash
  • partitioned an external SATA drive with 1.5GB swap, 5GB /var, 35GB /home, 830GB /opt … booted again from SD card, mounted /dev/nand3 and all the targets, cd’d to the source and cp -ax * /mnt/target to move em off the old / onto their new homes.  Then edited fstab to point to the right partitions.  Then moved /var to /var.old, /home to /home.old, /opt to /opt.old
  • in both cases, partitioning was a PAIN complaining about misaligned sectors and poor performance.  I followed the advice in _____ but it was just a guide to get me in the ballpark – mkfs stopped complaining when I just guessed at ‘4096s’ for the external 1TB drive, and ‘512s’ for the NAND, cause those were the identical values that popped up for [vars] – told you this was a terrible guide.  It’s really just notes to myself.  Sorry.
  • reboot without SD card.  / now takes up the internal NAND, and /var, /home and /opt are all on the drive.
  • the ethernet doesn’t have a permanent MAC!  forget messing with weird binaries like some guides tell you, just set it before dhclient asks for an IP from the DHCP server:  make a file in /etc/dhclient/dhclient-enter-hooks.d called e.g. ‘setmac’ and put the following in it, where you PICK the mac address to replace xx in the following: /sbin/ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
  • set up encrypted swap as at http://feeding.cloud.geek.nz/posts/encrypted-swap-partition-on/ … no swap was on but I formatted a partition on the SATA disk.
  • fails due to libdevmapper problems?  need to build own kernel, clearly… or wait for them to release newer ones for the A20, which they already did since I went through this pain.
  • ecryptfs-utils doesn’t work, just asks you to install cryptsetup…
  • root@cubie:~# cryptsetup -h sha256 -c aes-cbc-essiv:sha256 -s 256 luksFormat /dev/sda1   …. this didn’t work so I gave up for now.
  • Update: Also see this guide and fix your ssh keys, or you’re just handing your stuff over to the NSA: http://blog.gordon.morehouse.me/2013/10/26/change-ssh-host-keys-raspbian-cubian-premade-linux-virtual-machines/

So that’s essentially it to get you to a poorly running system.  Enjoy!  Come back to my blog in 2d12 weeks for a much better non-non-guide to an awesomely running system.

Other notes:

Advertisements

2 Comments

  1. Ronaldo
    Posted 28 August 2013 at 16:45 | Permalink | Reply

    Ahhh, I have just found this post AFTER having finaaaallly completed a successfull install of the same on the same, having been to the other side of sad and back again numerous times now and arriving at similar solutions. Gpio is in and working…apparently, but now to hook it up to its target ands see if its just been giving me the come on. Allso about to throw the Oracle jre at it and laughed out loud at your mention of “dark arts” elsewhere. Thank you for the light relief after several sleepless nights. .

    • Posted 28 August 2013 at 17:42 | Permalink | Reply

      Hey, cool, somebody already found the post and benefited from it (even if only for some comic relief) via search engine! Nice. The entire point of writing these posts is so somebody, somewhere, has a better day because of it.

      I have a long and growing draft about (re)installing onto the Cubieboard 2 in the works that is a lot more detailed and informative. I hope it’ll also help you once it’s posted. Cheers!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: