Kmake

This script does the following:
 * builds the kernel prior to the current patch and after the patch and points out
 * build warning deltas
 * size changes
 * static checks the impacted files
 * checks kernel documentation for the changed files
 * header file dependency checks
 * git am and checkpatch tests

WARNING: this does not provide any logical/functionality checks and merely uses a series of existing kernel scripts to go through the patch

if [ x$1 = x2 ]; then BIG_TEST=1 BLOAT=1 fi if [ x$1 = x1 ]; then BLOAT=1 fi TMP_PATCH=/tmp/test.patch CHECKPATCH=/tmp/chkpatch-report CHECKSTACK=/tmp/chkstack-report CHECKNAMESPACE=/tmp/chknamespace-report CHECKINCLUDE=/tmp/chkincludekernel-report CHECKHEADERS=/tmp/chkheaderkernel-report CHECKHEADERDEP=/tmp/chkheaderdepkernel-report CHECK_WARN=/tmp/chkwarn-file-report CHECK_KDOC=/tmp/chkkdoc-file-report CHECK_INC=/tmp/chkinc-file-report CHECK_HEADERDEP=/tmp/chkheaderdep-file-report CHECKAM=/tmp/chkam-patch-report CHECKB=/tmp/chkbuildkernel-report CHECKBLOAT=/tmp/chkbloat-o-meter-report ALLFILES="$TMP_PATCH $CHECKPATCH $CHECKNAMESPACE $CHECKINCLUDE $CHECKHEADERS 	 $CHECKHEADERDEP $CHECK_WARN $CHECK_KDOC $CHECK_INC 	  $CHECK_HEADERDEP $CHECKAM $CHECKB $CHECKBLOAT" PRINT_FILES="$CHECKPATCH $CHECK_WARN $CHECK_KDOC $CHECK_INC $CHECK_HEADERDEP" export mmake='make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- -j1' git format-patch -M --stdout -1> $TMP_PATCH ./scripts/checkpatch.pl --strict $TMP_PATCH >$CHECKPATCH ALLBFILES=`diffstat -lp1 $TMP_PATCH` CFILES=`diffstat -lp1 $TMP_PATCH|grep "c$"|sort` OFILES=`diffstat -lp1 $TMP_PATCH|grep "[Sc]$"|sort|sed -e "s/[Sc]$/o/g"` rm $OFILES $mmake C=2 $OFILES 2>$CHECK_WARN ./scripts/kernel-doc $CFILES 2>$CHECK_KDOC ./scripts/checkincludes.pl $CFILES >$CHECK_INC ./scripts/headerdep.pl $CFILES >$CHECK_HEADERDEP if [ -n "$BLOAT" ]; then cp $TMP_PATCH in_test.patch cp .config /tmp/oc git reset --hard HEAD^ $mmake C=1 uImage 2>/tmp/Kerr_old cp vmlinux vmlinux_old git am $TMP_PATCH 2>$CHECKAM mv /tmp/oc .config $mmake C=1 uImage 2>/tmp/Kerr_cur cp vmlinux vmlinux_cur diff -purN /tmp/Kerr_old /tmp/Kerr_cur>$CHECKB ./scripts/bloat-o-meter vmlinux_old vmlinux_cur >$CHECKBLOAT PRINT_FILES="$PRINT_FILES $CHECKAM $CHECKB $CHECKBLOAT" fi if [ -n "$BIG_TEST" ]; then $mmake checkstack >$CHECKSTACK $mmake namespacecheck >$CHECKNAMESPACE $mmake includecheck >$CHECKINCLUDE $mmake headers_check>$CHECKHEADERS $mmake headerdep>$CHECKHEADERDEP PRINT_FILES="$PRINT_FILES $CHECKSTACK $BORDER 		$CHECKNAMESPACE $CHECKINCLUDE $BORDER 		$CHECKHEADERS $CHECKHEADERDEP $BORDER" fi REPORT=./report-k-make git branch -v>$REPORT date>>$REPORT for i in $PRINT_FILES do 	f=`echo $i|cut -d '/' -f3` echo "========== FILE $f ======"|tee -a $REPORT cat $i|tee -a $REPORT done rm -f $ALLFILES 2>/dev/null
 * 1) !/bin/bash