[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: error running debootstrap - Failure to run chroot

+++ Amandeep Bhullar [2009-06-16 10:54 -0300]:
>    I also tried:
>    # debootstrap --arch arm lenny /Emdebian [1]http://www.emdebian.org/grip
>    Got the same error. Is it because I am running it on my desktop and it
>    wont chroot into arm based root (I wonder)?


(executive version of this email: use multistrap instead of
debootstrap to cross-bootstrap grip). Details below.

>      W: Failure trying to run: chroot /Emdebian mount -t proc proc /proc

That runs the 'mount' command inside the chroot, which is an arm
binary, which won't work on your non-arm desktop machine.

Try it:
# chroot /Emdebian mount -t proc proc /proc
chroot: cannot run command mount': Exec format error

As you have observed you need to do a debootstrap --foreign for this
to work.

# debootstrap --arch=arm --foreign lenny grip/ http://www.emdebian.org/grip/

   Now what do I do next? Normally if I make a native root FS for my desktop
   using debootstrap, after "Extracting zlib1g' it says Base system installed
   successfully. It did not do that here. If i make a tarball of this root FS
   folder that is grip/; how do I install it on my target now.

That depends on your target. Somehow you need to copy the tarball onto
the device. Or possibly make the tarball into a rootfs image for the
relevant filesystem and tftp/dd that onto the device.

Then you should be able to boot into it and do
/debootstrap/debootstrap --second-stage

However this can be complicated by having to have the correct console
setup (such as the console configured in /etc/securetty) and inittab
to generate gettys on the right devices and so on before it will boot
enough for you to actually run the above command.

So what you probably actually want to do, in order to generate
grip-based bootable rootfs images for target devices, is to use
multistrap instead of debootstrap. This tool uses apt and debootstrap
to download the correct dependencies and unpack them, but it also runs
machine-specific scripts to configure the root images enough to make
them bootable and then complete the debootstrap second stage. It also
enormously reduces the image size by removing all the .debs from the
apt cache.

In package 'multistrap'.

Principal hats:  iEndian - Balloonboard - Toby Churchill - Emdebian

Reply to: