Calamares Pinebook

Photo of laptop on table

Netrunner Pinebook

This week, there was the launch of Netrunner for Pinebook (1) (2). A lot of effort has gone into building the software, improving performance, getting automation and CI in place. That’s effort that benefits the wider KDE community, the wider Free Software-on-ARM community, and more. This is the laptop I’d take with me on a bicycle camping trip — clean, cheap and affordable, although heavier than a phone.

But there is an under-appreciated bit regarding images for an ARM laptop — or pre-installed Linux distro’s in general. And that’s the first-run experience. The Netrunner Pinebook image is delivered so that it boots to the Plasma 5 desktop, no passwords asked, etc. The user is called “live”, the password is “live”, and nothing is personalized. It’s possible, though not particularly secure, to use the laptop this way in a truly disposable fashion. A first-run application helps finalize the configuration of the device by creating a named user, among other things.

One of the under-documented features of Calamares is that it can operate as a first-run application as well as a system installer. This is called “OEM Mode“, because it’s of greatest interest to OEMs .. but also to distro’s that ship an image for users to flash onto (micro)SD card for use in a device.

Screenshot of desktop

Main Desktop on Pinebook

This screenshot is from Netrunner on the Pinebook, and you can see the purple-ish Calamares logo labeled “First Time Run This Installer” on the desktop — it’s partly hidden by the system information KCM. That runs Calamares in OEM mode, hardly distinguishable from the live-ISO-installer-mode that it usually has.

A Calamares OEM configuration generally:

  • Resizes the image file to fill the entire card,
  • Creates a user (the real one, personalised) with a password,
  • Performs some initial configuration of the real user,
  • Adds packages and system configuration based on that configuration, and
  • Does some cleanup (e.g. removing Calamares, since you only need it once).

Configuring Calamares as an OEM installer is no different from any other Calamares installation: make sure the config files end up in /etc/calamares, and then set dontChroot to true (that’s the real difference between OEM mode and regular).

The way Calamares development works, downstreams — that is the distro’s, and in this case Netrunner — just file feature requests for the stuff they need in Calamares, and after some back-and-forthing to make sure it’s sufficiently general, I write it. So the run up to Netrunner on the Pinebook saw some Calamares development aimed specifically at the OEM mode, and some extra bug reports. Nothing, though, that isn’t equally applicable to any other distro that needs a first-run installer.

There is a lot more that could be done in a first-run installer. KaOS has a really nice one, basically hand-holding through initial KDE Plasma Desktop setup. Pardus and Pisi Linux have something similar. A downside is that the more you do, the more specialized it becomes — it would be nice to have a good GNOME counterpart to the Plasma Look-and-Feel selection module in Calamares, but that quickly leads to a multitude of modules and dependencies (not to mention that I can’t write it all myself).

Anyway, that’s my little square inch claim to being useful to the Netrunner Pinebook project (which deletes itself).

Event Notes

From a KDE event somewhere in 2017 I found this note in the KDE-booth-crate that I keep at home:

1. thin, sour, 4/10 2. slap in the face, gummi bears, fotlcs 5/10 3. citrussy note 6/10 4. aardberg, smokey x3 8/10 5. nothing happens, competent

I can reconstruct that this particular event had some whiskey, but except for the Ardberg I would have no idea what any of them were. There are no alcoholic notes from FOSDEM, except that we ordered a beer because it was described as “trés désalterante” and we decided after tasting that that was French for “pretty gross”. It certainly quenched our thirst for more.

But if you’re thirsting for more KDE events, there’s the list of KDE Sprints which is where you will find the small, focused, fairly short events for hacking on a well-defined project. Some are open for visitors, and if there’s something you want to hack on with a group of KDE contributors, get organising! (Like, seriously, getting a hacking weekend together is just a few phone calls to reserve a rental house somewhere nice and to arrange for transportation — if you can get the people together, which is usually the biggest problem).

And of course there’s Akademy 2018 in Vienna — I suppose tasting notes will be of terrible coffee and that horrible Mozart liqueur — which is the two-litre stein of KDE interaction each year. The call for presentations is open, so you can pour your wisdom, wit, or vinegar on the audience this summer.

