scripts/m0: fix sudo requirement for make/rebuild
sudo should not be required for make/rebuild commands.
@@ -44,10 +44,12 @@ SUDO="${SUDO-sudo -E}" # the absence of ':' is important
# Increase the maximum number of memory map areas a process may have.
# m0d process may allocate and madvise() at least 2,000,000 memory map areas.
# See MOTR-2171 for more details.
+incr_mmap() {
# In WSL /proc/sys/vm/max_map_count is absent. See EOS-7296 for details.
if [ -f /proc/sys/vm/max_map_count ]; then
$SUDO sysctl -q -w vm.max_map_count=30000000
fi
+}
die() { echo "$@" >&2; exit 1; }
@@ -87,6 +89,7 @@ _time() {
}
rundir_init() {
+ incr_mmap
$SUDO rm -rf "$RUNDIR" # Ouch!
$SUDO mkdir -m 0777 -p "$RUNDIR"
cd "$RUNDIR"
