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 and to 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 and to 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 and to 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:

Sunday, January 3, 2016

Building an ethernet tap with linux

Say you want to see what's going on an ethernet line. And say the line runs something like PPPoE, i.e. a protocol below the internet layer, where the addressing is done by MAC addresses.

It's not possible to put an ordinary switch in the middle, as the ethernet frames would not get through. What is needed is an ethernet tap or port mirroring. An old-fashioned ethernet hub would work here, mirroring the traffic from either end of the original wire to a third port that could be monitored e.g. by Wireshark. But can this done be without a special device, with plain linux?

Thursday, June 11, 2015

Global proxy with Node.js

It would be nice if applications written in node.js respected system proxy setting (i.e. http_proxy and https_proxy). But this doesn't seem to be the case.
If you make http(s) requests from your node.js application, the system setting is ignored unless you take extra care to do the right thing.
So how does one even use a proxy with http and https modules? It turns out the answer is: use an agent (the same for https). Agents can do many things and they can also implement proxying. The most popular agents for proxying seem to be http-proxy-agent and https-proxy-agent but there's also proxying-agent which can do both HTTP and HTTPS.