Handle existing source dir in tmpfs - That's actually safe to do thanks to @AdelKS 's fine work.

Following 348f3c9bb6
This commit is contained in:
Tk-Glitch
2022-12-21 22:02:54 +01:00
parent 348f3c9bb6
commit 1854907001

View File

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