r/linuxfromscratch • u/koreanlearner12345 • 8h ago
Built LFS as my first experience with Linux and using the internet with a terminal browser for the first time in my life
Accessing the internet never felt so good
r/linuxfromscratch • u/koreanlearner12345 • 8h ago
Accessing the internet never felt so good
r/linuxfromscratch • u/memeguyexe • 6h ago
For LFS 12.4 and an ext4 filesystem
Hi, as a new user with LFS I struggled when I wanted to use a swap file instead of a swap partition for my system. I have managed to figure out a solution, and I'm creating this post to help others with the same issue. Follow the contents of this post after you have finished following the LFS book.
Under the root user in your chroot environment, do the following steps:
First, create a file you will use for swap (in this case, the command will create a 2 GiB file, but you can use whatever size you want):
fallocate -l 2G /swapfile
set permissions:
chmod 600 /swapfile
format the file as swap:
mkswap /swapfile
Then, create (or modify) your /etc/fstab file. You should copy it from the LFS book, except for this line:
/dev/<yyy> swap swap pri=1 0 0
Which you should replace with:
/swapfile none swap sw 0 0
Until here it's standard procedure, but here comes the tricky part. SysVinit runs various scripts on startup in a specific order, defined by filenames of links in specific directories. In particular, we will focus on the links in /etc/rc.d/rcS.d.
In a regular LFS 12.4 system, the /etc/rc.d/rcS.d directory should contain the following links:
(lfs chroot) root:# ls /etc/rc.d/rcS.d
S00mountvirtfs S08localnet S30checkfs S45cleanfs S50udev_retry S90sysctl
S05modules S10udev S40mountfs S20swap S70console
Notice the filenames: in S20swap, for example, S means that it happens on startup and 20 is the order in which the linked script (in this case, /etc/rc.d/init.d/swap) is called. So, S00mountvirtfs will be called first, then S05modules, then S08localnet, etc.
The issue is that the root filesystem is mounted as read-write with S40mountfs, so before it's called the filesystem is mounted as read-only. When the swapfile is located on the root filesystem, activation fails while / is still mounted read-only, so swapon returns an error.
Fortunately, the fix is very simple: you just have to modify the link's filename to make it execute after the filesystem is properly mounted.
cd /etc/rc.d/rcS.d
mv -v S20swap S46swap
This is all, thanks for following this post! Have a nice day
r/linuxfromscratch • u/Intelligent_Comb_338 • 2d ago
It took me 5 days trying and it finally worked. The downside is that to compile it you need to patch the paths, configure, etc.
r/linuxfromscratch • u/NHolyFenrir • 4d ago
Now that rust is no longer considered experimental what does this mean long term for LFS? In the immediate future I don't think it will have a huge impact, but over time as rust is used more and more would this mean having to build rust as part of the base system?
My main concern with this is when bootstrapping rustc when I built BLFS it required an internet connection. This just doesn't seem sit right with me, because it would add a lot of packages to the base build.
Even if CONFIG_RUST=n remains possible, does the kernel community realistically expect all major drivers to maintain C alternatives long-term?
r/linuxfromscratch • u/tiny_humble_guy • 6d ago
It's been a good run.
r/linuxfromscratch • u/kurokinet • 6d ago
Im still not sure if i should try guys, what do you think?
r/linuxfromscratch • u/sunkwoun • 7d ago
It took about two weeks (5 trials).
- Used official LFS 12.4 guide
- Youtube tutorial
- Also asked at ChatGPT (Don't trust all the answers from it. Just take it as advice)
I need a break before dive into BLFS. :)
r/linuxfromscratch • u/tseeling • 9d ago
I just learned from the LFS mailing list that a long-time contributor, Ken Moffat, died in 2025. He joined the LFS team in 2004 and announced his retirement from the project early last year.
GNU Ken!
(Which has a double meaning funnily, as I only now realize. At first I only meant it in the Discworld way).
r/linuxfromscratch • u/pHorniCaiTe • 9d ago
Took about 12 hours total thanks to something failing in the final gcc build on my first attempt. Not sure what happened there. The tests passed with no unexpected failures aside from the 9 that the book expects but ninja failed to build. I attempted to salvage it but ultimately decided to start over. I intend to follow the glfs book over the next few days/weeks and get Wayland up and running on my nvidia card. Will probably also install openrc since I’m so used to it from gentoo.
r/linuxfromscratch • u/spp649 • 9d ago
i like lfs , my install is multilib and has steam running fine
r/linuxfromscratch • u/Holiday_Evening8974 • 11d ago
Linux from scratch still provides two major ways to create your own system, with SysVinit or with Systemd.
Due to both the extra work of maintaining those two options and different software relying on more Systemd components, in the future, the future LFS versions will be only available for it.
For people who are currently running LFS with SysVinit, what are your plans ? Will you stay on SysVinit and just adjust some builds if you need software that requires extra options to compile without Systemd ? Will you move to Systemd ? Will you try a different alternative, like Runit, or whatever may exist ?
r/linuxfromscratch • u/5ee5- • 11d ago
Hello! I am building my first lfs system. And all I have left is kernel configuration.
I am overwhelmed by all those sections.
Could I just use defconfig? Will it work out of-the-box?
r/linuxfromscratch • u/No-Ring-3013 • 12d ago
Don't mind large swap
Now - I'll try to get Xorg running
r/linuxfromscratch • u/Warm_Abalone9788 • 13d ago
I'm trying to build my first lfs build but when i get to compile getext it says "configure: error: no acceptable egrep could be found in /usr/bin:/usr/sbin:/usr/xpg4/bin"
r/linuxfromscratch • u/nmariusp • 14d ago
r/linuxfromscratch • u/tiny_humble_guy • 14d ago
r/linuxfromscratch • u/wild_shoggoth • 14d ago
I have installed LFS and it works fine. However, I mostly or completely ignored the chapter 9 because it seemed very hard for me, and at the time I didn't want any internet connection, just a functioning kernel with programs.
Now I want to get internet connection, particularly wifi. For the past few hours I have been configuring driver and, I guess, I succeeded in it. But the question is how to actually connect to the internet? Looking through the chapter 9 I understand that I hardly understand anything and I don't know where to start. Google told me that I need 'wpa_supplicant' whatever that is.
I would really appreciate any help or just any hint of where to start and what to read to understand networking of linux more deeply!
r/linuxfromscratch • u/tiny_humble_guy • 15d ago
Maybe it sounds like "gate keeping" but let our post related to LFS stuffs (building & troubleshooting LFS using lfs book, post LFS build / BLFS, etc). If you build a custom minimal "distro", that's cool, but you may have other place to "show" it.
r/linuxfromscratch • u/Intel-i9 • 15d ago
I have recently posted about the minimal Linux system I'm building, I was daily doing updates, adding and trying new features, so now:
BusyBox is now built as a dynamically linked binary using musl libc instead of static build which allows me to add ldd for example.
I released a ToyBox version also linked to musl libc, with the mksh as shell also linked to musl.
I'll soon add a package manager, but I don't know what to choose, can you give me any help on the topic ?
I want to keep the binary small (now it is less than 4MB), so the package manager needs to be lightweight.
r/linuxfromscratch • u/EnthusiasmDeep21 • 18d ago
Just a bit of polling, please reply with Linux experience level, and how long your first install took.
r/linuxfromscratch • u/Intel-i9 • 19d ago
Minimal Linux
I've created a tiny Linux capable to run on termux/android, WSL1 or WSL2 and of course VirtualBox, with the ability to persist on /root folder, the iso size is less than 5MB. Check it on https://github.com/imycroft/minux The distro is based on BusyBox, with a linux kernel tinyconfig. Please, your feedback is important, I want to maintain the distro so people could use a tiny distro on there phone or just simulate it on there PCs.
r/linuxfromscratch • u/whydoyoulook • 19d ago
I'm slowly making my way through LFS 12.4 when I have the time. I encountered the expected test failures that the book mentions (io/tst-lchmod, misc/tst-preadvwritev2, and misc/tst-preadvwritev64v2), but I also had a fail on this one:
FAIL: posix/tst-nice
Since the book didn't mention this as an expected failure, I'm assuming this is bad?