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.
As a Linux novice I thought Linux From Scratch would be a useful method of learning Linux.
However it does have some problems for someone like myself with limited knowledge.
With the aid of Joseph M. Dupré and his setenv.sh script:
I have reached this point and no further.
LFS book: (extract from LFS V6.2)
#####################################################
5.3.1. Installation of Binutils
It is important that Binutils be the first package compiled because both Glibc and GCC perform various tests on the available linker and assembler to determine which of their own features to enable.
The Binutils documentation recommends building Binutils outside of the source directory in a dedicated build directory:
mkdir -v ../binutils-build
cd ../binutils-build
**In order for the SBU values listed in the rest of the book to be of any use, measure the time it takes to build this package from the configuration, up to and including the first install. To achieve this easily, wrap the three commands in a time command like this: time { ./configure ... && make && make install; }. **
Next, prepare the linker for the “Adjusting” phase later on:
make -C ld clean
make -C ld LIB_PATH=/tools/lib
cp -v ld/ld-new /tools/bin
#####################################################
My problem is that I have no idea how to run the time command and compile the
binutils-2.16.1 together
time { ./configure ... && make && make install; }.
../binutils-2.16.1/configure --prefix=/tools --disable-nls
time { ../binutils-2.16.1/configure --prefix=/tools --disable-nls && make && make install }
The other commands (make -C ld clean / make -C ld LIB_PATH=/tools/lib / cp -v ld/ld-new /tools/bin) don't have to be included in the time { ... } part.
You do understand that you only have to do the time command just once or not at all if you are not concerned with the SBU's that are given. I personally have never done this: I want to install (B)LFS, I don't care how long it takes (although the first time on a pentium II it took a long time.... ).
Yes I was aware that you only had to run the time command once, but a hudge thanks because I never would have got the sintax right for the command, a bit above my pay rate I'm afraid.
No I was no aware that you did not have to run time command. I don't know what SBU's are, I was just following the book.
Yes, I realise the : make -C ld clean
make -C ld LIB_PATH=/tools/lib
cp -v ld/ld-new /tools/bin
was not part of the of the time command, but you can never have enough help, I should know!!
So I ran
root:/mnt/lfs/lfs-sources/binutils-build# time { ../binutils-2.16.1/configure --prefix=/tools --disable-nls && make && make install } and got
> _
The command was asking for more imput? Now what? Well after a lot of mucking around I got
root:/mnt/lfs/lfs-sources/binutils-build# time { ../binutils-2.16.1 ./configure --prefix=/tools --disable-nls && make && make install; } and got
real 0m0.003s
user 0m0.000s
sys 0m0.010s
As clear as mud, I realise I must have got it to run correctly or else I would have no output. However, what does the output mean?
So I ran
root:/mnt/lfs/lfs-sources/binutils-build# time { ../binutils-2.16.1/configure --prefix=/tools --disable-nls && make && make install(missed out a semi-colon here) } and got
Quote:
Well after a lot of mucking around I got
root:/mnt/lfs/lfs-sources/binutils-build# time { ../binutils-2.16.1 ./configure --prefix=/tools --disable-nls && make && make install; }
This time you have the semi-colon but made a typo earlier on. It should read ../binutils-2.16.1/configure not ../binutils-2.16.1 ./configure
This time around you would have recieved three error messages in quick succession which is why the timings were near zero.
So.
time { ../binutils-2.16.1/configure --prefix=/tools --disable-nls && make && make install; }
time { ../binutils-2.16.1/configure --prefix=/tools --disable-nls && make && make install; }
loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for a BSD compatible install... /usr/bin/install -c
checking whether In works... yes
checking whether In -s works... yes
checking for gcc... gcc
checking whether the C compiler (gcc ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
Your hardware can handle LFS, although building time will be a bit longer due to the 'outdated' (read: slower) hardware.
The LFS live cd holds the correct versions of all the (base) programs needed, so your base isn't the problem. You probably did something wrong (missed a step, used a wrong option, did not start with a clean tree etc etc) in one of the previous steps.
First logical thing I can come up with: Did you start with a clean binutils tree?
You've had some trouble with the time command and probably executed the configure, make and make install multiple times without 'cleaning the tree'. If your build tree is not clean, some unexpected things could happen.
Try removing the binutils-2.16.1 and binutils-build directory, unpack binutils-2.16.1.tar.bz2 again and start from there.
If that doesn't solve your problem then it's something else you did (or did not) do. It's kinda hard to tell you what this could be. Starting over is probably the best thing to do.
You did not follow the book: You need to do this from a separate directory called binutils-build (this part at the beginning of this chapter: mkdir -v ../binutils-build and cd ../binutils-build).
If you also did the configure / make part in the binutils-2.16.1 directory: start over. Maybe you can re-do the make -C clean part from the binutils-build dir if the previous steps are done the way they should.
Do follow the book, it is essential to build a working LFS.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.