LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-15-2010, 02:37 PM   #1
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 3,229

Rep: Reputation: 825Reputation: 825Reputation: 825Reputation: 825Reputation: 825Reputation: 825Reputation: 825
Stuck at creating the LFS user


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
 
Old 03-15-2010, 03:00 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
I have no experience with LFS, so bear that in mind.

The symlink
ln -sv $LFS/tools /
is linking $LFS/tools to the root directory /

Then you are chowning $LFS/tools
which is chowning the entire root and presumably the symlink too.

What is $LFS
echo $LFS
 
Old 03-15-2010, 03:43 PM   #3
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Hi,

you probably missed this command in chapter 4.1.
Code:
export LFS=/mnt/lfs
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.
 
Old 03-15-2010, 05:09 PM   #4
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 3,229

Original Poster
Rep: Reputation: 825Reputation: 825Reputation: 825Reputation: 825Reputation: 825Reputation: 825Reputation: 825
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.
 
Old 03-15-2010, 05:28 PM   #5
charlie_lab
Member
 
Registered: Nov 2006
Posts: 255

Rep: Reputation: 30
Oke,

What happens when you do :

echo $LFS

Roelof
 
Old 03-15-2010, 07:13 PM   #6
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Quote:
Originally Posted by DavidMcCann View Post
... so I took it on trust.
... 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

Last edited by crts; 03-15-2010 at 07:35 PM.
 
Old 03-15-2010, 07:50 PM   #7
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Quote:
Originally Posted by DavidMcCann View Post
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.
May I suggest you read the error messages.
 
Old 03-16-2010, 03:04 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Quote:
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.

You did not (correctly) set the LFS variable.

Hope this helps.
 
Old 11-05-2012, 07:01 AM   #9
prashantdawar
LQ Newbie
 
Registered: Nov 2012
Posts: 1

Rep: Reputation: Disabled
Wink [solved] Stuck at creating lfsuser

Quote:
Originally Posted by DavidMcCann View Post
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 View Post
... 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 View Post
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 07:12 AM.
 
Old 11-05-2012, 10:05 AM   #10
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 494

Rep: Reputation: 133Reputation: 133
Quote:
Originally Posted by prashantdawar

Hey click the yes button buddy>>>
Oops. I clicked the Report button. Sorry.
 
  


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
LFS newbie stuck in Linux API headers step 5.5 LFS book 6.3 Vxplus Linux From Scratch 2 11-10-2008 09:13 PM
Another LFS newb is stuck: Linux API headers won't install smoochie Linux From Scratch 19 06-13-2008 12:26 PM
cannot login as user 'lfs' [su - lfs] mayasedai Linux From Scratch 2 07-26-2005 07:10 AM
Stuck on chapter 5 when building Tcl-8.4.6 For LFS-5.1 deMilo Linux From Scratch 2 06-20-2004 04:31 AM
LFS 5.0 stuck @ gettext-0.12.1 - missing aclocal-1.7 quantumechanix Linux From Scratch 1 11-26-2003 12:23 PM


All times are GMT -5. The time now is 11:56 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration