testing: Extract and patch each kernel version only once
authorMartin Willi <martin@revosec.ch>
Fri, 29 May 2015 20:28:05 +0000 (22:28 +0200)
committerMartin Willi <martin@revosec.ch>
Sun, 12 Jul 2015 11:54:08 +0000 (13:54 +0200)
This allows us to do modifications to the kernel tree and rebuild that kernel
using make-testing. We can even have a git kernel tree in a directory to
do kernel development.

testing/scripts/build-guestkernel

index 17f22bd..f7f3cce 100755 (executable)
@@ -26,18 +26,21 @@ then
        execute "wget -q $url"
 fi
 
-log_action "Unpacking kernel"
-execute "tar xJf $KERNELTARBALL"
-
 KERNELDIR=$BUILDDIR/$KERNEL
 cd $KERNELDIR
 
-if [ $KERNELPATCH ]
+if [ ! -d "$KERNELDIR" ]
 then
-       log_action "Applying kernel patch"
-       bzcat ../$KERNELPATCH | patch -p1 >>$LOGFILE 2>&1
-       log_status $?
-       [ $? -eq 0 ] || exit 1
+       log_action "Unpacking kernel"
+       execute "tar xJf $KERNELTARBALL"
+
+       if [ $KERNELPATCH ]
+       then
+               log_action "Applying kernel patch"
+               bzcat ../$KERNELPATCH | patch -p1 >>$LOGFILE 2>&1
+               log_status $?
+               [ $? -eq 0 ] || exit 1
+       fi
 fi
 
 execute "cp $KERNELCONFIG .config" 0