env problem

Kevin Day thekevinday at gmail.com
Tue Jun 3 05:56:08 PDT 2008


On Mon, Jun 2, 2008 at 11:46 PM, marty <marty at goodoldmarty.com> wrote:
> why did this screw this up after multiple tries?
>
> [root at localhost hlfs]# # Preparing Virtual Kernel File Systems
> [root at localhost hlfs]# install -vd $HLFS/{dev,proc,sys}
> install: creating directory `/mnt/hlfs/dev'
> install: creating directory `/mnt/hlfs/proc'
> install: creating directory `/mnt/hlfs/sys'
> [root at localhost hlfs]# mknod -m 600 $HLFS/dev/console c 5 1
> [root at localhost hlfs]# mknod -m 666 $HLFS/dev/null c 1 3
> [root at localhost hlfs]# mount -v --bind /dev $HLFS/dev
> /dev on /mnt/hlfs/dev type none (rw,bind)
> [root at localhost hlfs]# mount -vt devpts -o mode=620 devpts $HLFS/dev/pts
> devpts on /mnt/hlfs/dev/pts type devpts (rw,mode=620)
> [root at localhost hlfs]# mount -vt tmpfs shm $HLFS/dev/shm
> shm on /mnt/hlfs/dev/shm type tmpfs (rw)
> [root at localhost hlfs]# mount -vt proc proc $HLFS/proc
> proc on /mnt/hlfs/proc type proc (rw)
> [root at localhost hlfs]# mount -vt sysfs sysfs $HLFS/sys
> sysfs on /mnt/hlfs/sys type sysfs (rw)
> [root at localhost hlfs]# # Entering the Chroot Environment
> [root at localhost hlfs]# chroot "$HLFS" /tools/bin/env -i \
>>     HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
>>     PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
>>     /tools/bin/bash --login +h
> chroot: cannot run command `/tools/bin/env': No such file or directory
> ----------- BARFED OUT HERE --------------------
> [root at localhost hlfs]# ls -l /tools/bin/env
> -rwxr-xr-x 1 root root 96752 Jun  1 15:41 /tools/bin/env
> The file is obviously there but as root I can't access or execute it?
> Why not? Coreutils broken maybe?
>
> Marty B.
>
> --
> Building a better mousetrap only results in better mice. C. Darwin
>
>

The most common case of this is when some library doesn't make it into
/tools/lib or is improperly linked outside of the /tools directory.
do an ldd on /tools/bin/env and make sure all of the requested
libraries are in /tools/lib
make sure they are not linked to /lib and instead are in /tools/lib
/tools/bin/env should be linked only to /tools/lib libraries.
/tools/lib/* libraries should be linked only to other /tools/lib
libraries as well.


-- 
Kevin Day



More information about the hlfs-dev mailing list