Gentoo Archives: gentoo-embedded

From: The MoonSeeker <themoonseeker@×××××.com>
To: gentoo-embedded@l.g.o
Subject: Re: [gentoo-embedded] Chroot the environment
Date: Tue, 29 May 2007 08:10:04
Message-Id: AAFDB535-3852-4C79-8698-9A573B4CA287@gmail.com
In Reply to: Re: [gentoo-embedded] Chroot the environment by Isidore Ducasse
1 > So try chroot /tmp/minime /bin/sh.
2
3 Doesn't work :(
4
5
6 > ldd /bin/ash to know which.
7
8 ldd /bin/bash
9 linux-gate.so.1 => (0xb7f84000)
10 libncurses.so.5 => /lib/libncurses.so.5 (0xb7f3e000)
11 libdl.so.2 => /lib/libdl.so.2 (0xb7f3a000)
12 libc.so.6 => /lib/libc.so.6 (0xb7e12000)
13 /lib/ld-linux.so.2 (0xb7f85000)
14
15
16 ldd /tmp/embtest/bin/bash
17 linux-gate.so.1 => (0xb7f5f000)
18 libncurses.so.5 => /lib/libncurses.so.5 (0xb7f19000)
19 libdl.so.2 => /lib/libdl.so.2 (0xb7f15000)
20 libc.so.6 => /lib/libc.so.6 (0xb7ded000)
21 /lib/ld-linux.so.2 (0xb7f60000)
22
23 > genkernel make all
24
25 genkernel make all
26 Error: Unknown option 'make'!
27
28 > - or if you made your chroot for x86 and try to launch from (non-
29 > multilib?) x86_64 system, you could catch some of those mysterious
30 > "No such file or directory".
31
32 I don't think this is the problem :
33
34 file /bin/bash
35 /bin/bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
36 for GNU/Linux 2.6.9, dynamically linked (uses shared libs), stripped
37 file /tmp/embtest/bin/bash
38 /tmp/embtest/bin/bash: ELF 32-bit LSB executable, Intel 80386,
39 version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses
40 shared libs), stripped
41
42 Thanks for help!
43
44 Any other idea? I'm lost :(
45
46 On May 25, 2007, at 5:48 PM, Isidore Ducasse wrote:
47
48 > le Fri, 25 May 2007 13:42:00 +0200
49 > The MoonSeeker <themoonseeker@×××××.com> a écrit:
50 >
51 >> Hi,
52 >>
53 >> Is it to possible to chroot the after we create it (USE=-iconv
54 >> ACCEPT_KEYWORDS="**" ROOT="/tmp/minime" emerge -avkN uclibc busybox
55 >> baselayout-lite dropbear), because i get this error :
56 >>
57 >> chroot /tmp/minime/
58 >> chroot: can't execute `/bin/bash': No such file or directory
59 >>
60 > I dunno where your bash comes from, but busybox embeds ash, a bash
61 > tiny ersatz. Normally sh is the most standard shell to ask for. So
62 > try chroot /tmp/minime /bin/sh.
63 >
64 > Two other possible reasons for this error:
65 > - either you're missing some dynamic libraries. In this case chroot
66 > or any shell don't even "see" the executable file. Use ldd /bin/ash
67 > to know which.
68 > - or if you made your chroot for x86 and try to launch from (non-
69 > multilib?) x86_64 system, you could catch some of those mysterious
70 > "No such file or directory".
71 >
72 > Hope it helps. If you're looking for a robust and not-often-
73 > changing miniroot, you could consider compiling busybox statically,
74 > still against uclibc. But the smart, easy, sure and efficient way
75 > to do this is
76 >
77 > emerge crossdev genkernel
78 > genkernel make all
79 >
80 > ( creates a new kernel and all relevant modules, and the miniroot I
81 > was talking about _if_ crossdev is present )
82 >
83 > genkernel make initrd --lots-of-cool-options
84 >
85 > ( generates an initrd for the previously made kernel. Basically
86 > involves harddrives pilots, a statical busybox with few commands
87 > and modprobe. You can append your files very easily but overwriting
88 > some is an issue, as far as I remember. )
89 > --
90 > gentoo-embedded@g.o mailing list
91 >
92
93 --
94 gentoo-embedded@g.o mailing list

Replies

Subject Author
Re: [gentoo-embedded] Chroot the environment Arkadi Shishlov <arkadi@××××××.lv>
Re: [gentoo-embedded] Chroot the environment Mike Frysinger <vapier@g.o>