Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to write a bootstrapper for a minimal, from-source linux distribution.

I would like to build in a chroot-like environment. This should simplify packaging. I do not care about security at this point. The bootstrapper should not require any non-standard third-party commands. It would be great if there is no need to be root, either.

This is why fakechroot(1) fakeroot(1) chroot(1) is not exactly what I am looking for.

Is it possible to fake / using unshare(1) and /bin/sh?

share|improve this question
    
AFAICS, unshare(1) is a rather thin wrapper around a collection of root-only system calls, and (at least on Fedora 18) it isn't SUID, so I doubt very much that that will work for non-root users. –  vonbrand Feb 25 '13 at 19:50
    
Oh, that's a shame. I was under the impression unshare is setuid. I guess I am fine with being root. –  Rooties Feb 25 '13 at 19:53
4  
With the release of the new Linux 3.8 kernel, you can use namespace features as non-root. But this is shiny new stuff: you need a uid namespace first, and unshare does not support that yet. And your actions will still be limited. –  BatchyX Feb 25 '13 at 20:35

1 Answer 1

Just bundle or install fakeroot/fakechroot, since they are already perfectly appropriate for this. Look at cdebootstrap for inspiration.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.