LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
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


Reply
  Search this Thread
Old 12-15-2005, 11:50 PM   #1
Michaelo
LQ Newbie
 
Registered: Dec 2005
Location: Dublin
Distribution: Several
Posts: 5

Rep: Reputation: 0
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
 
Old 12-16-2005, 01:28 AM   #2
axion0917
Member
 
Registered: Nov 2003
Distribution: Arch Linux / LFS
Posts: 49

Rep: Reputation: 16
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.
 
Old 12-16-2005, 06:14 AM   #3
Michaelo
LQ Newbie
 
Registered: Dec 2005
Location: Dublin
Distribution: Several
Posts: 5

Original Poster
Rep: Reputation: 0
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!

Last edited by Michaelo; 12-16-2005 at 06:32 AM.
 
Old 12-16-2005, 08:23 AM   #4
liquidtenmilion
Member
 
Registered: May 2004
Location: South Carolina
Distribution: Slackware 11.0
Posts: 606

Rep: Reputation: 32
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.
 
Old 12-16-2005, 09:24 AM   #5
Michaelo
LQ Newbie
 
Registered: Dec 2005
Location: Dublin
Distribution: Several
Posts: 5

Original Poster
Rep: Reputation: 0
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
 
Old 12-16-2005, 12:11 PM   #6
axion0917
Member
 
Registered: Nov 2003
Distribution: Arch Linux / LFS
Posts: 49

Rep: Reputation: 16
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!

Last edited by axion0917; 12-16-2005 at 12:14 PM.
 
Old 12-16-2005, 09:54 PM   #7
Michaelo
LQ Newbie
 
Registered: Dec 2005
Location: Dublin
Distribution: Several
Posts: 5

Original Poster
Rep: Reputation: 0
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

Last edited by Michaelo; 12-16-2005 at 10:47 PM.
 
Old 12-16-2005, 10:27 PM   #8
Michaelo
LQ Newbie
 
Registered: Dec 2005
Location: Dublin
Distribution: Several
Posts: 5

Original Poster
Rep: Reputation: 0
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! :->)

Last edited by Michaelo; 12-17-2005 at 03:25 AM.
 
Old 12-17-2005, 08:47 AM   #9
liquidtenmilion
Member
 
Registered: May 2004
Location: South Carolina
Distribution: Slackware 11.0
Posts: 606

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

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 03:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration