public inbox for gentoo-embedded@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-embedded] unable to chroot
@ 2006-11-17 21:35 Corey
  2006-11-17 22:15 ` Mike Frysinger
  2006-11-18  6:35 ` Corey
  0 siblings, 2 replies; 6+ messages in thread
From: Corey @ 2006-11-17 21:35 UTC (permalink / raw
  To: gentoo-embedded


I've got a minimal gentoo env on a separate partition, but I'm unable to chroot
into it - I get a "chroot: cannot run command `/bin/bash': No such file or directory",
even though bash does in fact exist in the target and is executable:

scanner gentoo # chroot /mnt/gentoo/ /bin/bash
chroot: cannot run command `/bin/bash': No such file or directory
scanner gentoo # pwd
/mnt/gentoo
scanner gentoo # ls
bin  dev  etc  home  lib  linuxrc  mnt  proc  root  sbin  sys  tmp  usr  var
scanner gentoo # ls -l bin/bash
-rwxr-xr-x 1 root root 869584 Nov 17 01:50 bin/bash
scanner gentoo # ./bin/bash --version
GNU bash, version 3.1.17(1)-release (i686-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
scanner gentoo # chroot /mnt/gentoo/ /bin/bash
chroot: cannot run command `/bin/bash': No such file or directory


Where should I begin trying to fix this?  I used crossdev w/ uclibc when I compiled
and installed the base fs into the partition in question.


Thanks,

Corey
-- 
gentoo-embedded@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-embedded] unable to chroot
  2006-11-17 21:35 [gentoo-embedded] unable to chroot Corey
@ 2006-11-17 22:15 ` Mike Frysinger
  2006-11-17 22:45   ` Hanni Ali
  2006-11-18  0:08   ` Corey
  2006-11-18  6:35 ` Corey
  1 sibling, 2 replies; 6+ messages in thread
