Alessandro Ghedini: Building Debian packages using Linux namespaces
In the past few days I have been messing around with Linux namespaces,
and developed a little tool (pflask) that automates the creation of
simple Linux containers based on them (a sort of
chroot(8) on steroids if you
will).
While the whole raison d' tre behind this project was "just because", and many
more mature solutions exist, I decided that it'd be nice to find an actual use
case for this (otherwise I tend to lose interest pretty quickly) so I wrote a
lil (and rather dumb) pbuilder clone that uses pflask instead of chroot.
The nice thing about pflask is that, differently from e.g. LXC, it doesn't need
any pre-configuration and can be used directly on a vanilla debootstrap(8)ed
Debian system:
$ sudo mkdir -p /var/cache/pflask $ sudo debootstrap --variant=buildd $DIST /var/cache/pflask/base-$DIST-$ARCHWhere
$DIST and $ARCH are e.g. unstable and amd64.
Once that's done just run pflask-debuild on the package sources:
$ apt-get source somepackage $ cd somepackage-XYX $ pflask-debuildThe script will take care of creating a new container,
chroot(2)ing into it,
installing all the required dependencies, building and signing the package (it
also runs lintian!).
The main difference from pbuilder is that pflask will mount a copy-on-write
filesystem (using AuFS) on the / of the container so that any modification
(e.g. installation of packages) can be easily discarded once the container
terminates (similarly to what cowbuilder(8) does, modulo the hardlinks hack).
Additionally, thanks to the mount namespace created inside the container, all
of this will be isolated from the host system and other containers, so that
multiple packages can be built simultaneously on the same base debootstrapped
directory.
Another possibility would be that of disabling the network inside the container
using a network namespace, in order to prevent the package build system from
downloading stuff from Internet while at the same time maintaining the network
active on the host system, but I haven't done any experiment in this direction
yet.
Note though that all of this is rather crude and experimental, but as a little
hack it seems to work rather well (YMMV).
Responsive web design is a techinique for offering the optimal user experience across different browser devices without the overhead of separate "mobile" sites or native applications.
Whilst there are hundreds of browser plugins that can make it easier to test responsive websites by resizing your browser window, this can also be achieved with a scriptable window manager such as




A maintenance release (now at version 0.1.2) of my RcppDE package (previously
described in 
This morning when preparing the update of a package, and I saw a PNG file in
its documentation. Even before opening it, I felt old, tired, distressed
and unable to escape the situation. Inspecting the file confirmed that the
image was not hand made. The source file is missing. The proof: anther
image in the same directory has the same style and a SVG source. To make
things worse, there are no instructions on how to generate the PNG from the
SVG. More and more in these cases, I give up and abandon the package. I
lost time and energy make Upstream some requirements for which I personally
have no concrete interest. SVG in addition to PNG is better, but PNG alone
for the documentation of a Free software is Free enough for me. However,
the points of view expressed on
Tuesday was a really nice evening. A few weeks ago I found a poster about the concert of
Cleaning up X server warnings
So I was sitting in the Narita airport with a couple of other free
software developers merging X server patches. One of the developers
was looking over my shoulder while the X server was building and
casually commented on the number of warnings generated by the
compiler.
I felt like I had invited someone into my house without cleaning for
months embarrassed and ashamed that we d let the code devolve into
this state.
Of course, we ve got excuses the X server code base is one of the
oldest pieces of regularly used free software in existence. It was
started before ANSI-C was codified. No function prototypes, no
const , no void * , no enums or stdint.h. There may be a few
developers out there who remember those days (fondly, of course), but
I think most of us are glad that our favorite systems language has
gained a lot of compile-time checking in the last 25 years.
We ve spent time in the past adding function prototypes and cleaning
up other warnings, but there was never a point at which the X server
compiled without any warnings. More recently, we ve added a pile of
new warning flags when compiling the X server which only served to
increase the number of warnings dramatically.
The current situation
With the master branch of the X server and released versions of the
dependencies, we generate 1047 warnings in the default build.
-Wcast-qual considered chatty
The GCC flag, -Wcast-qual, complains when you cast a pointer and
change the const qualifier status. A very common thing for the X
server to do is declare pointers as const to mark them as immutable
once assigned. Often, the relevant data is actually constructed once
at startup in allocated memory and stored to the data
structure. During server reset, that needs to be freed, but free
doesn t take a const pointer, so we cast to (void *), which
-Wcast-qual then complains about. Loudly.
Of the 1047 warnings, 380 of them are generated by this one warning
flag. I ve gone ahead and just disabled it in util/macros for now.
String constants are a pain
The X server uses string constants to initialize defaults for font
paths, configuration options, font names along with a host of other
things. These end up getting stored in variables that can also take
allocated storage. I ve gone ahead and declared the relevant objects
as const and then fixed the code to suit.
I don t have a count of the number of warnings these changes fixed;
they were scattered across dozens of X server directories, and I was
fixing one directory at a time, but probably more than half of the
remaining warnings were of this form.
And a host of other warnings
Fixing the rest of the warnings was mostly a matter of stepping
through them one at a time and actually adjusting the code. Shadowed
declarations, unused values, redundant declarations and missing printf
attributes were probably the bulk of them though.
Changes to external modules
Instead of just hacking the X server code, I ve created patches for
other modules where necessary to fix the problems in the right
place.
Fingerprints and Key IDs
Thanks to a corporate reward program, I just got a Pure Sensia
digital and Internet radio receiver: basically, it is a device able to
play streams from FM, DAB, HTTP and USB sticks. In overall, it works
fine, and it has a remote controller, so it makes a nice addition to my
home equipment, but it has what I consider a major flaw, which I suspect
to have been designed on purpose.For playing streams from FM or DAB, the process is rather simple: you
select a frequency and it plays, nothing else is involved. I did not try
USB yet but it should be similar: you select a file or a playlist and it
plays it. But for HTTP streams, it is quite different: you select a
stream from a the Pure Connect directory which is a list of HTTP
streaming services maintained by the manufacturer Pure.
This raises three concerns:
I am happy to announce that OASIS v0.4.0 has just been released.
OASIS is a tool to help OCaml developers to integrate configure, build and install systems in their projects. It should help to create standard entry points in the source code build system, allowing external tools to analyse projects easily.
This tool is freely inspired by Cabal which is the same kind of tool for Haskell.
You can find the new release
cjdns and enigmabox
While at the xWiki office, it was interesting to see a lot of innovative work taking place, including this VoIP setup where a Grandstream phone is attached to an