[Clfs-support] CLFS multilib (SVN20100103): cannot neither chroot nor boot Ch. 6
Chris Staub
chris at beaker67.com
Tue Jan 5 23:15:30 PST 2010
On 01/06/2010 02:00 AM, appzer0 wrote:
> Hi,
>
> I cannot chroot on my Slackware64 13.0 vanilla system:
>
> # chroot "${CLFS}" /tools/bin/env -i \
> HOME=/root TERM="${TERM}" PS1='CHROOT_CLFS\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
This usually indicates /tools/bin/env is linked incorrectly.
> though my CPU is a AMD Phenom X2 (64 bits). Kernel has IA32 emulation
> compiled in.
> I cross-compile for x86_64 target with multilib caabilities. Cross-tools
> compiled fine.
>
> Slackware64 has a multilib-capable design but is not able to compile
> multilib (gcc and glibc are pure 64-bit), so it has a lib64 _by
> default_. My guess is that other 64-bit distros may have their default
> libpath in /lib instead of /lib64, for example. So what should I do to
> be able to chroot?
>
> As a matter of fact, I wanted to boot following the Boot method but what
> I was expecting happened: no init found.
I'd bet this is due to the same problems mentioned below...
> I strictly followed the clfs multilib book several times now - excepting
> software versions - and I realize I'm just stuck each time at the
> Boot/Chroot step.
No you didn't, as your variables below clearly indicate. For example,
you apparently added "frenchslack" to the CLFS_TARGET vars...and a
number of other changes.
>
> Below are the values I'm using and system host values while at the end
> of chap. 6. TIA
>
> -------------------------
> # env
> AS=x86_64-frenchslack-linux-gnu-as
> AR=x86_64-frenchslack-linux-gnu-ar
> CLFS_TARGET32=i686-frenchslack-linux-gnu
> CLFS_HOST=x86_64-cross-linux-gnu
> TERM=xterm
> CLFS_TARGET=x86_64-frenchslack-linux-gnu
> LC_ALL=POSIX
> BUILD64=-m64
> CLFS=/frenchslack-prod
> BUILD32=-m32
> PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
If this is the env for the clfs user (as the indicated by the existence
of AS, LD, CC, etc...vars), the PATH is incorrect, main problem being
that /cross-tools/bin isn't anywhere to be found, which is likely the
main source of all your problems.
> LD=x86_64-frenchslack-linux-gnu-ld
> PWD=/frenchslack-prod/sources/util-linux-ng-2.16.2
> STRIP=x86_64-frenchslack-linux-gnu-strip
> PS1=CLFS:\u:\w\$
> CXX=x86_64-frenchslack-linux-gnu-g++
> HOME=/root
Never mind the previous comment about clfs user, as apparently you
aren't using it, despite your previous claim to be following the book.
> SHLVL=2
> RANLIB=x86_64-frenchslack-linux-gnu-ranlib
> CC=x86_64-frenchslack-linux-gnu-gcc
> _=/bin/env
>
> $ readelf -l /frenchslack-prod/tools/bin/bash | grep interpreter
> [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
> -------------------
>
There's one problem right there - Bash in /tools is linked to the host,
and I bet so is everything else (such as Coreutils, which would explain
the /tools/bin/env issue above). My guess your messing with various env.
vars (and/or not bothering to set the right PATH) has messed things
up...either that or it is due to even more deviations from the book that
you haven't mentioned. All I can suggest is to rm -rf /{cross-,}tools/*,
go back to the beginning and *actually* follow the book's
instructions...all of them...
More information about the Clfs-support
mailing list