Hello community, here is the log from the commit of package kiwi checked in at Thu Nov 22 17:47:05 CET 2007. -------- --- arch/i386/kiwi/kiwi.changes 2007-11-20 16:09:54.000000000 +0100 +++ /mounts/work_src_done/STABLE/kiwi/kiwi.changes 2007-11-22 14:21:46.865004000 +0100 @@ -1,0 +2,11 @@ +Wed Nov 21 14:37:07 CET 2007 - ms@suse.de + +- v1.94 +- added option --createhash to create a description md5sum +- added md5 based integrity check for image descriptions. As + soon as the file .checksum.md5 exists in the image directory + it will be used to check the md5 hash for all files listed in + the md5 file. Kiwi creates by default checksums for all boot + images + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kiwi.spec ++++++ --- /var/tmp/diff_new_pack.aw5067/_old 2007-11-22 17:46:32.000000000 +0100 +++ /var/tmp/diff_new_pack.aw5067/_new 2007-11-22 17:46:32.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package kiwi (Version 1.93) +# spec file for package kiwi (Version 1.94) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -18,7 +18,7 @@ %endif Requires: perl perl-XML-LibXML perl-libwww-perl screen coreutils Summary: OpenSuSE - KIWI Image System -Version: 1.93 +Version: 1.94 Release: 1 Group: System/Management License: GPL v2 or later @@ -352,7 +352,16 @@ %dir %{_datadir}/kiwi/image/oemboot %doc %{_datadir}/kiwi/image/oemboot/README %{_datadir}/kiwi/image/oemboot/suse* + %changelog +* Wed Nov 21 2007 - ms@suse.de +- v1.94 +- added option --createhash to create a description md5sum +- added md5 based integrity check for image descriptions. As + soon as the file .checksum.md5 exists in the image directory + it will be used to check the md5 hash for all files listed in + the md5 file. Kiwi creates by default checksums for all boot + images * Tue Nov 20 2007 - ms@suse.de - v1.93 - added support for iso:///path/to/iso/file (#338090) ++++++ kiwi.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/kiwi.pl new/kiwi/kiwi.pl --- old/kiwi/kiwi.pl 2007-11-20 15:19:44.000000000 +0100 +++ new/kiwi/kiwi.pl 2007-11-22 14:13:05.000000000 +0100 @@ -39,7 +39,7 @@ #============================================ # Globals (Version) #-------------------------------------------- -our $Version = "1.93"; +our $Version = "1.94"; our $openSUSE = "http://download.opensuse.org/repositories/"; our $ConfigFile = "$ENV{'HOME'}/.kiwirc"; our $ConfigStatus = 0; @@ -111,6 +111,7 @@ our $InstallStickSystem;# virtual disk system image to be installed on disk our $StripImage; # strip shared objects and binaries our $CreatePassword; # create crypt password string +our $CreateHash; # create .checksum.md5 for given description our $SetupSplashForGrub;# setup splash screen(s) for grub our $ImageName; # filename of current image, used in Modules our %ForeignRepo; # may contain XML::LibXML::Element objects @@ -249,6 +250,10 @@ my $code = kiwiExit (1); return $code; } $kiwi -> done(); + if (! $xml -> haveMD5File()) { + $kiwi -> warning ("Description provides no MD5 hash, check"); + $kiwi -> skipped (); + } #========================================== # Check for bootprofile in config.xml #------------------------------------------ @@ -663,6 +668,34 @@ } #========================================== + # Create md5 hash for given description + #------------------------------------------ + if (defined $CreateHash) { + $kiwi -> info ("Creating MD5 sum for $CreateHash..."); + if (! -d $CreateHash) { + $kiwi -> failed (); + $kiwi -> error ("Not a directory: $CreateHash: $!"); + $kiwi -> failed (); + my $code = kiwiExit (1); return $code; + } + if (! -f "$CreateHash/config.xml") { + $kiwi -> failed (); + $kiwi -> error ("Not a kiwi description: no config.xml found"); + $kiwi -> failed (); + my $code = kiwiExit (1); return $code; + } + my $cmd = "find -L -type f"; + my $status = qx (cd $CreateHash && $cmd | xargs md5sum > .checksum.md5); + my $result = $? >> 8; + if ($result != 0) { + $kiwi -> error ("Failed creating md5 sum: $status: $!"); + $kiwi -> failed (); + } + $kiwi -> done(); + my $code = kiwiExit (0); return $code; + } + + #========================================== # setup a splash initrd #------------------------------------------ if (defined $SetupSplashForGrub) { @@ -831,6 +864,7 @@ "installstick-system=s" => \$InstallStickSystem, "strip|s" => \$StripImage, "createpassword" => \$CreatePassword, + "createhash=s" => \$CreateHash, "setup-grub-splash=s" => \$SetupSplashForGrub, "list-profiles|i=s" => \$ListProfiles, "force-new-root" => \$ForceNewRoot, @@ -859,7 +893,8 @@ (! defined $BootVMDisk) && (! defined $CreatePassword) && (! defined $CreateInstSource) && (! defined $Migrate) && (! defined $ListProfiles) && (! defined $InstallStick) && - (! defined $listXMLInfo) && (! defined $BootCD) + (! defined $listXMLInfo) && (! defined $BootCD) && + (! defined $CreateHash) ) { $kiwi -> info ("No operation specified"); $kiwi -> failed (); @@ -969,6 +1004,7 @@ print " --installstick-system <vmx-system-image>\n"; print "Helper Tools:\n"; print " kiwi --createpassword\n"; + print " kiwi --createhash <image-path>\n"; print " kiwi --create-instsource <image-path>\n"; print " kiwi --setup-grub-splash <initrd>\n"; print "Options:\n"; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/Makefile new/kiwi/Makefile --- old/kiwi/Makefile 2007-10-31 16:38:46.000000000 +0100 +++ new/kiwi/Makefile 2007-11-21 14:46:12.000000000 +0100 @@ -39,6 +39,12 @@ find -name config.xml | xargs xmllint -noout -schema modules/KIWIScheme.xsd #============================================ + # create checksum files for boot images... + #-------------------------------------------- + (cd system/boot && ./.md5) + (cd system/boot && chmod -R u-w .) + + #============================================ # resolve relative links #-------------------------------------------- # ./.links diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/modules/KIWIManager.pm new/kiwi/modules/KIWIManager.pm --- old/kiwi/modules/KIWIManager.pm 2007-11-19 16:26:22.000000000 +0100 +++ new/kiwi/modules/KIWIManager.pm 2007-11-21 14:35:43.000000000 +0100 @@ -20,6 +20,7 @@ require Exporter; use strict; use FileHandle; +use File::Basename; use KIWILog; #========================================== @@ -1080,12 +1081,14 @@ my $this = shift; my $dataDir = $this->{dataDir}; my $kiwi = $this->{kiwi}; + my $config = dirname ($dataDir); $this -> freeLock(); if (defined $this->{child}) { kill 15,$this->{child}; } $kiwi -> loginfo ("Removing cache directory: $dataDir\n"); qx (rm -rf $dataDir); + qx (rm -rf $config/config); return $this; } 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 2007-11-20 15:19:43.000000000 +0100 +++ new/kiwi/modules/KIWIXML.pm 2007-11-22 14:13:04.000000000 +0100 @@ -69,8 +69,23 @@ my $arch = qx (uname -m); chomp $arch; my $systemTree; my $controlFile = $imageDesc."/config.xml"; + my $checkmdFile = $imageDesc."/.checksum.md5"; + my $havemd5File = 1; my $systemXML = new XML::LibXML; my $systemXSD = new XML::LibXML::Schema ( location => $main::Scheme ); + if (-f $checkmdFile) { + my $data = qx (cd $imageDesc && md5sum -c .checksum.md5 2>&1); + my $code = $? >> 8; + if ($code != 0) { + chomp $data; + $kiwi -> failed (); + $kiwi -> error ("Integrity check for $imageDesc failed:\n$data"); + $kiwi -> failed (); + return undef; + } + } else { + $havemd5File = 0; + } if (! -f $controlFile) { $kiwi -> failed (); $kiwi -> error ("Cannot open control file: $controlFile"); @@ -179,6 +194,7 @@ $this->{unionNodeList} = $unionNodeList; $this->{profilesNodeList} = $profilesNodeList; $this->{reqProfiles} = $reqProfiles; + $this->{havemd5File} = $havemd5File; $this->{arch} = $arch; #========================================== @@ -208,6 +224,14 @@ } #========================================== +# haveMD5File +#------------------------------------------ +sub haveMD5File { + my $this = shift; + return $this->{havemd5File}; +} + +#========================================== # createURLList #------------------------------------------ sub createURLList { diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/.revision new/kiwi/.revision --- old/kiwi/.revision 2007-11-20 16:09:23.000000000 +0100 +++ new/kiwi/.revision 2007-11-22 14:20:52.000000000 +0100 @@ -1 +1 @@ -831 \ No newline at end of file +835 \ No newline at end of file diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/system/boot/.md5 new/kiwi/system/boot/.md5 --- old/kiwi/system/boot/.md5 1970-01-01 01:00:00.000000000 +0100 +++ new/kiwi/system/boot/.md5 2007-11-21 14:46:11.000000000 +0100 @@ -0,0 +1,9 @@ +#!/bin/bash + +for dir in `find -type d`;do + if [ -f $dir/config.xml ];then + pushd $dir &>/dev/null + find -L -type f | grep -v .svn | xargs md5sum > .checksum.md5 + popd &>/dev/null + fi +done ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org