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

Re: multistrap rootfs with initramfs

On Fri, 30 Oct 2009 17:27:52 +1100
"Brendan Simon (eTRIX)" <brendan.simon@etrix.com.au> wrote:

> I'm looking at using multistrap to create a rootfs that can be passed
> to a linux build for an initramfs.

The thought had crossed my mind a few times but I've no experience with
> Is it feasible to create a linux image with an initramfs based on a
> multistrap rootfs ??

Sorry, I have no idea.

> Is emsecondstage still relevant with multistrap ??

No. You probably want the DEBCONF environment variables but not the
CDEBCONF one, you want to run 'dpkg --configure -a' but you certainly
don't want the rest of emsecondstage (which does lots of things that
Debian (and therefore Grip) cannot support).

> Is booting into a multistrap rootfs possible.

Yes. You do need to arrange for the configure scripts to be run
beforehand. The main thing that breaks (IIRC) is that ldconfig has not
been setup, so you have to take avoid executables using shared

> The multistrap page on wiki says the rootfs just needs to be mounted
> (or chrooted) and configured with "dpkg --configure -a"

Correct. Unless you are doing a native multistrap.
> Looks like multistrap does not create:
>     /dev entries.
>     /etc/inittab
>     /etc/fstab
>     /etc/hosts
>     /etc/securetty
>     /etc/modules
>     /etc/hostname
>     /etc/network/interfaces

Those are for you to create once multistrap has completed - just as
they are by debian installer.

udebs normally handle such things via a ramdisk and user interaction
(pre-seeding being difficult with Lenny).

Like debootstrap, multistrap doesn't do any hand-holding of the
installer side of things - any confguration that needs to precede
package configuration or which cannot be done via maintainer scripts is
meant to be done separately, between multistrap finishing and the
directory being put into a tarball or whatever.

emsandbox is quite a different animal but is not suited to use with
Grip. It can be tempting to see multistrap as similar to emsandbox, it
is not; multistrap is based on debootstrap but I didn't fancy calling
it multi_emdebootstrap.

> multistrap rootfs could be put into cpio.gz archive and set in linux
> config, or linux config could just point to the multistrap rootfs
> directory and the linux build will create the cpio.gz.

> The disadvantage of doing the cpio.gz manually is that it has to be
> complete, where as specifying a directory allows specifying multiple
> directories and control files and the build system will aggregate
> things. Also, the initramfs control files can be used to build /dev
> entries, and create directories and files with the correct
> permissions, uid and gid. Not sure which is better -- it may be just
> a case of "6 of one -- half a dozen of the other"

It is almost certainly a case of asking someone else . . . 
> One issue is that I do prefer not to build as root, even via sudo. 

I've had my issues with that - famously requiring the complete
reinstallation of this laptop after one late night typo involving
cleaning up after a failed test script and the complete removal
of /etc/ - but with care, scripts can be written to avoid these
problems. It is the developers who take those risks. As these things
go, whether you are logged in as root or using sudo makes absolutely no

> Either fakeroot or initramfs control files are required to ensure the
> files have the correct permissions, uids and gids.

emgrip uses fakeroot for these reasons, multistrap needs real or sudo
root to be able to work properly but you can run other commands under
fakeroot, once multistrap has finished. 

> Any thoughts about using initramfs with a multistrap rootfs ??

Thoughts but no actual methods and no real idea of how.
> If there are size restrictions, then two possibly two rootfs could be
> built -- a small one with enough to boot
> (eg. /bin /lib /etc /root ...) and a larger one to mount along side
> (or over the top) with all the other apps.

multistrap can support that quite easily - the rest of it, sorry, no


Neil Williams

Attachment: pgpgwRcp9DcML.pgp
Description: PGP signature

Reply to: