Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Thanks to the forum for allowing me to post my experiences in compiling LFS projects.
I have compiled LFS-7.x, 8.x and currently I am completing LFS-9.0.
I have already made a text file for creating LFS-9.0 along with screenshots. This will be posted shortly.
Meanwhile, I propose to send some tips for compiling LFS and BLFS-9.0.
TIP-1:
After completing LFS, we are eager to continue with BLFS. We continue with host system to compile make-ca-1.4, wget, nano, openssh-8.0p1, dhcpcd etc. and then start to install Xwindow system environment from Chapter 24 and then LXDE from Chapter 37 since LXDE is the simplest of all.
We can then boot in to LXDE. For copy and paste work from LFS and BLFS Books, we need a web browser. But installing Firefox or Seamonkey will take time in host PC. Fortunately, Pale Moon web browser is available readily. We download it from web site, untar it, change directory to palemoon and then a simple ./palemoon will load the web browser. We can download LFS and BLFS Books and start installing other programs! Help is available from their web site for making desktop entries. I have found this highly useful and hope that others also will find it useful.
-------------------------------------------------------------------------------------------------
Tip 2: Various Linux distributions name the ethernet and wireless cards differently. The conventional names such as eth0 or wlan0 are convenient in LFS where we have to create a few files like ifconfig.eth0 etc. LFS Book suggests in Chapter 7.4.1.1 to add net.ifnames=0 on the kernel command line. Google search says we need to add biosdevname=0 for distributions like Ubuntu. This has worked in my case earlier but not now, What I do is to change ethernet name to eth0 in the file
/etc/udev/rules.d/70-persistent-net.rules. In case you add the second ethernet card or wireless dongle, running
bash /lib/udev/init-net-rules.sh
will not produce new result. What I do here is to rename 70-persistent-net.rules and then run the bash script. You will now find the new card which can be renamed as eth1 or wlan0. Please reply if you have any other idea.
----------------------------------------------------------------------------------------------------
TIP 3:
After completing LFS, we are eager to continue with BLFS. BLFS Book suggests that we log in as unprivileged user and later we install as root. In the beginning, I compiled and installed BLFS packages as root as it was easier thing to do but I faced one problem with vlc as it cannot be run as root. (Hack is available in Google for this.) Unlike LFS, BLFS Book does not spoon-feed this aspect. Chapter 3 of BLFS Book talks about /etc/skel directory and recommends to install a few files as follows:
" The files from those sections that you might want to place in /etc/skel include .inputrc, .bash_profile, .bashrc, .bash_logout, .dircolors, and .vimrc."
It was somewhat difficult to follow in the beginning. (Probably BLFS authors expect you to be proficient by this time!) After a few trials, this is what I have done:
1. First create /etc/skel directory.
2. Copy files to /etc/skel/.inputrc, /etc/skel/bash_profile, /etc/skel/.bashrc, /etc/skel/bash_logout. For .inputrc, I used LFS Book. The remaining are from BLFS BOOK. For .dircolors, I did:
dircolors -p > /etc/skel/.dircolors.
I then deleted existing user which was lfs. After this, I did:
useradd -m <newuser> The newuser is again lfs. We can verify this from /home/lfs/etc/skel. You will find all the four files. I did not bother about .vimrc.
Next is to give permission for lfs user to use the directories we create for BLFS. I created /blfs, /scripts and /xc directories. /scripts directory holds blfs-bootscripts and linux. From LFS Book, i entered:
chown -v lfs <directories>.
I now login as lfs user in to BLFS desktop. I use wget, tar xf, sed, make etc. commands as user lfs and sudo or sudo su to install. I have compiled many BLFS programs this way. I feel this is better than copying and pasting from text web browsers in virtual terminals.
If there is better way, LFS enthusiasts may please reply to linuxquestions.org.
Installing a binary browser hardly seems in keeping with the spirit of the game! My advice is to build links (or lynx) in chroot. Then you will have a working command-line browser to read the book from when you boot your new system. Once you have X up and running, you can rebuild links as a graphical browser.
Installing a binary browser hardly seems in keeping with the spirit of the game! My advice is to build links (or lynx) in chroot. Then you will have a working command-line browser to read the book from when you boot your new system. Once you have X up and running, you can rebuild links as a graphical browser.
Your point is well-taken. I have an old i5 desktop with 4GB RAM. I found it difficult to compile rustc which is a dependency for firefox as the CPU is of first generation. The system used to freeze if I use all the four cores. The system got corrupted when I rebooted forcibly. Later I used single core which took a lot of time. The same is the case for falkon which requires qtwebengine and epiphany which needs webkitgtk. (BTW, both falkon and epiphany do not work properly.) I did not not have such problems with other software. Hence, the suggestion for palemoon browser.
You have put your finger on the reason why I have largely withdrawn from the LFS community. The amount of bloat one now has to build in to create a usable Linux system means that the fun has largely gone out of it. If you have to cheat to win the prize, the game becomes pointless.
It certainly is a much more complex project to have a usable system these days. The base system is only a little more work than it used to be, but the fun starts after that. I don't use BLFS (don't really want to eat someone else's dogfood, don't need all the dependencies, and prefer to do things my own way and fly by the seat of my pants) and I found it to be much more of a "chicken before egg" situation than the last time I did this (~5 years ago).
Very happy with the end result though, but it took me about 2 weeks by the time I had everything I wanted compiled. I strive to have minimal dependencies, so it was a bit of a struggle to get things like a useful qt5 installation, which I need for a few applications. Even things like Gimp are more complex now, with far more mandatory dependencies. I used to build that all the time (back in the day, without distro packaging scripts) and it was never this onerous. Everything is all dependencies, of dependencies, of dependencies nowadays.
I use Trinity Desktop, and Fluxbox (probably my second favourite thing) to fall back on.
I also made it tougher on myself by refusing to dump everything in /usr. For example, even though autotools ./configure, cmake, or meson etc. find includes and libraries at the beginning of builds (my environment is set up correctly for any alternate locations, like "/usr/X11R7"), there's often some place in a complex build where it bombs out with "can't find -lX11" and friends and you have to go back and get it to append cppflags and ldflags to every command. I'd still rather have a more maintainable system though, I really hate that lazy trend of expecting everything to be in --prefix=/usr. It makes manual hunt and pokery more difficult.
Rust... yes indeed, that's a cast iron bitch to bootstrap. I need it to build exactly two things, librsvg (mandatory if you want Gimp) and Firefox. I was almost going to just use rustup to get that, since it's not something used at runtime, but the "cheating" sentiment was exactly what was going through my mind. I did it the same way Slackware does, by stepping through the SlackBuild (only I had to let it download binaries for the bootstrap because, chicken before egg). I hate Rust.
But... I have been disenchanted with the way distributors are doing things, and the only way to have everything the way I want it, where I want it, optimized the way I want it, is to do it myself. This is my "good" setup though, not for games. I can't imagine having to build all that lib32 crap etc. on a LFS system.
Even things like Gimp are more complex now, with far more mandatory dependencies. I used to build that all the time (back in the day, without distro packaging scripts) and it was never this onerous. Everything is all dependencies, of dependencies, of dependencies nowadays.
Gimp was the straw that broke this camel's back. When I realised that I had to have librsvg and that suddenly required rust, I decided that this malarkey wasn't for me.
Quote:
I hate Rust.
I don't exactly hate it. It makes FF run much faster, so it's good for the users and they surely are the ones who count. It's just a pig and a half to build, therefore not suitable for a system based on LFS.
Quote:
I can't imagine having to build all that lib32 crap etc. on a LFS system.
Actually it's quite easy. There's a guide in this forum on how to do it. I did it so that I could use my printer in LFS.
I didn't think Rust was about speed, but more about code safety. Rust won't let you make a lot of mistakes, it will simply refuse to compile. The reason I said I hate it is because it's a pain in the ass :-)
But, you could have a working Rust toolchain in minutes, with rustup. Just have to set a few environment variables when installing Rust in that manner. It's only used for a few builds, and not at runtime so you could even just do your builds and delete it. I like a system wide bootstrapped install of it, because I regularly build Firefox though.
I didn't think Rust was about speed, but more about code safety. Rust won't let you make a lot of mistakes, it will simply refuse to compile. The reason I said I hate it is because it's a pain in the ass :-)
It's about speed too because apparently using rust means that you don't need a separate thread running just to do garbage collection. Objects get freed when no longer needed by explicit code put in by the rust compiler. At least that's how I understand it. I noticed the change at once when I first used FF Quantum. It was much faster than the old FF.
I said it here, and I've found I have to take back some of what I said about Rust, so I'll retract it here.
It's not difficult to bootstrap if you don't try to use the system rust (previous installed version) too bootstrap, or use the system's LLVM. Basically just "./x.py build && ./x.py install" after editing a few variables in the config.toml file (essentially just extended = true if you want a complete install with all the tools) according to the README.md file.
I just went with their defaults instead of trying to get cute and it did not fail.
TIP 4:
This is regarding my experiment with chromium in LFS-9.0.
Recently, I came across DietPi based on Raspbian Lite for Raspberry Pi. It is a wonderful software, although it requires a little help in the beginning. (More on this later.) I installed Docker and through it Jellyfin. This media server was not playable in Firefox ESR and so I tried Chromium. It was okay.
I then wanted to try Chromium in LFS-9.0. It does not have Chromium but a Google search reveals that LFS-8.2 had chromium. Its SBU is 120 and my old desktop will protest.
Luckily, I came across this web site: https://chromium.googlesource.com/ch...ons.md#Install
From /home/lfs directory, steps I followed are:
(This took many, many hours to compile. There was no protest from my CPU. I also took break twice.)
9. $ out/Default/chrome
Initially, it did not run. An error message was thrown at my face. "Use --no-sandbox, if you are not particular about security."
10 $ out/Default/chrome --no-sandbox
Now, Chromium opened. Immediately, I tested Emby Media Server from DietPi. I could log in but the web browser disappeared. I could see in the command line that my sandbox requires configuration. Thanks to Google, I entered command as:
This time, I could see the playback but it was not smooth. I stopped Emby Server and gave jellyfin command. But no playback was possible. The error message was:
Playback Error
PlaybackErrorNoCompatibleStream
Chromium was otherwise working. I tested Google in it.
I shall do some more tests. I was not very sure about Chromium installation and at every step, I was waiting for some error. Moreover, the commands were unusual. But finally it worked. If anybody is interested, please go through the web site. I hope I have reproduced the commands I have used correctly.
One reader (Hazel) found fault with my tip about Palemoon web browser as "it was against the spirit". He may be correct but I don't want to overload my old CPU! If it hangs and forcible reboot may corrupt the installation.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.