Movatterモバイル変換


[0]ホーム

URL:


     

The Unix tree rethought: an introduction to GoboLinux

Hisham Muhammad, May 09 2003.

Lately, there has been lots of discussion on the current state of Linuxas a desktop system, and articles pop uphere and there, occasionally with very good ideas. However, nonehave surprised me more thanthisone. It was all very hyphothetical, but had pretty radical ideas onhow the thought the Linux directory tree should be reorganized. This wasclearly the most polemical part of the article, and raised manydiscussions whether something like this could actually be implemented.And that's the reason for my surprise: we had this implemented for overan year.GoboLinux is a Linuxdistribution based on an alternative directory tree, which has evolvedfrom a customLFSinstallation to a distro that's used and maintained by a small group ofpeople today. It was interesting to see that there's a lot of peopleinterested in ideas similar to ours. So, maybe it's time for us to comeout of the shadows.

A bit of history

We all remember the time when talking about Linux distributions for thedesktop meant arguing which has the best installer. Much has evolvedsince: the easy, graphical installers are here, but we'renotquite there yet. Among the usual rants on "why (insert pet peeve here)is the problem", some interesting ideas come up from time to time. Moreinterestingly, some people started to believe maybe it's time for moreadventurous attempts.

Oddly, GoboLinux did not start as one of those. The whole thing startedwhen I had to install programs at the University. As I had no writeaccess to the standard Unix directories, I created my own directoriesunder$HOME the way I saw fit. I upgraded the programs fromsource constantly, and couldn't use a package manager. My solution wasthe most obvious one: to place each program in its own directory, suchas~/Programs/AfterStep. Soon the environment variables(PATH,LD_LIBRARY_PATH...) got bigger and bigger, so Icreated centralized directories for each class of files, containingsymbolic links:~/Libraries,~/Headers and so on. Anatural evolution was to write shell scripts to handle the links,configures andMakefiles.

This system proved itself to be very convenient to use. At my homesystem, I started to gradually remove pre-compiled packages andrecompile them with those scripts. I was moving towards a completelycustom Linux system, which I jokingly called LodeLinux. When I had itabout 80% complete, the Great Filesystem Crash struck. It was time tostart it all over again, but this time through a different route:instead of "deconstructing" an existing distribution, me (Hisham Muhammad) and a friend,André Detsch, spent twodays building a modifiedLinuxFrom Scratch system. Without much fuss, on March 20, 2002, GoboLinuxwas born. A month later, we presented an article at the3rd. Workshop on FreeSoftware called "A new proposal for the Unix directory tree".

What is it all about?

GoboLinux is definitelynot "yet another Linux distro for thedesktop". It is entirely based on an alternative directory structure.Every program lives in its own directory: you'll find XFree86 4.3 at/Programs/XFree86/4.3/, andping at/Programs/Netkit-Base/0.17/bin/ping. To see what programsare installed in the system, all you need to do isls /Programs.

For each category of files, there is a directory under/System/Links grouping files from each application as symboliclinks:Executables,Libraries,Headers,Shared andManuals. For compatibility, each "legacy"directory is a link to a corresponding category. Therefore,/bin,/sbin,/usr/bin,/usr/local/bin (and so on) areall symlinks to/System/Links/Executables. Environment variablesare also simplified:export PATH=/System/Links/Executables isenough.

