LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-07-2012, 12:40 AM   #1
k84834
Member
 
Registered: Aug 2012
Posts: 142

Rep: Reputation: Disabled
I can not remove tools directory and boot LFS without it, please consider my problem


Hi
I'd been familiar with LFS about 3 month ago, after that I build LFS twice time.
I desided to build LFS with fewer packages. for this I do any thing according to LFS7.2 book up to end of section 6.6
After that I installed packages with below order:
1) I first installed Kernel headers
2)Glibc
3)xz
4)pkg-config
5)zlib
6)kmod
7)util-linux
8)udev
9)sysvinit
10)bison
11)bash
12)make
13)sed
14)grep
15)shadow

I selected these packages according to dependency that described in the LFS book.
then I did chapter 7,8 and 9 instructions and booted the system.
until I dosn't remove tools directory, the LFS is booting and any thing be right, but when I remove the tools directory and booting the system, I encounter with kernel panic error.
what is the dependency between my LFS system and the tools directory?
how can I handle this error?
please don't tell me that " you must install all packages in chapter 6", I want to build LFS with fewer installed packages.
thank you

Last edited by k84834; 11-07-2012 at 12:56 AM.
 
Old 11-07-2012, 01:08 AM   #2
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
I believe that everything in chapter 6 is necessary to build system must be done in the exact order of the book, but you can strip some of the unecessary stuff at the end of chapter 6
 
Old 11-07-2012, 01:16 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Although I'm not 100% sure this experiment will work I do have a few points you might need to consider:

- First and foremost: You do not mention doing chapter 6.10. (Adjusting the Toolchain). That's a very important step in the build.
Quote:
Now that the final C libraries have been installed, it is time to adjust the toolchain so that it will link any newly compiled program against these new libraries.
I do believe this is the core of your problem.

- Secondly: How did you decide the order in which you installed the packages? This from chapter 6.1:
Quote:
The order that packages are installed in this chapter needs to be strictly followed to ensure that no program accidentally acquires a path referring to /tools hard-wired into it.
- Thirdly: Did you run all the checks/test for the aforementioned packages and did they all pass?

- Last: If you want help you need to post more details. Saying that you encounter a kernel panic doesn't tell us anything, besides that something went wrong. What was the actual error you encountered?
 
Old 11-07-2012, 02:06 AM   #4
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
- First and foremost: You do not mention doing chapter 6.10. (Adjusting the Toolchain). That's a very important step in the build.I do believe this is the core of your problem.
yes, I mentioned to the section 6.10 but for know path of my search directories and Dynamic linker and so on. dosn't replace old ld with new one (ld-new), in this section I just do below commands:
Code:
root:/sources# readelf -l a.out | grep ': /tools/lib'
      [Requesting program interpreter: /tools/lib/ld-linux.so.2]

root:/sources# grep -o '/.*/lib.*/crt[1in].*succeeded' dummy.log
/tools/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../crt1.o succeeded
/tools/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../crti.o succeeded
/tools/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../crtn.o succeeded

root:/sources# grep -B1 '^ /.*/include' dummy.log
#include <...> search starts here:
 /tools/lib/gcc/i686-pc-linux-gnu/4.7.1/include
 /tools/include
 /tools/lib/gcc/i686-pc-linux-gnu/4.7.1/include-fixed

root:/sources# grep 'SEARCH.*/lib' dummy.log |sed 's|; |\n|g'
SEARCH_DIR("/tools/i686-pc-linux-gnu/lib")
SEARCH_DIR("/tools/lib");

root:/sources# grep "/lib.*/libc.so.6 " dummy.log
attempt to open /tools/lib/libc.so.6 succeeded

root:/sources# grep found dummy.log
found ld-linux.so.2 at /tools/lib/ld-linux.so.2
can you find what is the problem with these informations?!
when I installed mentioned packages, I didn't change prefix directory and installed them in /usr.
have you any ideas?
thanks for your replies.

Last edited by k84834; 11-07-2012 at 02:10 AM.
 
Old 11-07-2012, 02:53 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Before I try to answer I first have a question: What is it you are trying to accomplish?

I'm asking because of the following: If you manage to create a minimal LFS system based on the above mentioned package you'll end up with a system that can do hardly anything. Installing/building any package after you're finished will not be possible.

That's ok if this is just an exercise in making the smallest system based on LFS. If you want to use/expand your (minimal) LFS system once you're finished, that's not ok......

Quote:
Originally Posted by k84834 View Post
Quote: Originally Posted by druuna
Quote:
- First and foremost: You do not mention doing chapter 6.10. (Adjusting the Toolchain). That's a very important step in the build.I do believe this is the core of your problem.
yes, I mentioned to the section 6.10 but for know path of my search directories and Dynamic linker and so on.
It probably is a language problem, but I really don't understand what it is you are saying in the above answer.

Quote:
dosn't replace old ld with new one (ld-new), in this section I just do below commands:
Code:
root:/sources# readelf -l a.out | grep ': /tools/lib'
      [Requesting program interpreter: /tools/lib/ld-linux.so.2]
.
.
.
root:/sources# grep found dummy.log
found ld-linux.so.2 at /tools/lib/ld-linux.so.2
can you find what is the problem with these informations?!
You need to successfully execute all the commands in chapter 6.10. As mentioned in the book and quoted by me in a previous post: This is a crucial step to make sure that the correct libraries are used once they come available.
 
  


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
Gcc 4.6.1 can't Find in /mnt/lfs/tools on LFS verison 7.0 using LFS_TGT xerofoify Linux From Scratch 20 08-03-2012 12:55 PM
[SOLVED] LFS 6.7 : $LFS/sources and $LFS/tools folders missing prakashsince92 Linux From Scratch 5 12-09-2010 02:26 PM
[SOLVED] LFS 6.6 boot problem smkh Linux From Scratch 4 03-31-2010 03:05 AM
lfs:/mnt/lfs/sources/util-linux-2.12r$ cp -v mount/{,u}mount text-utils/more /tools/b arougen02 Linux From Scratch 5 03-19-2008 01:15 PM
lfs:/mnt/lfs/sources/util-linux-2.12r$ cp -v mount/{,u}mount text-utils/more /tools/b arougen02 Linux - Newbie 2 03-16-2008 11:16 AM

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

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