LinuxQuestions.org
Review your favorite Linux distribution.
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 10-12-2009, 04:43 PM   #1
nomad5000
LQ Newbie
 
Registered: Dec 2006
Posts: 4

Rep: Reputation: 0
chapter 6, want to use bzip2 but it fails with bash: bzip2: No such file or directory


Hi everybody,

I'm having trouble using bzip2 in the chroot enviroment in chapter 6.

I compiled bzip2 in chapter 5 and it worked wounderfull. I try to execute my compiled bzip2 in the host enviroment, and all is working nicely.

But once I chroot, it stops to work and returns a error message that doesn't help me any further.

Code:
bash: bzip2: No such file or directory
I tried every thing, I went directly into the /tools/bin dir and did a
./bzip2, it returnes the same problem. Then I checked my path:
Code:
$: echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin
it is like the file bzip2 doesn't exist, but it is there, I checked with a

Code:
ls -l /tools/bin/bzip2
I was so desperate, that I desided to put some lines into the main function in bzip2.c just to see if they where executed, but the program doesn't even get to that point.

What can I do?

Any help is greatly apreciated
 
Old 10-12-2009, 08:36 PM   #2
nomad5000
LQ Newbie
 
Registered: Dec 2006
Posts: 4

Original Poster
Rep: Reputation: 0
OK I think I found the problem. But still I'm not able to solve it.

I used the tool readelf -l /tools/bin/bzip2 to find out what libraries the binary depends on. And guess what.

it depends on a binary in the /lib/ directory which is not populated at this point. To be more speciffic it depends on ld-linux.so.2 wgich was present in my host system, but is not pressent in my chroot enviroment.

I think this is a bug in the LFS book, but I don't know where to post it can somebody tell me where?

Thanks for your help!!

Michael
 
Old 10-12-2009, 08:58 PM   #3
nomad5000
LQ Newbie
 
Registered: Dec 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Now I solved the problem, with a little hack.

I created a symbolic link inside the /lib/ directory of my chroot env, to point to /tools/lib/ld-linux.so.2 and this way I got bzip2 to work propperly. Now this works fine but,you have to delete this link once you install Glibc because this packages creates the actual ld-linux.so.2 file in the right directory. This is why nobody has noticed this bug. The third package you install in LFS chapter 6 is Glibc

Gosh this is my first bug I find in an open source proyect, I am so happy!!
 
  


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
Compressing directory with bzip2 Haiyadragon Linux - Newbie 4 12-19-2016 03:51 PM
bzip2: Compressed file ends unexpectedly Teenna Debian 4 03-22-2012 05:34 AM
Bzip2 and File Size Limits floog Linux - Software 3 02-27-2007 10:14 AM
change bzip2 output file permisions ricksoft Linux - Security 5 08-18-2006 04:05 PM
kdelibs missing bzip2 file cain_eve Linux - Software 2 03-08-2005 03:48 PM

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

All times are GMT -5. The time now is 04:21 AM.

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