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

what is missing in multistrap to build rootfs without superuser priviliges



Hi,

wookey was recently talking about the possiblity of extending multistrap
with some additional functionality so that a wrapper like polystrap is
not necessary.

By going step by step through the things that polystrap does, let me
list what would have to change in multistrap to make it build foreign
rootfs without superuser priviliges:

 - getting settings for suite, arch, rootdir, mirror, packages list
      o this is all possible with multistrap already (NO CHANGE)

 - running multistrap
      o obviously noting to be changed :) (NO CHANGE)

 - backup ldconfig and ldd and replace with dummies
      o could be done by multistrap hooks (NO CHANGE)

 - copy static directory tree
      o this could be added as a new multistrap functionality but static
        files can as well be created by scripts that are run as hooks
        (NO CHANGE)

 - preseed debconf
      o multistrap does that already (NO CHANGE)

 - run preinst scripts
      o multistrap does it (NO CHANGE)

 - dpkg --configure -a
      o this is done by multistrap already as well but it is only done
        when building for native architecture
      o also, chroot is used with no possibility to use fakechroot
        instead
      (!CHANGE!)

 - run some more hooks
      o also done by multistrap (NO CHANGE)

 - replace dummy ldconfig and ldd with real ones
      o can be realized as a hook (NO CHANGE)

 - create tarball
      o to preserve symlinks of fakechroot correctly, this has to be done
        with a fakechroot call (CHANGE)

To summarize: hooks can do most of the stuff that polystrap does right
now. Even the rootfs tree that is currently copied in polystrap can be
dynamically created by hook scripts already. What multistrap would need
to allow would be to run the package configuration step for non native
targets as well and make it possible to use fakechroot in this step and
in the tarball creation step.

Polystrap really doesnt do much and this is the reason why only tiny
feature additions to multistrap would be necessary (fakechroot calls).
What is currently problematic are:

 - fakechroot needs bug #611156 to be fixed to allow mknod and (for some
   reason) to allow building of armhf roots

 - fakeroot and fakechroot foreign shared libraries need to be manually
   copied to /usr/lib/<triplet>/ while they are not yet multiarched
   Wrt multiarch I supplied a patch for fakechroot (#632954) and am
   waiting for an answer by the maintainer of fakeroot - if I dont get
   a response in a few days I will file a bug against fakeroot

 - /etc/qemu-binfmt/<arch>/ directories have to be set up or qemu with
   this patch has to be used #632192

 - for mips/mipsel qemu has to be patched as well (patches are submitted
   upstream)
   http://lists.nongnu.org/archive/html/qemu-devel/2011-07/msg00313.html

 - even with the qemu patch for mipsel, the mips loader only looks for
   libraries in /lib, /lib32, /usr/lib and /usr/lib32 and hence doesnt
   find the foreign fakeroot/fakechroot shared libraries in
   /usr/lib/<triplet>. This doesnt happen for other archs and no idea
   why it does. Maybe this is some libc6 bug for mips/mipsel?

Until all this is fixed it might not be desirable to have the "building
foreign rootfs without superuser priviliges" functionality in multistrap
at all but consider this email just as a short collection of ideas from
my side. Just a proposal to maybe discuss the possiblity of a future
extension of multistrap instead of just another foo-strap.

cheers, josch


Reply to: