diff options
author | Alexey Torkhov <atorkhov@gmail.com> | 2009-10-13 13:52:43 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-10-13 13:52:43 +0100 |
commit | e0948419331d56c8f95fdeba2bca12ed5b5f1270 (patch) | |
tree | 86cc2f05c71311681059ccdff0b93641f8319309 | |
parent | 2c8be74033d01f92c840bb382d66a523c63086ce (diff) | |
download | febootstrap-e0948419331d56c8f95fdeba2bca12ed5b5f1270.tar.gz febootstrap-e0948419331d56c8f95fdeba2bca12ed5b5f1270.tar.xz febootstrap-e0948419331d56c8f95fdeba2bca12ed5b5f1270.zip |
Allow febootstrap-run to be called by root (RHBZ#528687)
-rwxr-xr-x | febootstrap-run.sh | 10 |
1 files changed, 7 insertions, 3 deletions
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 \ |