makechrootpkg: make /tmp inside nspawn larger
systemd by default limits the /tmp folder to be 10% of the host memory:
6f2cea06bf/src/shared/mount-util.h (L33)
This is problematic to our builds because many toolchains opt to put
build artifacts in /tmp, and expecting the host memory to be 10 times
larger is not optimal or even realistic sometimes.
This MR attempts to enlarge it to 50% memory as the host machine's
default value of /tmp. This should be a fair compromise between being
overly conservative and taking up too much memory to crash the system.
This commit is contained in:
parent
f870ab6864
commit
112026580d
|
@ -24,6 +24,7 @@ clean_first=0
|
|||
run_namcap=0
|
||||
run_checkpkg=0
|
||||
temp_chroot=0
|
||||
tmp_opts="nosuid,nodev,size=50%,nr_inodes=2m"
|
||||
|
||||
bindmounts_ro=()
|
||||
bindmounts_rw=()
|
||||
|
@ -365,6 +366,7 @@ prepare_chroot
|
|||
if arch-nspawn "$copydir" \
|
||||
--bind="${PWD//:/\\:}:/startdir" \
|
||||
--bind="${SRCDEST//:/\\:}:/srcdest" \
|
||||
--tmpfs="/tmp:${tmp_opts}" \
|
||||
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
||||
/chrootbuild "${makepkg_args[@]}"
|
||||
then
|
||||
|
|
Loading…
Reference in New Issue