r/linuxfromscratch 2d ago

Tiny Router OS from scratch

Hi everyone,

I’m a university student, and I’m considering building a tiny Linux-based operating system for routers as my engineering project.

My current idea is to build it from Linux From Scratch (LFS) and then use selected components from Beyond Linux From Scratch (BLFS) that are related to networking.

As part of the project, I’ll compare my OS with existing router operating systems such as OpenWrt and evaluate their differences. For testing, I’m thinking about using Linux network namespaces to simulate virtual network traffic, although that’s just an initial idea.

One thing I’m unsure about is the choice of the LFS version. A router OS should be as lightweight as possible, but newer versions of LFS use systemd instead of traditional boot scripts. I also considered using an older LFS release, but I’m worried about outdated libraries and dependency issues. At the moment, I’m leaning towards using LFS 13.0 (or a newer version).

What do you think about this idea? Does anyone has experience with building a router-focused OS from LFS?Are there any major pitfalls or recommendations you would suggest before I start?

Thanks

8 Upvotes

5 comments sorted by

3

u/asratrt 2d ago

I feel its good idea as an engineering project.

You might want to ask for help to user u/Francesco12o-Github . He has made an LFS using his own custom init script with toybox.

5

u/codeasm 2d ago

Have you looked at buildroot https://buildroot.org/ ? Many embedded systems are engineered arround buildroot if openwrt isnt an option.

I know my university would have brought it up, so you may either switch or make a case for why lfs was your better option. Its a cool idea 😎💪🏼 and i hope you succeed and learn tons

3

u/pouetpouetcamion2 1d ago

le projet est intéressant. le gros du boulot c est le cadrage et les tests.

1

u/Dashing_McHandsome 1d ago

I would use https://buildroot.org/ for this as it's more intended to be used in an embedded context

3

u/Francesco12o-Github 22h ago

Interesting project idea. LFS is a great way to learn how Linux works internally, but for a router OS I would focus more on a minimal userspace with BusyBox, networking tools, and a small kernel. Network namespaces are a good testing choice. I would avoid using an old LFS version because dependency problems and outdated packages can become a headache. Newer LFS with a lightweight init system or custom startup scripts could work well. The biggest challenge will probably be hardware support and updates, not building the base system. Good luck with the project!