diff --git a/config/buildroot.yaml b/config/buildroot.yaml index 555c2d24bbc8c96c157e810275ef6b97cdbdc471..1e681c06c723e3ce690201e2727bd15b05d258f2 100644 --- a/config/buildroot.yaml +++ b/config/buildroot.yaml @@ -30,8 +30,21 @@ build: # Finalize the config. - make BR2_JLEVEL=${param:jobs} O=${param:builddir} olddefconfig + # Fakeroot takes a while to start when the file descriptor limit is high. + # Reduce it to significantly accelerate the build. + # - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=920913 + # - https://github.com/moby/moby/issues/45436 + - saved_limit=$$(ulimit -S -n) + - new_limit=4096 + - if [ "$$new_limit" -lt "$$saved_limit" ]; then + - ulimit -S -n "$$new_limit" + - fi + # Build. - make BR2_JLEVEL=${param:jobs} O=${param:builddir} + # Restore the previous file limit + - ulimit -S -n "$$saved_limit" + artifacts: BUILDROOT: ${param:builddir}/images/rootfs.ext2