A Day on Krypton

It’s a bird! It’s a plane! No, it’s a shiny stable-yet-bleeding-edge KDE Plasma distro!

Since Calamares has to run all over the place, and is used in derivatives of all of the “Big Five” Linux distributions, I regularly switch distro’s as a development platform. Also because I inevitably blow up the VM while running Calamares, or because an update renders the system useless. At FOSDEM I had the pleasure of chatting with the folks from the SUSE stand about OpenQA and OBS.

(Note, when I originally wrote this I was going to just fiddle around a bit and then return to my Manjaro dev VM; instead it’s turned into a week and Krypton is likely to stay lodged on my VMs and spare machines for the foreseeable future.)

Last week I spent the day with openSUSE Krypton, which is a almost-bleeding-edge KDE Plasma desktop (today’s version has Plasma 5.11.5) on top of openSUSE’s rolling-release, Tumbleweed. Most of my Linux systems (e.g. the kids gaming boxes) run openSUSE of some sort, as did all my work systems at my previous job, but I have not yet used it as a development platform for Calamares. Here’s some usage notes.

Day 1 First day with a distro is usually roughly the same: install it, copy some stuff over, install tools, checkout and build Calamares. With Krypton, it’s no different.

  1. Installation looks a little wonky here and there. The installer could use a careful go-over by a designer to smooth out lines, reduce drawing glitches, etc. It may have been an artifact of installing in an 800×600 VirtualBox window, but it didn’t seem very polished, even if the installer procedure was.
  2. Install basic development tools: zypper in git cmake make gcc gcc-c++. Huh, kdevelop is already installed, that’s a good sign (except it seems like it’s broken, and can’t find the plugin KDevWelcomePage, but see below). Shame Linux systems are otherwise so poorly prepared for being development systems.
  3. Run deploycala.py on the installed system (there’s big fat warnings saying never to do that, but I’m the developer and this is a fresh VM, so nyah nyah). Fall over backwards when it turns out that apt-get exists on this system (and invokes zypper via aptitude) so that the deploy script thinks it’s on Debian and is going to do all of the wrong things. Debug the script. Figure out dependency names (e.g. it’s gcc-c++ on openSUSE, g++ on Debian and just gcc on Arch).
  4. Find there’s no PythonQt packaged; while this is a strictly optional dependency, I would like to find a distro that actually ships something usable for PythonQt (seems Arch does, and KaOS).
  5. Build Calamares.
  6. Profit!

So where does that last, profit, step come in? Well, openSUSE has Secure Boot support, while distro’s using Calamares generally don’t — for the simple reason that Calamares doesn’t support it yet. So I’ll be peeking at what, and how, openSUSE does it and massaging that into Calamares.

