Archive for the ‘GoboLinux’ Category

Accepted to linux.conf.au 2010

Tuesday, September 1st, 2009

One of the GoboLinux papers I submitted has been accepted to linux.conf.au 2010, so I will be presenting on “An updated directory structure for Unix” at some point between 20 and 22 on the 22nd of January next year. I haven’t heard anything about the Aliens paper yet, so I guess that’s a provisional “no” for it (edit: but it will be in the Distro Summit miniconf on the Monday).

linux.conf.au is about free and open source software, especially Linux. It is a community-run technical conference which attracts some of the brightest minds in the world. Next year it is in New Zealand’s beautiful capital city of Wellington from January 18 to 23, and will be based at the Wellington Town Hall and Michael Fowler Centre in the central city.

Registration is $399 for hobbyists, $249 for students, or $799 for professionals and opens in a couple of weeks (all prices in NZD and for earlybird registration). Come along and watch me!

An overview of /System/Aliens

Thursday, July 23rd, 2009

/System/Aliens is a new feature that will debut in the 015 era, helping with the integration of the growing number of third-party package managers into the system as a whole. It’s prompted a few questions lately from those who weren’t around in the dev meetings where it was hashed out, particularly once we decided to submit a paper on it for linux.conf.au next year. It’s a really great feature that deserves explanation, so I’ll try to give an overview here with less technical detail than the paper and more GoboLinux-specific information. I have a working implementation locally, and it will go into trunk as soon as the feature slush for 015 is lifted (hopefully, soon). It should be in a Scripts release shortly after that, and possibly on a CD by January.

The goal of the Aliens system is to pull these various systems under the umbrella of our package manager, so everything within them is automatically available and there’s no need for repackaging. There are a lot of these systems nowadays – as well as the venerable CPAN, RubyGems, LuaRocks, Haskell’s Hackage, and myriad others are in play and growing in popularity. Often those are the only way libraries in their respective languages are published now. I can’t think how many times installation instructions have been “use gem install foo-bar“. Ultimately these systems (mostly) use standardised build and installation systems underneath, so we’ve been able to find the underlying tarball URL and create recipes for them, usually just the standard couple of lines. There’s an overhead in doing that though, and they inevitably get out-of-date. There are ways of automatically importing the entire tree and repackaging them up for the distribution, but they have their own complications and force everything to go through the distribution’s package manager, which can mask useful functionality the alien system provides.

The other temptation for users has been to go entirely over to the third-party system for those libraries, setting up their own tree either in /usr/local (in other distributions), or slightly more cleanly inside a /Programs entry here. Sometimes even over the top of distribution-provided files in /usr, which causes no end of conflicts later on. While at least it’s reversible and mildly clean inside a dedicated /Programs entry, it’s untidy and breaks dependency tracking. If a program depends on Ruby-GTK+, that will have to be wrapped in a distribution package and installed – even if it’s already around via RubyGems, and potentially conflicting with it. Aliens aims to avoid that.

When Aliens is around, alien packages can be installed in their ordinary way, using the familiar gem or luarocks or cabal install … command, and any of the functionality usually provided by those systems can be accessed. All the advantages of a separate tree remain, in this case the entire tree under /System/Aliens/{RubyGems,LuaRocks,Cabal,CPAN,…} being given over to the alien package manager to deal with as it likes, and our standard configurations for those languages being set up to look in there as well. Better though, a dependency from a program in the system package manager can be satisfied via the alien system. If a program depends on Ruby-GTK, it need only declare – within its ordinary dependencies – that it requires “RubyGems:ruby-gtk >= 2.10” and that will be satisfied on installation.

That’s achieved through just a couple of hooks into CheckDependencies and the installation tools. A dependency of the form Foo:Bar is recognised as one on package bar within the alien package manager Foo, and CheckDependencies will hand over to the Aliens subsystem to check that. If the dependency is satisfied, nothing more needs to happen. If not, it will remain in the dependency list and will be installed as soon as it is reached, using the alien package manager.

Each alien system supported will have a simple wrapper layer, using a defined protocol for answering queries and receiving commands. This wrapper protocol is simple and extensible so that adding new supported systems in the future will be easy. Some systems may not support all of the functionality Aliens can make use of – they will simply miss that feature, rather than being fully incompatible. At the simplest, a system need only support checking whether something is installed, and installing it.

Dependencies in the other direction, as from Ruby-GTK+ to GTK+ itself, may be handled one of two ways. Firstly, by defining a mapping of such dependencies as part of the Aliens system: this is not an enormous bother, since it need only be done the once for those items actually depended upon, but it is some. Alternatively, the system dependency may simply be specified before the alien one. If other distributions implemented this system (as we’d hope they might), they might prefer one way or the other of those two. We will probably begin with the second and move towards the first as a simpler migration path.

