LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   6.1.1 Help (https://www.linuxquestions.org/questions/linux-from-scratch-13/6-1-1-help-393426/)

Michaelo 12-15-2005 11:50 PM

6.1.1 Help
 
Need help: a couple of questions re 6.1.1

Everything is fine until I get to 5.4. GCC-3.4.3 - Pass 1

How, when and where do I run the patch(s)?

In the book the sequence is:

patch -Np1 -i ../glibc-2.3.4-fix_test-1.patch

mkdir -v ../glibc-build
cd ../glibc-build

../glibc-2.3.4/configure --prefix=/tools \
--disable-profile --enable-add-ons \
--enable-kernel=2.6.0 --with-binutils=/tools/bin \
--without-gd --with-headers=/tools/include \
--without-selinux

make
etc...

The main confusion is the ../ because I assume if I am in /mnt/lfs/ the operation of the second line will create a directory in /mnt/ called glibc-build (i.e the root of my hard-drive) but the first line look like it is trying to patch a file in the directory before I have created it or even copied or extracted any files there? Also do I run the patch before I extract or after?

Thanks... Mike

axion0917 12-16-2005 01:28 AM

If you read the beginning of the book, it states that you must extract the tarball and cd into the extracted directory before beginning the installation. This goes for every package.

Michaelo 12-16-2005 06:14 AM

I have read the book from cover to cover.
First off I extracted the source files to my hard-drive in: /mnt/lfs/sources/ (5.1. Introduction)

My confusion lies in the instructions in (5.3.1. Installation of Binutils). Here I am asked to create the build directory which I assumed was the directory where my extracted file should be... but obviously I got it wrong...

To follow the instructions exactly I would need to be in the /mnt/lfs/sources/ directory, here I would run the extraction process creating a new directory containing the new source code. Without changing directories I would run any patches that apply as well as any other instruction in 5.3.1. Installation of Binutils.

Doing this would result in the new directory containing the new source code inside /mnt/lfs/sources/ but where does the build directory come in?

Do I not copy/move the newly created source code to the build directory before make etc., cd to that directory and continue the process...?

Many Thanks. Confused!

liquidtenmilion 12-16-2005 08:23 AM

Here is what you should do.

First, make sure you are in /mnt/lfs/sources

then untar the binutils tarball(tar -xjvf blahblahblah.bz2"
then CD into that "cd binutils-blah/"
THEN when you are in the directory you just created when extracting binutils, issue the command to patch, and then mkdir ../binutils-build


On every single page the instructions assume that you first extract the tarball and then CD into the directory that the extraction just created.

Michaelo 12-16-2005 09:24 AM

Many thanks liquidtenmilion (and axion0917). I have done precisely what liquidtenmilion suggested, a couple of times...I guess it must have worked because I have the correct files in the tools directory, but I was sure I did something wrong because I never used the binutils-build directory!?! the book asks you to create. Maybe I use it later..? Stil confused but making progress so once again thanks guys no doubt I will be back later with more problems ;)
Mike

axion0917 12-16-2005 12:11 PM

If I remember correctly, the build instructions for packages that require a separate build directory are something like:

tar xjf binutils-*.tar.bz2
cd binutils-x.x
mkdir ../binutils-build
cd ../binutils-build
../binutils-x.x/configure --blah --blah && make

as you can see, from the source directory, you create a build directory in the package root directory, which you cd into directly after, followed by the build, which will build the package in the current dir (binutils-build) rather than the source directory...so it does indeed use this directory right after it's created if you follow the instructions.

Hope this clears some confusion at least :) Happy LFS'ing!

Michaelo 12-16-2005 09:54 PM

Thanks axion0917, Everything seem to be going fine now.
The difficulty was the book assumed the reader has some knowledge of Linux outside a gui and the problem was, up to now, I have issued a hand full of commands outside of a gui. I have been using linux since redhat 5 but have become dependant on MC and other utilities. The funny thing I can do almost anything in DOS (Must be an age thing ;)) I even wrote code for a living! Thanks again
Mike

Michaelo 12-16-2005 10:27 PM

More... ;(

In 5.5.1. Installation of Linux-Libc-Headers Install the header files:

Commands are:
cp -Rv include/asm-i386 /tools/include/asm
cp -Rv include/linux /tools/include

With this note:
If your architecture is not i386 (compatible), adjust the first command accordingly.

As the only asm and linux directories and I could find were in /usr/include/asm/ & /user/include/linux/ on the CD. Am I right in assuming these were the correct directories to copy?

I note later in the install the author leaves out the unzipping procedure at the start of each chapter. Once I was aware of this the rest went smoothly until this next problem...

I must need the LiveCD Install for Idiots! :->)

liquidtenmilion 12-17-2005 08:47 AM

Did you untar "linux-libc-headers-version.tar.bz2" and then cd into it?

From there you should have the include/asm-i386 directory.


All times are GMT -5. The time now is 11:38 AM.