From: Jiankang Fan Date: Tue, 27 Sep 2016 03:08:54 +0000 (+0800) Subject: Enable kvm build function X-Git-Tag: upstream/20160629~5^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d8618a3d37de8d8acede364f757e94836fed2e15;p=tools%2Fbuild.git Enable kvm build function Change-Id: I1213c284637e6ddb6538f7047468835bb99b4e39 --- diff --git a/expanddeps b/expanddeps index 7e3b795..2dcd3eb 100755 --- a/expanddeps +++ b/expanddeps @@ -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); diff --git a/init_buildsystem b/init_buildsystem index 55b6416..451de14 100755 --- a/init_buildsystem +++ b/init_buildsystem @@ -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