Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
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.
|
 |
06-09-2017, 02:04 AM
|
#1
|
LQ Newbie
Registered: Jun 2017
Posts: 2
Rep: 
|
chroot: failed to run command '/tools/bin/env': Too many levels of symbolic links
I am trying to build OS with the help of LFS-8.0,i Have completed till chapter-5 but in 6 i am getting error from 48hr. i tried my best solve it.even still i doing to fix it.But i want to take your experience and guidance.
Error:
root@administrator-Lenovo-U410:/mnt/lfs# 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: failed to run command '/tools/bin/env': Too many levels of symbolic links
while my configuration is :
root@administrator-Lenovo-U410:/mnt/lfs# /tools/bin/env
XDG_VTNR=7
XDG_SESSION_ID=c2
SHELL=/bin/bash
TERM=xterm
LC_ALL=POSIX
USER=root
SUDO_USER=sumitkumars
SUDO_UID=1001
LFS=/mnt/lfs
USERNAME=root
PATH=/tools/bin:/bin:/usr/bin
MAIL=/var/mail/root
PWD=/mnt/lfs
LANG=en_IN
LFS_TGT=x86_64-root-linux-gnu
SHLVL=1
XDG_SEAT=seat0
SUDO_COMMAND=/bin/su
HOME=/root
LANGUAGE=en_IN:en
LOGNAME=root
SUDO_GID=1001
COLORTERM=gnome-terminal
_=/tools/bin/env
OLDPWD=/mnt/lfs/tools
i have check with different test answer which is present in forum.:
root@administrator-Lenovo-U410:/mnt/lfs# ldd /tools/bin/env
linux-vdso.so.1 (0x00007fffb7142000)
libc.so.6 => /tools/lib/libc.so.6 (0x00007faf4ec0c000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00007faf4efaa000)
root@administrator-Lenovo-U410:/mnt/lfs# ldd /tools/bin/bash
linux-vdso.so.1 (0x00007ffd18cc9000)
libdl.so.2 => /tools/lib/libdl.so.2 (0x00007f498046a000)
libc.so.6 => /tools/lib/libc.so.6 (0x00007f49800cc000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00007f498066e000)
root@administrator-Lenovo-U410:/mnt/lfs# readelf -l /tools/bin/bash | grep interpreter
[Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]
root@administrator-Lenovo-U410:/mnt/lfs# readelf -l /tools/bin/env | grep interpreter
[Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]
root@administrator-Lenovo-U410:/mnt/lfs# find -L /tools -name bash 2>/dev/null
/tools/bin/bash
/tools/include/bash
/tools/lib64/bash
/tools/lib/bash
/tools/share/doc/bash
root@administrator-Lenovo-U410:/mnt/lfs# find -L /tools -name env 2>/dev/null
/tools/bin/env
root@administrator-Lenovo-U410:/mnt/lfs# ls -l /tools
total 60
drwxr-xr-x 2 root root 12288 Jun 8 10:41 bin
drwxr-xr-x 2 root root 4096 Jun 7 13:26 etc
drwxr-xr-x 41 root root 4096 Jun 8 09:33 include
drwxr-xr-x 12 root root 12288 Jun 8 09:33 lib
lrwxrwxrwx 1 root root 3 Jun 6 04:08 lib64 -> lib
drwxr-xr-x 6 1002 1002 4096 Jun 8 09:25 libexec
drwxr-xr-x 5 root root 4096 Jun 8 06:08 man
drwxr-xr-x 2 root root 4096 Jun 8 09:31 sbin
drwxr-xr-x 17 root root 4096 Jun 8 09:31 share
drwxr-xr-x 3 root root 4096 Jun 7 13:26 var
drwxr-xr-x 4 root root 4096 Jun 6 04:08 x86_64-pc-linux-gnu
drwxr-xr-x 4 root root 4096 Jun 7 12:27 x86_64-root-linux-gnu
root@administrator-Lenovo-U410:/mnt/lfs# ls -l /tools/bin/bash
-rwxr-xr-x 1 root root 4331888 Jun 8 06:41 /tools/bin/bash
root@administrator-Lenovo-U410:/mnt/lfs# ls -l /tools/bin/env
-rwxr-xr-x 1 root root 148448 Jun 8 07:32 /tools/bin/env
root@administrator-Lenovo-U410:/mnt/lfs#
|
|
|
06-09-2017, 07:59 AM
|
#2
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
The message seems fairly straight forward about the env command itself.
What do you see if you run "ls -l /tools/bin/env"? "ls -ld /tools/bin"? "ls -ld /tools".
If /tools/bin is a link to /usr/local/tools/bin which and /usr/local is a link to /usr/share and /usr/share is a link to /share etc... it might explain this error. (Of course the links might be anywhere - I'm just illustrating possibilities.) If "env" exists in /bin (as it does on RHEL) and is not a link there then adding /bin to the front of your PATH (before calling env command itself) would likely solve the issue.
|
|
1 members found this post helpful.
|
06-09-2017, 12:01 PM
|
#3
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,288
|
Quote:
Originally Posted by MensaWater
The message seems fairly straight forward about the env command itself.
What do you see if you run "ls -l /tools/bin/env"? "ls -ld /tools/bin"? "ls -ld /tools".
If /tools/bin is a link to /usr/local/tools/bin which and /usr/local is a link to /usr/share and /usr/share is a link to /share etc... it might explain this error. (Of course the links might be anywhere - I'm just illustrating possibilities.) If "env" exists in /bin (as it does on RHEL) and is not a link there then adding /bin to the front of your PATH (before calling env command itself) would likely solve the issue.
|
When you are building LFS, /tools on the host system is a link to $LFS/tools. $LFS/tools is not a link to anything and nor is $LFS/tools/bin; they are simple directories. At this stage in an LFS build, programs on the host are no longer used; everything is done with the new LFS tools in /tools/bin.
As far as I can see, the chroot instruction given by the OP is correct, so I'm not sure what is going wrong here. In addition to your suggestions, it would be worth doing "readlink /tools" in the host system.
|
|
|
All times are GMT -5. The time now is 01:15 PM.
|
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
|
|