Re: [lfs-support] ln -sv ../usr/bin/cpp /lib

2012-03-22 Thread Simon Geard
On Wed, 2012-03-21 at 21:54 +0200, Alexander Kapshuk wrote:
 (6). While still in $LFS/sources/gcc-build, I ran ln -sv ../usr/bin/cpp 
 /lib; And this is where I found it confusing, ../usr/bin/cpp == 
 $LFS/sources/usr/bin/cpp; but /usr/bin/cpp isn't found in $LFS/sources. 
 It's found is $LFS/usr/bin/cpp; I thought that ln was supposed to create 
 a link to an existing file whether using an absolute or a relative path;

Basically, ln -s creates a special kind of file (termed a symbolic
link, soft link, or just symlink) containing the string you passed in to
it - you can actually see it in the file size of the symlink (it should
be 14 bytes, for ../usr/bin/cpp).

That string is only interpreted when someone actually tries to read the
symlink, at which point a relative path is interpreted as relative to
the directory containing the symlink. It has nothing to do with the
directory you happened to be in at the time the symlink was created. And
it's entirely possible for that symlink to point to a file or directory
that doesn't exist - e.g if the target file is removed, or if it never
existed in the first place.

Also, note that I refer to symlinks only here. Running ln without the
-s results in a different type of link, usually called a hard link.
And none of what I've said applies to hard links - they're completely
different from symlinks in almost every way.

Simon.


signature.asc
Description: This is a digitally signed message part
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] ln -sv ../usr/bin/cpp /lib

2012-03-22 Thread Alexander Kapshuk
On Thu, Mar 22, 2012 at 8:51 AM, Simon Geard delga...@ihug.co.nz wrote:

 On Wed, 2012-03-21 at 21:54 +0200, Alexander Kapshuk wrote:
  (6). While still in $LFS/sources/gcc-build, I ran ln -sv ../usr/bin/cpp
  /lib; And this is where I found it confusing, ../usr/bin/cpp ==
  $LFS/sources/usr/bin/cpp; but /usr/bin/cpp isn't found in $LFS/sources.
  It's found is $LFS/usr/bin/cpp; I thought that ln was supposed to create
  a link to an existing file whether using an absolute or a relative path;

 Basically, ln -s creates a special kind of file (termed a symbolic
 link, soft link, or just symlink) containing the string you passed in to
 it - you can actually see it in the file size of the symlink (it should
 be 14 bytes, for ../usr/bin/cpp).

 That string is only interpreted when someone actually tries to read the
 symlink, at which point a relative path is interpreted as relative to
 the directory containing the symlink. It has nothing to do with the
 directory you happened to be in at the time the symlink was created. And
 it's entirely possible for that symlink to point to a file or directory
 that doesn't exist - e.g if the target file is removed, or if it never
 existed in the first place.

 Also, note that I refer to symlinks only here. Running ln without the
 -s results in a different type of link, usually called a hard link.
 And none of what I've said applies to hard links - they're completely
 different from symlinks in almost every way.

 Simon.

 --
 http://linuxfromscratch.org/mailman/listinfo/lfs-support
 FAQ: http://www.linuxfromscratch.org/lfs/faq.html
 Unsubscribe: See the above information page


It's all clear as day now.
Thanks for the explanation.
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] ln -sv ../usr/bin/cpp /lib

2012-03-21 Thread Simon Geard
On Tue, 2012-03-20 at 16:50 +0200, Alexander Kapshuk wrote:
 So in other words, 'ln -sv ../usr/bin/cpp /lib' and 'ln
 -sv /usr/bin/cpp /lib' are equivalent?

Not quite, and the difference can be seen when you look at the link
*outside* the chroot environment (i.e where the filesystem is mounted
to /mnt/lfs).

The /lib directory becomes /mnt/lfs/lib, and so the first link now
expands to /mnt/lfs/usr/bin/cpp. However, the second link is an absolute
path, and so still points to /usr/bin/cpp - not to the file it was
intended to point at.

Simon.




