Building a custom Linux

Hello world,

From the start, I want to say, that I didn’t want to write this, because so of you may remember the older posts I’ve and wanted to impress you on how far I’ve come in the Linux space.

All that aside as time is a little limited and I don’t really find anything good to read about this I wanted to ask you guys.

I want to craft a debloated, fast and agile, modern and maintainable Linux OS for my next PC build.

I’m looking to have the following components:
Arch Zen kernel , as a fast “gaming” kernel
Zshell or recommended by my friend Fishshell
Do As instead of Super User Do as for security reasons
Gnome, because it seems quite nice
And maybe Aura?

What do you think? Where should I start? DHS22 is coming up and I kind of need to start setting things up. Also I need to learn to set it up so I can setup Ubuntu server for our LMSE.

Alvast bedankt.

I would go with Gentoo if you are going that route. Free pro-tip though; this is way more trouble than it is worth. A stock Debian or Arch is already pretty unbloated to start with. Good luck though!

3 Likes

That sounds like a contradiction. A full-fat DE comes with lots of software, and daemons running this and that. XFCE or LXQt might be better for avoiding bloat.

3 Likes

Since OP mentions Aura—I assume s/he means the AUR helper written in Haskell—and the fact that the “Arch” Zen kernel is specified, I think they’re just asking for software selection advice for an Arch system in the first place? Reading through General recommendations would be a good start. For AUR helper, I use paru (the helper written in Rust).

Personally I don’t think using doas on Linux is “modern/maintainable”. If you just want to avoid using sudo because of bloat, you could just avoid installing it and use su directly.