From: Mike Frysinger @ 2006-11-17 22:15 UTC (permalink / raw
  To: gentoo-embedded; +Cc: Corey

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

On Friday 17 November 2006 16:35, Corey wrote:
> scanner gentoo # ./bin/bash --version
> GNU bash, version 3.1.17(1)-release (i686-pc-linux-gnu)
> Copyright (C) 2005 Free Software Foundation, Inc.
> scanner gentoo # chroot /mnt/gentoo/ /bin/bash
> chroot: cannot run command `/bin/bash': No such file or directory

assuming / is glibc and /mnt/gentoo is uclibc, this looks like the bin/bash is 
incorrectly linked against glibc

try running `readelf -d bin/bash` and make sure it is linked against uClibc 
libs
-mike

[-- Attachment #2: Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-embedded] unable to chroot
  2006-11-17 22:15 ` Mike Frysinger
@ 2006-11-17 22:45   ` Hanni Ali
  2006-11-18  0:10     ` Corey
  2006-11-18  0:08   ` Corey
  1 sibling, 1 reply; 6+ messages in thread
From: Hanni Ali @ 2006-11-17 22:45 UTC (permalink / raw
  To: gentoo-embedded

[-- Attachment #1: Type: text/plain, Size: 857 bytes --]

A few people have been having problems with this recently

could I ask what version of crossdev you are using I just checked a new
build and I've hit the same problem

On 17/11/06, Mike Frysinger <vapier@gentoo.org> wrote:
>
> On Friday 17 November 2006 16:35, Corey wrote:
> > scanner gentoo # ./bin/bash --version
> > GNU bash, version 3.1.17(1)-release (i686-pc-linux-gnu)
> > Copyright (C) 2005 Free Software Foundation, Inc.
> > scanner gentoo # chroot /mnt/gentoo/ /bin/bash
> > chroot: cannot run command `/bin/bash': No such file or directory
>
> assuming / is glibc and /mnt/gentoo is uclibc, this looks like the
> bin/bash is
> incorrectly linked against glibc
>
> try running `readelf -d bin/bash` and make sure it is linked against
> uClibc
> libs
> -mike
>
>
>


-- 
E-mail: hanni.ali@gmail.com
Mobile: 07985580147
Website: www.ainkaboot.co.uk

[-- Attachment #2: Type: text/html, Size: 1276 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-embedded] unable to chroot
  2006-11-17 22:15 ` Mike Frysinger
  2006-11-17 22:45   ` Hanni Ali
@ 2006-11-18  0:08   ` Corey
  1 sibling, 0 replies; 6+ messages in thread
From: Corey @ 2006-11-18  0:08 UTC (permalink / raw
  To: gentoo-embedded

On Friday 17 November 2006 15:15, Mike Frysinger wrote:
> On Friday 17 November 2006 16:35, Corey wrote:
> > scanner gentoo # ./bin/bash --version
> > GNU bash, version 3.1.17(1)-release (i686-pc-linux-gnu)
> > Copyright (C) 2005 Free Software Foundation, Inc.
> > scanner gentoo # chroot /mnt/gentoo/ /bin/bash
> > chroot: cannot run command `/bin/bash': No such file or directory
> 
> assuming / is glibc and /mnt/gentoo is uclibc, this looks like the bin/bash is 
> incorrectly linked against glibc
>

I think that may be the problem.  ( I'm completely new to this ).

 
> try running `readelf -d bin/bash` and make sure it is linked against uClibc 
> libs
>

scanner gentoo # readelf -d bin/bash

Dynamic section at offset 0xce014 contains 22 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libncurses.so.5]
 0x00000001 (NEEDED)                     Shared library: [libdl.so.2]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]



I was concerned about the way I was doing this the other night.

I was successfully ( in appearance at least ) able to run a full stage4
crossdev on my local dev box:  crossdev --t i686-pc-linux-uclibc .

THis completed successfully, we're talking linux-headers, gcc, uclibc,
etc. My '/etc/portage/catagories' has "cross-i686-pc-linux-uclibc". I was
able to then install/(bootstrap) uclibc w/ gcc and linux-headers onto my
'/mnt/gentoo' partition, basically like so:

ROOT="/mnt/gentoo" CHOST="cross-i686-pc-linux-uclibc" emerge cross-i686-pc-linux-uclibc/linux-headers

etc,etc.

The suspicion that I was doing something wrong, however, didn't occur until
I attempted to install some other necessary packages, such as bash:

ROOT="/mnt/gentoo" CHOST="cross-i686-pc-linux-uclibc" emerge bash

would cause:

"checking build system type... Invalid configuration `cross-i686-pc-linux-uclibc': machine `cross-i686-pc' not recognized
configure: error: /bin/sh ./support/config.sub cross-i686-pc-linux-uclibc failed"

So, trying a few different (basically random) things, I gave up and compiled it without
that CHOST env var - figuring that I would need to kind of recompile/'bootstrap' things
once I chroot'd into the new sandbox.

Here is ( what I believe to be ) a relevant portion of the bash config.log:

configure:2310: $? = 0
configure:2312: i686-pc-linux-uclibc-gcc -v </dev/null >&5
Using built-in specs.
Target: i686-pc-linux-uclibc
Configured with: /var/tmp/portage/gcc-4.1.1-r2/work/gcc-4.1.1/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/i686-pc-linux-uclibc/gcc-bin/4.1.1 --includedir=/usr/lib/gcc/i686-pc-linux-uclibc/4.1.1/include --datadir=/usr/share/gcc-data/i686-pc-linux-uclibc/4.1.1 --mandir=/usr/share/gcc-data/i686-pc-linux-uclibc/4.1.1/man --infodir=/usr/share/gcc-data/i686-pc-linux-uclibc/4.1.1/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-uclibc/4.1.1/include/g++-v4 --host=i686-pc-linux-gnu --target=i686-pc-linux-uclibc --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libmudflap --disable-libssp --disable-libgcj --enable-objc-gc --enable-languages=c,c++,objc,obj-c++ --with-sysroot=/usr/i686-pc-linux-uclibc --disable-__cxa_atexit --enable-target-optspace --enable-clocale=uclibc
Thread model: posix
gcc version 4.1.1 (Gentoo 4.1.1-r2)
configure:2315: $? = 0
configure:2317: i686-pc-linux-uclibc-gcc -V </dev/null >&5
i686-pc-linux-uclibc-gcc: '-V' option must have argument
configure:2320: $? = 1
configure:2346: checking for C compiler default output
configure:2349: i686-pc-linux-uclibc-gcc -O3 -march=i686 -pipe -fomit-frame-pointer -funroll-loops   conftest.c  >&5
configure:2352: $? = 0
configure:2385: result: a.out
configure:2390: checking whether the C compiler works
configure:2396: ./a.out
./configure: line 2397: ./a.out: No such file or directory
configure:2399: $? = 127
configure:2407: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.

-- 
gentoo-embedded@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-embedded] unable to chroot
  2006-11-17 22:45   ` Hanni Ali
@ 2006-11-18  0:10     ` Corey
  0 siblings, 0 replies; 6+ messages in thread
