Hello community, here is the log from the commit of package kiwi for openSUSE:Factory checked in at 2011-10-26 15:44:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kiwi (Old) and /work/SRC/openSUSE:Factory/.kiwi.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kiwi", Maintainer is "m...@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/kiwi/kiwi.changes 2011-10-18 14:29:07.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.kiwi.new/kiwi.changes 2011-10-26 15:53:52.000000000 +0200 @@ -1,0 +2,109 @@ +Wed Oct 26 14:47:02 CEST 2011 - m...@suse.de + +- v4.98.5 released + +------------------------------------------------------------------- +Wed Oct 26 14:44:39 CEST 2011 - m...@suse.de + +- fixed creation of XML diff in log file + +------------------------------------------------------------------- +Wed Oct 26 12:49:23 CEST 2011 - m...@suse.de + +- fixed parted flag setup in KIWILinuxRC code, 12.1 and upstream + parted doesn't support the hex id's like 'set type 0x..' + +------------------------------------------------------------------- +Wed Oct 26 12:38:34 CEST 2011 - m...@suse.de + +- fixed KIWIXMLInfo unit test due to last --info changes + +------------------------------------------------------------------- +Wed Oct 26 11:22:25 CEST 2011 - m...@suse.de + +- call createURLList() only on demand. Also provide accessor + methods for xml->{urllist} and xml->{urlhash}, don't access + these object data directly anymore. createURLList() was called + in the KIWIXML constructor but changes to the XML might happen + at a later point in time. So it makes sense to build the final + URL list when access to it is requested + +------------------------------------------------------------------- +Tue Oct 25 17:30:15 CEST 2011 - m...@suse.de + +- call setupNetworkStatic in suse-preinit for s390. With this + change we write the network configuration as received by + the initrd into the system config files below /etc/sysconfig + +------------------------------------------------------------------- +Tue Oct 25 17:20:53 CEST 2011 - m...@suse.de + +- added function convertCIDRToNetmask() which allows the interpretation + of the CIDR extension like 192.168.1.1/24 to create a standard netmask + 255.255.255.0 out of it. + +------------------------------------------------------------------- +Tue Oct 25 13:04:57 CEST 2011 - m...@suse.de + +- fixed use of uninitialized value $free in KIWIXML.pm + +------------------------------------------------------------------- +Tue Oct 25 12:33:09 CEST 2011 - m...@suse.de + +- make the info module write the imagescan XML into a tmpfile (bnc #726337) + +------------------------------------------------------------------- +Tue Oct 25 11:36:43 CEST 2011 - m...@suse.de + +- added log information about cylinder size and count +- fixed parted flag setup, 12.1 and upstream parted doesn't + support the hex id's like 'set type 0x..' + +------------------------------------------------------------------- +Mon Oct 24 16:00:41 CEST 2011 - m...@suse.de + +- fixed default boot label selection in syslinux mode + +------------------------------------------------------------------- +Mon Oct 24 10:56:31 CEST 2011 - m...@suse.de + +- added support for overlay file and archive listing in info module + +------------------------------------------------------------------- +Fri Oct 21 16:43:56 CEST 2011 - m...@suse.de + +- fixed escaping of chown parameters (bnc #725706) + +------------------------------------------------------------------- +Thu Oct 20 16:53:59 CEST 2011 - m...@suse.de + +- added update repo path for 11.4 images due to grub bug (bnc #717836) + +------------------------------------------------------------------- +Wed Oct 19 14:44:12 CEST 2011 - m...@suse.de + +- check for FSTYPE == btrfs in createOriginSnapshot() + +------------------------------------------------------------------- +Wed Oct 19 13:05:00 CEST 2011 - m...@suse.de + +- fixed creation of btrfs origin snapshot. This is now done + on first boot of the appliance and not after kiwi prepare + +------------------------------------------------------------------- +Wed Oct 19 12:01:38 CEST 2011 - m...@suse.de + +- added baseSetupBtrfsOrigin() function which allows to add + an origin snapshot for the image root filesystem contents + +------------------------------------------------------------------- +Tue Oct 18 15:38:30 CEST 2011 - m...@suse.de + +- moved README to mkd style + +------------------------------------------------------------------- +Tue Oct 18 15:37:31 CEST 2011 - m...@suse.de + +- adapt README style + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kiwi.spec ++++++ --- /var/tmp/diff_new_pack.oNDGmJ/_old 2011-10-26 15:54:19.000000000 +0200 +++ /var/tmp/diff_new_pack.oNDGmJ/_new 2011-10-26 15:54:19.000000000 +0200 @@ -69,7 +69,7 @@ %endif %endif Summary: OpenSuSE - KIWI Image System -Version: 4.98.4 +Version: 4.98.5 Release: 1 Group: System/Management License: GPLv2 ++++++ kiwi-docu.tar.bz2 ++++++ /work/SRC/openSUSE:Factory/kiwi/kiwi-docu.tar.bz2 /work/SRC/openSUSE:Factory/.kiwi.new/kiwi-docu.tar.bz2 differ: char 11, line 1 ++++++ kiwi-repo.tar.bz2 ++++++ ++++++ kiwi.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/.revision new/kiwi/.revision --- old/kiwi/.revision 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/.revision 2011-10-26 14:47:33.000000000 +0200 @@ -1 +1 @@ -5ce5840e53704be6ea9749c624382c1e93429f9d +c0cd267086f0183b6d6504885808cff14a9d3615 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/README new/kiwi/README --- old/kiwi/README 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,49 +0,0 @@ -KIWI -==== - -The openSUSE KIWI Image System provides a complete operating -system image solution for Linux supported hardware platforms as -well as for virtualization systems like Xen, VMware, etc. The KIWI -architecture was designed as a two level system. The first stage, -based on a valid software package source, creates a so called -unpacked image according to the provided image description. -The second stage creates from a required unpacked image an -operating system image. The result of the second stage is called -a packed image or short an image. - -Installation ------------- - -packages for kiwi are provided at the openSUSE buildservice: -http://download.opensuse.org/repositories/Virtualization:/Appliances/ - -Usage ------ - -* make sure you have the kiwi-templates package installed -* build a live ISO example: - - kiwi --build suse-XXX-JeOS -d /tmp/myimage --type iso - -* run your OS in a VM like kvm - - kvm -cdrom /tmp/myimage/*.iso - -Mailing list ------------- - - http://groups.google.com/group/kiwi-images - -Contributing ------------- - -1. Fork it. -2. Create a branch (`git checkout -b my_kiwi`) -3. Commit your changes (`git commit -am "Added Snarkdown"`) -4. Push to the branch (`git push origin my_kiwi`) -5. Create an [Issue][1] with a link to your branch -6. Enjoy a refreshing Diet Coke and wait - -also see the git-review gem - -Remember to have fun :) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/README.mkd new/kiwi/README.mkd --- old/kiwi/README.mkd 1970-01-01 01:00:00.000000000 +0100 +++ new/kiwi/README.mkd 2011-10-25 15:40:01.000000000 +0200 @@ -0,0 +1,54 @@ +KIWI +==== + +Introduction +------------ + +The openSUSE KIWI Image System provides a complete operating +system image solution for Linux supported hardware platforms as +well as for virtualization systems like Xen, VMware, etc. The KIWI +architecture was designed as a two level system. The first stage, +based on a valid software package source, creates a so called +unpacked image according to the provided image description. +The second stage creates from a required unpacked image an +operating system image. The result of the second stage is called +a packed image or short an image. + +Installation +------------ + +packages for kiwi are provided at the openSUSE buildservice: +http://download.opensuse.org/repositories/Virtualization:/Appliances/ + +Usage +----- + +1. make sure you have the kiwi-templates package installed +2. build a live ISO example: + +```kiwi --build suse-XXX-JeOS -d /tmp/myimage --type iso +``` + +3. run your OS in a VM like kvm + +```kvm -cdrom /tmp/myimage/*.iso +``` + +Mailing list +------------ + +* http://groups.google.com/group/kiwi-images + +Contributing +------------ + +1. Fork it. +2. Create a branch (`git checkout -b my_kiwi`) +3. Commit your changes (`git commit -am "Added Snarkdown"`) +4. Push to the branch (`git push origin my_kiwi`) +5. Create an [Issue][1] with a link to your branch +6. Enjoy a refreshing Diet Coke and wait + +also see the git-review gem + +Remember to have fun :) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/kiwi.pl new/kiwi/kiwi.pl --- old/kiwi/kiwi.pl 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/kiwi.pl 2011-10-26 14:47:33.000000000 +0200 @@ -1057,6 +1057,12 @@ } $InitCache =~ s/\/$//; } + if (defined $ListXMLInfo) { + if (($ListXMLInfo !~ /^\//) && (! -d $ListXMLInfo)) { + $ListXMLInfo = $gdata->{System}."/".$ListXMLInfo; + } + $ListXMLInfo =~ s/\/$//; + } #======================================== # store uniq path to image description #---------------------------------------- @@ -1670,13 +1676,6 @@ # private Exit function, exit safely # --- my $code = $_[0]; - my $gdata= $global -> getGlobals(); - #========================================== - # Write temporary XML changes to logfile - #------------------------------------------ - if (defined $kiwi) { - $kiwi -> writeXML ($gdata->{Pretty}); - } #========================================== # Create log object if we don't have one... #------------------------------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIBoot.pm new/kiwi/modules/KIWIBoot.pm --- old/kiwi/modules/KIWIBoot.pm 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/modules/KIWIBoot.pm 2011-10-25 15:40:01.000000000 +0200 @@ -386,7 +386,7 @@ my $minInodes; my $sizeXMLBytes = 0; my $spare = 100 * 1024 * 1024; # 100M free - my $fsoverhead = 1.4; # 4% filesystem overhead + my $fsoverhead = 1.4; my $fsopts = $cmdL -> getFilesystemOptions(); my $inodesize = $fsopts->[1]; my $inoderatio = $fsopts->[2]; @@ -2967,7 +2967,7 @@ #========================================== # setup boot loader default boot label/nr #------------------------------------------ - my $defaultBootNr = 0; + my $defaultBootNr = 0; if ($xml) { %type = %{$xml->getImageTypeAndAttributes()}; $cmdline = $type{cmdline}; @@ -3283,16 +3283,30 @@ print FD "gfxboot bootlogo"."\n"; } } + #========================================== + # Setup default title + #------------------------------------------ if ($type =~ /^KIWI (CD|USB)/) { - $title = $this -> makeLabel ("Install/Restore $label"); + if ($defaultBootNr == 0) { + $title = $this -> makeLabel ("Boot from Hard Disk"); + } elsif ($defaultBootNr == 1) { + $title = $this -> makeLabel ("Install/Restore $label"); + } else { + $title = $this -> makeLabel ( + "Failsafe -- Install/Restore $label" + ); + } } else { $title = $this -> makeLabel ("$label [ $type ]"); } print FD "default $title"."\n"; if ($type =~ /^KIWI (CD|USB)/) { - my $localboot = $this -> makeLabel ("Boot from Hard Disk"); - print FD "label $localboot\n"; + $title = $this -> makeLabel ("Boot from Hard Disk"); + print FD "label $title\n"; print FD "localboot 0x80\n"; + $title = $this -> makeLabel ("Install/Restore $label"); + } else { + $title = $this -> makeLabel ("$label [ $type ]"); } print FD "label $title"."\n"; push @labels,$title; @@ -4215,6 +4229,12 @@ } chomp $status; $this->{pDiskCylinders} = $status; + $kiwi -> loginfo ( + "Disk Cylinder size is: $this->{pDiskCylinderSize} kB\n" + ); + $kiwi -> loginfo ( + "Disk Cylinder count is: $this->{pDiskCylinders}\n" + ); return $status; } @@ -4405,7 +4425,11 @@ if ($cmd eq "t") { my $index= $commands[$count+1]; my $type = $commands[$count+2]; - push (@p_cmd,"set $index type 0x$type"); + if ($type eq "8e") { + push (@p_cmd,"set $index lvm on"); + } elsif ($type eq "82") { + push (@p_cmd,"set $index swap on"); + } } if ($cmd eq "a") { my $index= $commands[$count+1]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWICache.pm new/kiwi/modules/KIWICache.pm --- old/kiwi/modules/KIWICache.pm 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/modules/KIWICache.pm 2011-10-26 14:47:33.000000000 +0200 @@ -312,7 +312,7 @@ #========================================== # write XML changes to logfile... #------------------------------------------ - $kiwi -> writeXML ($this->{gdata}->{Pretty}); + $kiwi -> writeXMLDiff ($this->{gdata}->{Pretty}); #========================================== # Reformat log file for human readers... #------------------------------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIGlobals.pm new/kiwi/modules/KIWIGlobals.pm --- old/kiwi/modules/KIWIGlobals.pm 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/modules/KIWIGlobals.pm 2011-10-26 14:47:33.000000000 +0200 @@ -40,7 +40,7 @@ # Globals (generic) #------------------------------------------ my %data; - $data{Version} = "4.98.4"; + $data{Version} = "4.98.5"; $data{Publisher} = "SUSE LINUX Products GmbH"; $data{Preparer} = "KIWI - http://kiwi.berlios.de"; $data{ConfigName} = "config.xml"; 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-10-18 12:50:04.000000000 +0200 +++ new/kiwi/modules/KIWIImage.pm 2011-10-25 15:40:01.000000000 +0200 @@ -4025,7 +4025,7 @@ my $xml = $this->{xml}; my $mini = qxx ("find $extend | wc -l"); chomp $mini; my $minsize= qxx ("du -s --block-size=1 $extend | cut -f1"); chomp $minsize; - my $fsohead= 1.4; # 4% filesystem overhead + my $fsohead= 1.4; my $spare = 100 * 1024 * 1024; my $files = $mini; my $fsopts = $cmdL -> getFilesystemOptions(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIImageCreator.pm new/kiwi/modules/KIWIImageCreator.pm --- old/kiwi/modules/KIWIImageCreator.pm 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/modules/KIWIImageCreator.pm 2011-10-26 14:47:33.000000000 +0200 @@ -174,6 +174,7 @@ # Apply XML over rides from command line #------------------------------------------ $xml = $this -> __applyBaseXMLOverrides($xml); + $kiwi -> writeXMLDiff ($this->{gdata}->{Pretty}); return $this -> __prepareTree ( $xml,$configDir,$rootTgtDir,$systemTree ); @@ -230,6 +231,7 @@ #------------------------------------------ $xml = $this -> __applyBaseXMLOverrides($xml); $xml = $this -> __applyAdditionalXMLOverrides($xml); + $kiwi -> writeXMLDiff ($this->{gdata}->{Pretty}); if (! $krc -> prepareChecks()) { return undef; } @@ -310,6 +312,7 @@ #------------------------------------------ $xml = $this -> __applyBaseXMLOverrides($xml); $xml = $this -> __applyAdditionalXMLOverrides($xml); + $kiwi -> writeXMLDiff ($this->{gdata}->{Pretty}); if (! $krc -> prepareChecks()) { return undef; } @@ -364,6 +367,7 @@ # Apply XML over rides from command line #------------------------------------------ $xml = $this -> __applyBaseXMLOverrides($xml); + $kiwi -> writeXMLDiff ($this->{gdata}->{Pretty}); #========================================== # Create destdir if needed #------------------------------------------ @@ -483,6 +487,7 @@ #------------------------------------------ $xml = $this -> __applyBaseXMLOverrides($xml); $xml = $this -> __applyAdditionalXMLOverrides($xml); + $kiwi -> writeXMLDiff ($this->{gdata}->{Pretty}); if (! $krc -> createChecks()) { return undef; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWILinuxRC.sh new/kiwi/modules/KIWILinuxRC.sh --- old/kiwi/modules/KIWILinuxRC.sh 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/modules/KIWILinuxRC.sh 2011-10-26 14:47:33.000000000 +0200 @@ -3960,6 +3960,33 @@ fi } #====================================== +# convertCIDRToNetmask +#-------------------------------------- +function convertCIDRToNetmask { + # /.../ + # convert the CIDR part to a useable netmask + # ---- + local cidr=$1 + local count=0 + for count in `seq 1 4`;do + if [ $((cidr / 8)) -gt 0 ];then + echo -n 255 + else + local remainder=$((cidr % 8)) + if [ $remainder -gt 0 ];then + echo -n $(( value = 256 - (256 >> remainder))) + else + echo -n 0 + fi + fi + cidr=$((cidr - 8)) + if [ $count -lt 4 ];then + echo -n . + fi + done + echo +} +#====================================== # setupNetworkStatic #-------------------------------------- function setupNetworkStatic { @@ -3968,6 +3995,14 @@ # or save the configuration depending on 'up' parameter # ---- local up=$1 + if [[ $hostip =~ / ]];then + #====================================== + # interpret the CIDR part and remove it from the hostip + #-------------------------------------- + local cidr=$(echo $hostip | cut -f2 -d/) + hostip=$(echo $hostip | cut -f1 -d/) + netmask=$(convertCIDRToNetmask $cidr) + fi if [ "$up" == "1" ];then #====================================== # activate network @@ -6883,7 +6918,11 @@ "t") ptypex=${pcmds[$index + 2]} partid=${pcmds[$index + 1]} - cmdq="$cmdq set $partid type 0x$ptypex" + if [ $ptypex -eq "8e" ];then + cmdq="$cmdq set $partid lvm on" + elif [ $ptypex -eq "82" ];then + cmdq="$cmdq set $partid swap on" + fi partedWrite "$disk" "$cmdq" cmdq="" ;; @@ -8074,6 +8113,25 @@ fi } #====================================== +# createOriginSnapshot +#-------------------------------------- +function createOriginSnapshot { + # /.../ + # create a snapshot origin which allows to keep + # track of any changes happened during the live + # time of the image. This origin snapshot requires + # the use of the btrfs filesystem + # ---- + if [ ! "$FSTYPE" = "btrfs" ];then + return + fi + if [ ! -x /sbin/btrfsctl ];then + echo "btrfsprogrs not installed... skipped" + return + fi + btrfsctl -s origin / +} +#====================================== # initialize #-------------------------------------- function initialize { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWILog.pm new/kiwi/modules/KIWILog.pm --- old/kiwi/modules/KIWILog.pm 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/modules/KIWILog.pm 2011-10-26 14:47:33.000000000 +0200 @@ -998,9 +998,9 @@ } #========================================== -# writeXML +# writeXMLDiff #------------------------------------------ -sub writeXML { +sub writeXMLDiff { my $this = shift; my $pretty = shift; my $data = $this->{xmlString}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIRoot.pm new/kiwi/modules/KIWIRoot.pm --- old/kiwi/modules/KIWIRoot.pm 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/modules/KIWIRoot.pm 2011-10-25 15:40:01.000000000 +0200 @@ -930,7 +930,7 @@ } } next if ! $ok; - my $data = qxx ("chroot $root chown -c root:root \"$file\" 2>&1"); + my $data = qxx ("chroot $root chown -c root:root '".$file."' 2>&1"); my $code = $? >> 8; if ($code != 0) { $kiwi -> warning ( 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-10-18 12:50:04.000000000 +0200 +++ new/kiwi/modules/KIWIXML.pm 2011-10-26 14:47:33.000000000 +0200 @@ -218,9 +218,9 @@ $this->{usrdataNodeList} = $usrdataNodeList; $this->{controlFile} = $controlFile; #========================================== - # Store object data (create URL list) + # Store object data #------------------------------------------ - $this -> createURLList (); + $this -> updateXML(); return $this; } @@ -331,6 +331,28 @@ } #========================================== +# getURLHash +#------------------------------------------ +sub getURLHash { + my $this = shift; + if (! $this->{urlhash}) { + $this -> createURLList(); + } + return $this->{urlhash}; +} + +#========================================== +# getURLList +#------------------------------------------ +sub getURLList { + my $this = shift; + if (! $this->{urllist}) { + $this -> createURLList(); + } + return $this->{urllist}; +} + +#========================================== # getImageName #------------------------------------------ sub getImageName { @@ -2604,7 +2626,7 @@ foreach my $volume (@vollist) { my $name = $volume -> getAttribute ("name"); my $free = $volume -> getAttribute ("freespace"); - if ($free eq "all") { + if ((defined $free) && ($free eq "all")) { $allFree = $name; last; } @@ -3005,6 +3027,7 @@ my $what = shift; my $nopac= shift; my $kiwi = $this->{kiwi}; + my $urllist = $this -> getURLList(); my %pattr; my $nodes; if ($what ne "metapackages") { @@ -3119,7 +3142,7 @@ #------------------------------------------ # 1) try to use libsatsolver... my $psolve = new KIWISatSolver ( - $kiwi,\@pattlist,$this->{urllist},"solve-patterns", + $kiwi,\@pattlist,$urllist,"solve-patterns", undef,undef,undef,$ptype ); if (! defined $psolve) { @@ -3295,6 +3318,7 @@ my $kiwi = $this->{kiwi}; my $nodes = $this->{packageNodeList}; my $manager = $this->getPackageManager(); + my $urllist = $this -> getURLList(); my @result = (); my @delete = (); my %meta = (); @@ -3384,7 +3408,7 @@ } } else { my $psolve = new KIWISatSolver ( - $kiwi,\@result,$this->{urllist},"solve-patterns", + $kiwi,\@result,$urllist,"solve-patterns", undef,undef,undef,$ptype ); if (! defined $psolve) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIXMLInfo.pm new/kiwi/modules/KIWIXMLInfo.pm --- old/kiwi/modules/KIWIXMLInfo.pm 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/modules/KIWIXMLInfo.pm 2011-10-26 14:47:33.000000000 +0200 @@ -20,6 +20,7 @@ use strict; use warnings; require Exporter; +use File::Find; use XML::LibXML; #========================================== @@ -135,18 +136,28 @@ # --- my $this = shift; my $requests = shift; + my $kiwi = $this->{kiwi}; my $infoRequests = $this -> __checkRequests($requests); if (! $infoRequests) { return undef; } + my $outfile = qxx ("mktemp -q /tmp/kiwi-xmlinfo-XXXXXX 2>&1"); + my $code = $? >> 8; chomp $outfile; + if ($code != 0) { + $kiwi -> error ("Couldn't create tmp file: $outfile: $!"); + $kiwi -> failed (); + return undef; + } $this -> {kiwi} -> info ("Reading image description [ListXMLInfo]...\n"); my $infoTree = $this -> __getTree($infoRequests); if (! $infoTree) { return undef; } - open (my $F, "|xsltproc $this->{gdata}->{Pretty} -"); + open (my $F, "|xsltproc $this->{gdata}->{Pretty} - | cat > $outfile"); print $F $infoTree -> toString(); close $F; + system ("cat $outfile"); + $kiwi -> info ("Requested information written to: $outfile\n"); return 1; } @@ -184,6 +195,8 @@ $supportedInfoReq{'patterns'} = 'List configured patterns'; $supportedInfoReq{'profiles'} = 'List profiles'; $supportedInfoReq{'repo-patterns'} = 'List available patterns from repos'; + $supportedInfoReq{'overlay-files'} = 'List of files in root overlay'; + $supportedInfoReq{'archives'} = 'List of tar archives to be installed'; $supportedInfoReq{'size'} = 'List install/delete size estimation'; $supportedInfoReq{'sources'} = 'List configured source URLs'; $supportedInfoReq{'types'} = 'List configured types'; @@ -272,12 +285,50 @@ # Initialize XML imagescan element #------------------------------------------ my $scan = new XML::LibXML::Element ("imagescan"); + $scan -> setAttribute ("description",$this->{configDir}); #========================================== # Walk through selection list #------------------------------------------ for my $info (@infoRequests) { SWITCH: for ($info) { #========================================== + # overlay-files + #------------------------------------------ + /^overlay-files/ && do { + my %result; + sub generateWanted { + my $filehash = shift; + my $basedir = shift; + return sub { + my $file = $File::Find::name; + if (! -d $file) { + $file =~ s/$basedir//; + $file = "[root/]$file"; + $filehash->{$file} = $basedir; + } + } + } + if (! -d $this->{configDir}."/root") { + $kiwi -> info ("No overlay root directory present\n"); + } else { + my $wref = generateWanted ( + \%result,$this->{configDir}."/root/" + ); + my $rdir = $this->{configDir}."/root"; + find({ wanted => $wref, follow => 0 }, $rdir); + if (! %result) { + $kiwi -> info ("No overlay files found\n"); + } else { + foreach my $file (sort keys %result) { + my $overlay = new XML::LibXML::Element ("overlay"); + $overlay -> setAttribute ("file","$file"); + $scan -> appendChild ($overlay); + } + } + } + last SWITCH; + }; + #========================================== # repo-patterns #------------------------------------------ /^repo-patterns/ && do { @@ -428,6 +479,19 @@ } last SWITCH; }; + /^archives/ && do { + my @archives = $xml -> getArchiveList(); + if ((scalar @archives) == 0) { + $kiwi -> info ("No archives available\n"); + } else { + foreach my $archive (@archives) { + my $anode = new XML::LibXML::Element ("archive"); + $anode -> setAttribute ("name","$archive"); + $scan -> appendChild ($anode); + } + } + last SWITCH; + }; #========================================== # profiles #------------------------------------------ @@ -476,15 +540,16 @@ my $this = shift; my $xml = shift; my $kiwi = $this->{kiwi}; + my $uhash= $xml -> getURLHash(); my @mountPnts; - if ($xml->{urlhash}) { - for my $source (keys %{$xml->{urlhash}}) { + if ($uhash) { + for my $source (keys %{$uhash}) { #========================================== # iso:// sources #------------------------------------------ if ($source =~ /^iso:\/\/(.*)/) { my $iso = $1; - my $dir = $xml->{urlhash}->{$source}; + my $dir = $uhash->{$source}; my $data = qxx ("mkdir -p $dir; mount -o loop $iso $dir 2>&1"); my $code = $? >> 8; if ($code != 0) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/ix86/isoboot/suse-preinit new/kiwi/system/boot/ix86/isoboot/suse-preinit --- old/kiwi/system/boot/ix86/isoboot/suse-preinit 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/system/boot/ix86/isoboot/suse-preinit 2011-10-25 15:40:01.000000000 +0200 @@ -41,6 +41,11 @@ createFramebufferDevices #====================================== -# 5) clean mount +# 5) create origin snapshot if possible +#-------------------------------------- +createOriginSnapshot + +#====================================== +# 6) clean mount #-------------------------------------- umountSystemFilesystems diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/ix86/netboot/suse-preinit new/kiwi/system/boot/ix86/netboot/suse-preinit --- old/kiwi/system/boot/ix86/netboot/suse-preinit 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/system/boot/ix86/netboot/suse-preinit 2011-10-25 15:40:01.000000000 +0200 @@ -132,7 +132,12 @@ kernelCheck #====================================== -# 13) kill udev +# 13) create origin snapshot if possible +#-------------------------------------- +createOriginSnapshot + +#====================================== +# 14) kill udev #-------------------------------------- udevSystemStop umountSystemFilesystems 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 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/system/boot/ix86/oemboot/suse-preinit 2011-10-25 15:40:01.000000000 +0200 @@ -124,12 +124,17 @@ setupConsole #====================================== -# 11) Run user script +# 11) create origin snapshot if possible +#-------------------------------------- +createOriginSnapshot + +#====================================== +# 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/ix86/vmxboot/suse-preinit new/kiwi/system/boot/ix86/vmxboot/suse-preinit --- old/kiwi/system/boot/ix86/vmxboot/suse-preinit 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/system/boot/ix86/vmxboot/suse-preinit 2011-10-25 15:40:01.000000000 +0200 @@ -84,7 +84,12 @@ setupConsole #====================================== -# 10) kill udev +# 10) create origin snapshot if possible +#-------------------------------------- +createOriginSnapshot + +#====================================== +# 11) kill udev #-------------------------------------- udevSystemStop umountSystemFilesystems diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/ppc/netboot/suse-preinit new/kiwi/system/boot/ppc/netboot/suse-preinit --- old/kiwi/system/boot/ppc/netboot/suse-preinit 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/system/boot/ppc/netboot/suse-preinit 2011-10-25 15:40:01.000000000 +0200 @@ -132,7 +132,12 @@ kernelCheck #====================================== -# 13) kill udev +# 13) create origin snapshot if possible +#-------------------------------------- +createOriginSnapshot + +#====================================== +# 14) kill udev #-------------------------------------- udevSystemStop umountSystemFilesystems diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/ppc/oemboot/suse-preinit new/kiwi/system/boot/ppc/oemboot/suse-preinit --- old/kiwi/system/boot/ppc/oemboot/suse-preinit 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/system/boot/ppc/oemboot/suse-preinit 2011-10-25 15:40:01.000000000 +0200 @@ -124,12 +124,17 @@ setupConsole #====================================== -# 11) Run user script +# 11) create origin snapshot if possible +#-------------------------------------- +createOriginSnapshot + +#====================================== +# 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/ppc/vmxboot/suse-preinit new/kiwi/system/boot/ppc/vmxboot/suse-preinit --- old/kiwi/system/boot/ppc/vmxboot/suse-preinit 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/system/boot/ppc/vmxboot/suse-preinit 2011-10-25 15:40:01.000000000 +0200 @@ -84,7 +84,12 @@ setupConsole #====================================== -# 10) kill udev +# 10) create origin snapshot if possible +#-------------------------------------- +createOriginSnapshot + +#====================================== +# 11) kill udev #-------------------------------------- udevSystemStop umountSystemFilesystems diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/s390/netboot/suse-preinit new/kiwi/system/boot/s390/netboot/suse-preinit --- old/kiwi/system/boot/s390/netboot/suse-preinit 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/system/boot/s390/netboot/suse-preinit 2011-10-26 14:47:33.000000000 +0200 @@ -115,12 +115,24 @@ fi #====================================== -# 10) kernelCheck +# 10) setup static network +#-------------------------------------- +if [ "$systemIntegrity" = "clean" ];then + setupNetworkStatic 0 +fi + +#====================================== +# 11) kernelCheck #-------------------------------------- kernelCheck #====================================== -# 11) kill udev +# 12) create origin snapshot if possible +#-------------------------------------- +createOriginSnapshot + +#====================================== +# 13) kill udev #-------------------------------------- udevSystemStop umountSystemFilesystems 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 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/system/boot/s390/oemboot/suse-preinit 2011-10-25 15:40:01.000000000 +0200 @@ -137,12 +137,17 @@ setupConsole #====================================== -# 12) Run user script +# 12) create origin snapshot if possible +#-------------------------------------- +createOriginSnapshot + +#====================================== +# 13) Run user script #-------------------------------------- runHook preCallInit #====================================== -# 13) kill udev +# 14) kill udev #-------------------------------------- udevSystemStop umountSystemFilesystems 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 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/system/boot/s390/vmxboot/suse-preinit 2011-10-25 15:40:01.000000000 +0200 @@ -97,7 +97,12 @@ setupConsole #====================================== -# 11) kill udev +# 11) create origin snapshot if possible +#-------------------------------------- +createOriginSnapshot + +#====================================== +# 12) kill udev #-------------------------------------- udevSystemStop umountSystemFilesystems diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/template/ix86/suse-11.4-JeOS/config.xml new/kiwi/template/ix86/suse-11.4-JeOS/config.xml --- old/kiwi/template/ix86/suse-11.4-JeOS/config.xml 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/template/ix86/suse-11.4-JeOS/config.xml 2011-10-25 15:40:01.000000000 +0200 @@ -62,6 +62,9 @@ <repository type="yast2"> <source path="opensuse://11.4/repo/oss"/> </repository> + <repository type="rpm-md"> + <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-11.4/openSUSE_11.4"/> + </repository> <packages type="image"> <package name="bootsplash-branding-openSUSE" bootinclude="true" bootdelete="true"/> <package name="gfxboot-branding-openSUSE" bootinclude="true" bootdelete="true"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/tests/unit/lib/Test/kiwiXMLInfo.pm new/kiwi/tests/unit/lib/Test/kiwiXMLInfo.pm --- old/kiwi/tests/unit/lib/Test/kiwiXMLInfo.pm 2011-10-18 12:50:04.000000000 +0200 +++ new/kiwi/tests/unit/lib/Test/kiwiXMLInfo.pm 2011-10-26 14:47:33.000000000 +0200 @@ -145,6 +145,8 @@ $this -> assert_str_equals($expectedMsg, $errMsg); my $msg = $kiwi -> getMessage(); $expectedMsg = "Choose between the following:\n" + . "--> archives :List of tar archives to be installed\n" + . "--> overlay-files :List of files in root overlay\n" . "--> packages :List of packages to be installed\n" . "--> patterns :List configured patterns\n" . "--> profiles :List profiles\n" @@ -211,7 +213,7 @@ my $info = $this -> __getInfoObj($cmd); my @requests = ('packages'); my $tree = $info -> getXMLInfoTree(\@requests); - my $expectedMsg = '<imagescan><package name="kiwi-test-dummy" ' + my $expectedMsg = '<imagescan description="'.$cmd->getConfigDir().'"><package name="kiwi-test-dummy" ' . 'arch="noarch" version="0.0.1-1"/></imagescan>'; $this -> assert_str_equals($expectedMsg, $tree -> toString()); $this -> assert_not_null($tree); @@ -274,6 +276,8 @@ $this -> assert_str_equals($expectedMsg, $errMsg); my $msg = $kiwi -> getMessage(); $expectedMsg = "Choose between the following:\n" + . "--> archives :List of tar archives to be installed\n" + . "--> overlay-files :List of files in root overlay\n" . "--> packages :List of packages to be installed\n" . "--> patterns :List configured patterns\n" . "--> profiles :List profiles\n" @@ -326,7 +330,7 @@ my $info = $this -> __getInfoObj($cmd); my @requests = ('profiles'); my $tree = $info -> getXMLInfoTree(\@requests); - my $expectedMsg = '<imagescan><profile name="first" description="a ' + my $expectedMsg = '<imagescan description="'.$cmd->getConfigDir().'"><profile name="first" description="a ' . 'profile"/><profile name="second" description="another profile"/>' . '</imagescan>'; $this -> assert_not_null($tree); @@ -353,7 +357,7 @@ my $info = $this -> __getInfoObj($cmd); my @requests = ('types'); my $tree = $info -> getXMLInfoTree(\@requests); - my $expectedMsg = '<imagescan><type name="iso" primary="true" ' + my $expectedMsg = '<imagescan description="'.$cmd->getConfigDir().'"><type name="iso" primary="true" ' . 'boot="isoboot/suse-11.4"/><type name="oem" primary="false" ' . 'boot="oemboot/suse-11.4"/><type name="xfs" primary="false"/>' . '</imagescan>'; @@ -395,7 +399,7 @@ my $info = $this -> __getInfoObj($cmd); my @requests = ('size'); my $tree = $info -> getXMLInfoTree(\@requests); - my $expectedMsg = '<imagescan><size rootsizeKB="1"/></imagescan>'; + my $expectedMsg = '<imagescan description="'.$cmd->getConfigDir().'"><size rootsizeKB="1"/></imagescan>'; $this -> assert_str_equals($expectedMsg, $tree -> toString()); $this -> assert_not_null($tree); # Setting up SaT generates a number of meesges that are not useful @@ -419,7 +423,7 @@ my $info = $this -> __getInfoObj($cmd); my @requests = ('sources'); my $tree = $info -> getXMLInfoTree(\@requests); - my $expectedMsg = '<imagescan><source path="/tmp" type="rpm-dir"/>' + my $expectedMsg = '<imagescan description="'.$cmd->getConfigDir().'"><source path="/tmp" type="rpm-dir"/>' . '</imagescan>'; $this -> assert_not_null($tree); $this -> assert_str_equals($expectedMsg, $tree -> toString()); @@ -445,7 +449,7 @@ my $info = $this -> __getInfoObj($cmd); my @requests = ('version'); my $tree = $info -> getXMLInfoTree(\@requests); - my $expectedMsg = '<imagescan><image version="1.0.0" ' + my $expectedMsg = '<imagescan description="'.$cmd->getConfigDir().'"><image version="1.0.0" ' . 'name="test-xml-infod"/></imagescan>'; $this -> assert_not_null($tree); $this -> assert_str_equals($expectedMsg, $tree -> toString()); -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org