running `busybox --install -s` as non-root in a staging dir

Natanael Copa ncopa at alpinelinux.org
Thu Dec 15 15:37:22 UTC 2016


Hi,

I am working on creating a rootfs tarball for alpine linux to be used
as base for things like docker images. Currently all alpine release
iso images are created as non-root, with some help from fakeroot.

I do have a problem with the rootfs image. The problem is that package
manager (apk-tools) runs the install scripts in a chroot. This is
because we need `/bin/busybox --install -s` to run relative the temp
root. chroot(2) will fail in fakeroot with permission denied.

I need a way to install the busybox symlinks relative a root. I know
`/bin/busybox --install -s <DIR>` but that will install all the
symlinks in a give dir instead of <DIR>/usr/bin <DIR>/sbin etc.

Possible solutions:

1) Add a -p flag to indicate that DIR is a root prefix instead of
   target directory for all links.

    /bin/busybox --install -s -p DIR

2) Add an flag to print all install paths to the applet.

   /bin/busybox --print-paths

I want avoid a custom patch for busybox, so what would be an acceptable
solution for upstream busybox? Other ideas?

Thanks!

-nc

PS. There is a fakechroot but it appears to be very gnu libc centric and
does not build with musl libc.


More information about the busybox mailing list