Enable kvm build function
authorJiankang Fan <jiankang.fan@samsung.com>
Tue, 27 Sep 2016 03:08:54 +0000 (11:08 +0800)
committerSoonKyu Park <sk7.park@samsung.com>
Mon, 26 Dec 2016 09:20:32 +0000 (18:20 +0900)
Change-Id: I1213c284637e6ddb6538f7047468835bb99b4e39

expanddeps
init_buildsystem

index 7e3b795567e723ecd5ec8a5397e350d618e2f646..2dcd3eb4237007db3f3367750ff6458ac22396b6 100755 (executable)
@@ -29,7 +29,7 @@ use strict;
 use Build;
 use File::Basename;
 
-my ($dist, $rpmdeps, $archs, $configdir, $useusedforbuild, $installonly, $noinstall, $usehigherdeps);
+my ($dist, $rpmdeps, $archs, $configdir, $useusedforbuild, $installonly, $noinstall, $usehigherdeps, $isvm);
 
 $configdir = ($::ENV{'BUILD_DIR'} || '/usr/lib/build') . '/configs';
 
@@ -82,6 +82,11 @@ while (@ARGV)  {
     $usehigherdeps = 1;
     next;
   }
+  if ($ARGV[0] eq '--vm') {
+    shift @ARGV;
+    $isvm = 1;
+    next;
+  }
   last;
 }
 
@@ -410,6 +415,9 @@ Build::readdeps($cf, undef, \%repo);
 
 #######################################################################
 
+if ($isvm) {
+  push @packdeps, @{$cf->{'vminstall'}};
+}
 my @bdeps = Build::get_build($cf, $subpacks, @packdeps, @extradeps);
 
 if (!shift @bdeps) {
@@ -435,5 +443,8 @@ if (@sysdeps) {
 # make sure all preinstalls are in bdeps;
 # XXX: also add vmdeps?
 @bdeps = Build::unify(@bdeps, Build::get_preinstalls($cf));
+if ($isvm) {
+  @bdeps = Build::unify(@bdeps, Build::get_vminstalls($cf));
+}
 
 print_rpmlist(@bdeps);
index 55b64166bd0621245871835b5a6e2790f1119c76..451de14b38ed419486600cb02028228175dc2b9d 100755 (executable)
@@ -579,7 +579,9 @@ else
        #
        RPMLIST=$BUILD_ROOT/.init_b_cache/rpmlist
        test -z "$LIST_STATE" && echo "expanding package dependencies..."
-       if ! $BUILD_DIR/expanddeps $USEUSEDFORBUILD $USEHIGHERDEPS "${definesnstuff[@]}" --dist "$BUILD_DIST" --depfile "$CACHE_FILE" --archpath "$BUILD_ARCH" --configdir $CONFIG_DIR "${PKGS[@]}" > $RPMLIST ; then
+        VMOPT=
+        test -z "$PREPARE_VM" || VMOPT=--vm
+       if ! $BUILD_DIR/expanddeps $USEUSEDFORBUILD $VMOPT $USEHIGHERDEPS "${definesnstuff[@]}" --dist "$BUILD_DIST" --depfile "$CACHE_FILE" --archpath "$BUILD_ARCH" --configdir $CONFIG_DIR "${PKGS[@]}" > $RPMLIST ; then
            rm -f $BUILD_IS_RUNNING
            cleanup_and_exit 1
        fi
@@ -604,9 +606,9 @@ else
     # register the QEMU emulator if needed
     # (we do not need this for the prepare step, as we do not run scripts in this case)
     #
+    copy_qemu
     if test -z "$PREPARE_VM" ; then
        if check_use_emulator ; then
-           copy_qemu
            echo "registering binfmt handlers for cross build"
            "$BUILD_DIR/$INITVM_NAME"
            echo 0 > /proc/sys/vm/mmap_min_addr