LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 01-08-2020, 01:39 AM   #1
vsayanam
LQ Newbie
 
Registered: Jan 2009
Posts: 22

Rep: Reputation: 10
Linux From Scratch for Newbies - Part 1


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.

Last edited by vsayanam; 01-18-2020 at 09:58 PM.
 
Old 01-09-2020, 05:40 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,706
Blog Entries: 19

Rep: Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506
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.
 
1 members found this post helpful.
Old 01-10-2020, 12:48 AM   #3
vsayanam
LQ Newbie
 
Registered: Jan 2009
Posts: 22

Original Poster
Rep: Reputation: 10
Linux From Scratch for Newbies - Part 1

Quote:
Originally Posted by hazel View Post
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.
 
Old 01-10-2020, 04:54 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,706
Blog Entries: 19

Rep: Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506
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.
 
Old 01-16-2020, 01:00 PM   #5
TheRealGrogan
Member
 
Registered: Oct 2010
Location: Ontario, Canada
Distribution: Slackware, LFS, Manjaro (for gaming)
Posts: 570

Rep: Reputation: 413Reputation: 413Reputation: 413Reputation: 413Reputation: 413
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.
 
Old 01-17-2020, 06:13 AM   #6
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,706
Blog Entries: 19

Rep: Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506
Quote:
Originally Posted by TheRealGrogan View Post
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.
 
Old 01-18-2020, 02:18 AM   #7
TheRealGrogan
Member
 
Registered: Oct 2010
Location: Ontario, Canada
Distribution: Slackware, LFS, Manjaro (for gaming)
Posts: 570

Rep: Reputation: 413Reputation: 413Reputation: 413Reputation: 413Reputation: 413
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.
 
Old 01-18-2020, 05:34 AM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,706
Blog Entries: 19

Rep: Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506
Quote:
Originally Posted by TheRealGrogan View Post
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.
 
1 members found this post helpful.
Old 01-22-2020, 07:51 PM   #9
TheRealGrogan
Member
 
Registered: Oct 2010
Location: Ontario, Canada
Distribution: Slackware, LFS, Manjaro (for gaming)
Posts: 570

Rep: Reputation: 413Reputation: 413Reputation: 413Reputation: 413Reputation: 413
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.
 
Old 01-23-2020, 03:24 AM   #10
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,706
Blog Entries: 19

Rep: Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506
Could you write a blog or a HOWTO on building/installing rustup? I think it could be useful.
 
Old 01-23-2020, 02:54 PM   #11
TheRealGrogan
Member
 
Registered: Oct 2010
Location: Ontario, Canada
Distribution: Slackware, LFS, Manjaro (for gaming)
Posts: 570

Rep: Reputation: 413Reputation: 413Reputation: 413Reputation: 413Reputation: 413
Rustup? It doesn't really need a howto. It's for downloading binary toolchain components, not for building.

Code:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Go with defaults and it will install to your home directory. Then all you need to do is add ~/.cargo/bin to your path.

You can install it anywhere you like though, but then that necessitates also setting RUSTUP_HOME and CARGO_HOME

Pretty much everything you'd need to know is available with a quick skim of this:
https://github.com/rust-lang/rustup/...ster/README.md
 
Old 01-25-2020, 03:21 AM   #12
vsayanam
LQ Newbie
 
Registered: Jan 2009
Posts: 22

Original Poster
Rep: Reputation: 10
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:

1. $ git clone https://chromium.googlesource.com/ch...epot_tools.git

2. $ export PATH="$PATH:${HOME}/depot_tools"

3. $ mkdir ~/chromium && cd ~/chromium

4. $ fetch --nohooks chromium

5. $ cd src

6. $ gclient runhooks

7. $ gn gen out/Default

8. $ autoninja -C out/Default chrome

(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:

11. $ out/Default/chrome --no-sandbox --disable-setuuid-sandbox

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.
 
Old 01-25-2020, 07:25 AM   #13
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
FYI
Hazel is a Lady
 
Old 01-25-2020, 11:45 AM   #14
arch-linq
Member
 
Registered: Sep 2018
Location: Midwest, USA
Distribution: Arch,LFS,BLFS
Posts: 110

Rep: Reputation: Disabled
Building rust isn't too bright given the ease of this way.

Quote:
wget linux binary from downloads untar then sudo ./install You get the message Rust is ready to roll !
It installs to /usr/bin/local which is already in the default path. Cheers, Archetech

Last edited by arch-linq; 01-25-2020 at 11:46 AM.
 
Old 01-26-2020, 05:02 AM   #15
vsayanam
LQ Newbie
 
Registered: Jan 2009
Posts: 22

Original Poster
Rep: Reputation: 10
Linux From Scratch for newbies - Part 1

Quote:
Originally Posted by spiky0011 View Post
FYI
Hazel is a Lady
Sorry. I stand corrected!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Where can I find a newbies guide to XFCE or is XFCE not for newbies? Robert.Thompson Slackware 5 03-07-2011 10:27 AM
ali aladdin v agp stinks :scratch: :scratch: :scratch: Mr Marmmalade Linux - Hardware 1 07-08-2003 05:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 10:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration