Linux From ScratchThis 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.
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.
At section 4.3 of the manual I've already run into a problem:
chown -v lfs $LFS/tools
chown: cannot dereference `/tools': Too many levels of symbolic links
failed to change ownership of `/tools' to lfs
chown -v lfs $LFS/sources
chown: cannot access `/sources': No such file or directory
failed to change ownership of `/sources' to lfs
I then tried
ls $LFS
and got my home directory. I never quite understood
ln -sv $LFS/tools /
and it looks like the computer is in the same boat.
Where should I go from here? The answer "stick to Fedora" is the first to occur to me
Assumed, that you followed the instructions and mounted your LFS partition as the book suggests. Keep in mind, that if you reboot your computer or just open another terminal you will have to issue that command again.
crts: I didn't miss anything, and I put the command in .bashrc to avoid the problem you suggest.
smoker: I thought the command looked odd, but the book says
"The above command is correct. The ln command has a few syntactic variations, so be sure to check info coreutils ln and ln(1) before reporting what you may think is an error."
so I took it on trust. May I politely suggest that you do not answer posts where you admittedly have no experience, especially when that takes the post out of the unanswered threads category. No harm was done in this case, but it can be very annoying.
... and you can. I build my LFS with that same syntax for that command.
Now let's do some sanity checks first because your problem sounds really strange.
So first please post the output of
Code:
echo $LFS
mount
ls -l /
ls -l /mnt
ls -l /mnt/lfs
Now when you did
Code:
ls $LFS
was your current directory also your home directory?
Quote:
I never quite understood
ln -sv $LFS/tools /
Ok, this is a tricky one and I am not referring to the syntax. What it actually does, is to create a symlink in your / directory, which looks like
Code:
/tools -> /mnt/lfs/tools
When you build your toolchain you will configure your packages with target prefix /tools. So everything will link against /tools. Later, when you build your real LFS you will chroot into /mnt/lfs. This will be your new / directory. Would we have configured with prefix /mnt/lfs/tools then the toolchain would not work in the chrooted environment. All programs would expect their binaries and shared objects etc. to be in /mnt/lfs/tools which became just /tools in the chrooted environment.
Hope I explained it in an understandable manner.
P.S.: Please post also your hostsystem and the version of the LFS book
smoker: I thought the command looked odd, but the book says
"The above command is correct. The ln command has a few syntactic variations, so be sure to check info coreutils ln and ln(1) before reporting what you may think is an error."
so I took it on trust. May I politely suggest that you do not answer posts where you admittedly have no experience, especially when that takes the post out of the unanswered threads category. No harm was done in this case, but it can be very annoying.
chown -v lfs $LFS/tools
chown: cannot dereference `/tools': Too many levels of symbolic links
failed to change ownership of `/tools' to lfs
chown -v lfs $LFS/sources
chown: cannot access `/sources': No such file or directory
failed to change ownership of `/sources' to lfs
The bold parts should point to $LFS/tools and $LFS/sources (if LFS is /mnt/lfs, it should for example point to /mnt/lfs/tools). For both the $LFS part is missing.
At section 4.3 of the manual I've already run into a problem:
chown -v lfs $LFS/tools
chown: cannot dereference `/tools': Too many levels of symbolic links
failed to change ownership of `/tools' to lfs
chown -v lfs $LFS/sources
chown: cannot access `/sources': No such file or directory
failed to change ownership of `/sources' to lfs
I then tried
ls $LFS
and got my home directory. I never quite understood
ln -sv $LFS/tools /
and it looks like the computer is in the same boat.
Where should I go from here? The answer "stick to Fedora" is the first to occur to me
Quote:
Originally Posted by crts
... and you can. I build my LFS with that same syntax for that command.
Now let's do some sanity checks first because your problem sounds really strange.
So first please post the output of
Code:
echo $LFS
mount
ls -l /
ls -l /mnt
ls -l /mnt/lfs
Now when you did
Code:
ls $LFS
was your current directory also your home directory?
Ok, this is a tricky one and I am not referring to the syntax. What it actually does, is to create a symlink in your / directory, which looks like
Code:
/tools -> /mnt/lfs/tools
When you build your toolchain you will configure your packages with target prefix /tools. So everything will link against /tools. Later, when you build your real LFS you will chroot into /mnt/lfs. This will be your new / directory. Would we have configured with prefix /mnt/lfs/tools then the toolchain would not work in the chrooted environment. All programs would expect their binaries and shared objects etc. to be in /mnt/lfs/tools which became just /tools in the chrooted environment.
Hope I explained it in an understandable manner.
P.S.: Please post also your hostsystem and the version of the LFS book
Quote:
Originally Posted by druuna
Hi,
The bold parts should point to $LFS/tools and $LFS/sources (if LFS is /mnt/lfs, it should for example point to /mnt/lfs/tools). For both the $LFS part is missing.
You did not (correctly) set the LFS variable.
Hope this helps.
Simply remove the earlier created symlink and then do this
Code:
root@dell-OptiPlex-780:/home/dell# rm -rf /tools
root@dell-OptiPlex-780:/home/dell# cd /mnt/lfs/tools
root@dell-OptiPlex-780:/mnt/lfs# chown -v lfs tools
changed ownership of `tools' from dell to lfs
root@dell-OptiPlex-780:/mnt/lfs# ln -sv $LFS/tools /
`/tools' -> `/tools'
Hey click the yes button buddy>>>
Last edited by prashantdawar; 11-05-2012 at 06:12 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.