signature.asc
Description: This is a digitally signed message part
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] ln -sv ../usr/bin/cpp /lib

2012-03-21 Thread Alexander Kapshuk
Here's what I did to build gcc:
(1). Extracted the gcc archive within the $LFS/sources directory;
(2). cd'd into gcc-4.6.2;
(3). Ran the instructions from 6.17.1. Installation of GCC;
(4). Created $LFS/sources/gcc-build and cd'd into it;
(5). Configured and compiled gcc;
(6). While still in $LFS/sources/gcc-build, I ran ln -sv ../usr/bin/cpp 
/lib; And this is where I found it confusing, ../usr/bin/cpp == 
$LFS/sources/usr/bin/cpp; but /usr/bin/cpp isn't found in $LFS/sources. 
It's found is $LFS/usr/bin/cpp; I thought that ln was supposed to create 
a link to an existing file whether using an absolute or a relative path;

I hope I'm making sense here.

Anyway, thanks a lot to all those who responded to my query. I reckon 
it'll make more sense as I progress through the book.

Alexander Kapshuk.


On 03/21/2012 10:07 AM, Simon Geard wrote:
 On Tue, 2012-03-20 at 16:50 +0200, Alexander Kapshuk wrote:

 So in other words, 'ln -sv ../usr/bin/cpp /lib' and 'ln
 -sv /usr/bin/cpp /lib' are equivalent?
  
 Not quite, and the difference can be seen when you look at the link
 *outside* the chroot environment (i.e where the filesystem is mounted
 to /mnt/lfs).

 The /lib directory becomes /mnt/lfs/lib, and so the first link now
 expands to /mnt/lfs/usr/bin/cpp. However, the second link is an absolute
 path, and so still points to /usr/bin/cpp - not to the file it was
 intended to point at.

 Simon.




-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] ln -sv ../usr/bin/cpp /lib

2012-03-21 Thread Ken Moffat
On Wed, Mar 21, 2012 at 09:54:18PM +0200, Alexander Kapshuk wrote:
 (6). While still in $LFS/sources/gcc-build, I ran ln -sv ../usr/bin/cpp 
 /lib; And this is where I found it confusing, ../usr/bin/cpp == 
 $LFS/sources/usr/bin/cpp; but /usr/bin/cpp isn't found in $LFS/sources. 
 It's found is $LFS/usr/bin/cpp; I thought that ln was supposed to create 
 a link to an existing file whether using an absolute or a relative path;
 
 I hope I'm making sense here.
 
 The 'ln' command has many different ways of being invoked (see 'man
ln').  In this case, ../usr/bin/ is relative to /lib/ so we create
/lib/cpp as a symlink to /usr/bin/cpp.  Similarly, the next
instruction creates a symlink to /usr/bin/gcc called /usr/bin/cc.

ĸen
-- 
das eine Mal als Tragödie, das andere Mal als Farce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] ln -sv ../usr/bin/cpp /lib

2012-03-21 Thread Alexander Kapshuk
Got it. Thanks.

It's relative to /lib, not $LFS/sources/gcc-build as I had thought 
initially.

I'll have another look at ln(1).


On 03/21/2012 10:25 PM, Ken Moffat wrote:
 On Wed, Mar 21, 2012 at 09:54:18PM +0200, Alexander Kapshuk wrote:

 (6). While still in $LFS/sources/gcc-build, I ran ln -sv ../usr/bin/cpp
 /lib; And this is where I found it confusing, ../usr/bin/cpp ==
 $LFS/sources/usr/bin/cpp; but /usr/bin/cpp isn't found in $LFS/sources.
 It's found is $LFS/usr/bin/cpp; I thought that ln was supposed to create
 a link to an existing file whether using an absolute or a relative path;

 I hope I'm making sense here.

  
   The 'ln' command has many different ways of being invoked (see 'man
 ln').  In this case, ../usr/bin/ is relative to /lib/ so we create
 /lib/cpp as a symlink to /usr/bin/cpp.  Similarly, the next
 instruction creates a symlink to /usr/bin/gcc called /usr/bin/cc.

 ĸen


-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] ln -sv ../usr/bin/cpp /lib

