Z

Zygmunt Krynicki

Free software developer. Huawei, ex-Canonical, ex-Linaro, ex-Samsung. I write in C, Go and Python. I usually do system software. Zyga aka Zygoon

gitlab.com/zygoon/go-cmdr v1.9.0 has been released

I've just released go-cmdr version 1.9.0 This version brings in several small improvements and one deprecation I wanted to explain below. Update: most of the new functionality is in: https://pkg.go.dev/gitlab.com/zygoon/go-cmdr@v1.9.0/format?tab=versions and https://pkg.go.dev/gitlab.com/zygoon/go-cmdr@v1.9.0/cmdtest?tab=versions Prepared test invocation The testcmd package, which simplifies testing command line applications, has gained support for replacing standard input stream. The existi...
Read post

Remarkable paper tablet, with keyboard

I have been using the "remarkable" e-paper tablet for a long while now. In general I am very happy with it. It is lightweight, lasts very long on battery, and significantly helps with the creative process of sketching ideas, doodling, and taking notes. Recently, the company behind it released a new style of folio with an embedded keyboard. I jumped right in, wanting to see how it feels like. The main surprise was the method the keyboard folded away. When not in use, you can not even see it is t...
Read post

Deploying Raspberry Pi as LAVA dispatcher for USB-attached DUTs

Today I will talk about using a Raspberry Pi 4B (8GB) with an SSD disk as infrastructure for deploying LAVA dispatcher used for testing USB-attached devices such as The 96Boards Nitrogen board. Introduction This somewhat lengthy post goes into the practical details of setting up a minature infrastructure and test stack on a single board or a cluster of identical boards. It is separated into two main parts - the physical part with the bare-metal OS (infrastructure) and the software-defined se...
Read post

Introduction to SystemOTA (1/n)

Today I will talk about SystemOTA. An image-based, transactional update system for embedded Linux devices. Disclaimer. This blog talks about my work but offers my personal opinions and does not speak for my employer or customers. -- SystemOTA is one of the first projects started by Huawei Europe Open Source Technology Center, (OSTC). It is an Apache 2.0-licensed, no-strings-attach update system for devices such as routers, gateways, smart switches, smart thermostats or any other device that i...
Read post

Unexpected control flow

Today I will talk about unexpected control flow in shell I was doing code review of a piece of shell code. It looked good on paper, if some poor soul is printing shell on paper, and was even shellcheck-clean, but we decided to add set -e at the top of the script, to see if anything was failing silently. It was, obviously. After a moment of shock and disbelief, it struck us what was broken. The broken part was inside out heads. Shell itself did exactly what we told it to do. Our understandin...
Read post

Fixing VMware Workstation 16.1 after kernel upgrade on Ubuntu 20.04

Today I will talk about making VMware Workstation survive a kernel update This is a continuation of https://listed.zygoon.pl/21339/installing-vmware-workstation-16-pro-on-ubuntu-20-04 When you get a new kernel you need to re-compile out-of-tree modules in order for them to continue working, if possible. VMware currently uses two kernel modules: vmmon and vmnet. Surprisingly after all those years VMware did not adopt DKMS so you you, the customer, are responsible for doing the hard work that...
Read post

Integrating PVS Studio and Coverity with make

Today I will talk about integration of PVS Studio and Coverity into a make-based build system. As a part of my work on Open Harmony, I'm looking into static analysis for C and C++ projects. I had prior experience with PVS Studio and Coverity. I've used them in my personal projects as well as in my work on snap-confine, a privileged part of snapd responsible for creation of the execution environment for snap application processes, where security is extremely important. Let us briefly look at...
Read post

Installing VMware® Workstation 16 Pro on Ubuntu 20.04

Today I will talk about installing VMware® Workstation 16 Pro on Ubuntu 20.04 x86_64 For the most part, installation of this program has been streamlined. Compared to earlier versions, you really don't have do do anything more than: chmod +x VMware-Workstation-Full-16.1.0-17198959.x86_64.bundle sudo ./VMware-Workstation-Full-16.1.0-17198959.x86_64.bundle This will give you working application but won't let you run any virtual machines yet. For a while, kernel lockdown is in effect, where th...
Read post

