]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
ts-kernel-build: Support --reuse to keep same build tree
authorIan Campbell <ian.campbell@citrix.com>
Thu, 18 Jun 2015 16:25:03 +0000 (17:25 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 19 Jun 2015 16:07:28 +0000 (17:07 +0100)
This is very useful when iterating over kernel configurations, since
it avoids blowing away the build tree and all the existing built
objects. The Linux build system does the right thing when .config
changes and only rebuilds the affected bits.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
ts-kernel-build

index e7cbdc13ec8b8e1c2b712887ca00bd9c61fb47f1..3f86bcd70073857d7ca4de1cb774b7dbff2ca719 100755 (executable)
@@ -22,6 +22,18 @@ use Osstest::TestSupport;
 use Osstest::BuildSupport;
 
 tsreadconfig();
+
+our $reuse = 0;
+while (@ARGV and $ARGV[0] =~ m/^-/) {
+    $_= shift @ARGV;
+    last if m/^--$/;
+    if (m/^--reuse$/) {
+       $reuse = 1;
+    } else {
+       die "$_ ?";
+    }
+}
+
 selectbuildhost(\@ARGV);
 builddirsprops();
 
@@ -34,6 +46,8 @@ my $archparms = {
 sub enable_xen_config ();
 
 sub checkout () {
+    return if $reuse;
+
     prepbuilddirs();
 
     build_clone($ho, 'linux', $builddir, 'linux');