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 11-21-2007, 08:06 AM   #1
wvernon
LQ Newbie
 
Registered: Nov 2007
Posts: 1

Rep: Reputation: 0
LFS 6.3 Pointers for Dummies


Hello LFS users! This is my first post on this forum.

I have been wrestling with the 6.3 version LFS book, as many out there probably are. I wanted to clarify parts of the book that (I banged my head on for a while!) were not clear to me, and may not be clear to some of you. As a side note, I am using Debian 4.0 as my host systems.

The first is

5.5.1. Installation of Linux API Headers
The Linux kernel needs to expose an Application Programming Interface (API) for the system's C library (Glibc in LFS) to utilize. This is done by way of sanitizing various C header files that are shipped in the Linux kernel source tarball.

Install the header files:

make mrproper
make headers_check
make INSTALL_HDR_PATH=dest headers_install
cp -rv dest/include/* /tools/include


In order for this to work, you have to go to where you saved the Linux-2.6.22.5.tar.bz2 (I saved it in $LFS/tools/) and untar by typing the following as user lfs:

tar -jxvf linux-2.6.22.5.tar.bz2

You should see the files fly by on the screen as they are untarred into a new directory (in my case in $LFS/tools/linux-2.6.22.5). Then enter directory by

cd ./linux-2.6.22.5

and then type

make mrproper
make headers_check
make INSTALL_HDR_PATH=dest headers_install
cp -rv dest/include/* /tools/include


After that, you can go on to your next package.

Just a little note, the package glibc will not install if you build the /glibc-build directory in $LFS/tools. This was (and is) a point of confusion because one of the prefacing statements to Chapter 5 was that

Chapter 5
Introduction, Paragraph 3

The files compiled in this chapter will be installed under the $LFS/tools directory to keep them separate from the files installed in the next chapter and the host production directories.

Make your glibc-build directory under $LFS/sources and you should be good to go. If you do try to compile and build in $LFS/tools/glibc-build/, you will get Make errors which will prohibit you from installing. I about lost all my hair on that one!

I'm looking forward to comments (especially if I made a mistake in my statements).
 
Old 11-21-2007, 09:39 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
I'm always a little amazed when people have such a difficult time with CLFS/LFS. I can only presume that they didn't read the book carefully enough. Maybe that's why this statement is made in section iii.
Quote:
Originally Posted by LFS-6.3
...as an absolute minimum, the reader should already have the ability to use the command line (shell) to copy or move files and directories, list directory and file contents, and change the current directory. It is also expected that the reader has a reasonable knowledge of using and installing Linux software.
It's nice that you posted this info, but you're not adding anything that isn't already in the LFS book. This excerpt from section 3.1 clearly indicates that $LFS/sources will be used to store the tarballs and build each pacakge.
Quote:
Originally Posted by LFS-6.3
Downloaded packages and patches will need to be stored somewhere that is conveniently available throughout the entire build. A working directory is also required to unpack the sources and build them. $LFS/sources can be used both as the place to store the tarballs and patches and as a working directory. By using this directory, the required elements will be located on the LFS partition and will be available during all stages of the building process.
The need to unpack the source tarball and cd into the top of the source tree should be obvious. But just in case it's not, there's a big box with word Important in section 5.1. That box clearly states
Quote:
Originally Posted by LFS-6.3
Before issuing the build instructions for a package, the package should be unpacked as user lfs, and a cd into the created directory should be performed. The build instructions assume that the bash shell is in use.
 
Old 05-03-2008, 07:10 AM   #3
drut
LQ Newbie
 
Registered: Mar 2007
Posts: 21

Rep: Reputation: 15
Just found this thread doing a search for "Installation of API headers" - for LFS 6.3, as this is the chapter I am now paused at.

I had been wondering what steps to do, and had thought you needed to create a 'build' directory (I did create "linux-headers-build") but obviously as I had created it, it was empty.

Then I checked my log book and found for 'gcc-4.12' there was a "cc" command that made the 'Makefile' - hmmm. So I was thinking what should the cc command look like? I tried "linuxquestions.org" for a solution like I have many times before...
And it pointed me here, and using wvernon's instructions I found out you dont make a 'build' folder like before - you run the commands from the folder you un-tarred to!

Success!
So this has helped me continue my attempt at finishing LFS, thanks for the info.

I am wondering though, why you are manually putting 'stuff' in the $LFS/tools/ folder because everything I have done so far is under $LFS/sources/ and only the 'system' is altering the tools folder (as I understand it?)

The manual does say "The files compiled in this chapter will be installed under the $LFS/tools directory..." but it doesn't say you should put the build folders there - just that the system will install files in $LFS/tools - At least thats how I read it? - it's not that the LFS book doesn't mention it, I think it just the way it describes things..

Regards

PS - @wvernon :I know this thread is a few months old so I am wondering, did you manage to finish LFS?

Last edited by drut; 05-03-2008 at 07:12 AM. Reason: typo
 
Old 05-09-2008, 11:03 PM   #4
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
Just a note for the curious the linux API headers is a newer step to LFS the older ones used a separate package. The package they used is no longer supported as the original maintainer gave up trying to keep up with kernel releases.

If you wanna know why they ever had a separate package its an interesting read and shows how much the kernel devs and user space devs dont seam to mingle.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
LFS 6.2: made mistake when going from lfs to root setup oldgeek Linux From Scratch 4 11-12-2006 09:00 PM
LFS question - lack of activity in LFS Forum nykey Slackware 4 06-05-2006 05:54 PM
LFS Book Chapter 6 - 1st step (chroot to /mnt/lfs) doens't work bauld Linux From Scratch 11 03-15-2006 12:31 AM
LFS-7.0-cross-lfs-20050902-x86_64-Multilib Basel Linux From Scratch 0 09-03-2005 05:03 AM
SUSE Linux 9.3 for Dummies (For Dummies S.) samuelmp SUSE / openSUSE 11 08-01-2005 01:42 PM

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

All times are GMT -5. The time now is 04:56 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