commit kiwi for openSUSE:Factory
Hello community,
here is the log from the commit of package kiwi for openSUSE:Factory
checked in at Mon Feb 7 16:46:59 CET 2011.
--------
--- kiwi/kiwi.changes 2011-02-04 15:18:26.000000000 +0100
+++ /mounts/work_src_done/STABLE/kiwi/kiwi.changes 2011-02-07 14:48:38.000000000 +0100
@@ -1,0 +2,41 @@
+Mon Feb 7 14:06:02 CET 2011 - adrian@suse.de
+
+ ignore missing debug packages, they may not get generated (esp on noarch packages).
+
+-------------------------------------------------------------------
+Mon Feb 7 13:48:07 CET 2011 - adrian@suse.de
+
+ handle autodetected src packages with correct arch (src or nosrc)
+
+-------------------------------------------------------------------
+Mon Feb 7 12:25:34 CET 2011 - ms@suse.de
+
+- DB: update documentation and examples due to new ec2region element
+
+-------------------------------------------------------------------
+Mon Feb 7 12:23:39 CET 2011 - ms@suse.de
+
+- added support for the <ec2region> child element for
+ <ec2config>. With this a user can specify one or multiple
+ target regions for the EC2 image. Specifying multiple <ec2region>
+ elements creates multiple AMIs. The main convenience is that one
+ does not have to look for the aki-... cryptic name for the PVGrub
+ boot kernel as the value gets embedded in the generated manifest.
+ Supported values are: AP-Singapore, EU-West, US-East, US-West
+
+-------------------------------------------------------------------
+Mon Feb 7 12:06:09 CET 2011 - adrian@suse.de
+
+ support blacklisting of packages via onlyarch=""
+
+-------------------------------------------------------------------
+Mon Feb 7 10:26:29 CET 2011 - adrian@suse.de
+
+ report about all missing packages and abort afterwards, not at the first missing package.
+
+-------------------------------------------------------------------
+Mon Feb 7 10:18:46 CET 2011 - adrian@suse.de
+
+ take care about arch= package statement for product required architectures
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kiwi.spec ++++++
--- /var/tmp/diff_new_pack.Zu58Bc/_old 2011-02-07 16:46:48.000000000 +0100
+++ /var/tmp/diff_new_pack.Zu58Bc/_new 2011-02-07 16:46:48.000000000 +0100
@@ -66,7 +66,7 @@
%endif
Summary: OpenSuSE - KIWI Image System
Version: 4.73
-Release: 1
+Release: 2
Group: System/Management
License: GPLv2
Source: %{name}.tar.bz2
++++++ kiwi-docu.tar.bz2 ++++++
kiwi/kiwi-docu.tar.bz2 /mounts/work_src_done/STABLE/kiwi/kiwi-docu.tar.bz2 differ: char 11, line 1
++++++ kiwi.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/.revision new/kiwi/.revision
--- old/kiwi/.revision 2011-02-04 15:14:05.000000000 +0100
+++ new/kiwi/.revision 2011-02-07 14:45:57.000000000 +0100
@@ -1 +1 @@
-2a678cf973f3dcaafc0091961e3b16167a9dd502
+11392a44f3147b90816aabcc622a254039f425f5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/kiwi.pl new/kiwi/kiwi.pl
--- old/kiwi/kiwi.pl 2011-02-04 15:14:05.000000000 +0100
+++ new/kiwi/kiwi.pl 2011-02-07 14:45:57.000000000 +0100
@@ -100,6 +100,7 @@
our $SchemaTST= $BasePath."/modules/KIWISchemaTest.rng";
our $KConfig = $BasePath."/modules/KIWIConfig.sh";
our $KMigrate = $BasePath."/modules/KIWIMigrate.txt";
+our $KRegion = $BasePath."/modules/KIWIEC2Region.txt";
our $KMigraCSS= $BasePath."/modules/KIWIMigrate.tgz";
our $KSplit = $BasePath."/modules/KIWISplit.txt";
our $Revision = $BasePath."/.revision";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWICollect.pm new/kiwi/modules/KIWICollect.pm
--- old/kiwi/modules/KIWICollect.pm 2011-01-31 12:38:16.000000000 +0100
+++ new/kiwi/modules/KIWICollect.pm 2011-02-07 14:45:57.000000000 +0100
@@ -743,7 +743,7 @@
sub setupPackageFiles
{
my $this = shift;
- my $mode = shift; # 1 = collect source & debug packnames; 2 = use only src/nosrc packs; 0 = nothing special
+ my $mode = shift; # 1 = collect source & debug packnames; 2 = use only src/nosrc packs; 3 = ignore missing packages in any case (debug media mode);
my $usedPackages = shift;
my $retval = 0;
@@ -763,6 +763,7 @@
my $last_progress_time = 0;
my $count_packs = 0;
my $num_packs = keys %{$usedPackages};
+ my @missingPackages = ();
PACK:foreach my $packName(keys(%{$usedPackages})) {
next if $packName eq "_name";
@@ -772,7 +773,8 @@
my @archs;
$count_packs++;
if ( $mode == 2 ) {
- push @archs, 'src', 'nosrc';
+ # use src or nosrc only for this package
+ push @archs, $packOptions->{'arch'};
}else{
@archs = $this->getArchList($packOptions, $packName, \$nofallback);
}
@@ -848,11 +850,14 @@
$srcname =~ s/-[^-]*-[^-]*\.rpm$//; # this strips everything, except main name
#
if ( $this->{m_srcmedium} > 0 ) {
+ my $srcarch = $packPointer->{sourcepackage};
+ $srcarch =~ s{.*\.(.*)\.rpm$}{$1};
if (!$this->{m_sourcePacks}->{$srcname}) {
# FIXME: add forcerepo here
$this->{m_sourcePacks}->{$srcname} = {
'medium' => $this->{m_srcmedium},
- 'onlyarch' => 'src,nosrc'
+ 'arch' => $srcarch,
+ 'onlyarch' => $srcarch
};
}
$packPointer->{sourcepackage} =~ m/.*-([^-]*-[^-]*)\.[^\.]*\.rpm/; # get version-release string
@@ -875,15 +880,23 @@
};
}
}
- next PACKKEY if ( scalar(keys %{$packOptions->{requireVersion}}) > 0 );
next ARCH; # package processed, jump to the next request arch or package
}
$this->logMsg("W", " => package $packName not available for arch $arch in any repo") if $this->{m_debug} >= 4;
} # /@fallbackarch
- # FIXME: we need to make it an option to ignore this error.
- $this->logMsg("E", " => package $packName not available for $requestedArch nor its fallbacks"); # if $this->{m_debug} >= 1;
+ $this->logMsg("W", " => package $packName not available for $requestedArch nor its fallbacks") if $this->{m_debug} >= 1;
+ push @missingPackages, $packName;
} # /@archs
}
+ # Ignore missing packages on debug media, they may really not exist
+ if ($mode != 3 && @missingPackages > 0) {
+ $this->logMsg("W", "MISSING PACKAGES:");
+ foreach my $pack(@missingPackages) {
+ $this->logMsg("W", " ".$pack);
+ }
+ # FIXME: we need to make it an option to ignore this error.
+ $this->logMsg("E", "Required packages were not found");
+ }
return $retval;
}
# /setupPackageFile
@@ -960,7 +973,7 @@
}
}
if ( $this->{m_debugmedium} > 0 ) {
- $setupFiles = $this->setupPackageFiles(0, $this->{m_debugPacks});
+ $setupFiles = $this->setupPackageFiles(3, $this->{m_debugPacks});
if($setupFiles > 0) {
$this->logMsg("E", "[collectPackages] $setupFiles DEBUG RPM packages could not be setup");
return 1;
@@ -1464,6 +1477,13 @@
my @archs = ();
return @archs if(not defined($packName));
+
+ if(defined($packOptions->{'onlyarch'})) {
+ # black listed packages
+ return @archs if ($packOptions->{'onlyarch'} eq "");
+ return @archs if ($packOptions->{'onlyarch'} eq "skipit"); # convinience for old hack
+ };
+
if(defined($packOptions->{'arch'})) {
# Check if this is a rule for this platform
$packOptions->{'arch'} =~ s{,\s*,}{,}g;
@@ -1496,7 +1516,17 @@
}
# set required archs
- push @archs, $this->{m_archlist}->headList();
+ if(defined($packOptions->{'arch'})) {
+ # use archs defined for this package
+ foreach my $plattform (split(/,\s*/, $packOptions->{'arch'})) {
+ foreach my $reqArch ($this->{m_archlist}->headList()) {
+ push @archs, $reqArch if ( $reqArch eq $plattform );
+ };
+ };
+ }else{
+ # take all global defined archs
+ push @archs, $this->{m_archlist}->headList();
+ }
if(defined($packOptions->{'addarch'})) {
if(not(grep($packOptions->{'addarch'} eq $_, @archs))) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIEC2Region.txt new/kiwi/modules/KIWIEC2Region.txt
--- old/kiwi/modules/KIWIEC2Region.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/kiwi/modules/KIWIEC2Region.txt 2011-02-07 14:45:57.000000000 +0100
@@ -0,0 +1,11 @@
+# /.../
+# Ec2 region table for correct Amazon kernel (aki) assignment
+# ----
+AP-Singapore-i386=aki-13d5aa41
+AP-Singapore-x86_64=aki-11d5aa43
+EU-West-i386=aki-4deec439
+EU-West-x86_64=aki-4feec43b
+US-East-i386=aki-407d9529
+US-East-x86_64=aki-427d952b
+US-West-i386=aki-99a0f1dc
+US-West-x86_64=aki-9ba0f1de
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIImageFormat.pm new/kiwi/modules/KIWIImageFormat.pm
--- old/kiwi/modules/KIWIImageFormat.pm 2011-02-04 11:31:11.000000000 +0100
+++ new/kiwi/modules/KIWIImageFormat.pm 2011-02-07 14:45:57.000000000 +0100
@@ -25,6 +25,7 @@
use KIWIQX;
use File::Basename;
use KIWIBoot;
+use KIWILocator;
#==========================================
# Constructor
@@ -349,6 +350,34 @@
my $tmpdir;
my $FD;
#==========================================
+ # Check for Amazon EC2 toolkit
+ #------------------------------------------
+ my $locator = new KIWILocator($kiwi);
+ my $bundleCmd = $locator -> getExecPath ('ec2-bundle-image');
+ if (! $bundleCmd ) {
+ $kiwi -> error (
+ "Couldn't find ec2-bundle-image; required to create EC2 image"
+ );
+ $kiwi -> failed ();
+ return undef
+ }
+ #==========================================
+ # Import AWS region kernel map
+ #------------------------------------------
+ my %ec2RegionKernelMap;
+ if (! open ($FD,$main::KRegion)) {
+ return undef;
+ }
+ while (my $line = <$FD>) {
+ next if $line =~ /^#/;
+ if ($line =~ /(.*)\s*=\s*(.*)/) {
+ my $region= $1;
+ my $aki = $2;
+ $ec2RegionKernelMap{$region} = $aki;
+ }
+ }
+ close $FD;
+ #==========================================
# Check AWS account information
#------------------------------------------
$kiwi -> info ("Creating $format image...");
@@ -579,18 +608,28 @@
my $ca = $ec2{EC2CertFile};
my $nr = $ec2{AWSAccountNr};
my $fi = $source;
- my $amiopts = "-i $fi -k $pk -c $ca -u $nr -p $aminame";
- qxx ("mkdir -p $target 2>&1");
- qxx ("rm -rf $target/* 2>&1");
- $status = qxx (
- "ec2-bundle-image $amiopts -d $target -r $arch 2>&1"
- );
- $result = $? >> 8;
- if ($result != 0) {
- $kiwi -> failed ();
- $kiwi -> error ("ec2-bundle-image: $status");
- $kiwi -> failed ();
- return undef;
+ my $amiopts = "-i $fi -k $pk -c $ca -u $nr -p $aminame "
+ . '--block-device-mapping ami=sda1,root=/dev/sda1';
+ my @regions = @{ $ec2{EC2Regions} };
+ if (! @regions) {
+ push @regions, 'any';
+ }
+ for my $region (@regions) {
+ my $regionTgt = "$target-$region";
+ if ( $region ne 'any' ) {
+ my $kernel = $ec2RegionKernelMap{"$region-$arch"};
+ $amiopts .= " --kernel $kernel";
+ }
+ qxx ("mkdir -p $regionTgt 2>&1");
+ qxx ("rm -rf $regionTgt/* 2>&1");
+ $status = qxx ( "$bundleCmd $amiopts -d $regionTgt -r $arch 2>&1" );
+ $result = $? >> 8;
+ if ($result != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("$bundleCmd: $status");
+ $kiwi -> failed ();
+ return undef;
+ }
}
$kiwi -> done();
return $target;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWISchema.rnc new/kiwi/modules/KIWISchema.rnc
--- old/kiwi/modules/KIWISchema.rnc 2011-01-31 12:38:16.000000000 +0100
+++ new/kiwi/modules/KIWISchema.rnc 2011-02-07 14:45:57.000000000 +0100
@@ -282,6 +282,26 @@
}
#==========================================
+# common element <ec2region>
+#
+div {
+ k.ec2region.attlist = empty
+ k.ec2region =
+ ## Specify the region/availability zone
+ [
+ db:para [
+ "Specify the region/availability zone in EC2 for this image.\x{a}"~
+ "Values are limited to the EC2 recognized zones:\x{a}"~
+ "AP-Singapore, EU-West, US-East, and US-West"
+ ]
+ ]
+ element ec2region {
+ k.ec2region.attlist,
+ text
+ }
+}
+
+#==========================================
# common element <file>
#
div {
@@ -2071,7 +2091,8 @@
k.ec2config.attlist &
k.ec2accountnr? &
k.ec2certfile? &
- k.ec2privatekeyfile?
+ k.ec2privatekeyfile? &
+ k.ec2region*
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWISchema.rng new/kiwi/modules/KIWISchema.rng
--- old/kiwi/modules/KIWISchema.rng 2011-01-31 12:38:16.000000000 +0100
+++ new/kiwi/modules/KIWISchema.rng 2011-02-07 14:45:57.000000000 +0100
@@ -432,6 +432,26 @@
</div>
<!--
==========================================
+ common element <ec2region>
+
+ -->
+ <div>
+ <define name="k.ec2region.attlist">
+ <empty/>
+ </define>
+ <define name="k.ec2region">
+ <element name="ec2region">
+
participants (1)
-
root@hilbert.suse.de