2012-03-20 Thread Alexander Kapshuk
While working on '6.17.1. Installation of GCC', I created and cd'd into
'/sources/gcc-build'. One of the instructions suggests creating this
symlink, 'ln -sv ../usr/bin/cpp /lib'. I assumed that I was supposed to run
the command line while still in '/sources/gcc-build'. If that is the case,
shouldn't the command line be 'ln -sv ../../usr/bin/cpp'?

Thanks.
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] ln -sv ../usr/bin/cpp /lib

2012-03-20 Thread Rick Shelton
On Tue, Mar 20, 2012 at 7:41 AM, Alexander Kapshuk
alexander.kaps...@gmail.com wrote:
 While working on '6.17.1. Installation of GCC', I created and cd'd into
 '/sources/gcc-build'. One of the instructions suggests creating this
 symlink, 'ln -sv ../usr/bin/cpp /lib'. I assumed that I was supposed to run
 the command line while still in '/sources/gcc-build'. If that is the case,
 shouldn't the command line be 'ln -sv ../../usr/bin/cpp'?


When the ln command is given two paths, the current directory does not
affect the result. The current directory only has an affect when there
is only one path passed to the command.
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] ln -sv ../usr/bin/cpp /lib

2012-03-20 Thread Alexander Kapshuk
On Tue, Mar 20, 2012 at 4:39 PM, Rick Shelton rick.shel...@gmail.comwrote:

 On Tue, Mar 20, 2012 at 7:41 AM, Alexander Kapshuk
 alexander.kaps...@gmail.com wrote:
  While working on '6.17.1. Installation of GCC', I created and cd'd into
  '/sources/gcc-build'. One of the instructions suggests creating this
  symlink, 'ln -sv ../usr/bin/cpp /lib'. I assumed that I was supposed to
 run
  the command line while still in '/sources/gcc-build'. If that is the
 case,
  shouldn't the command line be 'ln -sv ../../usr/bin/cpp'?
 

 When the ln command is given two paths, the current directory does not
 affect the result. The current directory only has an affect when there
 is only one path passed to the command.
 --
 http://linuxfromscratch.org/mailman/listinfo/lfs-support
 FAQ: http://www.linuxfromscratch.org/lfs/faq.html
 Unsubscribe: See the above information page


So in other words, 'ln -sv ../usr/bin/cpp /lib' and 'ln -sv /usr/bin/cpp
/lib' are equivalent?
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] ln -sv ../usr/bin/cpp /lib

2012-03-20 Thread Bruce Dubbs
Alexander Kapshuk wrote:
 On Tue, Mar 20, 2012 at 4:39 PM, Rick Shelton rick.shel...@gmail.comwrote:
 
 On Tue, Mar 20, 2012 at 7:41 AM, Alexander Kapshuk
 alexander.kaps...@gmail.com wrote:
 While working on '6.17.1. Installation of GCC', I created and cd'd into
 '/sources/gcc-build'. One of the instructions suggests creating this
 symlink, 'ln -sv ../usr/bin/cpp /lib'. I assumed that I was supposed to
 run
 the command line while still in '/sources/gcc-build'. If that is the
 case,
 shouldn't the command line be 'ln -sv ../../usr/bin/cpp'?

 When the ln command is given two paths, the current directory does not
 affect the result. The current directory only has an affect when there
 is only one path passed to the command.
 --
 http://linuxfromscratch.org/mailman/listinfo/lfs-support
 FAQ: http://www.linuxfromscratch.org/lfs/faq.html
 Unsubscribe: See the above information page

 
 So in other words, 'ln -sv ../usr/bin/cpp /lib' and 'ln -sv /usr/bin/cpp
 /lib' are equivalent?

A general practice is for symbolic links to be relative.  If you copy a 
directory tree, relative paths stay relative.

   -- Bruce


-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] ln -sv ../usr/bin/cpp /lib

