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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
|
09-23-2006, 04:37 PM
|
#16
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Hi,
That is incorrect, it should be /tools/bin/gcc.
Different things could have gone wrong. Incorrect PATH setting and/or chap 5.5 (gcc pass 1) failed somewhere. Maybe it's something else, but these came to mind first.
|
|
|
09-23-2006, 05:59 PM
|
#17
|
Member
Registered: Sep 2006
Posts: 122
Original Poster
Rep:
|
Hello,
At what point /tools/bin/gcc should be created ?
Is there a way to work around this problem ? (copy the files needed to the right directory )
I just rebooted and I tried the command which gcc and it's the same /usr/bin/gcc
so it never changed from the begining
Is the ln -s gcc /tools/bin/cc command supposed to create that ?
|
|
|
09-24-2006, 06:24 AM
|
#18
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Hi,
In chapter 5.5 you build and install a temporary gcc (in /tools/usr/bin), the ln -s gcc /tools/bin/cc makes a link from cc to the new gcc in /tools/usr/bin This link isn't gcc related it's cc related (some programs call cc instead of gcc).
In order to build the rest of the temporary environment you need access to the new gcc (the one in /tools/usr/bin), otherwise things will fail. I wouldn't take any shortcuts here, just restart at chapter 5.5 and continue from there (personally I would start at the beginning of chapter 5).
Chapter 5 is (very) important, it's the base you are going to use to create your LFS system (done in chapter 6). This base should be 100% correct otherwise you will end up with a LFS system that doesn't work or is very unstable/buggy.
Hope this helps.
EDIT
/tools/usr/bin should be /tools/bin
Last edited by anon237; 09-24-2006 at 09:34 AM.
|
|
|
09-24-2006, 08:12 AM
|
#19
|
Member
Registered: Sep 2006
Posts: 122
Original Poster
Rep:
|
Hello,
How does the program know where to create it?
Is it built into the program ?
I looked in the book and I did't find any place that it mentions /tools/usr/bin
I just want to clarify something here a little bit.
Yesterday you said that gcc should be in /tools/bin/gcc.
You are saying that"In chapter 5.5 you build and install a temporary gcc (in /tools/usr/bin)
Is that the actual place where gcc is installed or /tools/bin/gcc
In chapter 4.4 when seting op the environment there is a line where the PATH
is set and it shows PATH=/tools/bin:/bin:/usr/bin
Do you think this has anything to do with it ?
|
|
|
09-24-2006, 08:38 AM
|
#20
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Hi,
Quote:
Originally Posted by status1
How does the program know where to create it?
|
That information is pre-defined, but can be overruled (--prefix=/tools being an example of that). To find out which part is placed were, take a look at the output of ./configure --help. This should also explain a bit more what all the --xxxxx options do. The actual pre-defined settings are inside the configure script.
Quote:
Is it built into the program ?
|
?? I'm not sure where it refers to. I suspect that the above answer also answers this questions.
Quote:
I looked in the book and I did't find any place that it mentions /tools/usr/bin
|
Not literally, but the --prefix=/tools is mentioned. The rest is up to the program that is being installed (the pre-defined settings) and should be known by the person installing it (to override where needed).
Quote:
I just want to clarify something here a little bit.
Yesterday you said that gcc should be in /tools/bin/gcc.
|
Correct for gcc in chapter 5.5
Quote:
You are saying that"In chapter 5.5 you build and install a temporary gcc (in /tools/usr/bin)
Is that the actual place where gcc is installed or /tools/bin/gcc
|
Chapter 5.5 installs gcc in /tools/bin
Quote:
In chapter 4.4 when seting op the environment there is a line where the PATH
is set and it shows PATH=/tools/bin:/bin:/usr/bin
Do you think this has anything to do with it ?
|
This (PATH=/tools/bin:/bin:/usr/bin) looks correct. The /tools/bin dir is checked first.
|
|
|
09-24-2006, 01:34 PM
|
#21
|
Member
Registered: Sep 2006
Posts: 122
Original Poster
Rep:
|
Hello,
I looked at the configure file but I am nut sure exactly what to look for.
The closest thing I found was a line that's something like this
bindir = ${prefix}/bin
The /tools/bin is created after running Binutils but the gcc is not placed
in there after running gcc-3.4.1
Should gcc be in /tools/bin or is it just linked to it ?
|
|
|
09-24-2006, 01:59 PM
|
#22
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Hi,
If there is no gcc in /tools/bin, gcc is not/not correctly installed.
Like I said before: Something probably went wrong while doing chapter 5.5 (gcc pass 1) .
In order to build the rest of the temporary environment you need access to the gcc installed in chapter 5.5, otherwise things will fail. I wouldn't take any shortcuts here, just restart at chapter 5.5 and continue from there (personally I would start at the beginning of chapter 5).
|
|
|
09-24-2006, 03:05 PM
|
#23
|
Member
Registered: Sep 2006
Posts: 122
Original Poster
Rep:
|
Hello,
Well I always restart because I don't want to leave my laptop on The only thing is that I have my commands on a floppy so it will always be the same unless I made a mistake making the commads
I was reading a little bit about the toolchain technical notes on page 39
where it talks about obtaining detailed information from gcc by passing it the -v command line option while compiling a dummy program
So after typing gcc -v I get
Reading specs from /usr/lib/gcc/i486-pc-linux-gnu/3.4.1/specs which is the
wrong one
After that the next line is
Configured with ../gcc-3.4.1/configure --prefix=/usr --libexecdir=/usr/lib
--enable-shared --enable-threads=posix --enable-_cxa_atexit --enable-clocale=gnu --enable-languages=c.c++
thread model : posix
gcc version 3.4.1
I was wondering where is the "--prefix=/usr" in that line is coming from or if this has anything to do with with where gcc is placed.
I can put the gcc into /tools/bin so that when I type which gcc I get
/tools/bin/gcc but that's not going to change the path of where the specs is read from
I have to find out somehow where this path is located so I can change it or make it read from somewhere else
|
|
|
09-24-2006, 04:17 PM
|
#24
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Quote:
Originally Posted by status1
Well I always restart because I don't want to leave my laptop on The only thing is that I have my commands on a floppy so it will always be the same unless I made a mistake making the commads
|
With restart I mean: Scratch all you have and start over, not restarting your computer. This removes any mistakes, bad links, misplaced files etc, etc.
Rechecking all the automated commands wouldn't be a bad idea  Especially those concerning gcc pass 1.
Quote:
I was reading a little bit about the toolchain technical notes on page 39 where it talks about obtaining detailed information from gcc by passing it the -v command line option while compiling a dummy program
So after typing gcc -v I get
Reading specs from /usr/lib/gcc/i486-pc-linux-gnu/3.4.1/specs which is the wrong one
After that the next line is
Configured with ../gcc-3.4.1/configure --prefix=/usr --libexecdir=/usr/lib
--enable-shared --enable-threads=posix --enable-_cxa_atexit --enable-clocale=gnu --enable-languages=c.c++
thread model : posix
gcc version 3.4.1
I was wondering where is the "--prefix=/usr" in that line is coming from or if this has anything to do with with where gcc is placed.
|
I (most of us) don't have the book, so page 39 doesn't tell us that much. A chapter would be a lot better ( online LFS 6.0). I think you are talking about chapter 5.3 (Toolchain Technical Notes).
The information shown is from the gcc that came on the cd, the wrong gcc. You need the newly installed gcc files (chap 5.5) from chapter 5.10 (tcl) onwards. That is why you need to adjust the toolchain (chap 5.9) and have to check the Requesting program interpreter.
But, you already noticed that there is no /tools/bin/gcc. Conclusion: gcc pass 1 went wrong.
Quote:
I can put the gcc into /tools/bin so that when I type which gcc I get /tools/bin/gcc but that's not going to change the path of where the specs is read from
I have to find out somehow where this path is located so I can change it or make it read from somewhere else
|
I still think that something went wrong while installing gcc pass 1. This part is too important to 'play around' with, restart with chapter 5.5
|
|
|
09-24-2006, 06:13 PM
|
#25
|
Member
Registered: Sep 2006
Posts: 122
Original Poster
Rep:
|
Hello,
Do I not start from scratch if I boot from the cd?
I don't see how else can I restart without the cd at this point in the begining
If I don't use the cd it will boot into windows
I will check my commands again but I am pretty sure that it's correct.
It may be due to where I am executing the commads from.
I am thinking that I am running the first commands (from chapter2.3 to 4.4)
from the floppy dir (/mnt/floppy) then after the sources dir is created copy the rest of the commands from the floppy to sources and run it from there
Do you think that may be the problem ?
|
|
|
09-25-2006, 04:20 AM
|
#26
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Hi,
Quote:
Originally Posted by status1
Hello,
Do I not start from scratch if I boot from the cd?
|
Starting from the cd gives you a base to work from. Not necessarely a clean environment.
You already created a minimal directory structure and installed binutils (to name just 2), so in this case starting from the cd will not give you a clean environement but a base and a partially installed LFS.
Make sure all the old stuff is gone, then restart with the LFS parts.
Quote:
I don't see how else can I restart without the cd at this point in the begining
If I don't use the cd it will boot into windows
|
By starting with the cd, clean what you've already done and start over.
Quote:
I will check my commands again but I am pretty sure that it's correct.
It may be due to where I am executing the commads from.
I am thinking that I am running the first commands (from chapter2.3 to 4.4)
from the floppy dir (/mnt/floppy) then after the sources dir is created copy the rest of the commands from the floppy to sources and run it from there
Do you think that may be the problem ?
|
If you never installed LFS before, automating it is on hell of a challenge. Saving all the commands you entered is a good thing, but I would not automate things if this is your first LFS install. Even if you have a good grasp of LFS, automating it is a challenge.
First try to get an idea what and why certain things are done and after a successful LFS install you can consider automating it.
|
|
|
09-25-2006, 06:37 PM
|
#27
|
Member
Registered: Sep 2006
Posts: 122
Original Poster
Rep:
|
Hello,
"You already created a minimal directory structure and installed binutils"
That would be a nice change if something would stay there after I turn it off
but that is not the case.
When I turn it on again there is nothing there except the empty lfs directory
which is created by the cd in /mnt
I have no /tools no /sources nothing and no binutils either
I don't know how else to delete something that is not there unless I format the hard drive which I am not planing on doing
Is there any command I can use to make sure I start clean even though I don't see any directories that were created ?
I am not trying to fully automate it I just want to save time on typing and avoid typos. I am running small sections at a time. I only automate one program or file at a time after I type it in first to make sure it's working without errors.
"First try to get an idea what and why certain things are done"
Well that's why I am here, to get an idea of what is supposed to be happening
at certain points in the building process from someone who has built an lfs
before.
|
|
|
09-25-2006, 08:28 PM
|
#28
|
LQ Newbie
Registered: May 2006
Distribution: Archlinux, LFS 6.2
Posts: 20
Rep:
|
You probably didn't remount the partition. Unless you list the partition in /etc/fstab, you'll have to manually mount it every time you start the computer.
Last edited by Axalon; 09-25-2006 at 08:30 PM.
|
|
|
09-26-2006, 01:31 AM
|
#29
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Quote:
Originally Posted by status1
Hello,
"You already created a minimal directory structure and installed binutils"
That would be a nice change if something would stay there after I turn it off
but that is not the case.
When I turn it on again there is nothing there except the empty lfs directory
which is created by the cd in /mnt
I have no /tools no /sources nothing and no binutils either
I don't know how else to delete something that is not there unless I format the hard drive which I am not planing on doing
|
If this is the case, you are doing something wrong (or the book is corrupt.......  )
One of the steps is to create, format and mount the LFS partition (chapter 2). $LFS should point to this partition. This is NOT /tmp and this NOT done by the cd, it should be done by you.
This partition will be on your HD and will still be there after a reboot.
It could be that you created it, but forgot to mount it after you resumed the LFS install.
This, creating/formatting/mounting the LFS partition, should be done first. Without it you won't go anywhere.
|
|
|
09-26-2006, 06:30 PM
|
#30
|
Member
Registered: Sep 2006
Posts: 122
Original Poster
Rep:
|
Hello,
Well I guess I have a problem then because I have nothing after I reboot except
an empty lfs directory. Maybe the cd is somehow overwriting it when it boots up ?
I tried to delete the lfs directory but it shows up as soon as I reboot.
So you are saying that I should have everything there whatever I put in there
the /tools /sources and any untarred files ?
If that is the case this is definitely a problem.
That's the only reason I put the commads on the floppy because everytime I reboot everything is lost
I will try to rename lfs something else temporarily just to see what happens
when I reboot
|
|
|
All times are GMT -5. The time now is 08:09 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|