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.
This commit is contained in:
Tk-Glitch
2022-12-21 21:52:07 +01:00
parent 9948b85dac
commit 348f3c9bb6
2 changed files with 11 additions and 2 deletions

View File

@@ -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"

View File

@@ -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"
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