Day 2 Ran an update, hoping that KDevelop would be fixed by now. That’s a nice thing about rolling- and bleeding-edge distro’s, stuff gets fixed and/or broken on a daily basis. With Krypton, the underlying rolling base is touted as stable while the KDE bits are bleeding-edge. It wasn’t, but a quick question in the right IRC channel (#opensuse-kde for Krypton) got me sorted and a fix scheduled for the next build. Well done, Kryptonites.

Spent the day hacking on Calamares, mostly fiddling with other bits-and-pieces rather than doing what I intended to do, which was examine secure boot.

Day 3 Still stable. Today’s bleeding-edge update is 112MB, as KDE Plasma is updated to 5.12. I decide to do some ARM development today as well. This is obviously not ideal, since I’m then cross-compiling to aarch64 in a Linux VM running on FreeBSD, but hey. After installing cross-aarch64-gcc7 and adjusting some build instructions that assume Debian naming (e.g. CROSS_COMPILE=aarch64-suse-linux- instead of CROSS_COMPILE=aarch64-linux-gnu-), spent a thoroughly frustrating morning building U-Boot and watching it panic. That’s the downside to using very new hardware which isn’t supported by anything yet except the OEM’s binary-blob package.

Day 4 (after the weekend) A total of 733 package updates today, 810MB to download. They’re not kidding about bleeding-edge and up-to-date. In the meantime I’ve learned that my deploycala script could be much simplified by using the package-manager. Since Calamares is packaged for openSUSE, I could have done zypper mr --enable repo-source ; zypper source-install -d calamares to get the build dependencies for it.

Anyway, after a week I’ve I have not yet broken the system, it’s fast and up-to-date. I’ll be keeping this one around. (And if I was looking for something between Krypton and Leap, I’d probably go for GeckoLinux, which uses Calamares — a bit of dogfooding, as it were).

Events: Akademy 2018

Not nearly as close as FOSDEM, but still coming up on the KDE Community calendar: Akademy 2018. It’s in Vienna. I vaguely remember visiting Vienna once, long ago — possibly an FSFE function. So it’s high time to head out that way again to visit the local KDE team and to see what 2017-2018 has brought (and will bring) the KDE community.

Of course, to hear from the community, the community needs to speak! The call for participation is open, so send something in to the programme committee. Check out the list of potential topics — a lot of stuff can fit.

Personally, I’d like to give a talk on Calamares — which isn’t a KDE project, but which is used by various distro’s that ship KDE versions (e.g. Manjaro, Netrunner, KDE Neon dev, KaOS, Kannolo). Not really sure which parts of Calamares to present, but something will fit. And as a packager, I’d really like to see a panel-ish thing with OpenSUSE, KDE Neon, FreeBSD and other distro’s on stage talking about the KDE packaging process in the traditional sense. After that, Flatpak can take over 🙂

But for everyone in the KDE community: what have you done, what are you doing, and where are you going? Share it with us and with the world at Akademy 2018.

Events: FOSDEM 2018

The annual FOSDEM event is really close now. It’s a kind of geek valhalla, with carousing and quaffing and a whole lot of technology things. There’s a KDE stand where you can see some of the latest KDE bits and pieces, including Plasma 5 running on low-power hardware. 2GB ought to be enough for everyone, right? We might have a phone available running the existing Plasma Mobile code, since hardware continues to be tricky to come by (Nexus5X is fine).

Come by and chat about Plasma, Kirigami, artwork, Krita, databases, graphics on low-power ARM devices, KDE on FreeBSD, Konversation, Discover (Nate Graham gives really good overviews of what’s happening), translation and more. See you soon!

Debugging Tools

Today I had to repair my most important debugging tool. Here’s the result:

That’s three strands (red, white, black) from a USB-to-serial converter, soldered on to a 3-pole screw-tightened connector. Clamped into that are the serial lines (red, green and blue) which were originally crimped straight to the lines. After a few months of use, the crimping failed and the red cable (RX) broke off.

So I had to fix it, and in the process decided to make it more sturdy, more ugly, but also easier to use.

The three grey wires clamped into the connector are part of a 10-pin flat cable which I scavenged out of a 9-pin serial connector I had left in the box-of-old-parts.

The flatcable, and especially the 10-pin connector at the end, is nice and sturdy for connecting to the headers on single-board-computers, like here:

That’s why I need a serial cable for debugging. The frontmost board is a Pine64+. It runs FreeBSD and Linux; in Linux it will drive a full Plasma 5 desktop at FHD and acceptable responsiveness; FreeBSD is limited to serial console and ssh access. I use this board to test aarch64 support in FreeBSD and to test our KDE-FreeBSD packages on yet-more-unusual platforms. This turns up occasional issues in KDE code.

(The other two boards are a switch I had left over, and there’s an Odroid C2 at the back; together they form my little ARM rack, along with two planks they’re screwed on to and a power supply. Did you know the Palm m500 used the same size barrel jack for power as the Odroid C2? Yet another reason to keep old parts lying around.)

Retrospectacle

At the beginning of 2017, I was a programmer (mostly Python, and a little bit of C++) and spent most of my day at my desk, with an IDE open and a cup of coffee at hand. At the end of 2017, I’m a programmer (mostly C++, and a little bit of Python) and spend most of my day at my desk, with an IDE open and a cup of espresso at hand.

At some level of abstraction, not much has changed this year.

Of course, now I spend my entire day working on Free Software, in three different but partly-overlapping communities: KDE, FreeBSD, and Calamares. Basically you can track everything I do each day by looking in the relevant repositories on GitHub (read-only mirrors in the case of FreeBSD and KDE). Inspired by Michael, Krita, Matthieu Gallien (with the this-week-in-Elisa series) and Dominik Haumann, I’ve collected a list of things I did this year, in no particular order:

  • Released two versions of the proprietary application I worked on previously, and quit my job. Started working for BlueSystems and other organizations as a free-lance yet full-time programmer.
  • Updated Nethack in FreeBSD, and discovered I no longer have the Nethack chops to ascend half of the games I start. Updated Unnethack on FreeBSD, and fixed a clang-related bug upstream. Yay for roguelikes.
  • Released a dozen Calamares versions with regular bugfixes and small features. Worked together with the KDE VDG, Jens in particular, to figure out some of the UI choices — thanks for plying me with ideas.
  • Updated CMake a couple of times in FreeBSD and chased lots of weird CMakeLists code in unrelated applications.
  • Massaged KDE on FreeBSD under the expert guidance of Tobias and Raphael.
  • Attended three weeks of KDE-related sprints or meetings and a week of Akademy.

Here’s to a productive year, and looking forward to the same in 2018. You can see more of what happened in KDE in 2017 on the KDE year-end fundraiser page.

Switching Distro’s

Obviously I still use FreeBSD on the desktop; with the packages from area51 I have a full and modern KDE Plasma environment. We (as in, the KDE-FreeBSD team) are still wrestling with getting the full Plasma 5 into the official ports tree (stalled, as so often it has been, on concerns of backwards compatibility), but things like CMake 3.10.1 and Qt 5.9 are sliding into place. Slowly, like brontosauruses driving a ’57 Cadillac.

In the meantime, I do most of my Calamares development work — it is a Linux installer, after all — in VMs with some Linux distro installed. Invariably — and especially when working on tools that do the most terrible things to the disks attached to a system — I totally break the system, the VM no longer starts at all, and my development environment is interrupted for a bit.

That’s always a good moment to switch distro’s .. since I’m going to spend an hour or so re-invigorating the VM anyway, reminding myself that this time I’ll make a clone and keep snapshots and whatnot, I may as well see what others use Calamares for. I’ve left a dusty and broken KDE Neon and a Manjaro behind me, and today I’m starting on Kaos.

For the very reason that Calamares can break stuff, and because new Calamares versions need to be tested on (older) live ISO images, there’s a deploycala Python3 script that helps install all the (development) dependencies needed. This is a bit of a drag, since it’s tied to a whole bunch of distro’s specific package names, but it gets the job done. I update it whenever I hit a new distro.

Kaos Linux Logo

Kaos Linux Logo

Kaos is a KDE-leading-edge distro, and daaannnggg is it ever slick in the first 10 minutes of use. The customization of Calamares is some of the nicest I’ve seen. The release-notes page could use some work (on my part) .. if only because I could read that stuff during unsquashfs, instead of before it. First-time startup with Kaptan is a hardly-intrusive way of configuring a bunch of separate things that would require a careful trip through systemsettings.

Look for the next few Calamares releases (in particular 3.2) to emerge from the Kaos, then.

Randa-progress post-hoc

So, back in Randa I was splitting my energies and attentions in many pieces. Some attention went to making pancakes and running the kitchen in the morning — which is stuff I take credit for, but it is really Grace, and Scarlett, and Thomas who did the heavy lifting, and Christian and Mario who make sure the whole thing can happen. And the attendees of the Randa meeting who pitch in for the dishes after lunch and dinner. The Randa meetings are more like a campground than a 5-star hotel, and we work together to make the experience enjoyable. So thanks to everyone who pitched in.

Part of a good sprint is keeping the attendees healthy and attentive — otherwise those 16-hour hacking days really get to you, in spite of the fresh Swiss air.

Frederik encouraged us to touch the floor and the ceiling with his acro-yoga sessions; it is good to get out of the hacking room and get into shape. These sessions also teach us all trust and cooperation. And between sessions, he fixed a Qt bug that probably affects Calamares accessibility.

Calamares had some more bugs squashed, its accessibility improved — although I need to test that again and again on different setups now that I’m home, since it needs time to re-build Qt and all. Even with this fix, the goal to reduce Calamares’ root-needs remains.

You can read more of what the attendees in Randa achieved on planet KDE (e.g. kdenlive, snappy, kmymoney, marble, kube, Plasma mobile, kdepim, and kwin). I’d like to give a special shout out to Manuel, who taught me one gesture in Italian Sign Langauage — which is different from American or Dutch Sign Language, reminding me that there’s localization everywhere.

For me, being back home means sitting back at my big FreeBSD box, hacking on Calamares and ARPA and CMake and stuff again, with a renewed sense of purpose and team thanks to having worked together in Randa. If you like what KDE achieves in Randa, consider still supporting the fundraiser so that we can return to the mountains next year.

Take Randa and Stuff It

[[ Written monday, but I did not get around to posting it then. Since I do not feel like applying a modal time-shift operator to the text, I will publish it on tuesday, even though that introduces some temporal disparities.]]

It is almost 3pm. At three, the presentations from the Randa attendees will start, where each team or individual will present what they want to do for the week, and what they need from other attendees. So I’ll say “Calamares needs to support orca”. Short presentation, but then I’ve not had much time to prepare.

It’s almost 3pm, I’ve been up since 6:45 and have spent half an hour at my laptop. The rest of the day so far has been in the kitchen. Because keeping the meeting running, so that the attendees can do their thing to their full potential, takes a lot of logistics and effort. Let me give an example, based on profession software-engineers who are not professional cooks, doing the logistics.

Breakfast is from 7:30 to 9:00, which means that at 7:02 the kitchen opens. Coffee machine on. Dishwasher on. Tea kettle on. Send a minion to fetch the bread from the bakery. Dispense jam, nutella, peanut butter into bowls. Slice butter. Prepare muesli and yoghurt. Slice bread, together now that the minion has returned. One person runs the cheese / sausage slicer for 15 minutes while the other sets out cutlery, plates, cups, gets milk and orange juice ready. So at 7:30 when the first breakfasters show up, we’ve already put in one person-hour getting it ready. Hang around during breakfast, getting more bread, butter, refilling the coffee machine, slicing more salami. Once the last breakfasters are done (they show up at 8:50 for a quick bite), there’s three loads of dishes to do. The dishwasher is fast — less than two minutes — but everything needs to be put away, and the tables wiped down, and the slicer dismantled and cleaned, and the kitchen cleaned and swept.

So the “human cost” of breakfast is roughly 4, maybe five hours for non-professionals. Granted, there’s some time lost just in finding the way in the kitchen during the first day.

Lunch is a hot meal at 13:00 sharp, so preparations start at 11:00. Collecting today’s ingredients. Starting the stove and the oven. Starting 6l of water to boil for the rice, and another 6l of water for other parts of the meal. Cracking 15 eggs and whisking them. Cleaning, rinsing, and chopping 6kg of vegetables. Starting two pans of peanut sauce. Making a giant omelette. Waiting for 2kg of rice to cook. Shuffling six pans across five giant electric hobs. Setting out the chafing dishes, cutlery, plates, places again. Filling all the water pitchers. Checking the coffee machine. We — Grace, Scarlett, and I — had everything on the table at 13:05. And the cleanup cycle repeats, but with about six loads of dishes because of pots and pans. At 14:30, the kitchen is clean and tidy again.

The “human cost” of lunch is about six hours.

Dinner is scheduled at 19:00, which will have costs similar to lunch. Tallying up, it takes about 16 hours a day to keep everyone fed and happy (“it takes 30 people with their feet on the ground, to keep one man with his head in the air”). Today, we are doing it ourselves, because it is also a really fun way to work together and it’s a good team-building exercise. And while we’re sure to get more efficient, it’s just not efficient to actually do the cooking ourselves. I’m very happy to have worked together with Grace and Scarlett and Christian today, but I’ll be happy to hand over the chef’s hat to Hadrien tomorrow.

(O yeah, lunch was pretty expansive and tasty, so we’re stuffed. And in Randa.)