LinuxQuestions.org
Help answer threads with 0 replies.
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 02-17-2010, 04:18 PM   #1
junust
Member
 
Registered: Jul 2008
Location: Israel Ramat Gan
Distribution: CentOs 5.3, SuSe 11.1, Solaris 9, Slackware 13
Posts: 81

Rep: Reputation: 15
bash: ./perl: No such file or directory


Hello
My LFS book is ver 6.5
I am trying to find out, why I have this error (bash: ./perl: No such file or directory)

Just right after I switched to chroot env, and trying to install Linux API hearders 2.6.30.2

Code:
make INSTALL_HDR_PATH=dest headers_install
I have error message '/bin/sh: /usr/bin/perl: No such file or directory'

On my chroot enviroment
Code:
ls -l /usr/bin/perl
lrwxrwxrwx 1 root root 15 Feb 18 07:27 /usr/bin/perl -> /tools/bin/perl
and actually when I do /tools/bin/perl -v or some like outside the chroot env, perl works perfect


What could be the problem???

Last edited by junust; 02-18-2010 at 01:51 AM.
 
Old 02-17-2010, 04:56 PM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,863

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
When chrooted what is the ouput of

Code:
ls -l /tools/bin/perl
ldd /tools/bin/perl
[edit]

And what does
Code:
ls -l /
return? Is /lib64 linked to /lib?

Last edited by crts; 02-17-2010 at 04:58 PM.
 
Old 02-17-2010, 05:07 PM   #3
junust
Member
 
Registered: Jul 2008
Location: Israel Ramat Gan
Distribution: CentOs 5.3, SuSe 11.1, Solaris 9, Slackware 13
Posts: 81

Original Poster
Rep: Reputation: 15
Quote:
When chrooted what is the ouput of

Code:
ls -l /tools/bin/perl
ldd /tools/bin/perl
ls -l /tools/bin/perl
-rwxr-xr-x 1 root root 1231536 Feb 17 21:44 /tools/bin/perl

ldd /tools/bin/perl
/tools/bin/ldd: line 126: /tools/bin/perl: No such file or directory

Quote:
and what does
Code:
ls -l /
ls -l /
total 64
drwxr-xr-x 2 root root 4096 Feb 18 07:33 bin
drwxr-xr-x 2 root root 4096 Feb 18 01:20 boot
drwxr-xr-x 10 root root 4280 Feb 24 13:15 dev
drwxr-xr-x 3 root root 4096 Feb 18 07:40 etc
drwxr-xr-x 2 root root 4096 Feb 18 01:20 home
drwxr-xr-x 2 root root 4096 Feb 18 01:20 lib
drwxr-xr-x 4 root root 4096 Feb 18 01:21 media
drwxr-xr-x 2 root root 4096 Feb 18 01:20 mnt
drwxr-xr-x 2 root root 4096 Feb 18 01:20 opt
dr-xr-xr-x 122 root root 0 Feb 14 12:25 proc
drwxr-x--- 2 root root 4096 Feb 18 07:52 root
drwxr-xr-x 2 root root 4096 Feb 18 01:21 sbin
drwxrwxrwt 30 1002 root 4096 Feb 25 00:38 sources
drwxr-xr-x 2 root root 4096 Feb 18 01:21 srv
drwxr-xr-x 12 root root 0 Feb 14 12:25 sys
drwxrwxrwt 2 root root 4096 Feb 25 01:48 tmp
drwxr-xr-x 12 root root 4096 Feb 17 21:46 tools
drwxr-xr-x 9 root root 4096 Feb 18 01:34 usr
drwxr-xr-x 12 root root 4096 Feb 18 01:46 var


Quote:
Is /lib64 linked to /lib?
what for???
uname -a
Linux node1 2.6.27.7-9-pae #1 SMP 2008-12-04 18:10:04 +0100 i686 GNU/Linux
 
Old 02-17-2010, 05:19 PM   #4
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,863

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Quote:
Originally Posted by junust View Post

what for???
uname -a
Linux node1 2.6.27.7-9-pae #1 SMP 2008-12-04 18:10:04 +0100 i686 GNU/Linux
I once messed up my toolchain. One problem was a missing symlink from lib64 to lib in my toolchain. It also gave a 'no such file' error although the file was there. After restoring this symlink it worked again.
However, my build was a subversion of LFS-6.3 and it definitly required a lib64 symlink. I am not sure if LFS-6.5 does so, too.

Can you run
ldd $LFS/tools/bin/perl
when not chrooted?

And also check
ls -l $LFS/tools
when not chrooted.
 
Old 02-18-2010, 02:11 AM   #5
junust
Member
 
Registered: Jul 2008
Location: Israel Ramat Gan
Distribution: CentOs 5.3, SuSe 11.1, Solaris 9, Slackware 13
Posts: 81

Original Poster
Rep: Reputation: 15
crts,
first of all thanks for trying to help!


Actually, I did not realize what was the problem at real, but It was the session open through 'screen option' on my LFS station, and it was chrooted already inside, I reattached this screen, and VOOLA, it works like a charm...

Last edited by junust; 02-18-2010 at 02:15 AM.
 
Old 02-18-2010, 02:15 AM   #6
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
I think "No such file or directory" in your case meant that no ld-linux
found.

Run
Code:
readelf -l /usr/bin/perl
outside your chroot

You'll output like this:
Code:
Elf file type is EXEC (Executable file)
Entry point 0x400b20
There are 8 program headers, starting at offset 64

Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
  PHDR           0x000040 0x0000000000400040 0x0000000000400040 0x0001c0 0x0001c0 R E 0x8
  INTERP         0x000200 0x0000000000400200 0x0000000000400200 0x00001c 0x00001c R   0x1
      [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
  LOAD           0x000000 0x0000000000400000 0x0000000000400000 0x000f54 0x000f54 R E 0x200000
....
Is requesting program interpreter present in your chroot environment ?
 
Old 02-18-2010, 03:29 AM   #7
junust
Member
 
Registered: Jul 2008
Location: Israel Ramat Gan
Distribution: CentOs 5.3, SuSe 11.1, Solaris 9, Slackware 13
Posts: 81

Original Poster
Rep: Reputation: 15
Valery Reznic

Please refer to the post just above of yours..

thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Perl, Removing file from path to get directory only xemous Programming 8 04-11-2012 11:13 AM
Loop through all files in a directory. Bash/Perl script? Nzo Linux - Newbie 9 12-09-2009 07:09 PM
Perl script to look at a directory for a new file chackercon Programming 2 10-24-2009 03:23 PM
perl: (2)No such file or directory: exec of ... xpucto Linux - Newbie 1 11-13-2007 05:21 AM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM

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

All times are GMT -5. The time now is 01:00 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration