summaryrefslogtreecommitdiffstats
path: root/core/includes
diff options
context:
space:
mode:
authorSimon Rettberg2021-10-26 09:58:26 +0200
committerYour Name2021-10-26 09:58:26 +0200
commitdf644608f0532d79e069652782f22da6ce9e693a (patch)
tree38d3657a942b251342e823ed25ddb43a2e907b29 /core/includes
parentmltk: Require zstd (diff)
downloadmltk-df644608f0532d79e069652782f22da6ce9e693a.tar.gz
mltk-df644608f0532d79e069652782f22da6ce9e693a.tar.xz
mltk-df644608f0532d79e069652782f22da6ce9e693a.zip
Add CONFIG_NFS_CACHE global option, use for kernel
This adds the possibility to cache the built kernel on an NFS share for later re-use.
Diffstat (limited to 'core/includes')
-rw-r--r--core/includes/paths.inc15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/includes/paths.inc b/core/includes/paths.inc
index 29016598..18b2ba76 100644
--- a/core/includes/paths.inc
+++ b/core/includes/paths.inc
@@ -30,3 +30,18 @@ __init () {
pdebug "System lib paths: $SYS_LIB_PATHS"
}
+nfs_cache_avail () {
+ [ -z "$CONFIG_NFS_CACHE" ] && return 1
+ NFS_CACHE_DIR="${ROOT_DIR}/tmp/nfscache"
+ mountpoint "$NFS_CACHE_DIR" && return 0
+ pinfo "Trying to mount NFS cache"
+ mkdir -p "$NFS_CACHE_DIR" || perror "Could not mkdir $NFS_CACHE_DIR"
+ if mount -v -o rw,async,nolock,soft,timeo=300,fg,retry=0 "$CONFIG_NFS_CACHE" "$NFS_CACHE_DIR"; then
+ pinfo "Mounted NFS build cache"
+ return 0
+ fi
+ pwarning "Error mounting NFS build cache. Caching not enabled"
+ CONFIG_NFS_CACHE=
+ NFS_CACHE_DIR=
+ return 1
+}