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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-05-2005, 09:24 AM
|
#1
|
Member
Registered: Feb 2004
Location: United States
Distribution: Ubuntu 10.10
Posts: 319
Rep:
|
chroot: cannot run command `/tools/bin/env': No such file or directory
Hello,
Does anyone know why chroot is not able to run /tools/bin/env?
Code:
root@slackware:/# chroot /mnt/lfs_x86_64/ /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
Code:
root@slackware:/# 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:/# 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
Code:
root@slackware:/# 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 22 2005-09-04 17:56 cross-tools -> /home/lfs/cross-tools//
drwxr-xr-x 16 root root 0 2005-09-05 10:30 dev/
drwxr-xr-x 40 root root 4312 2005-09-05 15:30 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 80 root root 0 2005-09-05 13:30 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 13:30 sys/
drwxrwxrwt 12 root root 648 2005-09-05 15:25 tmp/
lrwxrwxrwx 1 root root 22 2005-09-04 17:49 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/
Code:
root@slackware:/# 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_64/dev type tmpfs (rw)
tmpfs on /mnt/lfs_x86_64/dev/shm type tmpfs (rw)
devpts on /mnt/lfs_x86_64/dev/pts type devpts (rw,gid=4,mode=620)
|
|
|
09-05-2005, 10:04 AM
|
#2
|
Member
Registered: Apr 2005
Distribution: LFS 5.0 and 6.1
Posts: 705
Rep:
|
hmm, did you set the $PATH????
Code:
export LFS=/path/to/lfs
|
|
|
09-05-2005, 10:17 AM
|
#3
|
Member
Registered: Feb 2004
Location: United States
Distribution: Ubuntu 10.10
Posts: 319
Original Poster
Rep:
|
Quote:
Originally posted by freakyg
hmm, did you set the $PATH????
Code:
export LFS=/path/to/lfs
|
I do not think there is a need to set the LFS for this command since I am using the complete path /mnt/lfs_x86_64
Code:
root@slackware:/home/basel# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
root@slackware:/home/basel# su - lfs
/dev/pts/2: Operation not permitted
lfs:~$ echo $PATH
/cross-tools/bin:/bin:/usr/bin
lfs:~$
|
|
|
09-17-2005, 05:25 AM
|
#4
|
Member
Registered: Sep 2005
Posts: 244
Rep:
|
Quote:
Originally posted by Basel
I do not think there is a need to set the LFS for this command since I am using the complete path /mnt/lfs_x86_64
Code:
root@slackware:/home/basel# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
root@slackware:/home/basel# su - lfs
/dev/pts/2: Operation not permitted
lfs:~$ echo $PATH
/cross-tools/bin:/bin:/usr/bin
lfs:~$
|
Check your fstab, type mount and Ensure that this new partition is not mounted with permissions that are too restrictive
(such as the nosuid, nodev, or noatime options).
and/or noatime are set, the partition will need to be remounted.
Run the mount command without any parameters to see what options are set for the mounted LFS partition. If nosuid, nodev,
If so change the mount options for the LFS partition to <user,exec,dev,suid>
|
|
|
06-29-2006, 03:56 AM
|
#5
|
LQ Newbie
Registered: Jun 2006
Location: orbiting around Saturn
Distribution: LFS, knoppix
Posts: 16
Rep:
|
Check: good access to /tools?
i had the same problem, found several threads on LQ and elsewhere about it - there seem to be too many ways to go wrong at this step. Though you may have solved your particular problem many months ago, an unending stream of head-scratching chroot wannabees will be discovering this and the other threads, so i'll describe my situation here.
I verified that /tools/bin/env did exist, ran it directly, and tried the same things others did. The problem turned out to be that in my LFS partition, mounted as /LFS, had a symbolic link where i had built my initial toolchain, /home/lfs/tools. I did this (not following the fine LFS book) so that i could play with other distros on the one partition, but keep my toolchain safe on another. Since a symbolic link was made in /, i figured the same would be okay in /LFS for access once i've chrooted. Not so! it just doesn't work. Solution: unmount the partition from /home, and remount it in /LFS/home (use mkdir /LFS/home if necessary) Then make a link: cd /LFS ; ln -s /home/lfs/tools tools - this link should work while chrooted to /LFS, but not earlier. (If you like, you could create another link in the host environment's /home, but then you should already have a /tools link for convenient access before the chrooting) Bottom line: Any symbolic links in /LFS to anything outside /LFS won't be any good while chrooted. Also, any partition mount points not in /LFS will become invisible after chroot.
|
|
|
06-30-2006, 04:00 AM
|
#6
|
Member
Registered: Jan 2004
Location: India
Distribution: Android 9.0.6
Posts: 123
Rep:
|
I have the same problem as posted in the first one of this thread. What I found out was that the $PATH of root does not contain /tools/bin on echo
Quote:
# echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin
|
So , i am getting the error of /tools/bin/env --> file not found.. Whereas it actually exists. Please tell me a solution ..
|
|
|
06-07-2018, 05:42 PM
|
#7
|
LQ Newbie
Registered: Jun 2018
Posts: 3
Rep:
|
I have the same problem; '/tools/bin/env' not found.
While logged in as a root I checked if the 'env' exists, but the directory is not there.
Before I continue doing anything I would like to hear some suggestions and a possible solution.
And the $PATH:
Quote:
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|
|
|
06-07-2018, 05:54 PM
|
#8
|
Senior Member
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
|
If tools/bin/env is not there, then something went wrong with "coreutils"
Did you restart pc for some reason if so was everything mounted, LFS partition ch6.2.2 6.2.3 and was LFS set for root
Last edited by spiky0011; 06-07-2018 at 05:56 PM.
|
|
|
06-07-2018, 06:17 PM
|
#9
|
LQ Newbie
Registered: Jun 2018
Posts: 3
Rep:
|
I am building on a virtual machine, connected via putty. I closed the connection and continued after some time. The $LFS was not set so I exported it again but the partition is mounted.
When I enter mount I am getting this:
Quote:
/dev/vdc1 on /mnt/lfs type ext4 (rw, realtime,data=ordered)
|
Should I just redo 5.19. Coreutils-8.29 and continue from chapter 6 after?
|
|
|
06-07-2018, 08:00 PM
|
#10
|
LQ Newbie
Registered: Jun 2018
Posts: 3
Rep:
|
I managed to fix this problem. Now the file exists but I am getting other issues which I think are not related to this question anymore.
About the solution, just repeat the 5.19 part - "Coreutils-8.29" and make sure that the 'env' exists. Then continue at chapter 6.
Thanks!
Last edited by atanasova; 06-07-2018 at 08:10 PM.
|
|
|
06-09-2018, 03:15 PM
|
#11
|
Member
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616
Rep:
|
I suspect you missed a part of section 4.2.
ln -sv $LFS/tools /
If so, you'd end up with /tools as a real directory in your host system rather than it being a symlink from your host /tools to -> $LFS/tools. Then, when you chroot there is no /tools inside the chroot. Or, you'd have both directories but the one on your host would be populated, but the chroot /tools would be empty.
|
|
|
All times are GMT -5. The time now is 04:24 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|