Merge branch 'upstream'
[automated-distro-installer] / myfai-chboot-local
index 5140f68bb73f349bdf741974b1fbef7e7ba076c5..3ecc7d13f83d5b3beb8af69327faca4c875f56ad 100755 (executable)
@@ -1,5 +1,8 @@
 #!/bin/bash
 # note, this script gets piped to bash, so cant cd to current dir
+
+[[ $EUID == 0 ]] || exec sudo "${BASH_SOURCE}" "$@"
+
 set -eE -o pipefail
 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
 
@@ -29,8 +32,6 @@ while [[ $1 == -* ]]; do
   esac
 done
 
-[[ $EUID == 0 ]] || exec sudo "${BASH_SOURCE}" "$@"
-
 e() {
   echo "$*"
   if ! "$@"; then
@@ -83,7 +84,7 @@ if modprobe nfsd &>/dev/null; then
   if [[ -w /etc/exports ]]; then
     sed -ri --follow-symlinks '\%^/srv/fai/%d' /etc/exports
     cat >>/etc/exports <<EOF
-/srv/fai/config $ip(async,ro,no_subtree_check)
+/srv/fai/config $ip(async,ro,no_subtree_check,no_root_squash)
 /srv/fai/nfsroot $ip(async,ro,no_subtree_check,no_root_squash)
 EOF
     exportfs -ra