From 740cee91c3f12b6db16f3573243bfcc8d93007b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Thu, 5 Apr 2012 15:59:16 +0800 Subject: [PATCH] rk: add pack-kernel-rk30.sh and pack-kernel-common.sh --- pack-kernel-common.sh | 95 +++++++++++++++++++++++++++++++++++++++++ pack-kernel-rk29.sh | 99 +++---------------------------------------- pack-kernel-rk30.sh | 43 +++++++++++++++++++ 3 files changed, 145 insertions(+), 92 deletions(-) create mode 100755 pack-kernel-common.sh create mode 100755 pack-kernel-rk30.sh diff --git a/pack-kernel-common.sh b/pack-kernel-common.sh new file mode 100755 index 000000000000..723788e69113 --- /dev/null +++ b/pack-kernel-common.sh @@ -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 + + diff --git a/pack-kernel-rk29.sh b/pack-kernel-rk29.sh index f7835b01b2a1..3fd38d88b3e4 100755 --- a/pack-kernel-rk29.sh +++ b/pack-kernel-rk29.sh @@ -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 index 000000000000..736e46304ea3 --- /dev/null +++ b/pack-kernel-rk30.sh @@ -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 -- 2.34.1