From 1854907001a2a62b039beb91a3bce787d76a6a74 Mon Sep 17 00:00:00 2001 From: Tk-Glitch Date: Wed, 21 Dec 2022 22:02:54 +0100 Subject: [PATCH] Handle existing source dir in tmpfs - That's actually safe to do thanks to @AdelKS 's fine work. Following 348f3c9bb6d000c31cfd1f0d037f7e5d901a15cc --- linux-tkg-config/prepare | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/linux-tkg-config/prepare b/linux-tkg-config/prepare index 8b94c9f..954b791 100644 --- a/linux-tkg-config/prepare +++ b/linux-tkg-config/prepare @@ -390,9 +390,10 @@ _linux_git_branch_checkout() { cd "$_where" - if ! [ -d linux-src-git ] || [ "$_source_in_tmpfs" = "true" ]; then + if ! [ -d linux-src-git ] || ( [ "$_source_in_tmpfs" = "true" ] && ! [ -d /tmp/linux-src-git ] ); then msg2 "First initialization of the linux source code git folder" if [ "$_source_in_tmpfs" = "true" ]; then + rm -rf "${_where}/linux-src-git" rm -rf "/tmp/linux-src-git" && mkdir "/tmp/linux-src-git" ln -s "/tmp/linux-src-git" "${_where}" else @@ -405,6 +406,11 @@ _linux_git_branch_checkout() { git remote add "$remote" "${_kernel_git_remotes[$remote]}" done else + if [ "$_source_in_tmpfs" = "true" ]; then + rm -rf "${_where}/linux-src-git" + ln -s "/tmp/linux-src-git" "${_where}" + fi + cd linux-src-git # Remove "origin" remote if present