Linux From ScratchThis 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.
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.
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).
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.