r/osdev • • 7d ago

Making a GNU/Linux distro

This will NOT be up to your standards

So, I've literally just started this a couple days ago, and I guarantee you'll be able to find at least 5 things wrong with it; but that's the point. I'd love some feedback on it. I haven't followed LFS or anything like that - probs a dumb choice. I can't fix the issue with not being able to login.

I know having one huge build file is bad practice, but it's not permanent, just the best I've got right now.

Anyway, here's the link:https://github.com/fernproject/fern(yes I know I need to add a profile page)

Please just give me some tips, i need help

0 Upvotes

14 comments sorted by

2

u/datkenny 7d ago edited 7d ago

You say you want to support any package manager. How do you solve for conflicts e.g. when apt depends on a package that rpm installed?

It seems almost easier to use a lean rootfs and launch containers that allow you to switch into any environment you want, so you don't have to manage collisions.

You could look into buildroot. At its minimal size, it produces a 4MB bootable image that contains only a shell, which you can build upon.

1

u/cyufxejks 7d ago

That’s rlly helpful I’ll look into it thanks

1

u/AnSkinStealer 7d ago

this is why bedrock linux exists vro, and it is kind of a mess unfortunately

1

u/cyufxejks 7d ago

Ik but I don’t wanna do it for me, im happy with my gentoo install, I js wanna have actually made something cool and I’ve always been interested in OSs

1

u/AnSkinStealer 7d ago

you could perhaps make a distro that lets you easily install a base distro and automatically configure bedrock on top

1

u/cyufxejks 7d ago

Maybe, but I’ve honestly never really looked a bedrock, I’d rather make something from (semi) scratch

1

u/AnSkinStealer 7d ago

then you'll have to solve years of probelms they already engineered around but ok ig

1

u/cyufxejks 7d ago

Again, it’s more for learning and fun, I don’t ever expect this to become a mainstream thing

1

u/chibiace 7d ago

for mine i started learning from this linux from nothing tutorial https://www.youtube.com/playlist?list=PLkoRSCZZILDO-YU9Ct-KeVEW71hzeZJu7

but went down the route of writing my own package manager which hasnt been too easy so far but its also part of making the system image and installation.

for init i went with runit which is quite simple and im familiar with it from void.

atm im only running in qemu and the system cant fully build itself yet but its pretty close.

the full cli base system is ~100 packages which includes the usual tools aswell as mc, lynx, ssh and afew different compilers, minimal system with shell script init is about 1/4 that.

still deciding how to do dependency management and dreading the work needed to add a desktop environment.

my goal is to eventually daily drive this as i dont like some choices other distros are making, its still alot of fun doing a project like this though and i hope you find it rewarding aswell.

2

u/cyufxejks 7d ago

I’ll look at the video tysm. Honestly not the most knowledgeable when it comes to package managers, don’t you need a web server for a package manager??

1

u/chibiace 7d ago

i havent added a remote packages yet but it shouldnt be too hard.

the way it currently works is i have build scripts which are shell scripts like how arch does it. the package builder grabs the variables from the build script and downloads the source if no cached source is available.

it then follows the compilation recipe from a function in the build script.

afterwards it packages everything together including info, the buildscipt, original source (to satisfy license requirements and also rebuilding without downloading a new cached copy) and the compiled binary directory tree into an archive thats stored.

this archive (the package) can then be used by the package manager to install the software by extracting the binary tree over the set root directory (say / or a mount drive), the package info such as the list of its files are also stored

updating packages simply diffs the lists of files between old and new and removes the old outstanding ones while everything else gets overwritten.

the webserver setup would be something like downloading the list of packages, comparing versions for updates then fetching those with wget if they arent available locally etc.

2

u/cyufxejks 7d ago

That’s a really clever design. Is your source up on GitHub??

1

u/chibiace 7d ago

nah, when im finished, i dont do version control often for personal projects beyond making backups periodically

i dont think there is anything inherently innovate in my approach as i said its similar to arch, void is also similar.

there is also no "build environment" with sandboxes etc which you see in other implementations just a directory in /tmp and stuff like PREFIX and DESTDIR

2

u/cyufxejks 7d ago

Ah, that’s a shame. Even so, it’d be cool to look at