In short, what he have is a database-less package management system:the directory structure itself organizes the system (wasn't that itsoriginal purpose, after all?). Each program directory (for example,/Programs/KDE) holds version directories (/Programs/KDE/3.0,/Programs/KDE/3.1.1), and a version-neutral directory forsettings (/Programs/KDE/Settings), to keep files that wouldnormally be in/etc. Keeping two or more versions of a libraryis trivial. When most distributions switched to GCC 3 they released anew major version, mostly incompatible with previous ones. When the 006series of GoboLinux adopted GCC 3, it was just a matter of keeping oldversions of libraries alongside the new ones, while they were graduallyphased out. No "compat" packages involved.

Most tasks in GoboLinux are automated by a collection of scripts. Tocreate a GoboLinux package, just type something likeCreatePackageCoreUtils. All this command does is storingCoreUtils/5.0/andCoreUtils/Settings in a .tar.bz2 file calledCoreUtils--5.0--i686.tar.bz2. A link called/Programs/CoreUtils/Current indicates which version iscurrently in effect. This is used by the scripts as a 'default version'.Installation of a program is handle by three scripts:PrepareProgram, which creates the/Program/ hierarchy and passes the properoptions toconfigure.SymlinkProgram creates thelinks at/System/Links. A wrapper script,CompileProgramcovers the commonconfigure && make && make install case (witha number of command-line options to handle special cases).

Alternative boot scripts

Since we felt like we were "starting from scratch" and we really wantedto make a system where everything just made sense for us, we also tookthe time to rethink the boot scripts. I felt the two historical models(System V and BSD) were overkill for our common desktop-machine setup.GoboLinux uses a simpler system: two scripts,Init andDone,do most of the job. Additional scripts, such asMulti andSingle, take care of the runlevels. These files are simplysequences of commands, prepended by the wordExec and a messagestring. Here's an excerpt ofInit:

Exec "Setting clock..." SetClockExec "Loading keymap..." loadkeys "$KeymapLayout"Exec "Bringing up the loopback interface..." ifconfig lo 127.0.0.1

More elaborate tasks such asSetClock are defined as shellfunctions in aTasks file (these tasks can also be called fromthe command-line using theRunTask script). Configurablesettings are defined as environment variables in theOptionsfile. The wrapper functionExec allows for a nifty additionalfeature: boot themes. The boot sequence can look Slackware-like (withthe standard error/output messages), RedHat-like (with lots of OK's), orGoboLinux-like (the latter uses a modified version of theLinux Progress Patch).

The "legacy" tree

Unfortunately, not all programs have the flexibility to be installedanywhere. Occasionally, hardcoded paths creep in even in programs thatbelong to userland, and should, at least theoretically, allow themselvesto be installed inside, say, a user's home directory.

As much as I'd like to see this done in the long term, patching allapplications is not an option. For this reason, GoboLinux keeps, asstated earlier, a legacy tree where all usual Unix paths are mapped toGoboLinux equivalents, so, if aMakefile looks for/usr/X11R6/include/X11/Xaw3d/XawInit.h, it will find it, although it is at/Programs/Xaw3d/1.5/include/X11/Xaw3d/XawInit.h, where itbelongs. When two applications have a directory entry with the samename, the GoboLinux scripts recursively expand them. Both XFree86 andXaw3d haveX11 underinclude. A directory/System/Links/Headers/X11 is created automatically, holdinglinks from bothX11 directories.

Another interesting feature is that the GoboLinux scripts executemake install using a special user id that only has writepermissions inside the program's source directories and the program'sentry under/Programs. This way, files can't "escape" fromthe GoboLinux hierarchy and slip directory into the legacy tree.

The GoboLinux directory structure brings a fresh, clean look the Linuxsystem, but the presence of the legacy tree, while necessary, takes someof this beauty away. Mac OS X uses a "dirty trick" to cover up its Unixnature: the Finder won't show the Unix directories, but you can see themfrom the command line. In Linux we have many different ways for lookingat the filesystem (shells, file managers, browsers...), so we had to godeeper to have a cleanly-looking system. GoboHide is a (obviouslyoptional) kernel patch plus userland application written byLucas Correia Villa Real andFelipe Damásio that effectively implements "hidden files" onLinux (way beyond dot-files, which are implemented on UI-level just likeFinder does).

Here's whatls / looks like on GoboLinux:

Depot  Mount     SystemFiles  Programs  Users

Related work

As you read this, you have probably found many familiar concepts (not tomention directory names). GoboLinux has clearly found inspiration inother operating systems, like Mac OS X, BeOS andAtheOS, but I think that the notion thatthey build "something different" using an existing Unix base (be itusing a Unix kernel as in OS X or using GNU tools as in AtheOS) was themost important influence of all. Right now there are several otherprojects, in various stages of development, that use the Linux Kernel asa foundation and feature alternative directory trees. Interestingly,most of them are clones or heavily inspired by a specific proprietary operating system:ROX OS intendsto be a RiscOS-like system,LinuxSTEP is a project based onGNUstep aiming for a NeXT-like system, andBlueEyedOS aims for asource-level-compatible BeOS clone.

GoboLinux, on the other hand, is not a clone of anything else. It usesstandard Linux desktop software. We believe that the well-organizeddirectory structure makes it a good testbed for new ideas -- possibilitiesare wide open.

Where are we now?

GoboLinux has evolved immensely during the last year. Atgobolinux.org you can find an ISOimage of our latest release, 006. It's a bootable "live CD" runningGoboLinux in a chrooted read-only filesystem, so you can walk around thedirectory structure and have a peek on how GoboLinux feels like. The CDalso features the usual installer scripts and extra packages. There's noflashy graphical installer yet, but I think the ease-of-use of theinstallation reflects the overal ease-of-use of the system as a whole(unlike it happens on many distributions).

Despite of the very small userbase (we have never really announced itanywhere yet), the project has progressed quickly and has been fullyusable for quite a while right now (most GoboLinux developers use itas their only operating system, and a few others do so, too).

© 2002–2026 GoboLinux.org


[8]ページ先頭

©2009-2026 Movatter.jp