Skip to content

Commit

Permalink
build.sh: move block for outputdir and enable debug
Browse files Browse the repository at this point in the history
move outputdir-commands below ARCH-assignment to run make mrproper
enable debug because wifi-driver is not compileable with builddir set
(header-files not found)
  • Loading branch information
frank-w committed Oct 26, 2019
1 parent 8f2f0b9 commit 41b8722
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions build.sh
Expand Up @@ -15,24 +15,6 @@ kernver=$(make kernelversion | grep -v 'make')

DOTCONFIG=".config"

if [[ "$builddir" != "" ]];
then
mkdir -p $builddir
if [[ ! "$builddir" =~ ^/ ]];then
#make it absolute
builddir=$(realpath $(pwd)"/"$builddir)
# echo "absolute: $builddir"
fi
mount | grep '\s'$builddir'\s' &>/dev/null #$?=0 found;1 not found
if [[ $? -ne 0 ]];then
echo "mounting tmpfs for building..."
sudo mount -t tmpfs -o size=2G none $builddir
fi

DOTCONFIG="$builddir/$DOTCONFIG"
export KBUILD_OUTPUT=$builddir
fi

clr_red=$'\e[1;31m'
clr_green=$'\e[1;32m'
clr_yellow=$'\e[1;33m'
Expand All @@ -58,6 +40,25 @@ if [[ -z $(cat /proc/cpuinfo | grep -i 'model name.*ArmV7') ]]; then #check need
crosscompile=1
fi;

if [[ "$builddir" != "" ]];
then
mkdir -p $builddir
if [[ ! "$builddir" =~ ^/ ]];then
#make it absolute
builddir=$(realpath $(pwd)"/"$builddir)
# echo "absolute: $builddir"
fi
mount | grep '\s'$builddir'\s' &>/dev/null #$?=0 found;1 not found
if [[ $? -ne 0 ]];then
echo "mounting tmpfs for building..."
sudo mount -t tmpfs -o size=2G none $builddir
make mrproper
fi

DOTCONFIG="$builddir/$DOTCONFIG"
export KBUILD_OUTPUT=$builddir
fi

#Check Dependencies

function check_dep()
Expand Down Expand Up @@ -480,7 +481,7 @@ function build {

exec 3> >(tee build.log)
export LOCALVERSION="${gitbranch}"
make ${CFLAGS} 2>&3 #&& make modules_install 2>&3
make V=1 ${CFLAGS} 2>&3 #&& make modules_install 2>&3
ret=$?
exec 3>&-

Expand Down

0 comments on commit 41b8722

Please sign in to comment.