LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Stuck at creating the LFS user (http://www.linuxquestions.org/questions/linux-from-scratch-13/stuck-at-creating-the-lfs-user-795565/)

DavidMcCann 03-15-2010 01:37 PM

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 :banghead:

smoker 03-15-2010 02:00 PM

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

crts 03-15-2010 02:43 PM

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.

DavidMcCann 03-15-2010 04:09 PM

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.

charlie_lab 03-15-2010 04:28 PM

Oke,

What happens when you do :

echo $LFS

Roelof

crts 03-15-2010 06:13 PM

Quote:

Originally Posted by DavidMcCann (Post 3899471)
... 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

smoker 03-15-2010 06:50 PM

Quote:

Originally Posted by DavidMcCann (Post 3899471)
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.

druuna 03-16-2010 02:04 AM

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.

prashantdawar 11-05-2012 06:01 AM

[solved] Stuck at creating lfsuser
 
Quote:

Originally Posted by DavidMcCann (Post 3899286)
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 :banghead:

Quote:

Originally Posted by crts (Post 3899572)
... 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 (Post 3899928)
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>>>

stoat 11-05-2012 09:05 AM

Quote:

Originally Posted by prashantdawar

Hey click the yes button buddy>>>

Oops. I clicked the Report button. Sorry.


All times are GMT -5. The time now is 09:17 AM.