Hello community,
here is the log from the commit of package kiwi for openSUSE:Factory
checked in at Fri Feb 4 18:39:06 CET 2011.
--------
--- kiwi/kiwi.changes 2011-01-31 12:41:36.000000000 +0100
+++ kiwi/kiwi.changes 2011-02-04 15:18:26.000000000 +0100
@@ -1,0 +2,92 @@
+Fri Feb 4 15:11:21 CET 2011 - ms@suse.de
+
+- v4.73 released
+
+-------------------------------------------------------------------
+Fri Feb 4 11:28:22 CET 2011 - ms@suse.de
+
+- DB: update ec2 documentation
+
+-------------------------------------------------------------------
+Fri Feb 4 11:26:58 CET 2011 - ms@suse.de
+
+- fixed typo in ec2 format creation (missing /)
+
+-------------------------------------------------------------------
+Thu Feb 3 15:51:06 CET 2011 - ms@suse.de
+
+- fixed ec2 examples
+
+-------------------------------------------------------------------
+Thu Feb 3 15:16:03 CET 2011 - ms@suse.de
+
+- DB: update ec2 docs and examples per request in (bnc #667303)
+
+-------------------------------------------------------------------
+Thu Feb 3 13:09:15 CET 2011 - ms@suse.de
+
+- improved ec2 format creation per request in (bnc #667303)
+
+-------------------------------------------------------------------
+Wed Feb 2 13:44:43 CET 2011 - ms@suse.de
+
+- provide partition info in MB instead of KB
+
+-------------------------------------------------------------------
+Tue Feb 1 17:23:24 CET 2011 - ms@suse.de
+
+- update s390 boot code according to generic changes in the x86 boot code
+
+-------------------------------------------------------------------
+Tue Feb 1 12:39:51 CET 2011 - ms@suse.de
+
+- DB: update documentation: Added information about plain:// source
+- DB: update documentation: Improved smb:// paragraph
+
+-------------------------------------------------------------------
+Tue Feb 1 11:39:12 CET 2011 - ms@suse.de
+
+- fixed squashfs version check
+
+-------------------------------------------------------------------
+Tue Feb 1 11:02:12 CET 2011 - ms@suse.de
+
+- DB: update documentation, removed wrong version information
+
+-------------------------------------------------------------------
+Tue Feb 1 10:28:08 CET 2011 - ms@suse.de
+
+- added support for plain:// url types. They forward the URL
+ (everything following "plain://") unmodified to the package
+ manager. This can be used if kiwi does not support a special
+ URL but the package manager does
+
+-------------------------------------------------------------------
+Tue Feb 1 10:23:59 CET 2011 - ms@suse.de
+
+- fixed smb mount. Leave // to indicate the share name and make
+ sure we create a unique mount point with mktemp instead of using
+ the share name as base
+
+-------------------------------------------------------------------
+Tue Feb 1 10:11:51 CET 2011 - ms@suse.de
+
+- DB: update documentation from review
+
+-------------------------------------------------------------------
+Mon Jan 31 17:11:27 CET 2011 - ms@suse.de
+
+- use -o guest option to mount a samba share without
+ username and password specified
+
+-------------------------------------------------------------------
+Mon Jan 31 16:57:23 CET 2011 - ms@suse.de
+
+- fixed use of profiled repository sections
+
+-------------------------------------------------------------------
+Mon Jan 31 16:43:08 CET 2011 - ms@suse.de
+
+- DB: fixed typo: cifs-utils is required in bootstrap section
+
+-------------------------------------------------------------------
@@ -142,0 +235,6 @@
+ Author: Bernhard M. Wiedemann
+-------------------------------------------------------------------
+Thu Jan 20 12:03:31 CET 2011 - ms@suse.de
+
+ fix approx 109 typos
+
@@ -148,0 +247,6 @@
+
+ Author: Bernhard M. Wiedemann
+-------------------------------------------------------------------
+Thu Jan 20 10:13:16 CET 2011 - ms@suse.de
+
+ fixes from review
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kiwi.spec ++++++
--- /var/tmp/diff_new_pack.hndWFz/_old 2011-02-04 18:37:11.000000000 +0100
+++ /var/tmp/diff_new_pack.hndWFz/_new 2011-02-04 18:37:11.000000000 +0100
@@ -65,7 +65,7 @@
%endif
%endif
Summary: OpenSuSE - KIWI Image System
-Version: 4.72
+Version: 4.73
Release: 1
Group: System/Management
License: GPLv2
++++++ kiwi-docu.tar.bz2 ++++++
kiwi/kiwi-docu.tar.bz2 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-01-28 15:48:06.000000000 +0100
+++ new/kiwi/.revision 2011-02-04 15:14:05.000000000 +0100
@@ -1 +1 @@
-e42c759bdd1827758440aa64ac578b47a95869c7
+2a678cf973f3dcaafc0091961e3b16167a9dd502
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/kiwi.pl new/kiwi/kiwi.pl
--- old/kiwi/kiwi.pl 2011-01-28 15:48:06.000000000 +0100
+++ new/kiwi/kiwi.pl 2011-02-04 15:14:05.000000000 +0100
@@ -48,7 +48,7 @@
#============================================
# Globals (Version)
#--------------------------------------------
-our $Version = "4.72";
+our $Version = "4.73";
our $Publisher = "SUSE LINUX Products GmbH";
our $Preparer = "KIWI - http://kiwi.berlios.de";
our $openSUSE = "http://download.opensuse.org";
@@ -742,25 +742,31 @@
# Initialize logical image extend
#------------------------------------------
my $ok;
+ my $checkFormat = 0;
SWITCH: for ($attr{type}) {
/^ext2/ && do {
$ok = $image -> createImageEXT2 ( $targetDevice );
+ $checkFormat = 1;
last SWITCH;
};
/^ext3/ && do {
$ok = $image -> createImageEXT3 ( $targetDevice );
+ $checkFormat = 1;
last SWITCH;
};
/^ext4/ && do {
$ok = $image -> createImageEXT4 ( $targetDevice );
+ $checkFormat = 1;
last SWITCH;
};
/^reiserfs/ && do {
$ok = $image -> createImageReiserFS ( $targetDevice );
+ $checkFormat = 1;
last SWITCH;
};
/^btrfs/ && do {
$ok = $image -> createImageBTRFS ( $targetDevice );
+ $checkFormat = 1;
last SWITCH;
};
/^squashfs/ && do {
@@ -801,6 +807,7 @@
};
/^xfs/ && do {
$ok = $image -> createImageXFS ();
+ $checkFormat = 1;
last SWITCH;
};
$kiwi -> error ("Unsupported type: $attr{type}");
@@ -808,10 +815,22 @@
undef $image;
my $code = kiwiExit (1); return $code;
}
- undef $image;
if ($ok) {
+ if (($checkFormat) && ($attr{format})) {
+ my $haveFormat = $attr{format};
+ my $imgfile= $main::Destination."/".$image -> buildImageName();
+ my $format = new KIWIImageFormat ($kiwi,$imgfile,$haveFormat);
+ if (! $format) {
+ my $code = kiwiExit (1); return $code;
+ }
+ if (! $format -> createFormat()) {
+ my $code = kiwiExit (1); return $code;
+ }
+ }
+ undef $image;
my $code = kiwiExit (0); return $code;
} else {
+ undef $image;
my $code = kiwiExit (1); return $code;
}
}
@@ -2474,11 +2493,11 @@
my $mktool_vs = qxx ("mksquashfs -version 2>&1 | head -n 1");
my $module_vs = qxx ("modinfo -d $km 2>&1");
my $error = 0;
- if ($mktool_vs =~ /^mksquashfs version (.*) \(/) {
+ if ($mktool_vs =~ /^mksquashfs version (\d\.\d) \(/) {
$mktool_vs = $1;
$error++;
}
- if ($module_vs =~ /^squashfs (.*),/) {
+ if ($module_vs =~ /^squashfs (\d\.\d),/) {
$module_vs = $1;
$error++;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIImage.pm new/kiwi/modules/KIWIImage.pm
--- old/kiwi/modules/KIWIImage.pm 2011-01-20 09:19:55.000000000 +0100
+++ new/kiwi/modules/KIWIImage.pm 2011-02-03 15:59:07.000000000 +0100
@@ -185,6 +185,9 @@
my %src_type = %{$src_xml->getImageTypeAndAttributes()};
my %changeset = ();
my @profiles;
+ my @xmlnodes;
+ my @xmlpnodes;
+ my @node;
#==========================================
# Store general data
#------------------------------------------
@@ -216,15 +219,36 @@
push @profiles,@{$src_xml->{reqProfiles}};
$changeset{"profiles"} = \@profiles;
}
- $changeset{"xmlobj"} = $src_xml;
- $changeset{"xmlnode"} = $src_xml->getNodeList();
- $changeset{"xmlpacnode"} = $src_xml->getPackageNodeList();
+ #==========================================
+ # Store general data
+ #------------------------------------------
$changeset{"packagemanager"} = $src_xml->getPackageManager();
$changeset{"domain"} = $src_xml->getXenDomain();
$changeset{"displayname"} = $src_xml->getImageDisplayName();
$changeset{"locale"} = $src_xml->getLocale();
$changeset{"boot-theme"} = $src_xml->getBootTheme();
#==========================================
+ # Store repositories
+ #------------------------------------------
+ @node = $src_xml->getNodeList() -> get_nodelist();
+ foreach my $element (@node) {
+ if ($src_xml -> __requestedProfile ($element)) {
+ $element -> removeAttribute ("profiles");
+ push (@xmlnodes,$element);
+ }
+ }
+ $changeset{"repositories"} = \@xmlnodes;
+ #==========================================
+ # Store packages
+ #------------------------------------------
+ @node = $src_xml->getPackageNodeList() -> get_nodelist();
+ foreach my $element (@node) {
+ if ($src_xml -> __requestedProfile ($element)) {
+ push (@xmlpnodes,$element);
+ }
+ }
+ $changeset{"xmlpacnode"} = \@xmlpnodes;
+ #==========================================
# Store OEM data
#------------------------------------------
$changeset{"oem-partition-install"} = $src_xml->getOEMPartitionInstall();
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 2010-11-26 15:48:16.000000000 +0100
+++ new/kiwi/modules/KIWIImageFormat.pm 2011-02-04 11:31:11.000000000 +0100
@@ -131,7 +131,7 @@
my $data = qxx ("parted $image print 2>&1");
my $code = $? >> 8;
if ($code != 0) {
- $kiwi -> error ("system image is not a disk");
+ $kiwi -> error ("system image is not a disk or filesystem");
$kiwi -> failed ();
return undef
}
@@ -343,14 +343,19 @@
my $format = $this->{format};
my $target = $source;
my $aminame= basename $source;
+ my $destdir= dirname $source;
my $status;
my $result;
+ my $tmpdir;
+ my $FD;
#==========================================
# Check AWS account information
#------------------------------------------
$kiwi -> info ("Creating $format image...");
- $target =~ s/\.raw$/\.$format/;
- $aminame=~ s/\.raw$/\.ami/;
+ $target =~ s/\/$//;
+ $target .= ".$format";
+ $aminame.= ".ami";
+ my $title= $xml -> getImageDisplayName();
my $arch = qxx ("uname -m"); chomp ( $arch );
my %type = %{$xml->getImageTypeAndAttributes()};
my %ec2 = $xml->getEc2Config();
@@ -392,6 +397,182 @@
return undef;
}
#==========================================
+ # loop mount root image and create config
+ #------------------------------------------
+ $tmpdir = qxx ("mktemp -q -d $destdir/ec2.XXXXXX"); chomp $tmpdir;
+ $result = $? >> 8;
+ if ($result != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("Couldn't create tmp dir: $tmpdir: $!");
+ $kiwi -> failed ();
+ return undef;
+ }
+ $status = qxx ("mount -o loop $source $tmpdir 2>&1");
+ $result = $? >> 8;
+ if ($result != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("Couldn't loop mount $source: $status");
+ $kiwi -> failed ();
+ return undef;
+ }
+ sub clean_loop {
+ my $dir = shift;
+ qxx ("umount $dir 2>&1");
+ qxx ("rmdir $dir 2>&1");
+ }
+ #==========================================
+ # setup Xen console as serial tty
+ #------------------------------------------
+ $this -> __copy_origin ("$tmpdir/etc/inittab");
+ if (! open $FD, ">>$tmpdir/etc/inittab") {
+ $kiwi -> failed ();
+ $kiwi -> error ("Failed to open $tmpdir/etc/inittab: $!");
+ $kiwi -> failed ();
+ clean_loop $tmpdir;
+ return undef;
+ }
+ print $FD "\n";
+ print $FD 'X0:12345:respawn:/sbin/agetty -L 9600 xvc0 xterm'."\n";
+ close $FD;
+ if (! open $FD, ">>$tmpdir/etc/securetty") {
+ $kiwi -> failed ();
+ $kiwi -> error ("Failed to open $tmpdir/etc/securetty: $!");
+ $kiwi -> failed ();
+ clean_loop $tmpdir;
+ return undef;
+ }
+ print $FD "\n";
+ print $FD 'xvc0'."\n";
+ close $FD;
+ #==========================================
+ # create initrd
+ #------------------------------------------
+ if (! open $FD, ">$tmpdir/create_initrd.sh") {
+ $kiwi -> failed ();
+ $kiwi -> error ("Failed to open $tmpdir/create_initrd.sh: $!");
+ $kiwi -> failed ();
+ clean_loop $tmpdir;
+ return undef;
+ }
+ print $FD 'export rootdev=/dev/sda1'."\n";
+ print $FD 'export rootfstype='.$type{type}."\n";
+ print $FD 'mknod /dev/sda1 b 8 1'."\n";
+ print $FD 'mkinitrd -B -A'."\n";
+ print $FD 'touch /boot/.rebuild-initrd'."\n";
+ close $FD;
+ qxx ("chmod u+x $tmpdir/create_initrd.sh");
+ $status = qxx ("chroot $tmpdir bash -c ./create_initrd.sh 2>&1");
+ $result = $? >> 8;
+ if ($result != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("Failed to create initrd: $status");
+ $kiwi -> failed ();
+ clean_loop $tmpdir;
+ return undef;
+ }
+ qxx ("rm -f $tmpdir/create_initrd.sh");
+ #==========================================
+ # create grub bootloader setup
+ #------------------------------------------
+ # copy grub image files
+ qxx ("cp $tmpdir/usr/lib/grub/* $tmpdir/boot/grub");
+ # boot/grub/device.map
+ if (! open $FD, ">$tmpdir/boot/grub/device.map") {
+ $kiwi -> failed ();
+ $kiwi -> error ("Failed to open $tmpdir/boot/grub/device.map: $!");
+ $kiwi -> failed ();
+ clean_loop $tmpdir;
+ return undef;
+ }
+ print $FD '(hd0)'."\t".'/dev/sda1'."\n";
+ close $FD;
+ # etc/grub.conf
+ if (! open $FD, ">$tmpdir/etc/grub.conf") {
+ $kiwi -> failed ();
+ $kiwi -> error ("Failed to open $tmpdir/etc/grub.conf: $!");
+ $kiwi -> failed ();
+ clean_loop $tmpdir;
+ return undef;
+ }
+ print $FD 'setup --stage2=/boot/grub/stage2 --force-lba (hd0) (hd0)'."\n";
+ print $FD 'quit'."\n";
+ close $FD;
+ # boot/grub/menu.lst
+ my $args="xencons=xvc0 console=xvc0 splash=silent showopts";
+ if (! open $FD, ">$tmpdir/create_bootmenu.sh") {
+ $kiwi -> failed ();
+ $kiwi -> error ("Failed to open $tmpdir/create_bootmenu.sh: $!");
+ $kiwi -> failed ();
+ return undef;
+ }
+ print $FD 'file=/boot/grub/menu.lst'."\n";
+ print $FD 'args="'.$args.'"'."\n";
+ print $FD 'echo "serial --unit=0 --speed=9600" > $file'."\n";
+ print $FD 'echo "terminal --dumb serial" >> $file'."\n";
+ print $FD 'echo "default 0" >> $file'."\n";
+ print $FD 'echo "timeout 0" >> $file'."\n";
+ print $FD 'echo "hiddenmenu" >> $file'."\n";
+ print $FD 'ls /lib/modules | while read D; do'."\n";
+ print $FD ' [ -d "/lib/modules/$D" ] || continue'."\n";
+ print $FD ' echo "$D"'."\n";
+ print $FD 'done | /usr/lib/rpm/rpmsort | tac | while read D; do'."\n";
+ print $FD ' for K in /boot/vmlinu[zx]-$D; do'."\n";
+ print $FD ' [ -f "$K" ] || continue'."\n";
+ print $FD ' echo >> $file'."\n";
+ print $FD ' echo "title '.$title.'" >> $file'."\n";
+ print $FD ' echo " root (hd0)" >> $file'."\n";
+ print $FD ' echo " kernel $K root=/dev/sda1 $args" >> $file'."\n";
+ print $FD ' if [ -f "/boot/initrd-$D" ]; then'."\n";
+ print $FD ' echo " initrd /boot/initrd-$D" >> $file'."\n";
+ print $FD ' fi'."\n";
+ print $FD ' done'."\n";
+ print $FD 'done'."\n";
+ close $FD;
+ qxx ("chmod u+x $tmpdir/create_bootmenu.sh");
+ $status = qxx ("chroot $tmpdir bash -c ./create_bootmenu.sh 2>&1");
+ $result = $? >> 8;
+ if ($result != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("Failed to create boot menu: $status");
+ $kiwi -> failed ();
+ clean_loop $tmpdir;
+ return undef;
+ }
+ qxx ("rm -f $tmpdir/create_bootmenu.sh");
+ # etc/sysconfig/bootloader
+ if (open $FD, "$tmpdir/etc/sysconfig/bootloader") {
+ my @lines = <$FD>; close $FD;
+ $this -> __ensure_key (\@lines, "LOADER_TYPE" , "grub");
+ $this -> __ensure_key (\@lines, "DEFAULT_NAME" , $title);
+ $this -> __ensure_key (\@lines, "DEFAULT_APPEND" , $args );
+ $this -> __ensure_key (\@lines, "DEFAULT_VGA" , "" );
+ $this -> __ensure_key (\@lines, "FAILSAFE_APPEND" , $args );
+ $this -> __ensure_key (\@lines, "FAILSAFE_VGA" , "" );
+ $this -> __ensure_key (\@lines, "XEN_KERNEL_APPEND", $args );
+ $this -> __ensure_key (\@lines, "XEN_APPEND" , "" );
+ $this -> __ensure_key (\@lines, "XEN_VGA" , "" );
+ open $FD, ">$tmpdir/etc/sysconfig/bootloader";
+ print $FD @lines;
+ close $FD;
+ }
+ #==========================================
+ # setup fstab
+ #------------------------------------------
+ $this -> __copy_origin ("$tmpdir/etc/fstab");
+ if (! open $FD, ">>$tmpdir/etc/fstab") {
+ $kiwi -> failed ();
+ $kiwi -> error ("Failed to open $tmpdir/etc/fstab: $!");
+ $kiwi -> failed ();
+ clean_loop $tmpdir;
+ return undef;
+ }
+ print $FD '/dev/sda1 / none defaults 0 0'."\n";
+ close $FD;
+ #==========================================
+ # cleanup loop
+ #------------------------------------------
+ clean_loop $tmpdir;
+ #==========================================
# call ec2-bundle-image (Amazon toolkit)
#------------------------------------------
my $pk = $ec2{EC2PrivateKeyFile};
@@ -707,6 +888,43 @@
return $this;
}
+#==========================================
+# helper functions
+#------------------------------------------
+#==========================================
+# __ensure_key
+#------------------------------------------
+sub __ensure_key {
+ my $this = shift;
+ my $lines= shift;
+ my $key = shift;
+ my $val = shift;
+ my $found= 0;
+ my $i = 0;
+ for ($i=0;$i<@{$lines};$i++) {
+ if ($lines->[$i] =~ /^$key/) {
+ $lines->[$i] = "$key=\"$val\"";
+ $found = 1;
+ last;
+ }
+ }
+ if (! $found) {
+ $lines->[$i] = "$key=\"$val\"\n";
+ }
+}
+#==========================================
+# __copy_origin
+#------------------------------------------
+sub __copy_origin {
+ my $this = shift;
+ my $file = shift;
+ if (-f "$file.orig") {
+ qxx ("cp $file.orig $file");
+ } else {
+ qxx ("cp $file $file.orig");
+ }
+}
+
1;
# vim: set noexpandtab:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIURL.pm new/kiwi/modules/KIWIURL.pm
--- old/kiwi/modules/KIWIURL.pm 2011-01-31 12:38:16.000000000 +0100
+++ new/kiwi/modules/KIWIURL.pm 2011-02-03 15:59:07.000000000 +0100
@@ -108,6 +108,10 @@
if (defined $path) {
return $path;
}
+ $path = $this -> plainPath ($module);
+ if (defined $path) {
+ return $path;
+ }
$path = $this -> dirPath ($module);
if (defined $path) {
return $path;
@@ -294,19 +298,17 @@
if ((! defined $module) || ($module !~ /^smb:\/\//)) {
return undef;
}
- $module =~ s/^smb:\/\///;
- $name = basename ($module);
- $tmpdir = "/tmp/kiwimount-$name";
+ $module =~ s/^smb://;
#==========================================
# create SMB mount point and perform mount
#------------------------------------------
if (! defined $root) {
return $tmpdir;
}
- $status = qxx ("mkdir -p $tmpdir 2>&1");
+ $tmpdir = qxx ("mktemp -q -d /tmp/kiwimount.XXXXXX"); chomp $tmpdir;
$result = $? >> 8;
if ($result != 0) {
- $kiwi -> warning ("Couldn't create tmp dir for smb mount: $status: $!");
+ $kiwi -> warning ("Couldn't create tmp dir for smb mount: $tmpdir: $!");
$kiwi -> skipped ();
return undef;
}
@@ -315,7 +317,7 @@
"mount -t cifs -o username=$user,passwort=$pwd $module $tmpdir 2>&1"
);
} else {
- $status = qxx ("mount -t cifs $module $tmpdir 2>&1");
+ $status = qxx ("mount -t cifs -o guest $module $tmpdir 2>&1");
}
$result = $? >> 8;
if ($result != 0) {
@@ -551,6 +553,31 @@
}
#==========================================
+# plainPath
+#------------------------------------------
+sub plainPath {
+ # ...
+ # This method forwards the URL (everything following "plain://")
+ # unmodified to the package manager. This can be used if kiwi
+ # does not support a special URL but the package manager does.
+ # ---
+ my $this = shift;
+ my $module = shift;
+ my $kiwi = $this->{kiwi};
+ #==========================================
+ # normalize URL data
+ #------------------------------------------
+ if ((! defined $module) || ($module !~ /^plain:\/\//)) {
+ return undef;
+ }
+ $module =~ s/^plain:\/\///;
+ $kiwi -> loginfo (
+ "URL: $module will be forwarded AS IS to the package manger!\n"
+ );
+ return $module;
+}
+
+#==========================================
# urlResponse
#------------------------------------------
sub urlResponse {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIXML.pm new/kiwi/modules/KIWIXML.pm
--- old/kiwi/modules/KIWIXML.pm 2011-01-31 12:38:16.000000000 +0100
+++ new/kiwi/modules/KIWIXML.pm 2011-02-03 15:59:07.000000000 +0100
@@ -107,6 +107,7 @@
# Store object data
#------------------------------------------
$this->{kiwi} = $kiwi;
+ $this->{arch} = $arch;
#==========================================
# Lookup XML configuration file
#------------------------------------------
@@ -156,6 +157,7 @@
$this->{profilesNodeList}= $profilesNodeList;
$this->{repositNodeList} = $repositNodeList;
$this->{packageNodeList} = $packageNodeList;
+ $this->{instsrcNodeList} = $instsrcNodeList;
#==========================================
# Read and create profile hash
#------------------------------------------
@@ -209,8 +211,6 @@
#------------------------------------------
$this->{driversNodeList} = $driversNodeList;
$this->{usrdataNodeList} = $usrdataNodeList;
- $this->{instsrcNodeList} = $instsrcNodeList;
- $this->{arch} = $arch;
$this->{controlFile} = $controlFile;
#==========================================
# Store object data (create URL list)
@@ -4076,9 +4076,10 @@
#==========================================
# 1) merge/update repositories
#------------------------------------------
- if ($changeset->{xmlnode}) {
+ if ($changeset->{repositories}) {
$kiwi -> info ("Updating repository node(s)");
- my $need = new XML::LibXML::NodeList();
+ $this -> ignoreRepositories();
+ # 1) add those repos which are marked as fixed in the boot xml
my @node = $repositNodeList -> get_nodelist();
foreach my $element (@node) {
if (! $this -> __requestedProfile ($element)) {
@@ -4086,18 +4087,25 @@
}
my $status = $element -> getAttribute("status");
if ((! defined $status) || ($status eq "fixed")) {
- $need -> push ($element);
+ $this->{imgnameNodeList}->get_node(1)->appendChild ($element);
}
}
- $this->{repositNodeList} = $changeset->{xmlnode};
- $this->{repositNodeList} -> prepend ($need);
+ # 2) add those repos which are part of the changeset
+ foreach my $element (@{$changeset->{repositories}}) {
+ $this->{imgnameNodeList}->get_node(1)->appendChild ($element);
+ }
+ # 3) update XML tree
+ $this->{repositNodeList} =
+ $this->{systemTree}->getElementsByTagName ("repository");
+ $this -> createURLList();
+ $this -> updateXML();
$kiwi -> done ();
}
#==========================================
# 2) merge/update packages
#------------------------------------------
- if (($changeset->{xmlpacnode}) && ($changeset->{xmlobj})) {
- my @node = $changeset -> {xmlpacnode} -> get_nodelist();
+ if ($changeset->{xmlpacnode}) {
+ my @node = @{$changeset->{xmlpacnode}};
my @plist;
my @alist;
my @falistImage;
@@ -4106,9 +4114,6 @@
my %fixedBootInclude;
foreach my $element (@node) {
my $type = $element -> getAttribute ("type");
- if (! $this -> __requestedProfile ($element)) {
- next;
- }
if (($type eq "image") || ($type eq "bootstrap")) {
push (@plist,$element->getElementsByTagName ("package"));
push (@alist,$element->getElementsByTagName ("archive"));
@@ -4500,19 +4505,21 @@
# ---
my $this = shift;
my $element = shift;
+ my $nodeName = $element->nodeName();
if (! defined $element) {
+ # print "Element not defined\n";
return 1;
}
my $profiles = $element -> getAttribute ("profiles");
if (! defined $profiles) {
- # If no profile is specified, then it is assumed
- # to be in all profiles.
+ # If no profile is specified, then it is assumed to be in all profiles.
+ # print "Section $nodeName always used\n";
return 1;
}
if ((! $this->{reqProfiles}) || ((scalar @{$this->{reqProfiles}}) == 0)) {
- # element has a profile, but no profiles requested
- # so exclude it.
+ # element has a profile, but no profiles requested so exclude it.
+ # print "Section $nodeName profiled, but no profiles requested\n";
return 0;
}
my @splitProfiles = split(/,/, $profiles);
@@ -4526,10 +4533,12 @@
$reqprof =~ s/^\s+//s;
$reqprof =~ s/\s+$//s;
if (defined $profileHash{$reqprof}) {
+ # print "Section $nodeName selected\n";
return 1;
}
}
}
+ # print "Section $nodeName not selected\n";
return 0;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/ix86/oemboot/suse-dump new/kiwi/system/boot/ix86/oemboot/suse-dump
--- old/kiwi/system/boot/ix86/oemboot/suse-dump 2011-01-27 12:18:29.000000000 +0100
+++ new/kiwi/system/boot/ix86/oemboot/suse-dump 2011-02-03 15:59:07.000000000 +0100
@@ -331,12 +331,13 @@
count=0
for i in /dev/mapper/${loop}*;do
psize=`partitionSize $i`
+ psize=$((psize / 1024))
partid=$(partitionID /dev/$loop $(nd $i))
partname=Root
if [ $reqpart -eq 2 ] && [ $count = 0 ];then
partname=Boot
fi
- echo "* $partname partition requires at least $psize KB" \
+ echo "* $partname partition requires at least $psize MB" \
>> $info
echo " Partition Type: 0x$partid" >> $info
count=$((count + 1))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/ix86/oemboot/suse-preinit new/kiwi/system/boot/ix86/oemboot/suse-preinit
--- old/kiwi/system/boot/ix86/oemboot/suse-preinit 2010-11-19 15:29:38.000000000 +0100
+++ new/kiwi/system/boot/ix86/oemboot/suse-preinit 2011-02-03 15:59:07.000000000 +0100
@@ -151,12 +151,12 @@
setupConsole
#======================================
-# Run user script
+# 12) Run user script
#--------------------------------------
runHook preCallInit
#======================================
-# 12) kill udev
+# 13) kill udev
#--------------------------------------
udevSystemStop
umountSystemFilesystems
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/s390/oemboot/suse-dump new/kiwi/system/boot/s390/oemboot/suse-dump
--- old/kiwi/system/boot/s390/oemboot/suse-dump 2010-11-19 15:29:39.000000000 +0100
+++ new/kiwi/system/boot/s390/oemboot/suse-dump 2011-02-03 15:59:07.000000000 +0100
@@ -99,11 +99,11 @@
local kbsize=$(echo $i | cut -f1 -d:)
local mbsize=$((kbsize / 1024))
local partid=$(partitionID /dev/$disk $(nd $device))
- if [ ! "$partid" = "83" ] && [ ! "$partid" = "8e" ] ;then
+ if [ ! "$partid" = "83" ];then
continue
fi
probeFileSystem $device
- if [ ! -z "$FSTYPE" ] && [ "$FSTYPE" != "unknown" ];then
+ if [ ! -z "$FSTYPE" ] && [ ! "$FSTYPE" = "unknown" ];then
continue
fi
if [ -z "$result" ];then
@@ -127,7 +127,7 @@
local dsize=0
local index=0
local message
- local prefix=/cdrom
+ local prefix
#======================================
# Check for install mode indicator file
#--------------------------------------
@@ -254,27 +254,21 @@
#======================================
# Evaluate OEM install file
#--------------------------------------
- field=0
- imageZipped="uncompressed"
- IFS=";" ; for n in $IMAGE;do
- case $field in
- 0) field=1 ;;
- 1) imageName=$n ; field=2 ;;
- 2) imageVersion=$n; field=3 ;;
- 3) imageZipped=$n ;
- esac
- done
+ imageName=$(echo $IMAGE | cut -f2 -d=)
if [ ! -z "$pxe" ];then
prefix=/image
- fi
- if [ "$imageZipped" = "compressed" ];then
- imageName="$prefix/$imageName.gz"
- imageMD5="$imageName.md5"
else
- imageName="$prefix/$imageName"
- imageMD5="$imageName.md5"
+ prefix=/squashed
+ mkdir -p $prefix
+ if ! mount -o loop /cdrom/$imageName.squashfs $prefix;then
+ systemException \
+ "Failed to mount install image container" \
+ "reboot"
+ fi
fi
- IFS=$IFS_ORIG
+ imageName=$prefix/$imageName
+ imageMD5=$(echo $imageName | sed -e s@.raw@.md5@)
+ OEMRootImage=$imageName
#======================================
# Search, ask for the install partition
#--------------------------------------
@@ -283,6 +277,8 @@
# Loop mount disk image file
#--------------------------------------
reqpart=1
+ info=/tmp/partinfo
+ wmrc=/wmrc
loop=$(losetup -s -f $imageName)
loop=$(echo $loop | sed -e s@^/dev/@@)
if ! kpartx -a /dev/$loop;then
@@ -305,47 +301,110 @@
"Installation aborted..." \
"reboot"
fi
- partitions=$(OEMFindPartitions $instDisk)
- if [ ! -z "$partitions" ];then
- count=0
- IFS=","
- for i in $partitions;do
- count=$((count + 1))
- done
- IFS=$IFS_ORIG
- fi
- if [ -z "$partitions" ] || [ $count -lt $reqpart ];then
- if [ -z "$partitions" ];then
- Echo "No suitable partition(s) for installation found:"
- else
- Echo "Not enough partitions for installation found:"
- Echo "Found $count but required $reqpart"
+ while true;do
+ partitions=$(OEMFindPartitions $instDisk)
+ if [ ! -z "$partitions" ];then
+ count=0
+ IFS=","
+ for i in $partitions;do
+ count=$((count + 1))
+ done
+ IFS=$IFS_ORIG
fi
- Echo "Please prepare your disk first:"
- echo
- Echo -b "kiwi requires $reqpart partition(s) of the types below"
- Echo -b "without any filesystem inside. I recommend to use YaST"
- Echo -b "to do the re-partitioning. YaST also allows you to shrink"
- Echo -b "existing partitions without loosing data."
- echo
- count=0
- for i in /dev/mapper/${loop}*;do
- psize=`partitionSize $i`
- partid=$(partitionID /dev/$loop $(nd $i))
- if [ $count = 0 ];then
- Echo -b "* Root partition requires at least $psize KB"
+ if [ -z "$partitions" ] || [ $count -lt $reqpart ];then
+ #======================================
+ # Print partition user information
+ #--------------------------------------
+ if [ -z "$partitions" ];then
+ echo "No suitable partition(s) for installation found:" \
+ > $info
+ else
+ echo "Not enough partitions for installation found:" \
+ > $info
+ echo "Found $count but required $reqpart" >> $info
fi
- if [ $count = 1 ];then
- Echo -b "* Boot partition requires at least $psize KB"
+ echo "Please prepare your disk first:" >> $info
+ echo >> $info
+ echo "kiwi requires $reqpart partition(s) of the" >> $info
+ echo "types below without any filesystem inside !" >> $info
+ echo >> $info
+ count=0
+ for i in /dev/mapper/${loop}*;do
+ psize=`partitionSize $i`
+ partid=$(partitionID /dev/$loop $(nd $i))
+ partname=Root
+ if [ $reqpart -eq 2 ] && [ $count = 0 ];then
+ partname=Boot
+ fi
+ echo "* $partname partition requires at least $psize KB" \
+ >> $info
+ echo " Partition Type: 0x$partid" >> $info
+ count=$((count + 1))
+ done
+ #======================================
+ # Mount OEM root image read-write
+ #--------------------------------------
+ OEMRootSystem=/system
+ mkdir -p $OEMRootSystem
+ createSnapshotMap $OEMRootImage
+ if [ ! -e $snapshotMap ];then
+ systemException \
+ "Failed to create CD root snapshot map..." \
+ "reboot"
fi
- Echo -b " Partition Type: 0x$partid"
- count=$((count + 1))
- done
- echo
- systemException \
- "Installation aborted..." \
- "reboot"
- fi
+ if ! mount $snapshotMap $OEMRootSystem;then
+ systemException \
+ "Failed to mount OEM root image..." \
+ "reboot"
+ fi
+ #======================================
+ # Check OEM image tool chain
+ #--------------------------------------
+ for i in \
+ usr/sbin/gparted \
+ usr/bin/dialog \
+ usr/bin/xinit \
+ usr/bin/xterm \
+ usr/bin/dialog \
+ usr/bin/icewm
+ do
+ if [ ! -e $OEMRootSystem/$i ];then
+ systemException \
+ "missing $i in OEM image..." \
+ "reboot"
+ fi
+ done
+ #======================================
+ # Make system devices available
+ #--------------------------------------
+ for i in dev sys proc dev/pts;do
+ mount --bind /$i /system/$i
+ done
+ #======================================
+ # Start gparted for partition setup
+ #--------------------------------------
+ cp $info /system/tmp
+ cp $wmrc /system/tmp
+ chroot /system xinit /bin/bash -c '
+ icewm -c /tmp/wmrc &
+ xterm +sb -e dialog --textbox /tmp/partinfo 20 70 &
+ gparted $imageDiskDevice
+ ' -- :0 vt7
+ #======================================
+ # Cleanup and recheck
+ #--------------------------------------
+ for i in dev/pts proc sys dev;do
+ umount /system/$i
+ done
+ umount $OEMRootSystem
+ resetSnapshotMap
+ continue
+ fi
+ #======================================
+ # Partition setup fine, proceed
+ #--------------------------------------
+ break
+ done
#======================================
# Do we have a LVM image...
#--------------------------------------
@@ -372,9 +431,9 @@
#--------------------------------------
for p in /dev/mapper/${loop}*;do
if [ $p = /dev/mapper/${loop}p1 ];then
- select="root"
- elif [ $p = /dev/mapper/${loop}p2 ];then
select="boot"
+ elif [ $p = /dev/mapper/${loop}p2 ];then
+ select="root"
fi
TEXT_SELECT=$(
getText "Select %1 partition for installation:" $select)
@@ -411,20 +470,27 @@
else
partitions_next=$partitions_next,$pname:$psize
fi
+ count=$((count + 1))
fi
- count=$((count + 1))
done
IFS=$IFS_ORIG
partitions=$partitions_next
if [ $p = /dev/mapper/${loop}p1 ];then
imageDevice=$selectedPart
- rID=$(nd $selectedPart)
- instItems[0]=$imageName:$imageDevice
- elif [ $p = /dev/mapper/${loop}p2 ];then
bID=$(nd $selectedPart)
+ instItems[0]=/dev/mapper/${loop}p1:$imageDevice
+ elif [ $p = /dev/mapper/${loop}p2 ];then
+ rID=$(nd $selectedPart)
instItems[1]=/dev/mapper/${loop}p2:$selectedPart
fi
done
+ # /.../
+ # reverse order of instItems because
+ # root partition must be first entry
+ # ----
+ instItems_tmp=${instItems[0]}
+ instItems[0]=${instItems[1]}
+ instItems[1]=$instItems_tmp
fi
#======================================
# Search for a swap space
@@ -448,9 +514,9 @@
bID=$rID
fi
if [ "$haveLVM" = "yes" ];then
- setupDeviceNames $rID $sID no no $bID no $VGROUP
+ setupDeviceNames $rID $sID no $bID no $VGROUP
else
- setupDeviceNames $rID $sID no no $bID no
+ setupDeviceNames $rID $sID no $bID no
fi
else
instItems[0]=$imageName:$imageDevice
@@ -470,9 +536,6 @@
if [ -z "$nombridcheck" ];then
mbrD=$instDisk
mbrI="cat $imageName"
- if [ "$imageZipped" = "compressed" ];then
- mbrI="gzip -cd $imageName"
- fi
mbrM=$(dd if=$mbrD bs=1 count=4 \
skip=$((0x1b8))|hexdump -n4 -e '"0x%x"')
mbrI=$($mbrI | dd bs=1 count=4 \
@@ -562,12 +625,14 @@
#--------------------------------------
if [ -z "$pxe" ];then
dump="cat $Source"
- if test "$imageZipped" = "compressed"; then
- dump="gzip -cd $Source"
- fi
if [ -x /usr/bin/dcounter ];then
- progressBaseName=$(basename $Source)
- TEXT_LOAD=$(getText "Loading %1" $progressBaseName)
+ if [ ! -z "$OEM_PARTITION_INSTALL" ];then
+ progressP=$(echo $Source | cut -f5 -dp)
+ progressBaseName="$(basename $OEMRootImage) [p$progressP]"
+ else
+ progressBaseName=$(basename $Source)
+ fi
+ TEXT_LOAD=$(getText "Loading %1" "$progressBaseName")
dump="$dump | dcounter -s $needMByte -l \"$TEXT_LOAD \""
fi
Echo "Loading $Source [$Target] "
@@ -606,7 +671,7 @@
else
multicast="disable"
Echo "Loading $Source [$Target BS:$imageBlkSize Byte]..."
- fetchFile $Source $Target $imageZipped $imageServer
+ fetchFile $Source $Target uncompressed $imageServer
if test $loadCode != 0 || ! loadOK "$loadStatus";then
systemException \
"Download of $imageName failed: $loadStatus" \
@@ -631,6 +696,7 @@
if [ -x /usr/bin/dcounter ];then
test -e /progress || mkfifo /progress
TEXT_VERIFY=$(getText "Verifying %1" $imageDevice)
+ echo "$TEXT_VERIFY ( 0% )" > /progress &
dump="cat $imageDevice"
dump="$dump | dcounter -s $verifyMByte -l \"$TEXT_VERIFY \""
errorLogStop
@@ -670,7 +736,10 @@
#======================================
# Umount CD/DVD USB
#--------------------------------------
- umount /cdrom
+ if [ -z "$pxe" ];then
+ umount /squashed
+ umount /cdrom
+ fi
#======================================
# Reread partition table
#--------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/s390/oemboot/suse-linuxrc new/kiwi/system/boot/s390/oemboot/suse-linuxrc
--- old/kiwi/system/boot/s390/oemboot/suse-linuxrc 2010-12-10 10:39:41.000000000 +0100
+++ new/kiwi/system/boot/s390/oemboot/suse-linuxrc 2011-02-03 15:59:07.000000000 +0100
@@ -87,7 +87,7 @@
export imageRWDevice=/dev/$VGROUP/LVRoot
export imageRODevice=/dev/$VGROUP/LVComp
export imageIOWRDevice=$imageRWDevice
- export imageBootDevice=$(ddn $imageDiskDevice 2)
+ export imageBootDevice=$(ddn $imageDiskDevice 1)
if [ ! -z "$KIWI_RECOVERY" ];then
export imageRecoveryDevice=$(ddn $imageDiskDevice $KIWI_RECOVERY)
fi
@@ -369,9 +369,13 @@
systemException "Failed to store $i" "reboot"
fi
done
- if ! cp -a var/lib/rpm tmp/;then
- rm -rf tmp/rpm; cd / ; umountSystem
- systemException "Failed to store RPM database" "reboot"
+ if ! cp -a etc/zypp etc/zypp.backup;then
+ rm -rf etc/zypp.backup; cd / ; umountSystem
+ systemException "Failed to backup zypp database" "reboot"
+ fi
+ if ! cp -a var/lib/rpm var/lib/rpm.backup;then
+ rm -rf var/lib/rpm.backup; cd / ; umountSystem
+ systemException "Failed to backup RPM database" "reboot"
fi
fi
#======================================
@@ -472,12 +476,9 @@
systemException "Failed to restore $i" "reboot"
fi
done
- mv /mnt/var/lib/rpm /mnt/var/lib/rpm.backup
- if ! mv /mnt/tmp/rpm /mnt/var/lib/;then
- mv /mnt/var/lib/rpm.backup /mnt/var/lib/rpm
- systemException "Failed to restore RPM database" "reboot"
+ if [ -e /mnt/etc/zypp.backup ];then
+ rm -rf /mnt/etc/zypp && mv /mnt/etc/zypp.backup /mnt/etc/zypp
fi
- rm -rf /mnt/var/lib/rpm.backup
fi
#======================================
# 16.5) restore boot files 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/s390/oemboot/suse-preinit new/kiwi/system/boot/s390/oemboot/suse-preinit
--- old/kiwi/system/boot/s390/oemboot/suse-preinit 2010-11-19 15:29:39.000000000 +0100
+++ new/kiwi/system/boot/s390/oemboot/suse-preinit 2011-02-03 15:59:07.000000000 +0100
@@ -156,12 +156,17 @@
fi
#======================================
-# Run user script
+# 12) setup console
+#--------------------------------------
+setupConsole
+
+#======================================
+# 13) Run user script
#--------------------------------------
runHook preCallInit
#======================================
-# 12) kill udev
+# 14) kill udev
#--------------------------------------
udevSystemStop
umountSystemFilesystems
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/s390/oemboot/suse-repart new/kiwi/system/boot/s390/oemboot/suse-repart
--- old/kiwi/system/boot/s390/oemboot/suse-repart 2010-11-05 16:47:03.000000000 +0100
+++ new/kiwi/system/boot/s390/oemboot/suse-repart 2011-02-03 15:59:07.000000000 +0100
@@ -419,7 +419,7 @@
# Extend LVRoot...
#--------------------------------------
if [ -z "$OEM_SYSTEMSIZE" ];then
- lvextend -l 100%FREE /dev/$VGROUP/LVRoot
+ lvextend -l +100%FREE /dev/$VGROUP/LVRoot
else
lvextend --size $OEM_SYSTEMSIZE"M" /dev/$VGROUP/LVRoot
fi
@@ -454,7 +454,7 @@
#======================================
# resize LV's
#--------------------------------------
- lvresize -l 100%FREE $imageRootDevice
+ lvresize -l +100%FREE $imageRootDevice
fi
#======================================
# resize boot filesystem if needed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/s390/vmxboot/suse-linuxrc new/kiwi/system/boot/s390/vmxboot/suse-linuxrc
--- old/kiwi/system/boot/s390/vmxboot/suse-linuxrc 2010-12-10 10:39:41.000000000 +0100
+++ new/kiwi/system/boot/s390/vmxboot/suse-linuxrc 2011-02-03 15:59:07.000000000 +0100
@@ -127,7 +127,11 @@
#--------------------------------------
Echo "Searching for boot device..."
if [ "$LOCAL_BOOT" = "no" ];then
- if ! searchBusIDBootDevice;then
+ searchBIOSBootDevice
+ if [ ! -e "$biosBootDevice" ];then
+ searchBusIDBootDevice
+ fi
+ if [ ! -e "$biosBootDevice" ];then
systemException "$biosBootDevice" "reboot"
fi
export imageDiskDevice=$biosBootDevice
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/s390/vmxboot/suse-preinit new/kiwi/system/boot/s390/vmxboot/suse-preinit
--- old/kiwi/system/boot/s390/vmxboot/suse-preinit 2010-09-09 13:14:25.000000000 +0200
+++ new/kiwi/system/boot/s390/vmxboot/suse-preinit 2011-02-03 15:59:07.000000000 +0100
@@ -108,7 +108,12 @@
fi
#======================================
-# 11) kill udev
+# 11) setup console
+#--------------------------------------
+setupConsole
+
+#======================================
+# 12) kill udev
#--------------------------------------
udevSystemStop
umountSystemFilesystems
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org