Saturday, February 23, 2019

Espressobin - building U-Boot

Continuing in the topic of the previous post - building the Kernel - I look into how Armbian builds U-Boot for the Espressobin.
There is some info on building U-Boot on the wiki but even though I tried to follow it to the letter, the U-Boot I build would never boot. Yet the U-Boot binaries build by Armbian work OK. Also note that there are several board revisions, so you certainly need sufficient new U-Boot or you can run into funny issues.

Wednesday, February 20, 2019

Espressobin - rebuilding kernel based on Armbian sources

Some time ago I bought the Espressobin board. It looked interesting but it turns out there is virtually zero support from the producer. There is some info on their wiki but it's quite obsolete.
I think the best way to get the Espressobin board running is installing Armbian. The good folks (or... the one person running the show?) build a decently working U-Boot and kernel and there is an SD card image that you can just dd onto a SD card. You don't even have to expand the partition to cover the whole SD card after copying the image -- after boot it expands it automatically.
This is all cool and dandy... But if you want to build your own U-Boot or kernel, Armbian does not make it easy. There is official documentation on how to build Armbian. This makes sense when you want to build the whole system but not so much if you just want to build the U-Boot and the kernel. Yet the fact that Armbian uses reasonably recent U-Boot and kernel, together with a bunch of patches, is interesting and I wanted to get to the U-Boot and kernel sources w/o having to run the whole Armbian build machinery. So I took a dive into the Armbian build scripts.

Friday, November 17, 2017

Linux 4.14.0 on the Alix 2c3 and 2d3

Up to recently the kernel 4.1.0-rc6 was the last one I was able to run on my Alix 2c3. Tag v4.1-rc7 would only do boot loop: grub loads the image and it reboots immediately without any output on serial.
I tried running git bisect but I haven't found anything useful: f18c34e48 would be the first bad commit but that seems strange. I think the commit only unmasked some other issue. Reverting it would make a few later commits work, but for e75c73ad6 the revert no longer helps.
But there is some good news: kernel 4.13.5 does not boot-loop and it does not freeze. It dies on a kernel BUG in the driver for the cs5535 timer (a spurious interrupt), but that can be fixed. The issue was introduced in 8f9327cbb, so it's been present in tags ≥ v4.3-rc7. For the record, the bug is only there because of a spurious interrupt at an unexpected moment. If the spurious interrupt wasn't there, the code would work OK. The interrupt looks like an Alix oddity. The issue is fixed in eb39a7c03, it's included in kernels ≥ v4.14-rc6.
All in all, upstream kernels ≥ 4.14-rc6 work again on the Alix 2 (I tested them on Alix 2c3 and Alix 2d3). :-)
Here is my 4.14.0 config. It's tuned for my needs - you most likely want to adapt the configuration for things like wifi and usb drivers, filesystems... But it should provide a working initial setup.

Sunday, January 15, 2017

The new Ubuntu SDK, part 3

[Update: Changed links to source code from https://launchpad.net/qtcreator-plugin-ubuntu and https://launchpad.net/ubuntu-sdk-tools to 
https://code.launchpad.net/~ubuntu-sdk-team/.... which is where the current tools probably live.]
Ubuntu SDK IDE offers custom project templates. Either CMake or qmake based.
I wonder how does the C++ compilation with CMake work in the Ubuntu SDK, so let's explore the "QML App with C++ plugin (cmake)" template. The source code for it can be seen in the qtcreator-plugin-ubuntu package. It includes all the parts required for a click package, wrapped in CMake:

Saturday, January 14, 2017

The new Ubuntu SDK, part 2

[Update: Changed links to source code from https://launchpad.net/qtcreator-plugin-ubuntu and https://launchpad.net/ubuntu-sdk-tools to 
https://code.launchpad.net/~ubuntu-sdk-team/.... which is where the current tools probably live.]

Continuing from part 1, which shows how to use the current Ubuntu SDK from the command line, let's have a look at how does the build from the SDK IDE (rebranded Qt Creator) work.
There are two relevant packages:

Friday, January 13, 2017

The new Ubuntu SDK, part 1

[Update: Changed links to source code from https://launchpad.net/qtcreator-plugin-ubuntu and https://launchpad.net/ubuntu-sdk-tools to 
https://code.launchpad.net/~ubuntu-sdk-team/.... which is where the current tools probably live.]

In September of 2016 Canonical released an updated version of the Ubuntu SDK. The main change there was a move from the schroot-based build images (kits) to LXD-based images as can be read in the announcement. Some more details are mentioned in the beta announcement. But that's about all I found about this change.

Luckily, there are some other places where one can see how does the new SDK work and how to use it from the command line:

Thursday, June 9, 2016

Building Ubuntu Click applications - minimal package built manually

Note: This has been obsoleted by the move from schroot to LXD. See this post.

There is some information available on the Ubuntu developer portal on building Click applications. But this mostly covers pure QML applications or QML applications with a C++ shared library, all with the Ubuntu SDK IDE (rebranded Qt Creator).
If you care about what is happening below this level, there is not that much info available, at least not in one place. I found: