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

Re: Configuring foreign packages without qemu in order to boot a system

Hi Paul,

On 12-09-02 at 01:07am, Paul Boddie wrote:
> I've recently been looking into using Emdebian on the Ben NanoNote, 
> which is typically supported by an OpenWrt-based kernel and 
> distribution, and I've reached the point where I can persuade the 
> system to boot Emdebian directly from an SD card.
> 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.
> The general advice about package configuration...
> http://wiki.debian.org/EmDebian/CrossDebootstrap
> ...seems to be mainly divided between booting into a device and 
> running dpkg (or performing a second-stage debootstrap if that is the 
> tool of choice) or using qemu. 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. Previously, I had hoped that 
> multiarch installations might alleviate the problem of package 
> configuration really wanting to run native programs, but I imagine 
> that readers of this list would be aware of more elegant solutions to 
> this problem.

Beware that I am not very experienced with these things, so take my 
input with caution...

As far as I know, multiarch at its current state in Debian won't help 
you with bootstrapping of the core system.

> Alternatively, I wondered whether there might be any way of deploying 
> a "first boot" script to perform configuration on the target system. I 
> see a script apparently suggested for this kind of thing...
> http://wiki.debian.org/Multistrap#Debconf_and_pre-seeding
> ...but I'm not sure whether the author of that suggestion intended 
> such scripts to be deployed in such a fashion.

Yes, that piece looks right.

You may also be able to use "debootstrap --foreign", but multistrap was 
invented for cross-arch bootstrapping so probably has had more testing.

It is even possible to do the whole bootstrapping, including that 
second-stage inside qemu inside chroot, using fakeroot.

Here are some scripts you might draw inspiration from...

Polystrap is a tool aiming at doing this bootstrapping with fakeroot: 

Freedom-maker is a script written specifically to bootstrap a DreamPlug 
(using qemu as root): git.debian.org:/git/freedombox/freedom-maker

Boxer is a tool I am working on to cover many types of bootstrapping - 
same-arch or cross-arch, real root or fakeroot, second-stage at once (on 
same-arch) or later (if somehow providing a barely bootable environment) 
or in qemu: git.debian.org:/git/collab-maint/boxer

Freedom-maker should be fully functional albeit for a specific different 
hardware.  Polystrap may be functional as well (but it has not appeared 
yet as a Debian package so I am not certain of it).  Boxer lacks 
applying a boot-leader, but the task of unfolding a core Debian system 
onto a filesystem should be fully working now, and due to its aim of 
being quite flexible might be of most help to you in understanding the 


...oh, and if you do play with boxer, you are of course more than 
welcome to give feedback ;-)

 - Jonas

 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

Attachment: signature.asc
Description: Digital signature

Reply to: