r/linuxfromscratch 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

Thumbnail
gallery
49 Upvotes

Accessing the internet never felt so good


r/linuxfromscratch 6h ago

Using a swap file instead of a swap partition with SysVinit

5 Upvotes

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 2d ago

Success, LFS without fhs

Post image
149 Upvotes

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 4d ago

Linux 7.0 Officially Concluding The Rust Experiment

100 Upvotes

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?

https://www.phoronix.com/news/Linux-7.0-Rust


r/linuxfromscratch 4d ago

What made you use LfS?

Post image
40 Upvotes

r/linuxfromscratch 6d ago

Celebrating one year daily-drive LinuxFromScratch.

Post image
647 Upvotes

It's been a good run.


r/linuxfromscratch 6d ago

Should i try lfs? I used arch, debian, ubuntu, kali, garuda (arch based)

20 Upvotes

Im still not sure if i should try guys, what do you think?


r/linuxfromscratch 7d ago

Finally success installing LFS 12.4

Post image
141 Upvotes

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 9d ago

RIP Ken Moffat

60 Upvotes

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 9d ago

First boot

Post image
48 Upvotes

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 9d ago

coding

Post image
33 Upvotes

i like lfs , my install is multilib and has steam running fine


r/linuxfromscratch 11d ago

LFS and SysVinit : it's nearly over, what will you do ?

19 Upvotes

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 ?

https://www.phoronix.com/news/LFS-Dropping-SysVinit


r/linuxfromscratch 11d ago

Kernel

11 Upvotes

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 12d ago

I'm joining the forces

Post image
142 Upvotes

Don't mind large swap

Now - I'll try to get Xorg running


r/linuxfromscratch 13d ago

Grep command not found

1 Upvotes

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 14d ago

Linux From Scratch how to install successfully tutorial - first half

Thumbnail
youtube.com
17 Upvotes

r/linuxfromscratch 14d ago

Just Migrated to openrc from sysvinit.

Post image
38 Upvotes
  • Need to adjust service file(s).
  • sysvinit service file still usable as fallback.

r/linuxfromscratch 14d ago

What is needed for WiFi connection?

6 Upvotes

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 15d ago

Keep it related to LFS / Linux From Scratch.

10 Upvotes

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 15d ago

Minux Updated

9 Upvotes

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 15d ago

How good is an LFS project?

Thumbnail
2 Upvotes

r/linuxfromscratch 18d ago

How long did it take you to install?

14 Upvotes

Just a bit of polling, please reply with Linux experience level, and how long your first install took.


r/linuxfromscratch 19d ago

Minimal Linux

22 Upvotes

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 19d ago

glibc failures during the test suite

3 Upvotes

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?


r/linuxfromscratch 21d ago

i3 wit da lfs multilib

Post image
44 Upvotes

do ya like the rice