zmk 0.4.2 released

I've released zmk 0.4.2 with several small bug-fixes. ZMK is a Make library for writing makefiles that behave like autotools without having the related baggage. It works out-of-the-box on POSIX systems, including MacOS. You can find ZMK releases at https://github.com/zyga/zmk/releases The changelog for zmk 0.4.2 is: The PVS module no longer fails when running the pvs-report target. The Header module no longer clobbers custom InstallDir. The Library.DyLib template no longer creates symlink...
Read post

Raspberry Pi 4B and 4K display at 60Hz

Today I will talk about using Raspberry Pi 4B as a Ubuntu 20.10 desktop, on a 4K TV. If you are interested in using Ubuntu 20.10 on a Raspberry Pi 4B with 8GB of RAM and want to use a TV as a display I have a bit of advice that can help you out and save your time. 1) Do not upgrade from 20.04 - after upgrading the essential boot section changes won't happen, and you won't have hardware acceleration. Unless you know what to change, just install 20.10 from scratch. 2) You need to edit /boot/f...
Read post

Introduction to bashunit - unit testing for bash scripts

Today I will talk about bashunit - a unit testing library for bash scripts. All the posts about bash were building up to this. I wanted to be able to test bash scripts, but having found nothing that makes that practical, I decided to roll my own. Having created bashcov earlier, I needed to connect the dots between discovering tests, running them, reporting errors in a nice way and measuring coverage at the same time. I also wanted to avoid having to source bashunit from test scripts, to avoi...
Read post

Broken composition or the tale of bash and set -e

Today I will talk about a surprising behavior in bash, that may cause issues by hiding bugs. Bash has rather simple error checking support. There are, in general, two ways one can approach error checking. The first one is entirely unrealistic, the second one has rather poor user experience. The first way to handle errors is to wrap, every single thing in and if-then-else statement, provide a tailored error message, perform cleanup and quit. Nobody is doing that. Shell scripts, it's sloppy mo...
Read post

Poor man's introspection in bash

Today I wanted to talk about bashunit, a unit testing library for bash scripts. This turned out to be a bigger topic, so you will have to wait a bit longer for the complete story. Instead I will talk about how to do poor man's introspection in bash, so that writing tests is less cumbersome. In some sense, if you have to know this sort of obscure bash feature, it may be a good indication to stop, take a step back and run away. Still if you are reading this, chances are you run towards things l...
Read post

Measuring execution coverage of shell scripts

Today I will talk about measuring test coverage of shell scripts Testing is being honest about our flawed brains that constantly make mistakes regardless of how much we try to avoid it. Modern programming languages make writing test code a first-class concept, with intrinsic support in the language syntax and in the first-party tooling. Next to memory safety, concurrency safety, excellent testing support allows us to craft ever larger applications with an acceptable failure rate. Shell scrip...
Read post

Signal to noise ratio in build systems

Today I will argue why silent rules are a useful feature of good build systems. Build systems build stuff, mainly by invoking other tools, like compilers, linkers, code generators and file system manipulation tools. Build tools were traditionally printing some indication of progress. Make displays the commands as they are executed. CMake displays a quasi progress bar, including the name of the compiled file and a counter. Interestingly, it seems the more vertically oriented, the less output...
Read post

Build system griefs - autotools

I always had a strong dislike of commonly used build systems. There's always something that would bug me about those I had to use or interact with. Autoconf/Automake/Libtool are complex, slow and ugly. Custom, weird macro language? Check. Makefile lookalike with different features? Check. Super slow single threaded configuration phase. Check. Gigantic, generated scripts and makefiles, full of compatibility code, workarounds for dead platforms and general feeling of misery when something goes wr...
Read post

New Blog

Just testing the whole blogging via-notes-thing, thanks to https://standardnotes.org/. The idea is that you can blog from a desktop or mobile client, by creating a set of notes that appear as distinct posts. Not all notes are public, in fact, by default they are all encrypted and private. The effort to set this up is remarkably low. The only downside is that, as all hosted products, there's a free tier that is not as nice as the paid subscription. There's a snap or appimage for Linux. The way...
Read post