X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=febootstrap-run.sh;h=6c5e9b90e51020595d7d9eba7e53c298c63739c4;hb=c0a9555e8559a0dbf432367f87c59c2a49520c99;hp=ce5fbe2efe44056ce44c89b4f059fd32ac9a7427;hpb=2c8be74033d01f92c840bb382d66a523c63086ce;p=febootstrap.git diff --git a/febootstrap-run.sh b/febootstrap-run.sh index ce5fbe2..6c5e9b9 100755 --- a/febootstrap-run.sh +++ b/febootstrap-run.sh @@ -68,15 +68,19 @@ if [ $(id -u) -eq 0 ]; then exit 0 fi -if [ ! -f "$target"/fakeroot.log ]; then +if [ $(id -u) -ne 0 -a ! -f "$target"/fakeroot.log ]; then echo "febootstrap-run: $target: not a root filesystem" exit 1 fi if [ "$readonly" = "no" ]; then - fakeroot -i "$target"/fakeroot.log -s "$target"/fakeroot.log \ - fakechroot -s \ + if [ $(id -u) -ne 0 ]; then + fakeroot -i "$target"/fakeroot.log -s "$target"/fakeroot.log \ + fakechroot -s \ + chroot "$target" "$@" + else chroot "$target" "$@" + fi else fakeroot -i "$target"/fakeroot.log \ fakechroot -s \