rk: add pack-kernel-rk30.sh and pack-kernel-common.sh
author黄涛 <huangtao@rock-chips.com>
Thu, 5 Apr 2012 07:59:16 +0000 (15:59 +0800)
committer黄涛 <huangtao@rock-chips.com>
Thu, 5 Apr 2012 07:59:16 +0000 (15:59 +0800)
pack-kernel-common.sh [new file with mode: 0755]
pack-kernel-rk29.sh
pack-kernel-rk30.sh [new file with mode: 0755]

diff --git a/pack-kernel-common.sh b/pack-kernel-common.sh
new file mode 100755 (executable)
index 0000000..723788e
--- /dev/null
@@ -0,0 +1,95 @@
+#!/bin/bash
+set -e
+
+# ---------------------------------------------------------------------------
+usage() {
+       echo usage: $0 kerneldir defconfig
+       echo example: $0 . rk29_ddr3sdk_defconfig
+       exit
+}
+
+while getopts "h" options; do
+  case $options in
+    h ) usage;;
+  esac
+done
+# ---------------------------------------------------------------------------
+
+# ---------------------------------------------------------------------------
+kerndir=${1-.}
+kerndir=$(cd $kerndir; pwd)    # get absolute path
+[ -d $kerndir ] || usage
+
+if [ "$defconfig" = ".config" ]; then
+       [ -f $kerndir/.config ] || usage
+else
+       [ -f $kerndir/arch/arm/configs/$defconfig ] || usage
+fi
+# ---------------------------------------------------------------------------
+
+# make .uu
+pushd $kerndir >/dev/null
+
+declare -a files
+
+for file in ${FILES[@]}; do
+       [ -e ${file} ] && files=( ${files[@]} ${file} ) || echo No such file: ${file}
+       [ -f ${file/.[cS]/.uu} ] && rm -f ${file/.[cS]/.uu}
+done
+
+for d in ${DIRS[@]}; do
+       [ -d $d ] && find $d -type f -name '*.uu' -print0 | xargs -0 rm -f
+done
+
+echo build kernel on $kerndir with $defconfig
+make clean >/dev/null 2>&1
+make $defconfig >/dev/null 2>&1
+make -j`grep 'processor' /proc/cpuinfo | wc -l` ${files[@]/.[cS]/.o} ${DIRS[@]}
+
+for file in ${FILES[@]}; do
+       filename=${file##*/} 
+       base=${filename%%.*}
+       dir=${file%/*}
+       [ -f $dir/$base.o ] && echo UU $dir/$base.uu && uuencode $dir/$base.o $base.o > $dir/$base.uu
+done
+
+for d in ${DIRS[@]}; do
+       for file in `find $d -type f -name '*.o'`; do
+               filename=${file##*/} 
+               base=${filename%%.*}
+               dir=${file%/*}
+               echo UU $dir/$base.uu && uuencode $dir/$base.o $base.o > $dir/$base.uu
+       done
+done
+
+make distclean >/dev/null 2>&1
+
+popd >/dev/null
+
+# fix local version
+echo "+" > $kerndir/.scmversion
+
+# tar kernel
+pushd $kerndir/../ >/dev/null
+package=$(basename $kerndir).tar
+ex=$package.ex
+> $ex
+for file in ${FILES[@]}; do
+       echo "$file" >> $ex
+done
+for file in ${EXCLUDES[@]}; do
+       echo "$file" >> $ex
+done
+echo TAR $(pwd)/$package
+tar cf $package --numeric-owner --exclude-from $ex --exclude=.git $(basename $kerndir)
+tar rf $package --numeric-owner --exclude=.git prebuilt/linux-x86/toolchain/arm-eabi-4.4.0
+echo GZIP $(pwd)/$package.gz
+gzip -9 -c $package > $package.gz
+rm $ex
+popd >/dev/null
+
+rm -f $kerndir/.scmversion
+
+echo done
+
+
index f7835b01b2a1051dacd3c3dc1e0542e9a3cf1d71..3fd38d88b3e424b3ee8f64d89bf1c8e4ed968a4a 100755 (executable)
@@ -11,6 +11,12 @@ arch/arm/mach-rk29/verifyID.c
 arch/arm/plat-rk/vpu*.c
 
 #drivers/staging/rk29/ipp/rk29-ipp.c
+
+# exclude drivers/net/wireless/rkwifi/fw_path.c
+drivers/net/wireless/rkwifi/[abcdeghijklmnopqrstuvwxyz]*.c
+)
+
+DIRS=(
 )
 
 EXCLUDES=(
@@ -73,96 +79,5 @@ arch/arm/mach-rk29/board-rk29-z5*
 arch/arm/configs/rk29_z5_defconfig
 )
 
-# ---------------------------------------------------------------------------
-usage() {
-       echo usage: $0 kerneldir defconfig
-       echo example: $0 . rk29_ddr3sdk_defconfig
-       exit
-}
-
-while getopts "h" options; do
-  case $options in
-    h ) usage;;
-  esac
-done
-# ---------------------------------------------------------------------------
-
-# ---------------------------------------------------------------------------
-kerndir=${1-.}
-kerndir=$(cd $kerndir; pwd)    # get absolute path
-[ -d $kerndir ] || usage
-
 defconfig=${2-rk29_ddr3sdk_defconfig}
-if [ "$defconfig" = ".config" ]; then
-       [ -f $kerndir/.config ] || usage
-else
-       [ -f $kerndir/arch/arm/configs/$defconfig ] || usage
-fi
-# ---------------------------------------------------------------------------
-
-# make .uu
-pushd $kerndir >/dev/null
-
-declare -a files
-
-for file in ${FILES[@]}; do
-       [ -e ${file} ] && files=( ${files[@]} ${file} ) || echo No such file: ${file}
-       [ -f ${file/.[cS]/.uu} ] && rm -f ${file/.[cS]/.uu}
-done
-
-for d in ${DIRS[@]}; do
-       [ -d $d ] && find $d -type f -name '*.uu' -print0 | xargs -0 rm -f
-done
-
-echo build kernel on $kerndir with $defconfig
-make clean >/dev/null 2>&1
-make $defconfig >/dev/null 2>&1
-make -j`grep 'processor' /proc/cpuinfo | wc -l` ${files[@]/.[cS]/.o} ${DIRS[@]}
-
-for file in ${FILES[@]}; do
-       filename=${file##*/} 
-       base=${filename%%.*}
-       dir=${file%/*}
-       [ -f $dir/$base.o ] && echo UU $dir/$base.uu && uuencode $dir/$base.o $base.o > $dir/$base.uu
-done
-
-for d in ${DIRS[@]}; do
-       for file in `find $d -type f -name '*.o'`; do
-               filename=${file##*/} 
-               base=${filename%%.*}
-               dir=${file%/*}
-               echo UU $dir/$base.uu && uuencode $dir/$base.o $base.o > $dir/$base.uu
-       done
-done
-
-make distclean >/dev/null 2>&1
-
-popd >/dev/null
-
-# fix local version
-echo "+" > $kerndir/.scmversion
-
-# tar kernel
-pushd $kerndir/../ >/dev/null
-package=$(basename $kerndir).tar
-ex=$package.ex
-> $ex
-for file in ${FILES[@]}; do
-       echo "$file" >> $ex
-done
-for file in ${EXCLUDES[@]}; do
-       echo "$file" >> $ex
-done
-echo TAR $(pwd)/$package
-tar cf $package --numeric-owner --exclude-from $ex --exclude=.git --exclude=`basename $0` $(basename $kerndir)
-tar rf $package --numeric-owner --exclude=.git prebuilt/linux-x86/toolchain/arm-eabi-4.4.0
-echo GZIP $(pwd)/$package.gz
-gzip -9 -c $package > $package.gz
-rm $ex
-popd >/dev/null
-
-rm -f $kerndir/.scmversion
-
-echo done
-
-
+. pack-kernel-common.sh
diff --git a/pack-kernel-rk30.sh b/pack-kernel-rk30.sh
new file mode 100755 (executable)
index 0000000..736e463
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/bash
+set -e
+
+FILES=(
+# arch
+arch/arm/mach-rk30/clock_data.c
+arch/arm/mach-rk30/ddr*.c
+
+arch/arm/plat-rk/vpu*.c
+
+# exclude drivers/net/wireless/rkwifi/fw_path.c
+drivers/net/wireless/rkwifi/[abcdeghijklmnopqrstuvwxyz]*.c
+)
+
+DIRS=(
+)
+
+EXCLUDES=(
+pack-kernel*
+
+arch/arm/mach-rk29/*.c
+arch/arm/mach-rk29/*.h
+arch/arm/mach-rk29/*.S
+arch/arm/mach-rk29/Makefile*
+arch/arm/mach-rk29/include
+arch/arm/configs/rk29*
+
+drivers/*rk28*.c
+include/*rk28*
+
+drivers/net/wireless/rkwifi/*.h
+drivers/net/wireless/rkwifi/include
+
+drivers/staging/rk29/vivante
+
+drivers/staging/rk29/ipp/rk29-ipp.c
+
+arch/arm/mach-rk30/board-rk30-phone*
+arch/arm/configs/rk30_phone_defconfig
+)
+
+defconfig=${2-rk30_sdk_defconfig}
+. pack-kernel-common.sh