From 348f3c9bb6d000c31cfd1f0d037f7e5d901a15cc Mon Sep 17 00:00:00 2001 From: Tk-Glitch Date: Wed, 21 Dec 2022 21:52:07 +0100 Subject: [PATCH] Add an option to clone the source in tmpfs everytime instead of using the root PKGBUILD dir. This effectively brings back a similar approach to makepkg in the way of handling git sources. It'll require ~20GB of space by itself, so if your tmpfs is in RAM, make sure you have enough free, and it's definitely not recommended to use this on a <32GB RAM machine. --- customization.cfg | 4 ++++ linux-tkg-config/prepare | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/customization.cfg b/customization.cfg index 6e89dc8..23351af 100644 --- a/customization.cfg +++ b/customization.cfg @@ -57,6 +57,10 @@ _diffconfig_name="" # [install.sh specific] Use tmpfs as a work directory, recommended when RAM >= 32GB to reduce HDD/SSD usage. For more information, see https://wiki.archlinux.org/title/Tmpfs _use_tmpfs="false" +# Always make a fresh clone of the source in tmpfs to speed up compilation times +# ! This will take ~20GB of RAM by itself, so don't use on <32GB RAM systems ! +_source_in_tmpfs="false" + # [install.sh specific] tmpfs folder path, only used when _use_tmpfs="true". # Creates a linux-tkg work folder within that pathmake sure to have nothing important in "$_tmpfs_path/linux-tkg" _tmpfs_path="/tmp" diff --git a/linux-tkg-config/prepare b/linux-tkg-config/prepare index 9a355d4..8b94c9f 100644 --- a/linux-tkg-config/prepare +++ b/linux-tkg-config/prepare @@ -390,9 +390,14 @@ _linux_git_branch_checkout() { cd "$_where" - if ! [ -d linux-src-git ]; then + if ! [ -d linux-src-git ] || [ "$_source_in_tmpfs" = "true" ]; then msg2 "First initialization of the linux source code git folder" - mkdir linux-src-git + if [ "$_source_in_tmpfs" = "true" ]; then + rm -rf "/tmp/linux-src-git" && mkdir "/tmp/linux-src-git" + ln -s "/tmp/linux-src-git" "${_where}" + else + mkdir linux-src-git + fi cd linux-src-git git init