BRANCH problem fixed and some clean up

This commit is contained in:
Igor Pečovnik 2015-12-09 14:39:27 +01:00
parent 98031a50cb
commit a3aa5e4046

View file

@ -155,45 +155,50 @@ compile_sunxi_tools (){
compile_kernel (){ compile_kernel (){
#-------------------------------------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------------------------------------
# Compile kernel # Compile kernel
#-------------------------------------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------------------------------------
display_alert "Compiling kernel" "@host" "info"
sleep 2
if [ -d "$SOURCES/$LINUXSOURCEDIR" ]; then if [ -d "$SOURCES/$LINUXSOURCEDIR" ]; then
cd $SOURCES/$LINUXSOURCEDIR/ local branch="${BRANCH//default/}"
# delete previous creations [[ -n "$branch" ]] && branch="-"$branch
# adding custom firmware to kernel source # read kernel version to variable $VER
if [[ -n "$FIRMWARE" ]]; then unzip -o $SRC/lib/$FIRMWARE -d $SOURCES/$LINUXSOURCEDIR/firmware; fi grab_version "$SOURCES/$LINUXSOURCEDIR"
# use proven config display_alert "Compiling kernel" "@host" "info"
if [ "$KERNEL_KEEP_CONFIG" != "yes" ] || [ ! -f $SOURCES/$LINUXSOURCEDIR/.config ]; then cp $SRC/lib/config/$LINUXCONFIG.config $SOURCES/$LINUXSOURCEDIR/.config; fi cd $SOURCES/$LINUXSOURCEDIR/
# hacks for banana # adding custom firmware to kernel source
if [[ $BOARD == banana* || $BOARD == orangepi* || $BOARD == lamobo* ]] ; then if [[ -n "$FIRMWARE" ]]; then unzip -o $SRC/lib/$FIRMWARE -d $SOURCES/$LINUXSOURCEDIR/firmware; fi
sed -i 's/CONFIG_GMAC_CLK_SYS=y/CONFIG_GMAC_CLK_SYS=y\nCONFIG_GMAC_FOR_BANANAPI=y/g' .config
fi
# hack for deb builder. To pack what's missing in headers pack. # use proven config
cp $SRC/lib/patch/misc/headers-debian-byteshift.patch /tmp if [ "$KERNEL_KEEP_CONFIG" != "yes" ] || [ ! -f $SOURCES/$LINUXSOURCEDIR/.config ]; then
cp $SRC/lib/config/$LINUXCONFIG.config $SOURCES/$LINUXSOURCEDIR/.config;
fi
export LOCALVERSION="-"$LINUXFAMILY # hacks for banana family
if [[ $LINUXFAMILY == "banana" ]] ; then
sed -i 's/CONFIG_GMAC_CLK_SYS=y/CONFIG_GMAC_CLK_SYS=y\nCONFIG_GMAC_FOR_BANANAPI=y/g' .config
fi
# this way of compilation is much faster. We can use multi threading here but not later # hack for deb builder. To pack what's missing in headers pack.
if [ "$KERNEL_CONFIGURE" != "yes" ]; then cp $SRC/lib/patch/misc/headers-debian-byteshift.patch /tmp
export LOCALVERSION="-"$LINUXFAMILY
# We can use multi threading here but not later since it's not working. This way of compilation is much faster.
if [ "$KERNEL_CONFIGURE" != "yes" ]; then
if [ "$BRANCH" = "default" ]; then if [ "$BRANCH" = "default" ]; then
make $CTHREADS ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- silentoldconfig make $CTHREADS ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- silentoldconfig
else else
make $CTHREADS ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- olddefconfig make $CTHREADS ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- olddefconfig
fi fi
else else
make $CTHREADS ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- oldconfig make $CTHREADS ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- oldconfig
fi make $CTHREADS ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
fi
if [ "$KERNEL_CONFIGURE" = "yes" ]; then make $CTHREADS ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig; fi
eval 'make $CTHREADS ARCH=arm CROSS_COMPILE="$CCACHE arm-linux-gnueabihf-" zImage modules 2>&1' \ eval 'make $CTHREADS ARCH=arm CROSS_COMPILE="$CCACHE arm-linux-gnueabihf-" zImage modules 2>&1' \
${USE_DIALOG_LOGGING:+' | tee -a $DEST/debug/compilation.log'} ${USE_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Compiling kernel..." 20 80'} ${USE_DIALOG_LOGGING:+' | tee -a $DEST/debug/compilation.log'} ${USE_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Compiling kernel..." 20 80'}
@ -211,12 +216,6 @@ if [ ${PIPESTATUS[0]} -ne 0 ]; then
fi fi
if [[ $BRANCH == "next" ]] ; then
KERNEL_BRACH="-next"
else
KERNEL_BRACH=""
fi
# different packaging for 4.3+ // probably temporaly soution # different packaging for 4.3+ // probably temporaly soution
KERNEL_PACKING="deb-pkg" KERNEL_PACKING="deb-pkg"
IFS='.' read -a array <<< "$VER" IFS='.' read -a array <<< "$VER"
@ -231,7 +230,7 @@ DEBEMAIL="$MAINTAINERMAIL" CROSS_COMPILE="$CCACHE arm-linux-gnueabihf-" 2>&1 | d
# we need a name # we need a name
CHOOSEN_KERNEL=linux-image"$KERNEL_BRACH"-"$CONFIG_LOCALVERSION$LINUXFAMILY"_"$REVISION"_armhf.deb CHOOSEN_KERNEL=linux-image"$branch"-"$CONFIG_LOCALVERSION$LINUXFAMILY"_"$REVISION"_armhf.deb
cd .. cd ..
mv *.deb $DEST/debs/ || exit mv *.deb $DEST/debs/ || exit
else else