Fix env config checks, allow building in local dir
This commit is contained in:
parent
3c4df47ad1
commit
69249c8a74
1 changed files with 12 additions and 1 deletions
13
buildtool.sh
13
buildtool.sh
|
@ -69,7 +69,7 @@ fi
|
|||
# shellcheck disable=SC1091
|
||||
source "/etc/os-release"
|
||||
if [ "${NAME}" != "Arch Linux" ] || [ "${PRETTY_NAME}" != "Arch Linux" ] || [ "${ID}" != "arch" ]; then
|
||||
if [ "${BUILDTOOL_COMPILE_NONARCH}" != "true" ]; then
|
||||
if [ -z "${BUILDTOOL_COMPILE_NONARCH}" ]; then
|
||||
errorh "Not running on Arch Linux"
|
||||
errore "This kernel can only compile on Arch Linux"
|
||||
errore "If you are sure that you want to compile this kernel on other distributions"
|
||||
|
@ -123,6 +123,11 @@ function ask_cpupower() {
|
|||
}
|
||||
## Ask for building in tmpfs
|
||||
function ask_tmpfs() {
|
||||
if [ -n "${BUILDTOOL_LOCALDIR}" ]; then
|
||||
warnh "Skipped ask_tmpfs, building in local directory instead (\$BUILDTOOL_LOCALDIR is set)"
|
||||
export "BUILDTOOL_CLONEDIR=$(pwd)"
|
||||
return
|
||||
fi
|
||||
read -rp "$(infoh "Do you want to build in a tmpfs (improves build performance, protects your disk from wearing out faster, ~32 GiB memory required) [Y/n]? ")" BUILDTOOL_TMPFS
|
||||
case "${BUILDTOOL_TMPFS}" in
|
||||
"y"|"Y"|"")
|
||||
|
@ -291,6 +296,12 @@ function ask_debug() {
|
|||
}
|
||||
## Ask for clone directory conflict resolution (includes check)
|
||||
function ask_clonedir_conflictresolution() {
|
||||
if [ -n "${BUILDTOOL_LOCALDIR}" ]; then
|
||||
warnh "Skipped conflict resolution (\$BUILDTOOL_LOCALDIR is set)"
|
||||
export "BUILDTOOL_CLONEDIR_CONFLICT=r"
|
||||
export "BUILDTOOL_MAKEPKG_REUSE= --noextract --force"
|
||||
return
|
||||
fi
|
||||
if [ ! -d "${BUILDTOOL_CLONEDIR}" ] && [ ! -L "${BUILDTOOL_CLONEDIR}" ]; then
|
||||
return
|
||||
elif [ -a "${BUILDTOOL_CLONEDIR}" ] && [ ! -d "${BUILDTOOL_CLONEDIR}" ] && [ ! -L "${BUILDTOOL_CLONEDIR}" ]; then
|
||||
|
|
Reference in a new issue