fakeroot/proot hangs during rootfs generation

710 Views Asked by At

I am trying to build a Debian Stretch-based armhf filesystem using multistrap, fakeroot and proot. I can create the rootfs using multistrap:

fakeroot /usr/sbin/multistrap -f multistrap.conf

Then I copy the fakeroot libraries into the rootfs (libfakechroot.so, libfakeroot-sysv.so, libfakeroot-tcp.so), and start proot:

fakeroot -- proot -S out/ -w / -q qemu-arm-static /bin/bash

Within this shell I execute the following commands:

export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
export LC_ALL=C LANGUAGE=C LANG=C
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

/var/lib/dpkg/info/dash.preinst install
dpkg --configure -a

This should configure all packages installed using multistrap, but this process always hangs halfway through configuring the packages, most of the time on the same package but not always (for example on passwd, adduser, openssh-server), but almost always on a cat/grep line. The system does not respond anymore, ^C does not work and I have to kill all the fakeroot processes from another shell.

I tried with an almost empty multistrap config (only bash as package) and then it continues, but with only apt as package it hangs. I tried with fakeroot, and with fakeroot-tcp. The only difference is that fakeroot-tcp is much slower, but it still hangs.

Is there something I forgot to do in this setup?

When I run with sudo instead of fakeroot the rootfs is generated correctly. But from a security point of view I do not want to run multistrap/proot as root, so I would like to get fakeroot to work.

My multistrap config:

[General]
arch=armhf
directory=out
cleanup=true
noauth=true
unpack=true
aptsources=Common
bootstrap=Common

[Common]
packages=apt <<more packages>>
source=http://deb.debian.org/debian
keyring=debian-archive-keyring
suite=REPO_RELEASE
components=main
omitdebsrc=true
0

There are 0 best solutions below