iankelling.org
/
git
/
automated-distro-installer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
arch use by-id and various fixes
[automated-distro-installer]
/
fai
/
config
/
distro-install-common
/
end
diff --git
a/fai/config/distro-install-common/end
b/fai/config/distro-install-common/end
index 6bb2880ef82a3f160c9cdcf31bed07826929220f..e6e182b82a82afbdc58aff3af9834574f8ac584d 100755
(executable)
--- a/
fai/config/distro-install-common/end
+++ b/
fai/config/distro-install-common/end
@@
-9,19
+9,27
@@
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
# based on unison error, with 8192 from
# sysctl -a | grep fs.inotify.max_user_watches
#http://stackoverflow.com/questions/535768/what-is-a-reasonable-amount-of-inotify-watches-with-linux
# based on unison error, with 8192 from
# sysctl -a | grep fs.inotify.max_user_watches
#http://stackoverflow.com/questions/535768/what-is-a-reasonable-amount-of-inotify-watches-with-linux
-echo "fs.inotify.max_user_watches = 1000000" >> $target/etc/sysctl.d/99-sysctl.conf
+
+f=$target/etc/sysctl.d/99-sysctl.conf
+key=fs.inotify.max_user_watches
+if [[ -e $f ]]; then sed -ri "/^\s*$key\s*=/d" $f; fi
+echo "fs.inotify.max_user_watches = 1000000" >> $f
# if we weren't rebooting, you could apply it now with:
# sysctl --system
# if we weren't rebooting, you could apply it now with:
# sysctl --system
-echo 'ian ALL=(ALL) NOPASSWD: ALL' >> $target/etc/sudoers
+f=$target/etc/sudoers
+line='ian ALL=(ALL) NOPASSWD: ALL'
+if [[ ! -e $f ]] || ! grep -xF "$line" $f; then
+ echo "$line" >> $f
+fi
dir=/q/p/c/machine_specific/$HOSTNAME/.unison
$ROOTCMD mkdir -p $dir
$ROOTCMD rm -rf /root/.unison
dir=/q/p/c/machine_specific/$HOSTNAME/.unison
$ROOTCMD mkdir -p $dir
$ROOTCMD rm -rf /root/.unison
-$ROOTCMD ln -s $dir /root
-$ROOTCMD ln -s /q/p /
+$ROOTCMD ln -s
f
$dir /root
+$ROOTCMD ln -s
f
/q/p /
while true; do
$ROOTCMD chown 1000:1000 $dir
while true; do
$ROOTCMD chown 1000:1000 $dir
@@
-32,4
+40,4
@@
done
# kvm is normally created by some package,
# but unison doesn't like unknown groups, so make it now so initial sync works.
# kvm is normally created by some package,
# but unison doesn't like unknown groups, so make it now so initial sync works.
-$ROOTCMD groupadd
kvm
+$ROOTCMD groupadd
-r kvm || [[ $? == 9 ]]