2012-03-20 Thread Andrew Benton
On Tue, 20 Mar 2012 14:55:28 +
Alexander Kapshuk alexander.kaps...@gmail.com wrote:

 So in other words, 'ln -sv ../usr/bin/cpp /lib' and 'ln -sv /usr/bin/cpp
 /lib' are equivalent?

ln -sv ../usr/bin/cpp /lib is a relative symbolic link.
ln -sv /usr/bin/cpp /lib is an absolute symbolic link.

Andy
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: ln

2006-01-22 Thread Chris Staub

Clemens Haupt wrote:

On Sunday 22 January 2006 12:30, you wrote:

man bash

Danke!

When the lfs partition is mounted, all ln -s are here again
Where is that stored?

Kind regards
Clemens


I don't know what you mean. Where is what stored?
--
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: Problem in running ln -s $LFS/tools /

2005-06-28 Thread steve crosby
On 6/28/05, Stephen Liu [EMAIL PROTECTED] wrote:
 Hi Andrew,
 
snip

 
 # chown lfs $LFS/sources
 chown: cannot access `/sources': No such file or
 directory
 
 I'm held here again.  Any advice?
 

When you su you load a new environment, and your $LFS variable is
lost, so the chown is attempting to access /sources, instead of
/mnt/lfs/sources.

do a export LFS=/mnt/lfs and run the chown again.

-- -
Steve Crosby
--
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: Problem in running ln -s $LFS/tools /

2005-06-28 Thread Stephen Liu
Hi Steve,

Tks for your advice.

- snip -

 When you su you load a new environment, and your
 $LFS variable is
 lost, so the chown is attempting to access /sources,
 instead of
 /mnt/lfs/sources.
 
 do a export LFS=/mnt/lfs and run the chown again.

Continued proceeding as follows;

# export LFS=/mnt/lfs
# chown lfs $LFS/tools
# chown lfs $LFS/sources
both went through without complaint

# su - lfs
-bash-3.00$ 


-bash-3.00$ cat  ~/.bash_profile  EOF
 exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ '
/bin/bash
 EOF
-bash-3.00$ cat  ~/.bashrc  EOF
 set +h
 umash 022
 lFS=/mnt/lfs
 LC_ALL=POSIX
 PATH=/tools/bin:/bin:/usr/bin
 export LFS LC_ALL PATH
 EOF
-bash-3.00$ source ~/.bash_profile
bash: umash: command not found
lfs:~$  

Up to here I have no idea whether I have committed any
mistake because no indication of success.

What is bash: umash: command not found?  Is it a
WARNING?

B.R.
Stephen
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: Problem in running ln -s $LFS/tools /

2005-06-28 Thread steve crosby
On 6/28/05, Stephen Liu [EMAIL PROTECTED] wrote:

snip

 bash: umash: command not found
 lfs:~$
 
 Up to here I have no idea whether I have committed any
 mistake because no indication of success.
 
 What is bash: umash: command not found?  Is it a
 WARNING?

You've made a typo - that should be umask, not umash. When you run
the source command, bash is reporting that it cannot find any
command called umash.

-- -
Steve Crosby
--
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: Problem in running ln -s $LFS/tools /

2005-06-28 Thread Stephen Liu
Hi Steve,

  What is bash: umash: command not found?  Is it a
  WARNING?
 
 You've made a typo - that should be umask, not
 umash. When you run
 the source command, bash is reporting that it
 cannot find any
 command called umash.

I re-checked the printout on Konsole;
...
.
-bash-3.00$ cat  ~/.bash_profile  EOF
 exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ '
/bin/bash
 EOF
-bash-3.00$ cat  ~/.bashrc  EOF
 set +h
 umash 022
 lFS=/mnt/lfs
 LC_ALL=POSIX
 PATH=/tools/bin:/bin:/usr/bin
 export LFS LC_ALL PATH
 EOF
-bash-3.00$ source ~/.bash_profile
bash: umash: command not found
lfs:~$

It was indicated bash: umash: command not found not
'umask'


Continued on
5. Constructing a Temporary System
http://www.sg.linuxfromscratch.org/lfs/view/6.0/chapter05/chapter05.html

AND

5.2. Host System Requirements
http://www.sg.linuxfromscratch.org/lfs/view/6.0/chapter05/hostreqs.html

lfs:~$ echo $LFS
No printout

lfs:~$ export LFS=/mnt/lfs
lfs:~$ echo $LFS
/mnt/lfs

lfs:~$ cat /proc/version
Linux version 2.6.11-1.35_FC3
([EMAIL PROTECTED]) (gcc version 3.4.3
20050227 (Red Hat 3.4.3-22)) #1 Mon Jun 13 00:52:08
EDT 2005
lfs:~$ 

Is it OK?  Can I continue further?  TIA

B.R.
Stephen
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: Problem in running ln -s $LFS/tools /

2005-06-28 Thread Stephen Liu
Hi Kevin,

Tks for your advice.

- snip -

 Well, it is supposed to be umask not umash.
 
 cat  ~/.bashrc  EOF
 set +h
 umask 022
 LFS=/mnt/lfs
 LC_ALL=POSIX
 PATH=/tools/bin:/bin:/usr/bin
 export LFS LC_ALL PATH
 EOF

Ah, I realize that I made a typing mistake on umask

I did it again as follows;

[EMAIL PROTECTED] ~]# su - lfs
bash: umash: command not found
lfs:~$ cat  ~/.bashrc  EOF
 set +h
 umask 022 (typing the correct word)
 LFS=/mnt/lfs
 LC_ALL=POSIX
 PATH=/tools/bin:/bin:/usr/bin
 export LFS LC_ALL PATH
 EOF
lfs:~$ source ~/.bash_profile
lfs:~$ echo $LFS
/mnt/lfs
lfs:~$ cat /proc/version
Linux version 2.6.11-1.35_FC3
([EMAIL PROTECTED]) (gcc version 3.4.3
20050227 (Red Hat 3.4.3-22)) #1 Mon Jun 13 00:52:08
EDT 2005
lfs:~$

Before proceeding further, how can I check I have
committed no mistake in previous steps.

TIA

B.R.
Stephen



-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: Problem in running ln -s $LFS/tools /

2005-06-28 Thread Kevin M. Jordan

 Hi Kevin,
 
 Tks for your advice.
 
 - snip -
 
  Well, it is supposed to be umask not umash.
 
  cat  ~/.bashrc  EOF
  set +h
  umask 022
  LFS=/mnt/lfs
  LC_ALL=POSIX
  PATH=/tools/bin:/bin:/usr/bin
  export LFS LC_ALL PATH
  EOF
 
 Ah, I realize that I made a typing mistake on umask
 
 I did it again as follows;
 
 [EMAIL PROTECTED] ~]# su - lfs
 bash: umash: command not found
 lfs:~$ cat  ~/.bashrc  EOF
  set +h
  umask 022 (typing the correct word)
  LFS=/mnt/lfs
  LC_ALL=POSIX
  PATH=/tools/bin:/bin:/usr/bin
  export LFS LC_ALL PATH
  EOF
 lfs:~$ source ~/.bash_profile
 lfs:~$ echo $LFS
 /mnt/lfs
 lfs:~$ cat /proc/version
 Linux version 2.6.11-1.35_FC3
 ([EMAIL PROTECTED]) (gcc version 3.4.3
 20050227 (Red Hat 3.4.3-22)) #1 Mon Jun 13 00:52:08
 EDT 2005
 lfs:~$
 
 Before proceeding further, how can I check I have
 committed no mistake in previous steps.
 
 TIA
 
 B.R.
 Stephen

Well, since you aren't very far yet and that's the only configuration
file you've really had to make, as long as everything is successfully
mounted, you should be good so far since all you've done so far is
make/mount the partitions, download packages, create the tools dir, and
add a new user and set up the user's environment.  Just make sure to
watch what you're typing and you might just want to copy and paste long
segments, especially when making configuration files.


-- 
Kevin M. Jordan [EMAIL PROTECTED]

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page