public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
* [git.ipfire.org] IPFire 2.x development tree branch, next, updated. ae0abec969ad78675e2f9f6340e2137f599e3a43
@ 2026-07-24  7:40 Arne Fitzenreiter
  0 siblings, 0 replies; only message in thread
From: Arne Fitzenreiter @ 2026-07-24  7:40 UTC (permalink / raw)
  To: ipfire-scm

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".

The branch, next has been updated
       via  ae0abec969ad78675e2f9f6340e2137f599e3a43 (commit)
      from  bba1a0a8b1141675ae463e8138b256a1f635c2ce (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ae0abec969ad78675e2f9f6340e2137f599e3a43
Author: Arne Fitzenreiter <arne_f@ipfire.org>
Date:   Fri Jul 24 09:35:55 2026 +0200

    make.sh: reimplement usr ramdisk for /usr/src
    
    this save around 30GB writes per build.
    It is automatic enabled if the system has more than 10GB ram installed
    and can enforces if there more than 6GB installed by setting
    RAMDISK=on in .config
    It can also diabled via RAMDISK=off
    this is needed if you want extract changed file from build environment
    if an other shell.
    
    Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>

-----------------------------------------------------------------------

Summary of changes:
 make.sh | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 72 insertions(+), 10 deletions(-)

Difference in files:
diff --git a/make.sh b/make.sh
index dfde840c2..6dffeac5c 100755
--- a/make.sh
+++ b/make.sh
@@ -270,6 +270,24 @@ print_build_summary() {
 	print_status DONE
 }
 
+cleanrd() {
+	if mountpoint "${BUILD_DIR}/usr/src" > /dev/null ; then
+		print_line "Unmount /usr/src ramdisk ..."
+		umount "${BUILD_DIR}/usr/src/cache"
+		umount "${BUILD_DIR}/usr/src/ccache"
+		umount "${BUILD_DIR}/usr/src/config"
+		umount "${BUILD_DIR}/usr/src/doc"
+		umount "${BUILD_DIR}/usr/src/html"
+		umount "${BUILD_DIR}/usr/src/images"
+		umount "${BUILD_DIR}/usr/src/langs"
+		umount "${BUILD_DIR}/usr/src/log"
+		umount "${BUILD_DIR}/usr/src/lfs"
+		umount "${BUILD_DIR}/usr/src/src"
+		umount "${BUILD_DIR}/usr/src"
+		print_status DONE
+	fi
+}
+
 exiterror() {
 	# Dump logfile
 	if [ -n "${LOGFILE}" ] && [ -e "${LOGFILE}" ]; then
@@ -289,6 +307,8 @@ exiterror() {
 		print_status FAIL
 	done
 
+	cleanrd
+
 	exit 1
 }
 
@@ -373,16 +393,6 @@ prepareenv() {
 	mkdir -p "${BUILD_DIR}/sys"
 	mkdir -p "${BUILD_DIR}/tmp"
 	mkdir -p "${BUILD_DIR}/usr/src"
-	mkdir -p "${BUILD_DIR}/usr/src/cache"
-	mkdir -p "${BUILD_DIR}/usr/src/ccache"
-	mkdir -p "${BUILD_DIR}/usr/src/config"
-	mkdir -p "${BUILD_DIR}/usr/src/doc"
-	mkdir -p "${BUILD_DIR}/usr/src/html"
-	mkdir -p "${BUILD_DIR}/usr/src/images"
-	mkdir -p "${BUILD_DIR}/usr/src/langs"
-	mkdir -p "${BUILD_DIR}/usr/src/lfs"
-	mkdir -p "${BUILD_DIR}/usr/src/log"
-	mkdir -p "${BUILD_DIR}/usr/src/src"
 
 	# Make BUILD_DIR a mountpoint
 	mount -o bind "${BUILD_DIR}" "${BUILD_DIR}"
@@ -407,6 +417,26 @@ prepareenv() {
 	mkdir -p "${BUILD_DIR}/proc"
 	mount --bind "${BUILD_DIR}/proc" "${BUILD_DIR}/proc"
 
+	# Optionally make /usr/src a ramdisk for less disk I/O
+	if [ "${ENABLE_RAMDISK}" = "on" ]; then
+		print_line "Mounting /usr/src Ramdisk ..."
+		mount build_usr_src "${BUILD_DIR}/usr/src" \
+			-t tmpfs -o size=8G,nr_inodes=1M,mode=1777
+		print_status DONE
+	fi
+
+	# Create directories in /usr/src
+	mkdir -p "${BUILD_DIR}/usr/src/cache"
+	mkdir -p "${BUILD_DIR}/usr/src/ccache"
+	mkdir -p "${BUILD_DIR}/usr/src/config"
+	mkdir -p "${BUILD_DIR}/usr/src/doc"
+	mkdir -p "${BUILD_DIR}/usr/src/html"
+	mkdir -p "${BUILD_DIR}/usr/src/images"
+	mkdir -p "${BUILD_DIR}/usr/src/langs"
+	mkdir -p "${BUILD_DIR}/usr/src/lfs"
+	mkdir -p "${BUILD_DIR}/usr/src/log"
+	mkdir -p "${BUILD_DIR}/usr/src/src"
+
 	# Make all sources and proc available under lfs build
 	mount --bind     	/sys					"${BUILD_DIR}/sys"
 	mount --bind -o ro	"${BASEDIR}/cache"		"${BUILD_DIR}/usr/src/cache"
@@ -2349,11 +2379,21 @@ SYSTEM_MEMORY="$(system_memory)"
 BUILD_ARCH="${HOST_ARCH}"
 CCACHE_CACHE_SIZE="4G"
 
+# Auto use ramdisk the host system more than 10GB of RAM or more
+if [ ${SYSTEM_MEMORY} -ge 10240 ]; then
+	ENABLE_RAMDISK="on"
+fi
+
 # Load configuration file
 if [ -f .config ]; then
 	source .config
 fi
 
+# Disable even enforced ramdisk if the system has less than 6GB of RAM
+if [ ${SYSTEM_MEMORY} -lt 6200 ]; then
+	ENABLE_RAMDISK="off"
+fi
+
 # Parse any command line options (not commands)
 while [ $# -gt 0 ]; do
 	case "${1}" in
@@ -2475,6 +2515,23 @@ BUILDTARGET="${BUILD_ARCH}-pc-linux-gnu"
 # Use this as default PARALLELISM
 DEFAULT_PARALLELISM="${SYSTEM_PROCESSORS}"
 
+# Unpacked and Compiled kernel needs 4300GB on Ramdisk
+# and one thread around 850MB Ram
+if [ "${ENABLE_RAMDISK}" = "on" ]; then
+	if [ $DEFAULT_PARALLELISM -gt $(((${SYSTEM_MEMORY}-4500)/850)) ]; then
+		DEFAULT_PARALLELISM=$(((${SYSTEM_MEMORY}-4500)/850))
+	fi
+else
+	if [ $DEFAULT_PARALLELISM -gt $((${SYSTEM_MEMORY}/850)) ]; then
+		DEFAULT_PARALLELISM=$((${SYSTEM_MEMORY}/850))
+	fi
+fi
+
+if [ $DEFAULT_PARALLELISM -lt 1 ]; then
+	DEFAULT_PARALLELISM=1
+fi
+
+
 # Limit lauched ninja build jobs to computed parallel value
 NINJAJOBS="${DEFAULT_PARALLELISM}"
 
@@ -2557,6 +2614,9 @@ build)
 	check_changed_rootfiles
 
 	print_build_summary $(( SECONDS - START_TIME ))
+
+	cleanrd
+
 	;;
 tail)
 	tail -F \
@@ -2573,6 +2633,7 @@ shell)
 	# may be used to changed kernel settings
 	prepareenv --network
 	entershell
+	cleanrd
 	;;
 check)
 	# Check for rootfile consistency
@@ -2624,6 +2685,7 @@ toolchain)
 	if ! compress_toolchain "${TOOLCHAIN}"; then
 		exiterror "Could not compress toolchain"
 	fi
+	cleanrd
 	;;
 
 gettoolchain)


hooks/post-receive
--
IPFire 2.x development tree


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-24  7:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-24  7:40 [git.ipfire.org] IPFire 2.x development tree branch, next, updated. ae0abec969ad78675e2f9f6340e2137f599e3a43 Arne Fitzenreiter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox