Opened 19 years ago

Closed 19 years ago

#1630 closed defect (invalid)

chroot: cannot run command `/tools/bin/env': No such file or directory

Reported by: basel_mahdi545@… Owned by: lfs-book@…
Priority: lowest Milestone:
Component: Book Version: Branch_Cross-LFS
Severity: normal Keywords:
Cc:

Description

Linux From Scratch - Version 7.0-cross-lfs-20050902-x86_64-Multilib Host Distribution - Slackware 10.1 with kernel-2.6.13 Section - 8.4. Entering the Chroot Environment Processor - AMD64 3000+

root@slackware:/home/basel# chroot "$LFS" /tools/bin/env -i \

HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \ /tools/bin/bash --login +h

chroot: cannot run command `/tools/bin/env': No such file or directory

I even tried to add /mnt/lfs_x86_64 to PATH but I got another error:

root@slackware:/home/basel# echo $PATH /usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin root@slackware:/home/basel# export PATH=/mnt/lfs_x86_64/tools/bin/:$PATH root@slackware:/home/basel# chroot "$LFS" /tools/bin/env -i \

HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \ /tools/bin/bash --login +h

bash: /mnt/lfs_x86_64/tools/bin/chroot: cannot execute binary file

I was not able to execute any comman after I added /mnt/lfs_x86_64/tools/bin to PATH:

root@slackware:/home/basel# ls -l /mnt/lfs_x86_64/tools/bin/chroot bash: /mnt/lfs_x86_64/tools/bin/ls: cannot execute binary file

I took a look at the mailing list and found the following thread: http://archives.linuxfromscratch.org/mail-archives/lfs-support/2005-July/027736.html Jens Olav suggests that there might be some problems with sed/perl/whatever adjustments to the spec files. How do I know if it was my fault or the commands did not execute as expected. Here is the output from my machine: lfs:~$ ldd /tools/bin/bash

not a dynamic executable

It would be nice if there is a way to verify the output of these commands.


Here is what I did initially after a reboot(this happened even before the reboot):

basel@slackware:~$ su Password: root@slackware:/home/basel# export LFS=/mnt/lfs_x86_64/ root@slackware:/home/basel# mount /dev/sda2 /mnt/lfs_x86_64/ root@slackware:/home/basel# ls -l /mnt/lfs_x86_64/ total 4 drwxr-xr-x 2 root root 48 2005-09-05 15:28 proc drwxr-xr-x 3 lfs lfs 4152 2005-09-05 15:26 sources drwxr-xr-x 2 root root 48 2005-09-05 15:28 sys drwxr-xr-x 14 lfs lfs 352 2005-09-05 14:42 tools root@slackware:/home/basel# mount -t proc proc $LFS/proc root@slackware:/home/basel# mount -t sysfs sysfs $LFS/sys root@slackware:/home/basel# mount -f -t tmpfs tmpfs $LFS/dev root@slackware:/home/basel# mount -f -t tmpfs tmpfs $LFS/dev/shm root@slackware:/home/basel# mount -f -t devpts -o gid=4,mode=620 devpts $LFS/dev/pts root@slackware:/home/basel# chroot "$LFS" /tools/bin/env -i \

HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \ /tools/bin/bash --login +h

chroot: cannot run command `/tools/bin/env': No such file or directory

However, "ls -l" shows that "env" exists:

root@slackware:/home/basel# ls -l /tools/bin/en* -rwxr-xr-x 1 lfs lfs 74828 2005-09-05 14:32 /tools/bin/env -rwxr-xr-x 1 lfs lfs 37763 2005-09-05 14:59 /tools/bin/envsubst root@slackware:/home/basel# ls -l /mnt/lfs_x86_64/tools/bin/en* -rwxr-xr-x 1 lfs lfs 74828 2005-09-05 14:32 /mnt/lfs_x86_64/tools/bin/env -rwxr-xr-x 1 lfs lfs 37763 2005-09-05 14:59 /mnt/lfs_x86_64/tools/bin/envsubst

Here is my root partition hierarachy:

root@slackware:/home/basel# ls -l / total 16 drwxr-xr-x 2 root bin 2512 2005-08-14 19:58 bin drwxr-xr-x 3 root root 568 2005-09-04 17:09 boot lrwxrwxrwx 1 root root 21 2005-09-05 15:47 cross-tools -> /home/lfs/cross-tools drwxr-xr-x 16 root root 0 2005-09-05 18:07 dev drwxr-xr-x 40 root root 4312 2005-09-05 18:34 etc drwxr-xr-x 5 root root 120 2005-09-04 17:50 home drwxr-xr-x 4 root root 3008 2005-01-23 00:11 lib drwxr-xr-x 8 root root 200 2005-09-04 17:46 mnt drwxr-xr-x 3 root root 72 2004-09-03 23:00 opt dr-xr-xr-x 87 root root 0 2005-09-05 21:07 proc drwx--x--- 6 root root 384 2005-09-04 16:59 root drwxr-xr-x 2 root bin 5416 2004-06-07 10:22 sbin drwxr-xr-x 10 root root 0 2005-09-05 21:07 sys drwxrwxrwt 12 root root 648 2005-09-05 18:30 tmp lrwxrwxrwx 1 root root 21 2005-09-05 15:47 tools -> /mnt/lfs_x86_64/tools drwxr-xr-x 18 root root 544 2004-09-03 23:00 usr drwxr-xr-x 15 root root 472 2005-08-15 17:08 var

Here is the output of mount:

root@slackware:/home/basel# mount /dev/sda3 on / type reiserfs (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) /dev/sda1 on /mnt/data type reiserfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) usbfs on /proc/bus/usb type usbfs (rw) /dev/sda2 on /mnt/lfs_x86_64 type reiserfs (rw) proc on /mnt/lfs_x86_64/proc type proc (rw) sysfs on /mnt/lfs_x86_64/sys type sysfs (rw) tmpfs on /mnt/lfs_x86_64dev type tmpfs (rw) tmpfs on /mnt/lfs_x86_64dev/shm type tmpfs (rw) devpts on /mnt/lfs_x86_64dev/pts type devpts (rw,gid=4,mode=620) root@slackware:/home/basel#

Change History (1)

comment:1 by Matthew Burgess, 19 years ago

Resolution: invalid
Status: newclosed

Please use lfs-support for support queries like this in the future. Your problem has been answered in the mailing lists many times, and is therefore now available in the FAQ (Frequently Asked Questions) at http://www.linuxfromscratch.org/lfs/faq.html#any-no-such-file. Basically, take a look at the gcc's specs file and if it still contains references to /tools then the sed/perl/patch adjustments didn't work correctly.

Note: See TracTickets for help on using tickets.