Making a micro Linux distro (2023)

by turrinion 10/25/2025, 1:01 PMwith 29 comments

by termieon 10/25/2025, 4:16 PM

I've been working on a micro Linux distro for a couple of months now. User mode is just a single static binary (and a few files to support confidential microVM containers). The initramfs is such an interesting feature, the kernel knows how to unpack cpio archives and just magically drops you into a tmpfs and executes /init. You can have multiple concatenated cpio archives, and each can be compressed, and they all just overlay in sequence. There's an elegance to the design. I also had to write some code to unpack them and learned more than I wanted to.

by sigwinchon 10/25/2025, 1:50 PM

More recently, qemu supports uftrace on the more popular architectures. That’s how you answer the pro’s question, “but how do I debug this?”

https://news.ycombinator.com/item?id=45533804

by Levitatingon 10/25/2025, 3:16 PM

I have a similar little project https://github.com/LevitatingBusinessMan/azathos

I have my own toy init, shell and other utilities. The GNU coreutils are included for debugging.

My current focus is on drawing windows onto the framebuffer.

by EvanAndersonon 10/25/2025, 2:38 PM

This is pretty neat. I remember making floppy-based "distributions" back in '98 to do utility tasks (imaging Windows PCs over UDP broadcast being one I spent a long time on). So many memories of "make bzimage", hanging init scripts, reboots. So many reboots.

Charmingly, the "modern" process doesn't seem wholly dissimilar. I would echo the comments of one of the sibling comments here: Targeting this to RPi would be fun and educational. Maybe I'll give it a try.

by mouse_on 10/25/2025, 3:10 PM

This entire, beautiful blog post scales wrong on my phone because of this one line of code near the bottom doesn't get wrapped or get its own overflow box: -device virtio-net-device,netdev=usernet -netdev user,id=usernet,hostfwd=tcp::10000-:22

by pluto_modadicon 10/25/2025, 3:36 PM

I wonder what the level of difficulty getting this to run as a cloud image (e.g. on Vultr or Digitalocean) would be. Or getting it to boot a GUI and run firefox.

by SomeHacker44on 10/25/2025, 1:39 PM

A version of this that targeted RPi would be neat!

by trelaneon 10/25/2025, 1:52 PM

I wonder why this instead of using Gentoo to explore Linux.

by ruguoon 10/25/2025, 3:54 PM

Thanks a lot for this awesome informative post, I genuinely learned a ton from it!

by synergy20on 10/26/2025, 12:33 AM

great for learning, to get one done fast, buildroot is a good candidate

by keyleon 10/25/2025, 1:55 PM

Obligatory reference

https://www.linuxfromscratch.org

by geroffon 10/27/2025, 4:24 AM

micro-distro?? just need one that installs easily on any 10year old hardware and can replace Windows for the most part.

by pluto_modadicon 10/25/2025, 3:34 PM

this is kinda cool. Does that mean you can use u-root to embed as a UEFI image? or to boot a u-root image over PXE netboot?

by abety607on 10/25/2025, 6:56 PM

Ilove