Search:  
Gentoo Wiki

Fakechroot

Fakechroot is kind of an extension to fakeroot. Fakeroot allows you to fake the root-account (you 'feel' like root inside). Fakechroot gives you the abbility to make a chroot somewhere.

ebuild to fakechroot: http://bugs.gentoo.org/show_bug.cgi?id=202144

Mini HOWTO create a Debian fakechroot

First you need to install fakeroot, fakechroot, debootstrap and dpkg.

Then, as your normal user:

# mkdir -p fakechroot/debian
# fakechroot # (not sure if needed here)
# fakeroot
# export PATH=/usr/sbin:/sbin:$PATH
# debootstrap --foreign --variant=fakechroot --exclude dhcp3-server,dhcp3-server-ldap sid fakechroot/debian
# echo "int main() { return 0; }" | gcc -x c - -o fakechroot/debian/usr/sbin/chown
# echo "int main() { return 0; }" | gcc -x c - -o fakechroot/debian/usr/sbin/chmod
# echo "int main() { return 0; }" | gcc -x c - -o fakechroot/debian/usr/sbin/chgrp
# DEBOOTSTRAP_DIR=fakechroot/debian/debootstrap debootstrap --second-stage --second-stage-target=fakechroot/debian

Note that I have replaced chown/chmod/chgrp by dummies in this HOWTO. This is because there seems to be trouble with them. You can replace them later by real ones if you like. I also exclude dhcp3-server* as it uses rm together with an absolute path and rm is not mapped by fakechroot, therefore this doesn't work. The easiest method here was to just exclude it.

(Btw., it took some time to figure out all the problems and how to work around them.)

Retrieved from "http://www.gentoo-wiki.info/Fakechroot"

Last modified: Fri, 05 Sep 2008 10:27:00 +0000 Hits: 526