Always create a subfolder for source and work directories with hardcoded names (linux-src-git and linux-kernel.git for source and work dirs respectively). If an absolute path is used, create a linux-tkg subdir to contain those. This allows using the same root path for both as well as defaulting to an empty value that mimics our previous behavior. The main motivation for this is to offer more safety as using an existing non-empty dir might result in unwanted behavior.
Fixes https://github.com/Frogging-Family/linux-tkg/issues/685
This commit is contained in:
@@ -23,17 +23,19 @@ _NUKR="true"
|
||||
# Git mirror to use to get the kernel sources, possible values are "kernel.org", "googlesource.com", "github.com" and "torvalds"
|
||||
_git_mirror="kernel.org"
|
||||
|
||||
# Folder where to checkout the kernel sources and build inside it
|
||||
# Note: - Start with a '/' for an absolute path
|
||||
# Root folder where to checkout the kernel sources (linux-src-git subdir) and build
|
||||
# Note: - Leave empty to use PKGBUILD's dir
|
||||
# - Start with a '/' for an absolute path in which `linux-tkg/linux-src-git/` will be created
|
||||
# - This setting can be used to set the work/build folder to a tmpfs folder
|
||||
# - Requires >= 32GB ram when building a full kernel, should work with less ram with modprobed-db
|
||||
_kernel_work_folder="linux-src-git"
|
||||
_kernel_work_folder=""
|
||||
|
||||
# Permanent folder where to keep the git clone and fetch new blobs
|
||||
# Note: - Start with a '/' for an absolute path
|
||||
# Permanent root folder where to keep the git clone (linux-kernel.git subdir) and fetch new blobs
|
||||
# Note: - Leave empty to use PKGBUILD's dir
|
||||
# - Start with a '/' for an absolute path in which `linux-tkg/linux-kernel.git/` will be created
|
||||
# - If your internet is faster than your storage, it may be wise to put this folder
|
||||
# in a tmpfs location (although it will reclone after each restart / tmpfs folder cleanup)
|
||||
_kernel_source_folder="linux-kernel.git"
|
||||
_kernel_source_folder=""
|
||||
|
||||
# Custom compiler root dirs - Leave empty to use system compilers
|
||||
# Example: CUSTOM_GCC_PATH="/home/frog/PKGBUILDS/mostlyportable-gcc/gcc-mostlyportable-9.2.0"
|
||||
|
@@ -383,14 +383,14 @@ _set_compiler(){
|
||||
|
||||
_define_kernel_abs_paths() {
|
||||
|
||||
_kernel_work_folder_abs="$_kernel_work_folder"
|
||||
if ! [[ "$_kernel_work_folder" == /* ]]; then
|
||||
_kernel_work_folder_abs="$_where/$_kernel_work_folder"
|
||||
_kernel_work_folder_abs="$_where/$_kernel_work_folder/linux-src-git"
|
||||
if [[ "$_kernel_work_folder" == /* ]]; then
|
||||
_kernel_work_folder_abs="$_kernel_work_folder/linux-tkg/linux-src-git"
|
||||
fi
|
||||
|
||||
_kernel_source_folder_abs="$_kernel_source_folder"
|
||||
if ! [[ "$_kernel_source_folder" == /* ]]; then
|
||||
_kernel_source_folder_abs="$_where/$_kernel_source_folder"
|
||||
_kernel_source_folder_abs="$_where/$_kernel_source_folder/linux-kernel.git"
|
||||
if [[ "$_kernel_source_folder" == /* ]]; then
|
||||
_kernel_source_folder_abs="$_kernel_source_folder/linux-tkg/linux-kernel.git"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -399,11 +399,6 @@ _setup_kernel_work_folder() {
|
||||
|
||||
_define_kernel_abs_paths
|
||||
|
||||
if [ "$_kernel_source_folder_abs" == "$_kernel_work_folder_abs" ]; then
|
||||
warning "The kernel source folder cannot be the same as the kernel work folder"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$_kernel_git_tag" ]; then
|
||||
warning "internal error: kernel version should be chosen before cloning kernel sources"
|
||||
exit 1
|
||||
|
Reference in New Issue
Block a user