Re: Configuring foreign packages without qemu in order to boot a system
+++ Paul Boddie [2012-09-02 01:07 +0200]:
> I've recently been looking into using Emdebian on the Ben NanoNote,
> However, to get to this point, I have to rely on the existing OpenWrt
> distribution to boot the device, log in, and then enter the Emdebian system
> root using chroot in order to run "dpkg --configure -a". Once this has been
> done, the device will boot into the Emdebian system.
> This configuration step appears to be the necessary measure to permit the init
> mechanism and various related activities to function. I suppose that not all
> packages need to be configured, but some configuration seems to make the
> difference between a functioning and non-functioning system.
> Obviously, in my situation, I can't boot into Emdebian without
> having first performed the configuration step, so this supposedly leaves me
> with the fairly undesirable option of using qemu.
> I did wonder, however, whether there are any known techniques for configuring
> just enough of a system on the build host so that the init mechanism can
> complete its work on the target system and then allow the proper
> configuration to occur.
Multistrap provides a (fairly low-tech) mechanism for this. In your
multistrap config provide a
which does any tweaking necessary to make the image bootable (e.g. setting
/etc/fstab, inittab, /etc/modules to something useful).
> Alternatively, I wondered whether there might be any way of deploying a "first
> boot" script to perform configuration on the target system.
That doesn't help if it won't even boot. So there is a second option:
configscript=/path/to/config.sh which specifies a script to copy into
the image for 'first run' use.
There are examples of these scripts in the package. Some details are
given in the 'Machine:variant support' and 'Root Filesystem
Configuration' sections of the multistrap man page. And also on
> I see a script
> apparently suggested for this kind of thing...
That is a typical example of a first-run 'configscript'.
An alternative approach is to use the 'polystrap' wrapper, which uses
qemu to cross-configure the packages (after running multistrap) so
that the image has already had dpkg --configure -a run. This may or
not be easier/better depending on your circumstances and how closely
the qemu device resembles the one you are trying to configure for...
> I would certainly appreciate any advice on this topic. Emdebian promises to
> make a lot of things easier when developing for embedded devices like the
> NanoNote - just the availability of numerous packages for different
> architectures is a real time-saver - and I'd like to be able to offer some
> concrete documentation to help people start using it without there being too
> many complications involved.
Principal hats: Linaro, Emdebian, Wookware, Balloonboard, ARM