Author Archives: Hal Martin

About Hal Martin

In my free time I like experiment with hardware and embedded systems. Here I write about personal projects and random adventures into firmware land.

Building the Banana Pi LeMaker Kernel

I recently bought a Banana Pi because I wanted something more powerful than a Raspberry Pi (and because I had store credit to use up).

I wanted to run Debian on it, but not the Raspbian distribution provided by Lemaker because I find it’s too resource heavy for what I will be using my Banana Pi for. I followed Christian Bock’s excellent blog post on how to build a Debian rootfs for the Banana Pi.

More pre-built SD card images are coming out for the Banana Pi, but I wanted to use a spare 1GB microSD card and no one provides images that small, so I went and built my own.

As Christian noted in his blog post, the sunxi kernel sources do not work well on the Banana Pi as they contain a broken sunxi ethernet driver. The NIC is unstable when running at gigabit speeds (my testing showed approximately 60% packet loss). A definite deal-breaker if you need reliable network access. LeMaker was a bit slow in releasing their kernel source, but after users complained it was released on github.

Prerequisites for building the kernel are outlined in LeMaker’s wiki page. Basically you need the following packages:

build-essential u-boot-tools uboot-mkimage binutils-arm-linux-gnueabihf gcc-4.7-arm-linux-gnueabihf-base g++-4.7-arm-linux-gnueabihf gcc-arm-linux-gnueabihf cpp-arm-linux-gnueabihf libusb-1.0-0 libusb-1.0-0-dev git wget fakeroot kernel-package zlib1g-dev libncurses5-dev

This is the Jenkins script I use to build the LeMaker kernel for the Banana Pi:

if [ ! -d "linux-bananapi" ]; then
git clone -b bananapi-3.4 https://github.com/LeMaker/linux-bananapi.git
fi
cd linux-bananapi
git pull
wget https://watchmysys.com/blog/wp-content/uploads/2014/08/linux-bananapi.config -O .config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- clean
make -j4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install
mkdir -p output/boot/
cp arch/arm/boot/uImage output/boot/
tar -C output -cjvf ../linux-bananapi-3.4.90.tar.bz2 boot/ lib/

I’ve included the above commands in a script at the end of this post. I’ve added additional comments explaining the what and why for people who don’t arbitrarily trust strangers on the internet.

Installation is fairly simple, you need to mount the sdcard /boot and / partitions on your computer and then run:

tar -C /path/to/sdcard -jxvf linux-bananapi-3.4.90.tar.bz2

This will extract /boot/uImage and the kernel modules to /lib/modules/3.4.90-00261-gb3b7287

My kernel configuration includes the sunxi ethernet driver as a module (sunxi_gmac) so that you can unload/reload it if necessary. This means you need to use both the uImage and the modules provided or you will not have network connectivity.

Build script: bash/Jenkins build script
Kernel and modules: linux-bananapi-3.4.90.tar.bz2
Kernel Config: linux-bananapi-3.4.90.config

ACME Systems Arietta G25 bootstrap

I’m using the ACME Systems Arietta G25 256MB model for a project I’m working on, but their website only provides a bootstrap for the 128MB version. Let’s build a bootstrap for the 256MB version.

The instructions on their website are for Ubuntu 13.10, but I run Debian so these instructions are for Debian 7.

As per their instructions you need to enable the emdebian repository:

user@debian7:~$ sudo -i
root@debian7:~# apt-get install emdebian-archive-keyring
root@debian7:~# echo "deb http://www.emdebian.org/debian/ squeeze main" > /etc/apt/sources.list.d/emdebian.list
root@debian7:~# echo "deb http://ftp.us.debian.org/debian/ squeeze main" >> /etc/apt/sources.list.d/emdebian.list

Even though I’m running Wheezy the repositories in /etc/apt/sources.list.d/emdebian.list are for squeeze. This is necessary due to unavailable packages on Wheezy which are present in squeeze. Please see the Emdebian page for an explanation.

user@debian7:~$ sudo apt-get install libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi u-boot-tools libncurses5-dev gcc-4.4-arm-linux-gnueabi cpp-4.4-arm-linux-gnueabi g++-4.4-arm-linux-gnueabi

Clone the bootloader from ACME Systems:

user@debian7:~$ git clone git://github.com/linux4sam/at91bootstrap.git
user@debian7:~$ cd at91bootstrap
user@debian7:~/at91bootstrap$: git checkout origin/at91bootstrap-3.x -b at91bootstrap-3.x
user@debian7:~/at91bootstrap$: wget http://www.acmesystems.it/www/compile_at91bootstrap/acme.patch -O acme.patch
user@debian7:~/at91bootstrap$: patch -p1 < acme.patch
user@debian7:~/at91bootstrap$: make mrproper
user@debian7:~/at91bootstrap$: make acme_ariettasd_linux_zimage_dt_defconfig
user@debian7:~/at91bootstrap$: wget https://watchmysys.com/blog/wp-content/uploads/2014/07/256mb.patch_.txt -O 256mb.patch
user@debian7:~/at91bootstrap$: patch -p1 < 256mb.patch
user@debian7:~/at91bootstrap$: make CROSS_COMPILE=arm-linux-gnueabi-

Now copy the generated zimage to the boot partition on the sdcard (/dev/sdX1, mounted here at /tmp/arietta/boot):

user@debian7:~/at91bootstrap$: sudo cp binaries/acme_arietta-sdcardboot-linux-zimage-dt-3.6.2.bin /tmp/arietta/boot/boot.bin

Boot the Arietta G25. You should have 256MB of RAM available now.

The 256mb.patch does two things to the at91bootstrap:
1) Changes the size of the memory initialized from 128MB (0x8000000) to 256MB (0x10000000)
2) Changes the Kernel command line to mem=256M so the additional memory is utilized by the Linux kernel

If you aren’t interested in setting up a build environment, you can find the 256MB boot.bin: here. WordPress does not allow .bin files, so you will need to rename boot.bin_.zip to “boot.bin” before copying it to the sdcard boot partition.

Additionally if you want to automate building the bootstrap with Jenkins, here is a shell script you can put into a new Jenkins project to automatically build the zimage. You will need to manually install the toolchain (described above).

Your company is using Twitter wrong

It’s 2014; if your company sells users a service and doesn’t already have a social media presence then you should stop reading this and fix that. Right now.

Okay, now you have a social media team. However, I would bet that they aren’t helping your brand image when the sh*t hits the fan. I’m going to cite examples of bad and good responses from companies I follow on Twitter:

Recently WIND Mobile (@WINDmobile) suffered from a service interruption on their network. Here’s how they responded to annoyed customers:

WIND Mobile Twitter responses to annoyed users during the service disruption

WIND Mobile Twitter responses to annoyed users during the service disruption

I’m not sure if this was a Twitter bot posting replies to users, or a CSR who just really likes to copy and paste things. Either way, it provides users with no information whatsoever on the cause of the disruption (ie., why they’re annoyed and Tweeting at WIND Mobile) and it reeks of a form letter beginning with “Dear VALUED CUSTOMER,”

Users want information on a disruption, they don’t want to feel like a wallet that is forced to give your company money every month and only gets form letters in response. The more information you supply to users, the happier they will be. Selfnet e.V. (@Selfnet_eV) is an ISP at a German university. Their twitter feed is perhaps a little more casual than that of a large corporation, but I think it still provides a good example of what kind of feedback a company should be providing users:

Selfnet eV Twitter response to a service disruption

Selfnet eV Twitter response to a service disruption

Teksavvy (@TeksavvyCSR) suffered from a network disruption, and here’s how they dealt with it:

Teksavvy Twitter response to an outage

Teksavvy Twitter response to a service disruption

Notice the difference between the response from Teksavvy and Selfnet e.V., and the response from WINDmobile? Teksavvy made a limited number of replies to people, and posted a link to their website where users could see status updates on the outage. As another user noted, their customer service representatives were also posting updates to Reddit on the progress being made toward restoring service:

UPDATE. Looks like a MUX card issue at 151. Rogers just tried to re-seat it but no luck. They are currently working on alternatives.

My point here isn’t to bash WINDmobile. Service providers have a tough job, users have an expectation that the availability of the network will be 100% and when things aren’t working they quickly become annoyed. But, there is a huge difference between giving users canned responses and no details about an outage or the progress toward restoring service, and actively working to update users, even if doing so doesn’t shorten the time to resolution.

If you notice that your company is giving users canned responses, it’s time to re-think how you are approaching social media platforms. Users come to platforms like Twitter and Facebook to get answers, if they want canned responses they’ll call your customer support line and listen to the phone menu and hold messages that endlessly repeat “Due to higher than normal call volume, all customer service representatives are currently busy. Your call is important to us, please continue to hold.”

I would like to clarify that I am not currently a customer of any of the companies mentioned above. I was formally a customer of Teksavvy and WINDmobile. I am no longer a customer because I moved out of their service region.