LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   I can not remove tools directory and boot LFS without it, please consider my problem (https://www.linuxquestions.org/questions/linux-from-scratch-13/i-can-not-remove-tools-directory-and-boot-lfs-without-it-please-consider-my-problem-4175436013/)

k84834 11-07-2012 12:40 AM

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

EDDY1 11-07-2012 01:08 AM

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

druuna 11-07-2012 01:16 AM

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?

k84834 11-07-2012 02:06 AM

Quote:

Originally Posted by druuna (Post 4823893)
- 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.

druuna 11-07-2012 02:53 AM

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 (Post 4823912)
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.


All times are GMT -5. The time now is 12:47 AM.