As for desktop environment, using a standalone window manager like i3 (https://i3wm.org/) is honestly one of the most minimal, performant, popular options out there. Otherwise basically what jlittle said and suggested, especially if you prefer to have GUIs for configuring stuff like displays.

1 Like

I don’t think what you are trying to achieve is worth the effort TBH. It would be easier to just grab Arch or Artix base, or Debian and remove stuff from it, especially since you want the Linux-zen kernel.

If you want a better gaming experience, you should probably look into lighter desktop environments, like jlittle mentioned. One pretty lightweight combination I went for when I used Arch on my work laptop (don’t judge) 3 or 4 years or so ago, was to install LXQt and replace Openbox with KWin for the eye-candy and other performance tuning from KDE (and used latte-dock, because I couldn’t stand not being able to use my old Super+[1-9,z-.] key combinations to switch between programs. The CPU utilization was minimal and RAM didn’t go above 350 MB, probably even less since LXQt with Openbox barely touches 130 MB and I know a light Plasma desktop doesn’t go above 400 MB.

There is a difference and somewhat of a compromise between minimalism and performance, when it comes to software development, but not necessarily mutually exclusive. What I mean by this is that you could “debloat” your system (whatever that means to you) and still not achieve a decent gaming performance. For example, if you go with a custom kernel that removes everything to the bare minimum for your hardware, you may miss on some performance tuning options that add a bit of bloat to the kernel, but make the system feel smoother.

In another example, using just a single-threaded Window Manager will be very minimal, but at the cost of screen tearing and potential stutter or frame drops. I would guess i3wm and sway are pretty performance optimized, as opposed to something like dwm which keeps the code minimal. It is very clear that dwm is the less bloated choice, but I would guess you would have a better time on i3 or sway.

One thing to note, I was using JWM + Compton on my raspberry pi, which worked, but screen tearing could still be observed in video playback, but when I moved to sway, everything was smooth. Wayland is just that good if you can get away with running it. I never managed to get KWin_Wayland and LXQt to play together nicely, so I only used Xorg KWin with LXQt.

Both GNOME Shell and Plasma5 have Wayland sessions, but I would argue that if you want a minimal setup to give more resources to your games, you shouldn’t use those. However, I would strongly argue that if you have the girth resources to run GNOME Shell or Plasma5 and you prefer a more featureful desktop environment, use those instead. I have ran KDE Wayland on my previous computer and I can say, while it was a bit unstable after 2 weeks or more of uptime, the perceived smoothness was great. I didn’t play games on it however, I had a Windows VM for that. But that was like 2 years ago, so I would guess a lot has improved in KWin_Wayland.


Then, there will be the new cool kid in town, SteamOS 3.0. It is using an Arch base and I would guess Valve would allow the user to break his own system if one wants to dig into it, so instead of trying to make a distro now, maybe you should wait for this to launch. I don’t really like the hype around the SteamDeck, mostly because everyone talks about it to death, but also because while the hardware is cool and all, there is not a lot of emphasis on the OS itself. It’s Linux! So potentially anyone could make an alternative to the Deck or a DIY steam machine (those are 2 words you probably haven’t heard in a long time) and slap SteamOS 3.0 on it. And I would assume the Valve engineers may be putting at least some effort to make the OS more optimized for gaming.

Even though I kinda despise Arch (mostly because it’s been so unstable over the years, with Manjaro taking the cake in that department), I’ll probably be trying SteamOS 3 if I’m going to get another x86 computer, although I’m uncertain about that. I haven’t seriously tried Artix, but some issues I had with Manjaro and Arch were due to systemd (things like not unmounting file systems or network shares), but I did have Arch completely bork itself due to a motherboard or RAM failure on my work laptop and when I moved it to a known working laptop, I couldn’t get Arch to work properly, the root FS was K.O., so I slapped Fedora on the other laptop, as I was in a pinch to get it working and go back to work (and enjoyed it).

Speaking of which, besides SteamOS, the only other distros that I would personally run if I were to get back into gaming would be Fedora, Artix-s6 or Pop!_OS, in this order. As general purpose distros, I like Void and Alpine more, but I mostly use the musl variants (well, Alpine is musl only). I know people ran Void with glibc for gaming and enjoyed it, but I would guess it will need quite a lot more effort to get it to run linux-zen and probably getting other software, like Steam going (I haven’t ever enabled the proprietary repos, so I don’t know what’s in there, but now I’m on ARM, so I have even less of a reason to do so).


I remembered I haven’t addressed the minimal software aspect when it comes to CLI tools. You only use sudo when you update stuff, so there is no reason to refer to sudo as bloat when it comes to a gaming distro, because tools like sudo and other CLI tools do not impact your system’s performance. They only run when you execute them, then they terminate, using no system resources other than storage.

I do use doas (and yes, I do see it getting updated from time to time), but I do so because I have no need for all the sudo features and because my distro easily allows me to ignore dependencies and remove them from my system, sudo included. And because I don’t want to login as root, I prefer staying in my own shell (ksh) with my own colorful options and display settings, and changing the .profile for the root user is not recommended (although the default shell for root is dash, so should technically be fine).

I do agree that on a distro like Arch and Debian, and to a lesser extent Void, you will find a lot more tools preinstalled than you will find on a distro like Alpine. But those do not impact the performance of your system. What does impact the performance is services that run in the background, which is why I don’t like Ubuntu-based distros, I don’t know what they do, but they got too much stuff in the backend.

1 Like

In the sense that it has many possible risk factors being such a big package

Well it isn’t, because debloat is a reason for other things. I’ve recently perceived GNome to be quite nice and I would like to look at it more. I’ve tried KDE and Cinnamon before. Cnamn I would prefer over the other, just way more features rich.

Well, it is either Arch, Fedora or Gentoo. But I’ve seen Fedora before and was quite disqusted by it. And for Gentoo, I don’t want to be spammed with the Anime clip. Rather have these:

Also, taking an existing distro and debloating it, would be an option if I could make it an iso or other easy way to install it on other computers.

I used mmdebstrap for my Debian. But, whichever distro you pick the process will be roughly the same, you’ll need to install packages in a couple of phases/waves/steps/groups using some kind of tool, and you’ll have either some commands to run before/after each group that override whatever distro has chosen with something you want.

If you don’t like the distro provided tooling for making live images/installation media/chroots … you can make your own either from scratch or using one of these as a starting point.

Reason I made my own was that I’m using Debian for my router, and wanted something minimal with exactly the stuff I need to restore from a backup. I basically, need to boot off of a USB stick, get IP from DHCP and start Tailscale and sshd, and be able to run rclone <google_drive> cat <some snapshot> | zstd -d | btrfs recv to restore a router backup.

It’s been relatively hard to build the damn thing.

1 Like

You can do that with both Debian and Fedora, tools exist for that. Problem is:

  1. “Bloat” varies from use case to use case, for instance a graphics stack is usually considered bloat on a server or embedded system, but not on a desktop system.
  2. You need to keep this up-to-date. For instance, Ubuntu at one point depended on mono for a couple of applications. It isn’t required anymore.
  3. As time moves on, old tools will stop being used and new ones will replace them. For instance, today we have Firefox and Chrome. In a year, you might use Firefox over Chrome, or vice-versa.

So, yeah, it sounds like a great idea… Until you realise the patch management nightmare that follows with it. Still, feel free to try it, but I’d suggest a revision every three months or so.

1 Like

“i want to craft” and “maintainable” are mutually exclusive imo

but i’ve been there. you want gentoo, which is basically LinuxFromScratch with a lot of prebuilt tools to make life suck less. get yourself way too far into the weeds with CFLAGS. optimise every thing down to the nanosecond. you’re going to end up right on the bleeding edge, and you’ll cut yourself. repeatedly. it’s pretty fun, and you learn lots!

eventually you realise it’s a nightmare and the extra handful of FPS isn’t worth the effort compared the ease of starting from a minimal debian install and actually getting to use your computer instead of babysitting updates.

avoid distros using snaps and flatpacks and you’ll be 90% of the way to “debloating” your OS.

having said that, i’m going to play with liquorix (the ‘zen’ kernel) tomorrow when this render is done, there’s a debian build for it, and I haven’t broken a distro in a while… :rofl:

2 Likes

Hello again,
is a little while now but on the weekend I had some time to install and build on my laptop. Still waiting for PC.

I don’t know why think this was so hard,

I installed Arch from a USB stick partitioned and did all that stuff, removed sudo and other things I didn’t need. Created custom commands with alias so it would be faster to install and remove apps. Then I upgraded to Zen kernel and GNOME. Had some fun with the keymaps, for some reason it change to every single key to random and had to reset but other than that no big issues.

I still need to figure to create an automatic script that it enables NetworkManager. I have no idea why Bluetooth doesn’t work, I got all the bluetooth pre-requisites mentioned in the wiki, idk but I can’t get nautilus-bluetooth. Then another issue that the keymap is US on boot, although I can go into the terminal environment and it will be the proper keymap, and also changed it in the file. Weird scrolling with two fingers and plasticy sound, is not much of an issue.

Although this is not completely what I imagined:
Downloading Arch src then adding Zen, Zsh, doas and others directly into the src, to the image it and have an iso ready for my pc.

Well so far I am at v0.5.2, I have way longer battery on my laptop now and things run smooth.
behold the SKAR OS


(logo, versions and other OS meta data is in the works)

For now it’s just a test ui, I’ll change it up a little later on but now it is kinda vital I get basic things to work like bluetooth, networkmanager and proper keymap on boot.

I haven’t crashed yet :wink: