Is it possible to run the BSD userland as a replacement to GNU coreutils with the linux kernel?

4.6k Views Asked by At

I have been looking for a linux distribution that is not for embedded systems and does not use many of the GNU utilities found in many popular distributions. I want to develop a (pet project) linux distribution that uses musl-libc, bsd userland, and Plan 9 from user space. Before I start and possibly waste time doing the impossible, is it feasible/practical to use the BSD userland as a replacement for GNU coreutils? If not, what is an alternative?

2

There are 2 best solutions below

1
On

Your goal appears to be much close to stali project (the only difference is the BSD userland requirement).

http://sta.li/

I don't know much about the stage of this project, but you can get some help in the project mailing-list.

As far as I know, the BSD tools uses a lot of direct syscalls and little usage of the POSIX API. I don't believe that bsd guys had written code using a lot of #ifdefs to get fully compliant programs (but I can be wrong)...

The suckless site ported the plan9 userland to unix (based on plan9port too), it's called 9base (and is available on archlinux repo to install).

I think you'll have the same problem I had in the past trying to assembly a similar distro: Too much effort to get rid of GNU... The base system is easy, but for something useful you'll need a C compiler and then you're out of good alternatives. GCC is gnu and have dozens of gnu dependencies and the sane freebsd gcc port never will work on linux for obvious reasons.

My current try is help finish the ken-c (or 9-cc) port for linux.

0
On

https://chimera-linux.org/

Linux with Alternative userland

Chimera comes with a novel userland setup based on FreeBSD core tools (replacing coreutils and related projects like findutils, diffutils, sed or grep; read our FAQ for details about why).

The FreeBSD tools were chosen for their high quality code and solid feature set. Some source code is also taken from NetBSD and OpenBSD. While we are not philosophically opposed to GNU/GPL and licensing is not really a factor, there are real benefits to using them, and they are overall a better fit for the project.

The LLVM/Clang suite provides the system toolchain (clang, lld) as well as runtime parts (compiler-rt, libunwind, libc++). The C library is provided by musl, patched to use LLVM’s (also used e.g. in Android and Fuchsia) Scudo allocator for performance as well as security.

This means Chimera is not a GNU/Linux system, as it utilizes neither GNU utilities, nor GNU libc, nor GNU toolchain. The system is bootstrappable almost entirely without any GNU components (other than make) and is capable of booting without them (however, most people will have some).