[2] chroot problem

Matthias Benkmann matthias at winterdrache.de
Sat Oct 27 11:35:17 PDT 2001


On 28 Oct 2001, at 12:46, luca de filippis wrote:

> "Matthias Benkmann" <matthias at winterdrache.de> wrote on 10/26/01 11:09:55
> PM : > >On 27 Oct 2001, at 18:40, luca de filippis wrote: > >> hi, problem
> just started with chap6. >> sorry, i know i'm really a newbie. >> this is
> the output of the command chroot. >> /lfs/proc is mounted and $LFS=/lfs. >>
> >> [root at localhost chapter6]# chroot /lfs /usr/bin/env >> chroot: cannot
> execute /usr/bin/env: No such file or directory > >Well, do you actually
> _have_ the file /lfs/usr/bin/env ?
> 
> 
> i don't.

Well, you should.

> but the book writes /lfs /usr/bin/env
> and not /lfs/usr/bin/env

First of all, the book does not write /lfs /usr/bin/env. The book has

$LFS /usr/bin/env

I assume that the $LFS you used during chapter 5 is /lfs because you used 
/lfs rather than $LFS in your message.

Secondly, the /usr/bin/env part of the command is relative to the new 
chroot environment, i.e. it must be interpreted relative to $LFS. 
 
> 
> >This env would be the env from your host distro. You have to check if you
> >have $LFS/usr/bin/env.
> > 
> 
> can you explain where should i have installed /lfs/usr/bin/env,
> because i'm really following the book.

No, you haven't followed the book or you would have installed env when you 
installed sh-utils. Apparently you did not install sh-utils properly. 
Try the command

file /usr/bin/env

on your host distro (without $LFS). If it says something with "statically 
linked" in it, you forgot to specify --prefix=$LFS/usr when you installed 
sh-utils or you did not have $LFS set, so instead of installing in the 
$LFS tree you have replaced your host distro's sh-utils with crippled 
static versions. Of course I have to mention that this would be only 
partly your fault. I have pointed out very often that it is foolish of the 
book to recommend installing chapter 5 as root.

Anyway, I digress. Just repeat the chapter 5 instructions for sh-utils and 
env will be installed. Of course, if the original problem when you 
installed sh-utils was an unset $LFS variable, you're probably in big 
trouble because it's likely that other packages have similarly been 
misinstalled on your host system. Make sure you DON'T install chapter 5 as 
root next time. That will protect you against this kind of problem.

> and, anyway, can i just copy it from my distro?

If it's a static version, yes, but it won't help because the rest of sh-
utils has to be installed, too. 
If it's not a static version, no.

MSB


----
Nietzsche: God is dead!

God: Nietzsche is dead!

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-support' in the subject header of the message



More information about the lfs-support mailing list