Spotted in the wild: Chimera – a Linux that isn't GNU/Linux
- Reference: 1676288528
- News link: https://www.theregister.co.uk/2023/02/13/chimera_non_gnu_linux/
- Source link:
[1]Chimera Linux is a new project which began in mid-2021, but has already made considerable progress. Its solo developer is Czech programmer Daniel [2]"q66" Kolesa, who gave a [3]talk about his project at FOSDEM last weekend.
His talk was part of the FOSDEM's BSD program stream, which itself is a hint that this is not a typical Linux distribution. This is reflected in its name: the original [4]chimera was a mythical creature whose body was made up of parts of different animals. There's a certain kind of Unix geek who insists that [5]Linux should properly be called GNU/Linux , because the kernel is built with the [6]GNU C Compiler , everything is linked against the [7]GNU C library , uses the [8]GNU coreutils , and usually multiple other components from the GNU Project.
[9]
Chimera Linux is an existence proof that this is not a hard requirement: it avoids all of these. Chimera is compiled with LLVM, uses the same [10]musl C library and packaging tools as the [11]lightweight Alpine Linux distro , the new [12]Dinit init system, and much of the rest of the userland is drawn from [13]the current version of FreeBSD . If things go according to plan, Kolesa hopes to release the first alpha version around the same time as the planned FreeBSD [14]version 13.2 , so that he can rebase on that version of the underlying tools.
[15]
[16]
Kolesa's talk is recommended, but be warned, it's very technical. For a quick overview, you can read his [17]presentation (PDF).
One of the things that BSD fans tend to praise is the sort of somewhat abstract virtue that appeals to hardcore Unix types: each BSD keeps the source code of the core OS in a single directory tree, making it possible to build the entire thing in a single operation. Third-party components are relegated to an external "ports tree". A Linux distro, on the other hand, is not so much "an operating system" as several thousand separately-developed OS components all flying in extremely close formation.
[18]
Chimera is an attempt to bring some of that design clarity to Linux. It's not all FreeBSD all the way down: this is still a Linux-based OS, and it remains binary-compatible with Linux. In a way, Chimera is the inverse of the now unmaintained [19]Debian GNU/kFreeBSD . That project put the GNU userland and Debian tools on top of a BSD kernel.
Instead, Chimera puts a ported version of quite a lot of the FreeBSD userland on top of the Linux kernel, with a native Linux, but non-GNU, C library. Another distro that uses the muscl libc is [20]the minimalist rolling-release Void Linux , of which Kolesa is a former developer.
An important part of this is replacing the GNU coreutils. Before attempting to port the FreeBSD equivalent across himself, he found an existing such project: [21]bsdutils . He upstreamed some fixes for this, but ended up forking it to create his own version: [22]chimerautils .
[23]
Aside from the these, the C library and the init system, Chimera uses several other non-FreeBSD tools. Although he is offering his patches to the FreeBSD code back upstream, and some are being picked up, he tried and then discarded FreeBSD's [24]pkg tool, commenting that "it's quite obvious that it's mainly all geared towards FreeBSD usage right now." (To be fair, that does seem reasonable enough to us.)
Instead, he uses [25]apk , which is short for Alpine Package Keeper and which he says "ended up proving to be a great fit". Even here, though, he's ahead of the curve, with his apk command based on APK version 3, which is not yet used in Alpine itself. APK 3 moves away from using tarballs and "has its own, custom, structured package format, which should help with avoiding vulnerabilities in the package manager."
There are many signs of this kind of attention to detail in his talk: checking for existing work, evaluating alternatives with an open mind, and cherry-picking then adapting the best bits.
For now, Chimera is still in its preliminary stages, but astonishingly, the project already supports four architectures. Kolesa told us:
ppc64le is my workstation, so that's the primary development target; x86_64 , for most people's computers; aarch64 for my single-board systems; and RISC-V_64, because I thought it would be cool to have it early while most distros are still figuring it out. (And also, I own the [26]HiFive Unmatched board from SiFive, and thought it would be sad to leave it mostly unused.)
There are live media and root filesystems available for [27]download . It's significant that the only desktop on offer right now is GNOME on Wayland (although other desktops will be supported later) – it's one of the bigger and more complex desktops out there, with significant dependencies, including on parts of systemd, and he comments that porting GNOME to FreeBSD was hard and messy. Getting all of this working on Chimera – and indeed building in LLVM – exercises the subsystems and helps uncover problems.
[28]Youtube Video
The talk has a lot of discussion of hardening and error checking, as one might expect from someone whose [29]day job involves developing mobile web browsers and the like. Here, LLVM and Clang enable a lot of additional error-checking and hardening, over and above that of the GNU toolchain.
Examples are [30]ThinLTO link-time optimization, and integrating the LLVM [31]Scudo hardened allocator into Musl.
[32]Don't bore us, get to the Horus: Elementary OS 7 is here and looking good
[33]Open Source Policy Summit: Where FOSS and government meet
[34]LibreOffice 7.5 update: A great time to jump on this FOSS productivity suite
[35]Founder of FreeDOS recounts the story so far, and the future
Another focus is not merely ripping out systemd and associated tools such as [36]elogind , but reproducing their functionality – for instance, the [37]Turnstile session tracker.
Chimera Linux is a project to watch – not only because it's incomplete, but because it's perhaps the most ambitious distro we've seen in many years. So far, it doesn't even have an installation program, although the steps to get it installed are [38]documented .
Chimera has bold goals: as Kolesa says at the start, projects with a single goal tend to fail, because if they achieve it, there's nowhere else to go. Chimera isn't just a proof of concept, such as a GNU-free Linux distro, or an effort to replace FreeBSD's kernel with a different one while keeping everything else. He is aiming to produce a viable alternative system, which doesn't just rip out some widely accepted and used subcomponents, but replaces their functionality in a cleaner, better way. ®
Get our [39]Tech Resources
[1] https://chimera-linux.org/
[2] https://q66.moe/
[3] https://fosdem.org/2023/schedule/event/chimera_linux/
[4] https://www.theoi.com/Ther/Khimaira.html
[5] https://www.theregister.com/2001/06/05/just_call_it_gnu_linux/
[6] https://gcc.gnu.org/
[7] https://www.gnu.org/software/libc/
[8] https://www.gnu.org/software/coreutils/
[9] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2Y@pstIPwCDf-hZKYLOBGOgAAAIU&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[10] https://www.musl-libc.org/
[11] https://www.theregister.com/2022/05/26/alpine_linux_316_released/
[12] https://davmac.org/projects/dinit/
[13] https://www.theregister.com/2022/05/20/freebsd_131/
[14] https://www.freebsd.org/releases/13.2R/schedule/
[15] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Y@pstIPwCDf-hZKYLOBGOgAAAIU&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[16] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33Y@pstIPwCDf-hZKYLOBGOgAAAIU&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[17] https://fosdem.org/2023/schedule/event/chimera_linux/attachments/slides/5397/export/events/attachments/chimera_linux/slides/5397/chimera_2023.pdf
[18] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Y@pstIPwCDf-hZKYLOBGOgAAAIU&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[19] https://wiki.debian.org/Debian_GNU/kFreeBSD
[20] https://www.theregister.com/2018/05/16/contributing_to_keep_small_linux_alive/
[21] https://github.com/dcantrell/bsdutils
[22] https://github.com/chimera-linux/chimerautils
[23] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33Y@pstIPwCDf-hZKYLOBGOgAAAIU&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[24] https://github.com/freebsd/pkg
[25] https://wiki.alpinelinux.org/wiki/Alpine_Package_Keeper
[26] https://www.sifive.com/boards/hifive-unmatched
[27] https://chimera-linux.org/downloads/
[28] https://video.fosdem.org/2023/AW1.120/chimera_linux.webm
[29] https://www.igalia.com/
[30] https://clang.llvm.org/docs/ThinLTO.html
[31] https://llvm.org/docs/ScudoHardenedAllocator.html
[32] https://www.theregister.com/2023/02/10/elementary_os_7_horus/
[33] https://www.theregister.com/2023/02/09/open_source_policy_summit/
[34] https://www.theregister.com/2023/02/03/libreoffice_75/
[35] https://www.theregister.com/2023/01/18/retro_tech_week_freedos/
[36] https://github.com/elogind/elogind
[37] https://github.com/chimera-linux/turnstile
[38] https://chimera-linux.org/docs/installation
[39] https://whitepapers.theregister.com/
Re: Igalia again?
God bless her and all who sail in her...
MUSL floating point is incomplete on ARM 64 bit
I have been doing some numerical (ODE/chaos) work, using exclusively long doubles (please don't attempt to persuade me they are unnecessary!), but found that on aarch64 (which I run on my Raspberry Pi 400s) the trig functions are merely double precision. I can't find out whether this is ever going to be fixed . . .
Re: MUSL floating point is incomplete on ARM 64 bit
From [1]Wikipedia
"In C and related programming languages, long double refers to a floating-point data type that is often more precise than double precision though the language standard only requires it to be at least as precise as double . As with C's other floating-point types, it may not necessarily map to an IEEE format."
There is nothing in the C specification that states that a long double has to be more precise than just a double, and actually specifies very little about the real size of data types. This is a long-standing feature for integer and floating point datatypes, all the way back to the original K&R.
It is also possible that the underlying hardware does not provide quadruple precision floating point arithmetic (come on, we're talking about a Raspberry Pi here!), so if they actually did it, it may have to be done (slowly) in software.
So no conflict with the standard, it's not a defect, and won't be 'fixed' any time soon.
[1] https://en.wikipedia.org/wiki/Long_double
Re: MUSL floating point is incomplete on ARM 64 bit
Was that an attempt? ;) Doesn't matter. I want them, and I can get them on all GNU/Linux systems (and probably on BSD I haven't looked).
Technically, the extended precision is based on 80-bit HW floating point on "intel" systems, 64-bit HW on ARM 32 bit systems, and 128-bit software floats on aarch64.
MUSL on aarch64 does 128-bit floats fine inherently, it is just the math library that clobbers it.
Perhaps you will now want to explain to me that SW floats are slow? I still don't care - I want them ;)
Re: MUSL floating point is incomplete on ARM 64 bit
I misunderstood your comment. I had not realised that you were saying that although MUSL does software 128 floating point arithmetic correctly on AArch64, some of the other maths functions in the library don't work to this precision. That does seem a bit of an omission.
I was commenting on something much more generic with C data types. Sorry.
Re: MUSL floating point is incomplete on ARM 64 bit
long double is 64-bit on musl in general; i doubt this is going to be fixed, and IMO it's a good thing (as you can never really be sure what long double is going to be, it's never guaranteed to be better than double precision)
you can use explicit quad-precision types if necessary, at least then you have a guarantee that they are indeed quad-precision (though of course, you cannot use standard c library with it for math ops, so a separate library would be needed, gcc provides libquadmath but llvm does not, but perhaps this could be addressed at some point)
But why?
I can understand removing SystemD but why the push to remove GNU?
Just curious.
Re: But why?
Maybe he doesn't like Stallman?
Re: But why?
In his presentation he says one reason is to prove that Linux does not equate to GNU/Linux.
Good enough reason for me but then he describes one of the biggest pains for those who need to modify a distribution, the system daemon. For embedded, single board people, it really sucks being forced into using Ubuntu if your SOM maker only supports it (and has proprietary dependencies in their variant of it). I agree with his assessment that systemd was needed but just isn't that great, it's got problems, like all init systems. I'm excited by his init system being designed to be modifiable down to bare initramfs yet able to work with Gnome (not that I require Gnome usually, it's just a great validation step/forcing function for development). Systemd just gets more and more brittle and it feels like even with plenty of experience plumbing with it and reading the documentation, it still can break unexpectedly from subtle changes.
Re: But why?
From my point of view, the GNU toolset is going in a direction that I don't like.
I was annoyed when they pulled netstat, route, ifconfig et. al. from the TCP packages, and I was extremely cross when they pulled pg from coreutils (I work on traditional UNIX systems for my job, and muscle memory is persistent). It seems that some decisions are made on the whim of the package maintainers who won't listen to counter arguments.
So, yes, having a free platform with alternate tooling is of interest to me, although I would ask why, if you want the FreeBSD tooling, why not run FreeBSD?
The reason why I'm currently sticking with mainstream Linux distros is the scope of the pre-built repositories, although the above changes and systemd are challenging that decision.
Re: But why?
netstat, route, ifconfig et al on Linux were never provided by GNU; they are part of net-tools (which is likely still available for installing on your distribution). The biggest reasons most distros switched from net-tools to inetutils were maintainership (net-tools had very little activity at one point, and all user-space support for cool new kernel networking features was going straight for iputils); and for whatever reason net-utils broke the output format of ifconfig which "forced" many distros to carry old net-utils versions.
Re: But why?
net-tools is marked as depricated by many distributions, but I knew that it could be installed if it was not in the standard set for a distro. Unfortunately, I don't have admin. access to all of the Linux systems I work with, and do not have total freedom on some of the ones I do, so it's difficult on those systems.
I had assumed that because it was part of the fundamental networking in older GNU/Linux systems, that it was a part of GNU provided toolset. I must re-educate myself about exactly how much of the toolset is actually provided by the FSF.
Re: But why?
Disclaimer: I'm not claiming the scenario I'm about to propose is the (or even a ) reason this project exists, but it is one reason why someone would create such a project:
Because of the (L)GPLv3 (although getting rid of as much GPLv2 as you can is also a plus for this scenario). Unlike the GPLv2, the GPLv3 requires hardware manufacturers distributing GPLv3-covered software to allow users to run said software on the hardware they sold, to stem what TiVO did (they gave the entire GPLv2 bits, but you couldn't run your own freshly baked OS image because it would only load signed images). IIRC, GPLv3 also closed a loophole regarding build systems (IIRC, you can arguably legally distribute your modified version of any GPLv2 stripped of the build system/"forgetting" to add the plumbing on the build system for your modifications).
Note that they didn't get here first; Android has been (L)GPLv3-free from day one, with their own ground-up implementation of Linux userspace (busybox is pretty much the only base component not written by google), and before that macOS stuck to the last stable GPLv2 versions of gcc, binutils/coreutils, bash, and samba until they got their own versions (invested heavily in LLVM, got coreutils from BSD, zsh to replace bash, and their own ground-up SMB implementation)
PD: Yes, Linux is GPLv2, but license enforcement efforts on the Kernel have been few, and there is seemingly lack of interest in enforcement within the project.
Re: But why?
it's definitely not a reason, as this is a free software project and therefore concerns of random corporates about the gpl don't matter to me whatsoever
i do prefer less restrictive licensing for my own code, but there is absolutely nothing blocking (l)gpl3 stuff going to chimera (and there is plenty); the only real concern is agpl-licensed stuff because of potential legal concerns, but this is also of concern to mainstream distros
Re: But why?
why the push to remove GNU
It helps to increase diversity. Like in life a monoculture of plants is more susceptible to devastation when hit by a virus or similar.
That is why I am pleased that the Intel x86/x86-64 architecture is seeing more competition.
Re: But why?
the project faq answers this and a lot of other things
(one thing i will say is that there is no silly ideological reason behind it)
several thousand separately-developed OS components all flying in extremely close formation
The Avro Shackleton is widely known to aviation buffs as "50,000 rivets flying in close formation" and is presumably the source of today's Linux wit.
Curiously, there is indeed a "Shackleton OS," though it ap[pears no more than a concept inspired by a mashup of Linux and iOS >shudder!<
Are we heading toward a converged Unix?
Or several Unices flying in close formation.
Gnome and Wayland?
I thought it sounded a nice idea until I read "Gnome on Wayland" :( Why?! I hate Gnome and Wayland is too new for me. A simpler DE and traditional X would have been nicer IMHO.
Re: Gnome and Wayland?
My thoughts too. Wayland is the systemD of graphical infrastructures.
Stallman on removing GNU from Linux
Around 20 years ago, I went to see Stallman give a talk in London. To get a sense of the time, the crowd was full of black t-shirts including a selection from ThinkGeek, a large contingent of "Perl Monks", and a couple involving the BSD daemon apparently buggering Tux the penguin. If you've ever been to a Stallman talk you'll know that he has a Q&A at the end, during which there are usually a couple of edgelords who try to ask awkward questions. On this occasion a guy stood up and asked what Stallman thought about a project at the time that sought to replace all GNU software in Linux with BSD equivalents.
Stallman's response was "I'd say, what an enormous waste of effort."
Re: Stallman on removing GNU from Linux
Stallman's response was "I'd say, what an enormous waste of effort."
It appears to be one guy's pet project. Maybe it'll go somewhere, maybe it won't. But if he wants to try, why not?
Containers
If its BSD running on a linux kernel you should be able to run it as a container in a normal linux host.
Not sure myself why you would want to do that but I'm sure somebody will want to.
Sound and fury
I know some corporates, e.g., Google, will not allow GPLv3 inside their code. Difficult to speculate why, perhaps it creates a hardware creep akin to Balmer's description of Linux, which seems to suggest GPLv3 does what it says on the tin and if there's no need to pick up the tin then don't.
Chimera is a pre-alpha by one person (see the appropriate XKCD) It might or might not be interesting, I've got no idea. Good luck to him scratching his itch.
I suppose the number of people involved will multiply based on the number of comments on this thread.
Perhaps one way to discover if any of this really matters is when Chimera gets to an RC and there are several developers.
Igalia again?
I'm not sure what they're putting in the water there, but it's clearly working.