From: Corey @ 2006-11-18  0:10 UTC (permalink / raw
  To: gentoo-embedded

On Friday 17 November 2006 15:45, Hanni Ali wrote:
> A few people have been having problems with this recently
> 
> could I ask what version of crossdev you are using I just checked a new
> build and I've hit the same problem
> 

sys-devel/crossdev-0.9.17-r2


I think in my case it's very likely to be user-error, I do appreciate any
assistance!


Beers,

Corey



-- 
gentoo-embedded@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-embedded] unable to chroot
  2006-11-17 21:35 [gentoo-embedded] unable to chroot Corey
  2006-11-17 22:15 ` Mike Frysinger
@ 2006-11-18  6:35 ` Corey
  1 sibling, 0 replies; 6+ messages in thread
From: Corey @ 2006-11-18  6:35 UTC (permalink / raw
  To: gentoo-embedded


After some frustration, impatience, and gnashing of teeth - I finally did
manage to see the error in my ways...

#1 - I didn't properly set my gcc-config to use the new profile ( i686-pc-linux-uclibc-4.1.1 )

#2 - I had my CHOST and CBUILD set incorrectly


So, things appear to be getting further along now, but I'll likely come
crying back to the list before too long on some new problem...   (c8=


Cheers,

Corey



On Friday 17 November 2006 14:35, Corey wrote:
> 
> I've got a minimal gentoo env on a separate partition, but I'm unable to chroot
> into it - I get a "chroot: cannot run command `/bin/bash': No such file or directory",
> even though bash does in fact exist in the target and is executable:
> 
> scanner gentoo # chroot /mnt/gentoo/ /bin/bash
> chroot: cannot run command `/bin/bash': No such file or directory
> scanner gentoo # pwd
> /mnt/gentoo
> scanner gentoo # ls
> bin  dev  etc  home  lib  linuxrc  mnt  proc  root  sbin  sys  tmp  usr  var
> scanner gentoo # ls -l bin/bash
> -rwxr-xr-x 1 root root 869584 Nov 17 01:50 bin/bash
> scanner gentoo # ./bin/bash --version
> GNU bash, version 3.1.17(1)-release (i686-pc-linux-gnu)
> Copyright (C) 2005 Free Software Foundation, Inc.
> scanner gentoo # chroot /mnt/gentoo/ /bin/bash
> chroot: cannot run command `/bin/bash': No such file or directory
> 
> 
> Where should I begin trying to fix this?  I used crossdev w/ uclibc when I compiled
> and installed the base fs into the partition in question.
> 
> 
> Thanks,
> 
> Corey
-- 
gentoo-embedded@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-11-18  6:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-17 21:35 [gentoo-embedded] unable to chroot Corey
2006-11-17 22:15 ` Mike Frysinger
2006-11-17 22:45   ` Hanni Ali
2006-11-18  0:10     ` Corey
2006-11-18  0:08   ` Corey
2006-11-18  6:35 ` Corey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox