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.
yes. I have managed to do quite well, progressing slowly.
I don't know if it helps, but I usually do a "history" command
and capture everything after a successful build in a file in the host
for future reference. This way, you are very sure that you can trace
back everything what you have done.
Another thing, just cut and paste the whole ../source/configure lines
in one go, this way, you are guaranteed not to miss everything.
Also make sure that "make install" is usually not the last step, which
I have painfully learned since I missed out a soft link step "ln -s ..."
step.
With all these precaution, a successful build is still at the mercy of
the host and careful bookkeeping.
I am not done with the whole LFS chapter 6 yet, but so far so good.
Thank you both, centguy and crts. I'll keep all of this advice in mind. I'm going to completely restart everything, except I'm keeping the source files, I'm too lazy to redownload it all, it took way too long xD
Thank you both, centguy and crts. I'll keep all of this advice in mind. I'm going to completely restart everything, except I'm keeping the source files, I'm too lazy to redownload it all, it took way too long xD
You don't have to redownload if you have an unmodified backup of your sources. Otherwise it might be problematic.
You don't have to redownload if you have an unmodified backup of your sources. Otherwise it might be problematic.
Don't worry about that, I made sure to back up the sources directory. even if I didn't, I could have just used the "wget -i" command and downloaded all of the files again. No biggy
That's one area where the book can be improved I think. Right now, they
are suggesting to build stuff under $LFS/sources. But I think it will clutter the $LFS/sources because the created directories will be hiding somewhere with massive $LFS/sources/*.tar.gz. I create $LFS/sources/build-dir/
and copy the necessary *.tar.gz or bzip to $LFS/sources/build-dir.
Then followed the book closely, and the end of the build
I do "cd $LFS/sources/build-dir" and "rm -rf *". Well the last command may be too dangerous for a newbie, but since you are doing LFS, I think you know what you are doing.
Do _not_ wait until the end to remove all created package (and build) dirs!!!
Gcc and binutils are 2 obvious (??) examples. You nust remove the source dir (and build dir in these cases) after you are done. Or, phrased differently: When you are done with binutils pass one you must remove the source and build dir, when you arrive at binutils pass 2 unpack a fresh copy and do _not_ use the source/build dir from pass 1!!
The above is just an example, you need to do this for all packages (unless stated differently). A side effect is that the $LFS/sources directory will stay 'clean'.
You are right. When I say "build" means building one particular package, such gcc pass-1 or sed or whatever.
I guess my "build" is your "installation".
See, that's why the book can guide the people a little bit by showing
how things can be done in the first two installations of binutils pass-1 in Chapter 5 and especially gcc pass-1 in Chapter 5. I was scratching my head when I saw "mkdir -v ../binutils-build". Okay, that is still guessable, because you only have one package.
Remember I have to create a thread to ask how to deal with mpfr and gmp
in the first pass of gcc pass-1 in chapter 5. I have to untar gcc FIRST before I can make sense of "tar -jxf ../mpfr-2.4.1.tar.bz2" (okay, that is kind of obvious when you have dealt with millions of packages under
LFS, but for first timers, I don't think it is obvious, at least for me.. call me dumb if you want )
Two comments: (1) the book does not explicitly say you can untar under
$LFS/sources and clean the "mess" after that.
As I say, I prefer to "build" things under $LFS/sources/build-dir. After rm -rf * does the job at the end of "my build" or your "installation".
You are right. When I say "build" means building one particular package, such gcc pass-1 or sed or whatever.
I guess my "build" is your "installation".
???
I don't mention "installation" anywhere in my previous reply, just "building".
Technically installing is one part of a build from source (the make install step).
Quote:
See, that's why the book can guide the people a little bit by showing
how things can be done in the first two installations of binutils pass-1 in Chapter 5 and especially gcc pass-1 in Chapter 5. I was scratching my head when I saw "mkdir -v ../binutils-build". Okay, that is still guessable, because you only have one package.
No need to guess anything.
Chapter 5.3 (the second Important box) mentions unpacking the package and entering the created directory. This is a given for all (build) chapters. First unpack and enter the created directory and then start with the first steps in the specific chapter.
Quote:
Remember I have to create a thread to ask how to deal with mpfr and gmp
in the first pass of gcc pass-1 in chapter 5. I have to untar gcc FIRST before I can make sense of "tar -jxf ../mpfr-2.4.1.tar.bz2" (okay, that is kind of obvious when you have dealt with millions of packages under
LFS, but for first timers, I don't think it is obvious, at least for me.. call me dumb if you want )
Two comments: (1) the book does not explicitly say you can untar under
$LFS/sources and clean the "mess" after that.
It does look like you did not read the whole LFS book before actually starting the LFS build, which is the most common reason for problems during the building of specific packages or LFS in general.
Again you write that the book does not mention to remove the created directory (and the build-dir if it is needed), even though it does in chapter 5.3 (which I also mentioned in my previous reply [#21]).
Quote:
As I say, I prefer to "build" things under $LFS/sources/build-dir. After rm -rf * does the job at the end of "my build" or your "installation".
It is completely up to you to pick a location to store the packages/patches, but I would not deviate from the book unless you have some experience building LFS.
It does look like you did not read the whole LFS book before actually starting the LFS build, which is the most common reason for problems during the building of specific packages or LFS in general.
I can acknowledge that. My first attempt to build LFS failed miserably because I thought some minor deviation from the book won't hurt.
Quote:
As I say, I prefer to "build" things under $LFS/sources/build-dir.
@centguy: If I understood correctly then, e.g., your binutils-build directory would reside in $LFS/sources/build-dir/binutils-build. Then your ../configure would become ../../binutils-2.19.1/configure, right? So you would have to pay close attention to every command that you issue and modify it accordingly. I think it is very easy to overlook something this way. Just think of all the 'sed' commands. They are all very cryptic. Making the path to file that is to be edited longer does not add to the readability.
Don't get me wrong. Maybe your way does indeed work better for you. But I think for most people it is more suitable to do things by the book, at least when you build LFS the first time.
I don't mention "installation" anywhere in my previous reply, just "building".
sorry: I mistaken the first box of in Chapter 5.3 to be from you:
Quote:
After installing each package, delete its source and build directories, unless specifically instructed otherwise. Deleting the sources prevents mis-configuration when the same package is reinstalled later.
Shouldn't that be "After building each package" ? points to think about.
Anyway, it may be that I am just plain silly to pick up non-essential points.
crts:
I think you misunderstand my point. I just want to work one level down
from $LFS/source (so that you can clean the mess easily!), the commands in the LFS book still apply strictly !
see my log to build pkg-config:
Quote:
389 cd $LFS/sources/build-dir/
390 ls
391 rm -rf *
392 cp ../pkg-config-0.23.tar.gz .
393 tar -xzvf pkg-config-0.23.tar.gz
394 cd pkg-config-0.23
395 ./configure --prefix=/usr
396 make
397 make check
398 make install
399 history
There is not special in my way of doing. Stick to whatever you think is correct but still stick to the book as much as possible.
I just want to work one level down
from $LFS/source (so that you can clean the mess easily!), the commands in the LFS book still apply strictly !
Ah, ok. I get your point now. So you basically just add a prestep which copies source and patches to a dedicated directory first and pick it up from there. I do my installation in a similiar way.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.