LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   <n00b Q> 5.3.1 installation of binutils (https://www.linuxquestions.org/questions/linux-from-scratch-13/n00b-q-5-3-1-installation-of-binutils-539289/)

LDJ 03-21-2007 06:14 AM

<n00b Q> 5.3.1 installation of binutils
 
I've followed the first few pages of LFS (using the LFS-Book-6.2 and the LFS live CD v 6.2-5) and hit a problem at the first step. The book states:

Quote:

Nowprepare Binutilsforcompilation:
../binutils-2.16.1/configure --prefix=/tools --disable-nls
but when I do that I get the following error:

Quote:

lfs:/mnt/lfs/binutils-build$ ../binutils-2.16.1/configure --prefix=/tools --disable-nls
bash: ../binutils-2.16.1/configure: No such file or directory
Obviously I'm running it from the wrong directory, but I thought all commands had to be run from the $LFS directory (i.e. /mnt/lfs)?

Im missing something obvious I know, but if anyone could point me in the right direction i'd be apprecaited.

Thanks

na5m 03-21-2007 10:26 AM

you need to execute the command(s) from inside the directory
of the package you're installing (the one you just untarred). For example:
Code:

lfs:/mnt/lfs/sources$ tar xf binutils-2.16.1.tar.bz2
lfs:/mnt/lfs/sources$ cd binutils-2.16.1
lfs:/mnt/lfs/sources/binutils-2.16.1$ mkdir -v ../binutils-build
lfs:/mnt/lfs/sources/binutils-2.16.1$ cd ../binutils-build
lfs:/mnt/lfs/sources/binutils-build$ ../binutils-2.16.1/configure --prefix=/tools --disable-nls

$LFS is the directory that is going to be your
new Linux From Scratch root directory in Chapter 6, so
you should do your untarring of the packages in some
subdirectory of $LFS. You can name this
subdirectory whatever you like, but 'sources' is a good
choice. After you've untarred the package, cd into the
newly created subdirectory (i.e. /mnt/lfs/sources/binutils-2.16.1)
and follow the commands from the book.

LDJ 03-21-2007 11:16 AM

Ok, thanks. So using the LFS liveCD I assume I dont need to download any of the files and patches and can just copy them from the CDROM to the $LFS/Sources directory then?

Zention 03-21-2007 03:08 PM

LFS is a just a book really - following all the instructions to the letter will result in a system built from the book - though it does let itself down in not showing the cd to the source directory each time (I think there is a note about this at the start of the pertinent chapter).

If you are going down the LFS route then of course it is wise to know exactly what each command is doing and what it expects in relation to your environment.

The present working directory is basic but of course very important.

LFS defaults to the notion of having a directory structure of:

/sources/
/sources/<sourcepkg>.tgz
/sources/<sourcepkg>/
/sources/<sourcepkg>-build/

Now of course you can build inside the sourcepkg dir though it is often unadvisable.

The reasons is the problem of name clash, but really it is about keeping the build distinct from the source.

This way you could build a number of distinct packages from the same source and maintain different build directories.

Should the build directory really be below the sources directory, a build is not really a source but a stage prior to deployment, anyway the choice is yours.

With LFS they advise you delete the build directory and sourcepkg dir after deployment and of course this saves a few Meg. But, if you are building a package system host to deploy/install to other hosts then it may be advisable to keep them around in which case a more flexible directory structure could be envisioned.

LDJ 03-21-2007 03:19 PM

It says in the book that if you download the LiveCD then you dont need to download anything else becuase all the packages and patches are on the CD. I've mounted the cdrom (mount /dev/cdrom /mnt/cdrom) and browsed the CD but cannot see these on here to copy to my sources dir. do i have to manually download them all then?

Zention 03-21-2007 03:47 PM

No idea - I just got everything from the source locations bar a couple of things that had got removed so those were taken from LFS servers.

well find is your friend, so go to the CD directory.

find ./ -name "*.patch"

if you get permission denied then up yourself to root.

na5m 03-22-2007 10:25 AM

If you booted the livecd, then you don't need to mount the cd at all.
Peek into the /lfs-sources directory and you will find all of
the tarballs and patches that the book requires. Have fun!

BobTheSlackUser 03-22-2007 10:29 AM

And if you ever forget what na5m said, just type in "Greeting" at your bash prompt and you get a message telling you where the sources and book is.

Oh yeah, and yes, just copy all the sources to the hard disk (under sources, like the book says) and begin the installation.

Bob

LDJ 03-23-2007 06:36 AM

Whoops! my Bad!
I didnt even bother reading the 'greeting' message at the start.

/hangs his head in shame!

Thanks for the pointers guys :)


All times are GMT -5. The time now is 03:29 AM.