Discussion:
chicken and egg problem
Piers Haken
2012-07-17 09:26:58 UTC
Permalink
Which comes first, the chicken (debootstrap) or the egg (scratchbox2) ?



Apparently 'debootstrap --variant=scratchbox' requires the scratchbox config
to exist already:



fakeroot /usr/sbin/debootstrap --arch=armel --foreign --variant=scratchbox
wheezy rootfs http://http.debian.net/debian

E: No scratchbox target configured for /home/piersh/rootfs



However, sb2 requires a working rootfs:



sb2-init -A armel -c `which qemu-arm` armel
~/arm-2012.03/bin/arm-none-linux-gnueabi-gcc

.

checking whether the C compiler works... configure: error: cannot run C
compiled programs.

If you meant to cross compile, use `--host'.

See `config.log' for more details.



config.log indicates that /lib/ld-linux.so.3 cannot be found even though
it's included in the toolchain, here:
~/arm-2012.03/arm-none-linux-gnueabi/libc/lib/ld-linux.so.3



I figure there must be a way to do this, otherwise there wouldn't be a
'--variant=scratchbox' switch in the first place.



Can anyone show me where I'm going wrong?



Thanks.

Piers.
Jussi Hakala
2012-08-06 08:18:08 UTC
Permalink
Post by Piers Haken
sb2-init -A armel -c `which qemu-arm` armel
~/arm-2012.03/bin/arm-none-linux-gnueabi-gcc
Drop the -A armel. You're overriding compiler architecture with debian
architecture.
Post by Piers Haken
checking whether the C compiler works... configure: error: cannot run C
compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
config.log indicates that /lib/ld-linux.so.3 cannot be found even though
~/arm-2012.03/arm-none-linux-gnueabi/libc/lib/ld-linux.so.3
If you want to run a binary from the target, you need ld.so and all the
libraries the binary requires to be present in the target.

If memory serves, debootstrap first unpacks the core rootfs before
trying to run anything (such as post/preinst scripts) from the rootfs.
Initially empty rootfs shouldn't be a problem with debootstrap.
Post by Piers Haken
I figure there must be a way to do this, otherwise there wouldn’t be a
‘--variant=scratchbox’ switch in the first place.
Can anyone show me where I’m going wrong?
Sounds awfully like you're trying to compile something against an empty
target. Did you run debootstrap successfully before attempting to compile?

Regards,

Jussi

Loading...