While I’ve made it sound pretty simple, there are a few technical complexities under the rug that are wrapped up by the Aliens subsystem. From a user level though, they get to rely on the distribution not duplicating or conflicting with their installation, while still having the full range of packages available to them. Users who move between distributions, or to *BSD, Mac OS X, or Windows, may also prefer to have the familiar language-specific interface available to them. If they don’t want to know about it, they won’t ever have to see it or notice it exists. For recipe authors, it’s many fewer dependencies they’ll run across and have to wrap up just to get an application up and running. For the developers (who are also in the first two categories), it’s another world-class feature that makes our lives easier by removing the need for coding so many special cases. For the developers of the packaging systems themselves, Aliens aims to embrace rather than extinguish their works, putting their domain-specific knowledge to work in providing the best way to install software in that language. And for authors of libraries, it lets them publish their creations the way they want, with a functional and consistent installation experience for end-users.

If there’s something I missed or didn’t cover, or you have any questions, comments, suggestions, post a comment, mail the list, or grab me on #gobolinux on Freenode (mwh).

Validating Scripts after a fresh installation

Saturday, June 20th, 2009

On #gobolinux last night an issue came up that has appeared occasionally before – the signature format for packages has changed between the 014.01 release and now, so the Scripts package won’t validate when you upgrade. The change was necessary to make for security, but it creates a problem for new installations trying to bring their tools up-to-date.

For those that don’t care for the fuss, and are willing to take the (very small) risk, you can just run SymlinkProgram Scripts 2.10.1 to activate the new package after installation fails with the validation error. Alternatively, you can upgrade piecewise through intermediate releases to get the fullest possible validation. The first stop should be 2.9.1, which will allow validating the latest package but does not include the version-validating code introduced for another problem. That will also be good enough for most people – the chance of a compromised mirror is pretty slight.

However for complete security you would need to validate the entire package as installed using a trusted signature from the CD release. Here’s a quick script to do that – it builds a verifiable checksum and validates it against the live system. The core code is embedded in a signed block using my key, with a small piece of code outside to verify the signature and execute the code automatically (not necessary, but the GPG command line to use the GoboLinux keyring is pretty long, so this makes it easier – you can copy the internal block out and validate manually if you prefer).

HopValidate will validate the Scripts 2.10.1 package using a known good checksum, preserving the chain of trust all the way. For full security, you should review the unsigned portion of the code, which uses the system keyring to validate the rest.

The manual command to decrypt is gpg –decrypt –no-default-keyring –keyring=/Programs/Scripts/Current/Data/gpg/goboring.gpg HopValidate, or –verify to verify the signature only. If you’re using this on Rootless, you’ll need to adjust the wrapper script and the command to use your local path to the Scripts directory – there’s no autodetection to keep the code easily reviewable.

[ed. 2010-01-31: Updated for 2.10.1]

Sample LocaliseDirs script

Saturday, April 4th, 2009

Every so often people come along wanting to localise (or otherwise change) the names of the /Programs or /System/* directories. We’re not terribly interested in changing our structure, and for the reasons outlined in one of the design documents I don’t think localising them is much use either, but I’ve written a little sample script that does it that somebody could run with if they were motivated.

It is of course fully possible to use whatever structure you like in Gobo – just create symlinks for your new tree, and optionally use `gobohide -h` to make the real versions disappear. That will suffice for those that just want to change the names for no particular reason (though it never seems to placate them…), but it’s clearly too much of a hassle for localisation.

The LocaliseDirs script will parse a simple tab-separated value file mapping the real location to a new name, and create symlinks to implement that vision. It saves a list of the changes it made into /.Localise_Journal, so that they can be reverted without guesswork (LocaliseDirs –reset), and it can use that file to hide/show the real directories (–hide and –show).

That script is unsupported and not a strong candidate for inclusion in the tools any time soon, but it’s there for those that might be interested in using or extending it. It’s mostly a proof-of-concept and demonstration of how you could go about it manually. If you do improve it, please send along the patches — if it gets to the point where it doesn’t have obvious flaws any more it could be merged into Scripts proper eventually.

Generic flags merged into UseFlags.conf

Tuesday, March 24th, 2009

Ever since the new flag engine came in it’s been possible to specify your generic flags in UseFlags.conf, using the same syntax you’d use in the GenericFlags.conf file. I’ve decided it’s not really worth having two separate closely-related files to do that, so GenericFlags.conf has been merged into UseFlags.conf in the default settings for trunk Scripts. It will make them more discoverable too, which is handy.

New users will get that automatically; existing users will need to run `UpdateSettings Scripts` and merge the files, then delete GenericFlags.conf once it’s not in use. If you’ve modified your generic flags, just concatenate it with UseFlags.conf; otherwise, the auto-merge ought to work.

Two new commands (or new syntaxes, really) come in to make it all easier too: foo:+ bar baz will prepend bar and baz to the generic foo, which may be especially handy in ~/.config/Scripts/UseFlags.conf. The other is foo:- bar baz, which will remove bar and baz from foo (wherever they’re listed).

All of this is in trunk Scripts now; if you’re not tracking trunk, you’ll get to see it in the next release.

Freshen 3.0.10

Monday, February 9th, 2009

There’s a new Freshen release out (should be accessible in the store in about two hours). This is a bugfix-only release, cleaning up some niggles around settings updating.

`Freshen -m Freshen` will do the job once it’s in the store, or `Compile http://mwh.geek.nz/files/gobo/recipes/Freshen–3.0.10–recipe.tar.bz2` if you can’t wait. It is a recommended update and won’t break any existing behaviours.