Hello community,
here is the log from the commit of package kiwi
checked in at Fri Oct 26 20:43:52 CEST 2007.
--------
--- arch/i386/kiwi/kiwi.changes 2007-10-25 10:48:34.000000000 +0200
+++ /mounts/work_src_done/STABLE/kiwi/kiwi.changes 2007-10-26 19:31:01.810331000 +0200
@@ -1,0 +2,27 @@
+Thu Oct 25 12:09:15 CEST 2007 - ms@suse.de
+
+- v1.77
+- fixed exit code of kiwi call. Some module destructors call
+ external processes which causes the exit code to be the value
+ of this process, which is apparently wrong. (#336734)
+- added support for pre-built boot images. To enable the lookup
+ one had to specify the attribute checkprebuilt="true" within the
+ type section(s). If specified the prebuilt boot image must reside
+ in /usr/share/kiwi/image/*boot/*-prebuilt/. The search is based
+ on the boot="..." attribute given in the type section (#334475)
+- moved call of config.sh at the end of all configurations
+- moved in place repo code into extra function called
+ baseSetupInPlaceSVNRepository. This function can be called
+ on demand in config.sh with the directories the repo should
+ take control over as function arguments
+- added creation of md5 file which was skipped due to performance
+ patches. In case kiwi directly writes the system image data onto
+ a device mapper partition the md5 file needs to be created
+ afterwards (#337096)
+- use bs=32k for image installation in oemboot linuxrc. Patch
+ by Till Franke
+- use bs=32k for usb and virtual disk dumps (#336822)
+- prevent e2fsck from being called too often (#336889)
+- code cleanup, added -w switch
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kiwi.spec ++++++
--- /var/tmp/diff_new_pack.F19537/_old 2007-10-26 20:42:28.000000000 +0200
+++ /var/tmp/diff_new_pack.F19537/_new 2007-10-26 20:42:28.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package kiwi (Version 1.76)
+# spec file for package kiwi (Version 1.77)
#
# 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.76
+Version: 1.77
Release: 1
Group: System/Management
License: GPL v2 or later
@@ -330,6 +330,30 @@
%{_datadir}/kiwi/image/oemboot/suse*
%changelog
* Thu Oct 25 2007 - ms@suse.de
+- v1.77
+- fixed exit code of kiwi call. Some module destructors call
+ external processes which causes the exit code to be the value
+ of this process, which is apparently wrong. (#336734)
+- added support for pre-built boot images. To enable the lookup
+ one had to specify the attribute checkprebuilt="true" within the
+ type section(s). If specified the prebuilt boot image must reside
+ in /usr/share/kiwi/image/*boot/*-prebuilt/. The search is based
+ on the boot="..." attribute given in the type section (#334475)
+- moved call of config.sh at the end of all configurations
+- moved in place repo code into extra function called
+ baseSetupInPlaceSVNRepository. This function can be called
+ on demand in config.sh with the directories the repo should
+ take control over as function arguments
+- added creation of md5 file which was skipped due to performance
+ patches. In case kiwi directly writes the system image data onto
+ a device mapper partition the md5 file needs to be created
+ afterwards (#337096)
+- use bs=32k for image installation in oemboot linuxrc. Patch
+ by Till Franke
+- use bs=32k for usb and virtual disk dumps (#336822)
+- prevent e2fsck from being called too often (#336889)
+- code cleanup, added -w switch
+* Thu Oct 25 2007 - ms@suse.de
- v1.76
- fixed ZYPP_MODALIAS_SYSFS setup for zypper install/update (#335116)
* Wed Oct 24 2007 - ms@suse.de
++++++ kiwi.tar.bz2 ++++++
Files old/kiwi/doc/kiwi.pdf and new/kiwi/doc/kiwi.pdf differ
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/kiwi.pl new/kiwi/kiwi.pl
--- old/kiwi/kiwi.pl 2007-10-25 10:42:28.000000000 +0200
+++ new/kiwi/kiwi.pl 2007-10-26 19:20:19.000000000 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
#================
# FILE : kiwi.pl
#----------------
@@ -32,7 +32,7 @@
#============================================
# Globals (Version)
#--------------------------------------------
-our $Version = "1.76";
+our $Version = "1.77";
our $openSUSE = "http://software.opensuse.org/download/";
our $ConfigFile = "$ENV{'HOME'}/.kiwirc";
our $ConfigStatus = 0;
@@ -751,7 +751,7 @@
if (! $boot -> setupBootDisk()) {
my $code = kiwiExit (1); return $code;
}
- my $code = kiwiExit (0); return $code;
+ $code = kiwiExit (0); return $code;
}
return 1;
}
@@ -1051,6 +1051,10 @@
$kiwi -> info ("KIWI exited successfully");
$kiwi -> done ();
}
+ if (defined $root) {
+ $root -> cleanManager ();
+ }
+ $kiwi -> cleanSweep();
exit $code;
}
@@ -1061,11 +1065,14 @@
# ...
# signal received, exit safely
# ---
- my $kiwi = new KIWILog("tiny");
+ if (! defined $kiwi) {
+ $kiwi = new KIWILog("tiny");
+ }
$kiwi -> note ("\n*** $$: Received signal $_[0] ***\n");
if (defined $root) {
$root -> cleanMount ();
$root -> cleanSource ();
+ $root -> cleanManager();
}
if (defined $image) {
$image -> cleanMount ();
@@ -1074,9 +1081,7 @@
if (defined $migrate) {
$migrate -> cleanMount ();
}
- $kiwi -> note ("*** done ***\n");
- $kiwi -> error ("KIWI exited on signal: $_[0]");
- $kiwi -> done ();
+ $kiwi -> cleanSweep();
exit 1;
}
@@ -1087,12 +1092,15 @@
# ...
# Version information
# ---
- my $kiwi = new KIWILog("tiny");
+ if (! defined $kiwi) {
+ $kiwi = new KIWILog("tiny");
+ }
my $rev = "unknown";
if (open FD,$Revision) {
$rev = <FD>; close FD;
}
$kiwi -> info ("kiwi version v$Version SVN: Revision: $rev\n");
+ $kiwi -> cleanSweep();
exit 0;
}
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 2007-10-24 17:57:05.000000000 +0200
+++ new/kiwi/modules/KIWIBoot.pm 2007-10-26 19:20:17.000000000 +0200
@@ -102,7 +102,7 @@
$kiwi -> failed ();
return undef;
}
- if (! defined $vmsize) {
+ if ((! defined $vmsize) && (defined $system)) {
my $kernelSize = -s $kernel; # the kernel
my $initrdSize = -s $initrd; # the boot image
my $systemSize; # the system image
@@ -121,9 +121,6 @@
$vmsize = $vmsize / 1024 / 1024;
$vmsize = int $vmsize;
$vmsize = $vmsize."M";
- #$kiwi -> info ("Using computed virtual disk size of: $vmsize");
- } else {
- #$kiwi -> info ("Using given virtual disk size of: $vmsize");
}
#$kiwi -> done ();
if ($syszip) {
@@ -181,6 +178,7 @@
$kiwi -> failed ();
$kiwi -> error ("Failed importing initrd: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$status = qx ( cp $kernel $tmpdir/boot/$lname 2>&1 );
@@ -189,6 +187,7 @@
$kiwi -> failed ();
$kiwi -> error ("Failed importing kernel: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$kiwi -> done();
@@ -270,6 +269,7 @@
$kiwi -> failed ();
$kiwi -> error ("Failed importing grub stages: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$kiwi -> done ();
@@ -280,6 +280,7 @@
if (! %storage) {
$kiwi -> error ("Couldn't find any removable USB storage devices");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
my $prefix = $kiwi -> getPrefix (1);
@@ -323,6 +324,7 @@
}
if (! $found) {
print STDERR $prefix,"Couldn't find [ $stick ] in list\n";
+ qx (rm -rf $tmpdir);
return undef;
}
}
@@ -334,6 +336,7 @@
$kiwi -> failed ();
$kiwi -> error ("Couldn't create menu.lst: $!");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
my $label = $this -> getImageName();
@@ -369,6 +372,7 @@
$kiwi -> failed ();
$kiwi -> error ("Couldn't create image file: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$status = qx (/sbin/mkfs.ext2 -F $name 2>&1);
@@ -377,6 +381,7 @@
$kiwi -> failed ();
$kiwi -> error ("Couldn't create filesystem: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$status = qx (mount -o loop $name /mnt/ 2>&1);
@@ -385,6 +390,7 @@
$kiwi -> failed ();
$kiwi -> error ("Couldn't mount image: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$status = qx (mv $tmpdir/boot /mnt/ 2>&1);
@@ -393,19 +399,21 @@
$kiwi -> failed ();
$kiwi -> error ("Couldn't install image: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
#==========================================
# check for message file in initrd
#------------------------------------------
my $message = "'image/loader/message'";
- $status = qx (gzip -cd $initrd | (cd /mnt && cpio -d -i $message 2>&1));
+ $status = qx (gzip -cd $initrd | (cd /mnt/ && cpio -d -i $message 2>&1));
$result = $? >> 8;
if ($result != 0) {
$kiwi -> failed ();
$kiwi -> error ("Couldn't find message file: $status");
$kiwi -> failed ();
qx (umount /mnt/ 2>&1);
+ qx (rm -rf $tmpdir);
return undef;
}
qx (umount /mnt/ 2>&1);
@@ -419,6 +427,7 @@
$kiwi -> failed ();
$kiwi -> error ("Couldn't create temporary partition data: $!");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
#==========================================
@@ -446,6 +455,7 @@
$kiwi -> failed ();
$kiwi -> error ("Couldn't create partition table: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$kiwi -> done();
@@ -460,7 +470,7 @@
#------------------------------------------
$kiwi -> info ("Dumping initrd image to stick");
$status = qx ( umount $stick"1" 2>&1 );
- $status = qx (dd if=$name of=$stick"1" bs=8k 2>&1);
+ $status = qx (dd if=$name of=$stick"1" bs=32k 2>&1);
$result = $? >> 8;
if ($result != 0) {
$kiwi -> failed ();
@@ -477,7 +487,7 @@
$kiwi -> info ("Dumping system image to stick");
$status = qx ( umount $stick"1" 2>&1 );
$status = qx ( umount $stick"2" 2>&1 );
- $status = qx (dd if=$system of=$stick"2" bs=8k 2>&1);
+ $status = qx (dd if=$system of=$stick"2" bs=32k 2>&1);
$result = $? >> 8;
if ($result != 0) {
$kiwi -> failed ();
@@ -566,6 +576,7 @@
if ($namecd !~ /(.*)-(\d+\.\d+\.\d+)\.raw$/) {
$kiwi -> error ("Couldn't extract version information");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$ibasename = $1;
@@ -574,6 +585,7 @@
#------------------------------------------
$initrd = $this -> setupInstallFlags();
if (! defined $initrd) {
+ qx (rm -rf $tmpdir);
return undef;
}
#==========================================
@@ -603,6 +615,7 @@
$kiwi -> error ("Failed importing grub stages: $status");
$kiwi -> failed ();
$this->{initrd} = $oldird;
+ qx (rm -rf $tmpdir);
return undef;
}
qx (rm -rf $tmpdir/usr 2>&1);
@@ -618,6 +631,7 @@
$kiwi -> failed ();
$kiwi -> error ("Couldn't create menu.lst: $!");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
print FD "color cyan/blue white/blue\n";
@@ -648,6 +662,7 @@
$kiwi -> failed ();
$kiwi -> error ("Failed importing system image: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$kiwi -> done();
@@ -669,6 +684,7 @@
$kiwi -> failed ();
$kiwi -> error ("Failed creating ISO image: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$kiwi -> done ();
@@ -716,6 +732,7 @@
$kiwi -> failed ();
$kiwi -> error ("Couldn't find free loop device");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$kiwi -> done();
@@ -725,6 +742,7 @@
if ($namecd !~ /(.*)-(\d+\.\d+\.\d+)\.raw$/) {
$kiwi -> error ("Couldn't extract version information");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$ibasename = $1;
@@ -733,6 +751,7 @@
#------------------------------------------
$initrd = $this -> setupInstallFlags();
if (! defined $initrd) {
+ qx (rm -rf $tmpdir);
return undef;
}
$this->{initrd} = $initrd;
@@ -756,6 +775,7 @@
$kiwi -> error ("Failed importing grub stages: $status");
$kiwi -> failed ();
$this->{initrd} = $oldird;
+ qx (rm -rf $tmpdir);
return undef;
}
$kiwi -> done ();
@@ -768,6 +788,7 @@
$kiwi -> error ("Couldn't create menu.lst: $!");
$kiwi -> failed ();
$this->{initrd} = $oldird;
+ qx (rm -rf $tmpdir);
return undef;
}
print FD "color cyan/blue white/blue\n";
@@ -798,6 +819,7 @@
$kiwi -> failed ();
$kiwi -> error ("Failed creating virtual disk: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$kiwi -> done();
@@ -808,6 +830,7 @@
$kiwi -> failed ();
$kiwi -> error ("Failed binding virtual disk: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$kiwi -> done();
@@ -846,6 +869,7 @@
$kiwi -> error ("Failed mapping virtual partition: $status");
$kiwi -> failed ();
qx ( /sbin/losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
my $dmap = $loop; $dmap =~ s/dev\///;
@@ -865,6 +889,7 @@
$kiwi -> failed ();
qx ( /sbin/kpartx -d $loop );
qx ( /sbin/losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
$kiwi -> done();
@@ -881,6 +906,7 @@
$kiwi -> failed ();
qx ( /sbin/kpartx -d $loop );
qx ( /sbin/losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
$status = qx (cp -a $tmpdir/boot /mnt/ 2>&1);
@@ -892,6 +918,7 @@
qx ( umount /mnt/ 2>&1 );
qx ( /sbin/kpartx -d $loop );
qx ( /sbin/losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
my $message = "'image/loader/message'";
@@ -904,6 +931,7 @@
qx ( umount /mnt/ 2>&1 );
qx ( /sbin/kpartx -d $loop );
qx ( /sbin/losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
qx ( umount /mnt/ 2>&1 );
@@ -921,6 +949,7 @@
$kiwi -> failed ();
qx ( /sbin/kpartx -d $loop );
qx ( /sbin/losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
$status = qx (cp $system /mnt/$ibasename 2>&1);
@@ -932,6 +961,7 @@
qx ( umount /mnt/ 2>&1 );
qx ( /sbin/kpartx -d $loop );
qx ( /sbin/losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
qx ( umount /mnt/ 2>&1 );
@@ -1007,6 +1037,7 @@
if ( -d $system ) {
my $xml = new KIWIXML ( $kiwi,$system."/image",undef,"vmx" );
if (! defined $xml) {
+ qx (rm -rf $tmpdir);
return undef;
}
#==========================================
@@ -1026,11 +1057,13 @@
if (! $fstype) {
$kiwi -> error ("Can't find filesystem type in image tree");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
if ($fstype eq "squashfs") {
$kiwi -> error ("Can't copy data into requested RO filesystem");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
}
@@ -1053,6 +1086,7 @@
$kiwi -> failed ();
$kiwi -> error ("Couldn't find free loop device");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$kiwi -> done();
@@ -1077,6 +1111,7 @@
$kiwi -> failed ();
$kiwi -> error ("Failed importing grub stages: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$kiwi -> done ();
@@ -1088,6 +1123,7 @@
$kiwi -> failed ();
$kiwi -> error ("Couldn't create menu.lst: $!");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
print FD "color cyan/blue white/blue\n";
@@ -1123,6 +1159,7 @@
$kiwi -> failed ();
$kiwi -> error ("Couldn't create image file: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$status = qx (/sbin/mkfs.ext2 -F $sysname 2>&1);
@@ -1131,6 +1168,7 @@
$kiwi -> failed ();
$kiwi -> error ("Couldn't create filesystem: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$status = qx (mount -o loop $sysname /mnt/ 2>&1);
@@ -1139,6 +1177,7 @@
$kiwi -> failed ();
$kiwi -> error ("Couldn't mount image: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$status = qx (mv $tmpdir/boot /mnt/ 2>&1);
@@ -1147,6 +1186,7 @@
$kiwi -> failed ();
$kiwi -> error ("Couldn't install image: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
qx (umount /mnt/ 2>&1);
@@ -1160,6 +1200,7 @@
$kiwi -> failed ();
$kiwi -> error ("No system image given");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$status = qx (qemu-img create $diskname $vmsize 2>&1);
@@ -1168,6 +1209,7 @@
$kiwi -> failed ();
$kiwi -> error ("Failed creating virtual disk: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$status = qx ( /sbin/losetup $loop $diskname 2>&1 );
@@ -1176,6 +1218,7 @@
$kiwi -> failed ();
$kiwi -> error ("Failed binding virtual disk: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
#==========================================
@@ -1186,6 +1229,7 @@
$kiwi -> error ("Failed creating virtual partition");
$kiwi -> failed ();
qx ( losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
my @commands;
@@ -1218,6 +1262,7 @@
$kiwi -> error ("Failed mapping virtual partition: $status");
$kiwi -> failed ();
qx ( /sbin/losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
my $dmap = $loop; $dmap =~ s/dev\///;
@@ -1231,7 +1276,7 @@
$kiwi -> done();
if (! $haveTree) {
$kiwi -> info ("Dumping system image on virtual disk");
- $status = qx (dd if=$system of=$root bs=8k 2>&1);
+ $status = qx (dd if=$system of=$root bs=32k 2>&1);
$result = $? >> 8;
if ($result != 0) {
$kiwi -> failed ();
@@ -1239,6 +1284,7 @@
$kiwi -> failed ();
qx ( /sbin/kpartx -d $loop );
qx ( /sbin/losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
$kiwi -> done();
@@ -1269,12 +1315,14 @@
};
$kiwi -> error ("Unsupported filesystem type: $fstype");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
};
if ($result != 0) {
$kiwi -> failed ();
$kiwi -> error ("Couldn't create $fstype filesystem: $status");
$kiwi -> failed ();
+ qx (rm -rf $tmpdir);
return undef;
}
$kiwi -> done();
@@ -1289,13 +1337,14 @@
$kiwi -> failed ();
qx ( /sbin/kpartx -d $loop );
qx ( /sbin/losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
#==========================================
# Copy root tree to virtual disk
#------------------------------------------
$kiwi -> info ("Copying system image tree on virtual disk");
- $status = qx (cp -a $system/* /mnt 2>&1);
+ $status = qx (cp -a $system/* /mnt/ 2>&1);
$result = $? >> 8;
if ($result != 0) {
$kiwi -> failed ();
@@ -1303,6 +1352,7 @@
$kiwi -> failed ();
qx ( /sbin/kpartx -d $loop );
qx ( /sbin/losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
$kiwi -> done();
@@ -1317,7 +1367,7 @@
$kiwi -> info ("Dumping boot image to virtual disk");
if ($syszip > 0) {
$root = "/dev/mapper".$dmap."p1";
- $status = qx (dd if=$sysname of=$root bs=8k 2>&1);
+ $status = qx (dd if=$sysname of=$root bs=32k 2>&1);
$result = $? >> 8;
if ($result != 0) {
$kiwi -> failed ();
@@ -1325,6 +1375,7 @@
$kiwi -> failed ();
qx ( /sbin/kpartx -d $loop );
qx ( /sbin/losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
unlink $sysname;
@@ -1340,6 +1391,7 @@
$kiwi -> failed ();
qx ( /sbin/kpartx -d $loop );
qx ( /sbin/losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
#==========================================
@@ -1354,6 +1406,7 @@
qx ( umount /mnt/ 2>&1 );
qx ( /sbin/kpartx -d $loop );
qx ( /sbin/losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
#==========================================
@@ -1369,6 +1422,7 @@
qx ( umount /mnt/ 2>&1 );
qx ( /sbin/kpartx -d $loop );
qx ( /sbin/losetup -d $loop );
+ qx (rm -rf $tmpdir);
return undef;
}
qx ( umount /mnt/ 2>&1 );
@@ -1654,6 +1708,16 @@
}
#==========================================
+# cleanTmp
+#------------------------------------------
+sub cleanTmp {
+ my $this = shift;
+ my $tmpdir = $this->{tmpdir};
+ qx (rm -rf $tmpdir);
+ return $this;
+}
+
+#==========================================
# getImageName
#------------------------------------------
sub getImageName {
@@ -1665,12 +1729,4 @@
return $label;
}
-#==========================================
-# Destructor
-#------------------------------------------
-sub DESTROY {
- my $this = shift;
- qx (rm -rf $this->{tmpdir} 2>&1);
-}
-
1;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/modules/KIWIConfig.sh new/kiwi/modules/KIWIConfig.sh
--- old/kiwi/modules/KIWIConfig.sh 2007-10-11 15:33:25.000000000 +0200
+++ new/kiwi/modules/KIWIConfig.sh 2007-10-26 19:20:17.000000000 +0200
@@ -301,6 +301,45 @@
}
#======================================
+# baseSetupInPlaceSVNRepository
+#--------------------------------------
+function baseSetupInPlaceSVNRepository {
+ # /.../
+ # create an in place subversion repository for the
+ # specified directories. A standard call could look like this
+ # baseSetupInPlaceSVNRepository /etc /srv /var/log
+ # ----
+ local paths=$1
+ local repo=/var/adm/sys-repo
+ if [ ! -x /usr/bin/svn ];then
+ echo "subversion not installed... skipped"
+ return
+ fi
+ svnadmin create $repo
+ chmod 700 $repo
+ svn mkdir -m created file:///$repo/trunk
+ local ifss=$IFS
+ local subp=""
+ for dir in $paths;do
+ subp=""
+ IFS="/"; for n in $dir;do
+ if [ -z $n ];then
+ continue
+ fi
+ subp="$subp/$n"
+ svn mkdir -m created file:///$repo/trunk/$subp
+ done
+ done
+ IFS=$ifss
+ for dir in $paths;do
+ chmod 700 $dir/.svn
+ svn add $dir/*
+ find $dir -name .svn | xargs chmod 700
+ svn ci -m initial $dir
+ done
+}
+
+#======================================
# suseStripInitrd
#--------------------------------------
function suseStripInitrd {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/modules/KIWIConfigure.pm new/kiwi/modules/KIWIConfigure.pm
--- old/kiwi/modules/KIWIConfigure.pm 2007-10-09 10:28:24.000000000 +0200
+++ new/kiwi/modules/KIWIConfigure.pm 2007-10-26 19:20:16.000000000 +0200
@@ -82,7 +82,7 @@
my $xml = $this->{xml};
my $root = $this->{root};
my %users = $xml -> getUsers();
- if (defined %users) {
+ if (%users) {
my $adduser = "/usr/sbin/useradd";
my $moduser = "/usr/sbin/usermod";
my $addgroup = "/usr/sbin/groupadd";
@@ -186,109 +186,4 @@
return $this;
}
-#==========================================
-# setupInPlaceSVNRepository
-#------------------------------------------
-sub setupInPlaceSVNRepository {
- my $this = shift;
- my $kiwi = $this->{kiwi};
- my $root = $this->{root};
- if (-f "$root/usr/bin/svn") {
- $kiwi -> info ("Creating in-place SVN repository...");
- #==========================================
- # screen files
- #------------------------------------------
- my $repo = "/var/adm/etc-repos";
- my $file = "/screenrc.svn";
- my $screenCall = $root.$file;
- my $screenCtrl = $root."/screenrc.ctl";
- my $screenLogs = $kiwi -> getRootLog();
- my $data;
- my $code;
- my $logs = 1;
- #==========================================
- # Initiate screen call file
- #------------------------------------------
- if ((! open (FD,">$screenCall")) || (! open (CD,">$screenCtrl"))) {
- $kiwi -> failed ();
- $kiwi -> error ("Failed to create SVN script: $!");
- $kiwi -> failed ();
- return undef;
- }
- print CD "logfile $screenLogs\n";
- print CD "logfile flush 0\n";
- close CD;
- #==========================================
- # Create screen call file
- #------------------------------------------
- print FD "#!/bin/bash\n";
- print FD "svnadmin create $repo\n";
- print FD "chmod 700 $repo\n";
- print FD "svn mkdir -m created file:///$repo/trunk\n";
- print FD "svn mkdir -m created file:///$repo/trunk/etc\n";
- print FD "svn mkdir -m created file:///$repo/trunk/srv\n";
- print FD "svn mkdir -m created file:///$repo/trunk/var\n";
- print FD "svn mkdir -m created file:///$repo/trunk/var/log\n";
- print FD "svn co file:///$repo/trunk/etc /etc\n";
- print FD "svn co file:///$repo/trunk/srv /srv\n";
- print FD "svn co file:///$repo/trunk/var/log /var/log\n";
- print FD "chmod 700 /etc/.svn\n";
- print FD "chmod 700 /srv/.svn\n";
- print FD "chmod 700 /var/log/.svn\n";
- print FD "svn add /etc/*\n";
- print FD "find /etc -name .svn | xargs chmod 700\n";
- print FD "svn ci -m initial /etc\n";
- print FD "svn add /srv/*\n";
- print FD "find /srv -name .svn | xargs chmod 700\n";
- print FD "svn ci -m initial /srv\n";
- print FD "svn add /var/log/*\n";
- print FD "find /var/log -name .svn | xargs chmod 700\n";
- print FD "svn ci -m initial /var/log\n";
- print FD "echo \$? > $file.exit\n";
- close FD;
- #==========================================
- # Check log location
- #------------------------------------------
- if ($main::LogFile eq "terminal") {
- $logs = 0;
- }
- #==========================================
- # run repository creation in screen
- #------------------------------------------
- $data = qx ( chmod 755 $screenCall );
- if ( $logs ) {
- $data = qx ( screen -L -D -m -c $screenCtrl chroot $root $file );
- $code = $? >> 8;
- if (open (FD,$screenLogs)) {
- local $/; $data = <FD>; close FD;
- }
- if ($code == 0) {
- if (! open (FD,"$screenCall.exit")) {
- $code = 1;
- } else {
- $code = <FD>; chomp $code;
- close FD;
- }
- }
- } else {
- $code = system ( "chroot $root $file" );
- $code = $code >> 8;
- }
- qx ( rm -f $screenCall* );
- qx ( rm -f $screenCtrl );
- #==========================================
- # check exit code from screen session
- #------------------------------------------
- if ($code != 0) {
- $kiwi -> failed ();
- if ( $logs ) {
- $kiwi -> error ($data);
- }
- return undef;
- }
- $kiwi -> done();
- }
- return $this;
-}
-
1;
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 2007-10-24 17:57:05.000000000 +0200
+++ new/kiwi/modules/KIWIImage.pm 2007-10-26 19:20:17.000000000 +0200
@@ -389,6 +389,9 @@
if (! $ok) {
return undef;
}
+ if (! defined $main::ImageName) {
+ $this -> buildImageName();
+ }
$result{systemImage} = $main::ImageName;
#==========================================
# Prepare and Create USB boot image
@@ -400,6 +403,7 @@
return undef;
}
my %type = %{$xml->getImageTypeAndAttributes()};
+ my $pblt = $type{checkprebuilt};
my $tmpdir = qx ( mktemp -q -d /tmp/kiwi-$text.XXXXXX ); chomp $tmpdir;
my $result = $? >> 8;
if ($result != 0) {
@@ -428,14 +432,67 @@
$main::ForeignRepo{create} = $main::Create;
$main::Create = $main::RootTree;
undef $main::SetImageType;
- if (! defined main::main()) {
- $main::Survive = "default";
- if (! -d $main::RootTree.$baseSystem) {
- qx (rm -rf $main::RootTree);
- qx (rm -rf $tmpdir);
+ $kiwi -> info ("Checking for pre-built boot image");
+ if ((! $pblt) || ($pblt eq "false") || ($pblt eq "0")) {
+ #==========================================
+ # don't want a prebuilt boot image
+ #------------------------------------------
+ $kiwi -> notset();
+ $pblt = 0;
+ } else {
+ #==========================================
+ # check if a prebuilt boot image exists
+ #------------------------------------------
+ my $storexml = $this->{xml};
+ $this->{xml} = new KIWIXML ( $kiwi,$main::Prepare );
+ $this -> buildImageName();
+ $this->{xml} = $storexml;
+ my $lookup = $main::Prepare."-prebuilt/";
+ my $pinitrd = $lookup.$main::ImageName.".gz";
+ my $plinux = $lookup.$main::ImageName.".kernel";
+ if ((! -f $pinitrd) || (! -f $plinux)) {
+ $kiwi -> skipped();
+ $kiwi -> info ("Can't find pre-built boot image in $lookup");
+ $kiwi -> skipped();
+ $pblt = 0;
+ } else {
+ $kiwi -> done();
+ $kiwi -> info ("Copying pre-built boot image to destination");
+ my $data = qx (cp -a $pinitrd $main::Destination 2>&1);
+ my $code = $? >> 8;
+ if ($code != 0) {
+ $kiwi -> failed();
+ $kiwi -> error ("Can't copy pre-built initrd: $data");
+ $kiwi -> failed();
+ $pblt = 0;
+ } else {
+ $data = qx (cp -a $plinux* $main::Destination 2>&1);
+ $code = $? >> 8;
+ if ($code != 0) {
+ $kiwi -> failed();
+ $kiwi -> error ("Can't copy pre-built kernel: $data");
+ $kiwi -> failed();
+ $pblt = 0;
+ } else {
+ $kiwi -> done();
+ $pblt = 1;
+ }
+ }
}
- return undef;
}
+ if (! $pblt) {
+ if (! defined main::main()) {
+ $main::Survive = "default";
+ if (! -d $main::RootTree.$baseSystem) {
+ qx (rm -rf $main::RootTree);
+ qx (rm -rf $tmpdir);
+ }
+ return undef;
+ }
+ }
+ #==========================================
+ # remove tmpdir with boot tree
+ #------------------------------------------
if (! -d $main::RootTree.$baseSystem) {
qx (rm -rf $main::RootTree);
qx (rm -rf $tmpdir);
@@ -444,13 +501,14 @@
# Include splash screen to initrd
#------------------------------------------
my $initrd = $main::Destination."/".$main::ImageName.".gz";
- my $boot = new KIWIBoot ($kiwi,$initrd);
- if (! defined $boot) {
+ my $kboot = new KIWIBoot ($kiwi,$initrd);
+ if (! defined $kboot) {
return undef;
}
if ($text ne "VMX") {
- $boot -> setupSplashForGrub();
+ $kboot -> setupSplashForGrub();
}
+ $kboot -> cleanTmp();
#==========================================
# Store meta data for subsequent calls
#------------------------------------------
@@ -537,9 +595,23 @@
return undef;
}
#==========================================
+ # Create md5sum if not yet done
+ #------------------------------------------
+ if (defined $name->{imageTree}) {
+ my $nsys = $name->{systemImage}.".raw";
+ my $nmd5 = $name->{systemImage}.".md5";
+ if (! $this -> buildMD5Sum ($nsys)) {
+ return undef;
+ }
+ $nsys = $main::Destination."/".$nsys.".md5";
+ $nmd5 = $main::Destination."/".$nmd5;
+ unlink ($nmd5);
+ rename ($nsys,$nmd5);
+ }
+ #==========================================
# Create virtual disk configuration
#------------------------------------------
- if ($main::BootVMFormat eq "vmdk") {
+ if ((defined $main::BootVMFormat) && ($main::BootVMFormat eq "vmdk")) {
# VMware vmx file...
if (! $this -> buildVMwareConfig ($main::Destination,$name,\%vmwc)) {
$main::Survive = "default";
@@ -619,6 +691,8 @@
my $data;
my $code;
my $imageTreeReadOnly;
+ my $plinux;
+ my $pinitrd;
#==========================================
# Get system image name
#------------------------------------------
@@ -627,6 +701,7 @@
# Get system image type information
#------------------------------------------
my %type = %{$sxml->getImageTypeAndAttributes()};
+ my $pblt = $type{checkprebuilt};
#==========================================
# Get boot image name and compressed flag
#------------------------------------------
@@ -822,25 +897,71 @@
if (($main::Prepare !~ /^\//) && (! -d $main::Prepare)) {
$main::Prepare = $main::System."/".$main::Prepare;
}
+ if ($type{bootprofile}) {
+ @main::Profiles = split (/,/,$type{bootprofile});
+ }
$main::ForeignRepo{xmlnode} = $xml -> getForeignNodeList();
$main::ForeignRepo{packagemanager} = $xml -> getPackageManager();
$main::ForeignRepo{prepare} = $main::Prepare;
$main::ForeignRepo{create} = $main::Create;
$main::Create = $main::RootTree;
+ $xml = new KIWIXML ( $kiwi,$main::Prepare );
+ my $iso = $xml -> getImageName();
undef $main::SetImageType;
- if (! defined main::main()) {
- $main::Survive = "default";
- if (! -d $main::RootTree.$baseSystem) {
- qx (rm -rf $main::RootTree);
- qx (rm -rf $tmpdir);
- qx (rm -rf $imageTreeReadOnly);
+ $kiwi -> info ("Checking for pre-built boot image");
+ if ((! $pblt) || ($pblt eq "false") || ($pblt eq "0")) {
+ #==========================================
+ # don't want a prebuilt boot image
+ #------------------------------------------
+ $kiwi -> notset();
+ $pblt = 0;
+ } else {
+ #==========================================
+ # check if a prebuilt boot image exists
+ #------------------------------------------
+ $pinitrd = glob ("$main::Prepare-prebuilt/$iso*$arch*.gz");
+ $plinux = glob ("$main::Prepare-prebuilt/$iso*$arch*.kernel");
+ my $lookup = $main::Prepare."-prebuilt/";
+ if ((! -f $pinitrd) || (! -f $plinux)) {
+ $kiwi -> skipped();
+ $kiwi -> info ("Cant't find pre-built boot image in $lookup");
+ $kiwi -> skipped();
+ $pblt = 0;
+ } else {
+ $kiwi -> done();
+ $kiwi -> info ("Extracting pre-built boot image");
+ $data = qx (mkdir -p $main::Create);
+ $data = qx (gzip -cd $pinitrd|(cd $main::Create && cpio -di 2>&1));
+ $code = $? >> 8;
+ if ($code != 0) {
+ $kiwi -> failed();
+ $kiwi -> error ("Can't extract pre-built boot image: $data");
+ $kiwi -> failed();
+ $pblt = 0;
+ } else {
+ $kiwi -> done();
+ $pblt = 1;
+ }
+ }
+ }
+ if (! $pblt) {
+ #==========================================
+ # build an isoboot boot image
+ #------------------------------------------
+ if (! defined main::main()) {
+ $main::Survive = "default";
+ if (! -d $main::RootTree.$baseSystem) {
+ qx (rm -rf $main::RootTree);
+ qx (rm -rf $tmpdir);
+ qx (rm -rf $imageTreeReadOnly);
+ }
+ return undef;
}
- return undef;
}
$main::Survive = "default";
undef %main::ForeignRepo;
#==========================================
- # Create CD ISO image
+ # Prepare for CD ISO image
#------------------------------------------
$kiwi -> info ("Creating CD filesystem");
qx (mkdir -p $main::RootTree/CD/boot);
@@ -950,8 +1071,6 @@
#------------------------------------------
my $CD = $main::Prepare."/cdboot";
my $gfx = $main::RootTree."/image/loader";
- my $xml = new KIWIXML ( $kiwi,$main::Prepare );
- my $iso = $xml -> getImageName();
my $isoarch = qx (arch); chomp $isoarch;
if ($isoarch =~ /i.86/) {
$isoarch = "i386";
@@ -971,10 +1090,18 @@
$kiwi -> info ("Copying boot image and kernel [$isoarch]");
my $destination = "$main::RootTree/CD/boot/$isoarch/loader";
qx (mkdir -p $destination);
- $data = qx (cp $imageDest/$iso*$arch*.gz $destination/initrd);
+ if ($pblt) {
+ $data = qx (cp $pinitrd $destination/initrd);
+ } else {
+ $data = qx (cp $imageDest/$iso*$arch*.gz $destination/initrd);
+ }
$code = $? >> 8;
if ($code == 0) {
- $data = qx (cp $imageDest/$iso*$arch*.kernel $destination/linux);
+ if ($pblt) {
+ $data = qx (cp $plinux $destination/linux);
+ } else {
+ $data = qx (cp $imageDest/$iso*$arch*.kernel $destination/linux);
+ }
$code = $? >> 8;
}
if ($code != 0) {
@@ -1023,11 +1150,13 @@
#==========================================
# remove original kernel and initrd
#------------------------------------------
- $data = qx (rm $imageDest/$iso*.* 2>&1);
- $code = $? >> 8;
- if ($code != 0) {
- $kiwi -> warning ("Couldn't cleanup boot files: $data");
- $kiwi -> skipped ();
+ if (! $pblt) {
+ $data = qx (rm $imageDest/$iso*.* 2>&1);
+ $code = $? >> 8;
+ if ($code != 0) {
+ $kiwi -> warning ("Couldn't cleanup boot files: $data");
+ $kiwi -> skipped ();
+ }
}
#==========================================
# Create boot configuration
@@ -1052,8 +1181,8 @@
#------------------------------------------
$kiwi -> info ("Calling mkisofs...");
my $name = $imageDest."/".$namerw.".iso";
- my $data = qx ($CD/isolinux.sh $main::RootTree/CD $name 2>&1);
- my $code = $? >> 8;
+ $data = qx ($CD/isolinux.sh $main::RootTree/CD $name 2>&1);
+ $code = $? >> 8;
if ($code != 0) {
$kiwi -> failed ();
$kiwi -> error ("Failed to create ISO image: $data");
@@ -1064,6 +1193,9 @@
}
return undef;
}
+ #==========================================
+ # remove tmpdir with boot tree
+ #------------------------------------------
if (! -d $main::RootTree.$baseSystem) {
qx (rm -rf $main::RootTree);
qx (rm -rf $tmpdir);
@@ -1086,6 +1218,10 @@
my $error;
my $ok;
my $imageTreeReadOnly;
+ my $mbytesreal;
+ my $mbytesrw;
+ my $mbytesro;
+ my $xmlsize;
#==========================================
# Get filesystem info for split image
#------------------------------------------
@@ -1142,8 +1278,8 @@
# Count disk space for extends
#------------------------------------------
$kiwi -> info ("Computing disk space...");
- my ($mbytesreal,$mbytesrw,$xmlsize) = $this -> getSize ($imageTree);
- my ($mbytesreal,$mbytesro,$xmlsize) = $this -> getSize ($imageTreeReadOnly);
+ ($mbytesreal,$mbytesrw,$xmlsize) = $this -> getSize ($imageTree);
+ ($mbytesreal,$mbytesro,$xmlsize) = $this -> getSize ($imageTreeReadOnly);
$kiwi -> done ();
#==========================================
@@ -1500,7 +1636,7 @@
# UNIONFS_CONFIG information
#------------------------------------------
my %unionConfig = $xml -> getDeployUnionConfig ();
- if (defined %unionConfig) {
+ if (%unionConfig) {
my $valid = 0;
my $value;
if (! $unionConfig{type}) {
@@ -1828,7 +1964,11 @@
# mount logical extend for data transfer
#------------------------------------------
mkdir "$imageDest/mnt-$$";
- my $data = qx (mount $opts -oloop $imageDest/$name $imageDest/mnt-$$ 2>&1);
+ my $mount = "mount";
+ if (defined $opts) {
+ $mount = "mount $opts";
+ }
+ my $data = qx ($mount -oloop $imageDest/$name $imageDest/mnt-$$ 2>&1);
my $code = $? >> 8;
if ($code != 0) {
chomp $data;
@@ -1859,7 +1999,10 @@
# script which exists for boot images only
# ---
my %type = %{$xml->getImageTypeAndAttributes()};
- my $para = $type{type}.":".$type{filesystem};
+ my $para = $type{type};
+ if (defined $type{filesystem}) {
+ $para = $para.":".$type{filesystem};
+ }
SWITCH: for ($para) {
/ext3/i && do {
return $name;
@@ -2226,10 +2369,12 @@
# method returns the size value in MegaByte
# ---
my $this = shift;
- my $xml = $this->{xml};
my $extend = shift;
- my $size = qx ( du -ks $extend );
- $size =~ /(\d+)\s.*/;
+ my $xml = $this->{xml};
+ my $size = qx ( du -ks $extend ); chomp $size;
+ if ($size =~ /(\d+)\s.*/) {
+ $size = $1;
+ }
#==========================================
# Add 30% more space for later filesystem
#------------------------------------------
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 2007-10-24 17:57:05.000000000 +0200
+++ new/kiwi/modules/KIWILog.pm 2007-10-26 19:20:16.000000000 +0200
@@ -891,7 +891,7 @@
$logServer -> write ( $this -> getLogServerMessage() );
$logServer -> closeConnection();
$sharedMem -> closeSegment();
- exit 0;
+ exit 1;
};
while (my $command = $logServer -> read()) {
#==========================================
@@ -920,15 +920,15 @@
}
}
undef $logServer;
- exit 0;
+ exit 1;
}
return $this;
}
#==========================================
-# Destructor
+# cleanSweep
#------------------------------------------
-sub DESTROY {
+sub cleanSweep {
my $this = shift;
my $jclient = $this->{jclient};
my $logchild = $this->{logchild};
@@ -940,8 +940,11 @@
$jclient -> Disconnect();
}
if (defined $logchild) {
- kill 15, $logchild;
+ kill (15, $logchild);
+ waitpid ($logchild,0);
+ undef $this->{logchild};
}
+ return $this;
}
1;
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-10-25 10:42:27.000000000 +0200
+++ new/kiwi/modules/KIWIManager.pm 2007-10-26 19:20:17.000000000 +0200
@@ -179,7 +179,7 @@
#==========================================
# Check log location
#------------------------------------------
- if ($main::LogFile eq "terminal") {
+ if ((defined $main::LogFile) && ($main::LogFile eq "terminal")) {
$logs = 0;
}
#==========================================
@@ -384,6 +384,7 @@
}
foreach my $chl (keys %{$source{$stype}}) {
my @opts = @{$source{$stype}{$chl}};
+ @opts = map { if (defined $_) { $_ } } @opts;
if (! $chroot) {
$this -> checkExclusiveLock();
$this -> setLock();
@@ -981,12 +982,13 @@
}
#==========================================
-# Destructor
+# removeCacheDir
#------------------------------------------
-sub DESTROY {
+sub removeCacheDir {
my $this = shift;
my $dataDir = $this->{dataDir};
qx (rm -rf $dataDir);
+ return $this;
}
1;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/modules/KIWIMigrate.pm new/kiwi/modules/KIWIMigrate.pm
--- old/kiwi/modules/KIWIMigrate.pm 2007-09-20 17:37:50.000000000 +0200
+++ new/kiwi/modules/KIWIMigrate.pm 2007-10-26 19:20:17.000000000 +0200
@@ -412,6 +412,7 @@
#------------------------------------------
sub generateWanted {
my $filehash = shift;
+ my $mount = shift;
return sub {
if (-f $File::Find::name) {
my $expr = quotemeta $mount;
@@ -424,7 +425,7 @@
#==========================================
# Find files not packaged
#------------------------------------------
- my $wref = generateWanted (\%result);
+ my $wref = generateWanted (\%result,$mount);
$kiwi -> info ("Inspecting root file system...");
find ({ wanted => $wref, follow => 0 }, $mount );
$this -> cleanMount();
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 2007-10-04 16:21:21.000000000 +0200
+++ new/kiwi/modules/KIWIRoot.pm 2007-10-26 19:20:17.000000000 +0200
@@ -472,24 +472,6 @@
}
close FD;
#========================================
- # call config.sh image script
- #----------------------------------------
- if (-x "$imageDesc/config.sh") {
- $kiwi -> info ("Calling image script: config.sh");
- qx ( cp $imageDesc/config.sh $root/tmp );
- my $data = qx ( chroot $root /tmp/config.sh 2>&1 );
- my $code = $? >> 8;
- if ($code != 0) {
- $kiwi -> failed ();
- $kiwi -> info ($data);
- return undef;
- } else {
- $kiwi -> loginfo ("config.sh: $data");
- }
- qx ( rm -f $root/tmp/config.sh );
- $kiwi -> done ();
- }
- #========================================
# check for linuxrc
#----------------------------------------
if (-f "$root/linuxrc") {
@@ -578,10 +560,22 @@
return undef;
}
#========================================
- # Create in place SVN repos from /etc
+ # call config.sh image script
#----------------------------------------
- if (! $configure -> setupInPlaceSVNRepository()) {
- return undef;
+ if (-x "$imageDesc/config.sh") {
+ $kiwi -> info ("Calling image script: config.sh");
+ qx ( cp $imageDesc/config.sh $root/tmp );
+ my $data = qx ( chroot $root /tmp/config.sh 2>&1 );
+ my $code = $? >> 8;
+ if ($code != 0) {
+ $kiwi -> failed ();
+ $kiwi -> info ($data);
+ return undef;
+ } else {
+ $kiwi -> loginfo ("config.sh: $data");
+ }
+ qx ( rm -f $root/tmp/config.sh );
+ $kiwi -> done ();
}
return $this;
}
@@ -710,10 +704,23 @@
# remove all source locations created by kiwi
# ---
my $this = shift;
- my $kiwi = $this->{kiwi};
my $manager = $this->{manager};
$manager -> resetSource();
return $this;
}
+#==========================================
+# cleanManager
+#------------------------------------------
+sub cleanManager {
+ # ...
+ # remove data dir(s) of the packagemanager created
+ # for kiwi in /var/cache/kiwi/<packagemanager>
+ # ---
+ my $this = shift;
+ my $manager = $this->{manager};
+ $manager -> removeCacheDir();
+ return $this;
+}
+
1;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/modules/KIWIScheme.xsd new/kiwi/modules/KIWIScheme.xsd
--- old/kiwi/modules/KIWIScheme.xsd 2007-10-09 10:26:00.000000000 +0200
+++ new/kiwi/modules/KIWIScheme.xsd 2007-10-26 19:20:17.000000000 +0200
@@ -289,6 +289,7 @@
xs:complexType
xs:simpleContent
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/modules/KIWISocket.pm new/kiwi/modules/KIWISocket.pm
--- old/kiwi/modules/KIWISocket.pm 2007-10-04 16:21:21.000000000 +0200
+++ new/kiwi/modules/KIWISocket.pm 2007-10-26 19:20:17.000000000 +0200
@@ -149,6 +149,7 @@
if (defined $server) {
close $server;
}
+ return $this;
}
1;
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-10-10 16:42:32.000000000 +0200
+++ new/kiwi/modules/KIWIXML.pm 2007-10-26 19:20:17.000000000 +0200
@@ -352,13 +352,14 @@
if ($count == 0) {
$first = $prim;
}
- $record{type} = $node -> string_value();
- $record{boot} = $node -> getAttribute("boot");
- $record{flags}= $node -> getAttribute("flags");
- $record{filesystem} = $node -> getAttribute("filesystem");
- $record{baseroot} = $node -> getAttribute("baseroot");
- $record{bootprofile} = $node -> getAttribute("bootprofile");
+ $record{type} = $node -> string_value();
+ $record{boot} = $node -> getAttribute("boot");
+ $record{flags} = $node -> getAttribute("flags");
$record{format} = $node -> getAttribute("format");
+ $record{checkprebuilt} = $node -> getAttribute("checkprebuilt");
+ $record{filesystem} = $node -> getAttribute("filesystem");
+ $record{baseroot} = $node -> getAttribute("baseroot");
+ $record{bootprofile} = $node -> getAttribute("bootprofile");
$result{$prim} = \%record;
$count++;
}
@@ -1672,7 +1673,7 @@
# a regular expression to find the file. After that repeat
# the download
# ----
- my $dest = $dirname."/".$basename;
+ $dest = $dirname."/".$basename;
my $data = qx (lwp-download $url $dest);
my $code = $? >> 8;
if ($code == 0) {
@@ -1748,8 +1749,8 @@
#==========================================
# remove leading/trailing slashes if any
#------------------------------------------
- $pattern =~ s#^/*(.*)#\1#;
- $pattern =~ s#(.*)/$#\1#;
+ $pattern =~ s#^/*(.*)#$1#;
+ $pattern =~ s#(.*)/$#$1#;
my @testlist = split( "/", $pattern, 2);
my $prefix = $testlist[0];
my $rest = $testlist[1];
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/.revision new/kiwi/.revision
--- old/kiwi/.revision 2007-10-25 10:48:17.000000000 +0200
+++ new/kiwi/.revision 2007-10-26 19:29:48.000000000 +0200
@@ -1 +1 @@
-727
\ No newline at end of file
+735
\ No newline at end of file
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/system/boot/netboot/suse-linuxrc new/kiwi/system/boot/netboot/suse-linuxrc
--- old/kiwi/system/boot/netboot/suse-linuxrc 2007-10-24 17:56:56.000000000 +0200
+++ new/kiwi/system/boot/netboot/suse-linuxrc 2007-10-26 19:20:09.000000000 +0200
@@ -441,8 +441,6 @@
INITRD_MODULES="$INITRD_MODULES reiserfs"
fi
if test "$FSTYPE" = "ext2";then
- Echo "Checking EXT2 filesystem..."
- e2fsck -f $imageDevice -y
Echo "Resize EXT2 filesystem to full partition space..."
resize2fs -f -F -p $imageDevice
Echo "Checking EXT2 filesystem..."
@@ -450,8 +448,6 @@
INITRD_MODULES="$INITRD_MODULES ext2"
fi
if test "$FSTYPE" = "ext3";then
- Echo "Checking EXT3 filesystem..."
- e2fsck -f $imageDevice -y
Echo "Resize EXT3 filesystem to full partition space..."
resize2fs -f -F -p $imageDevice
Echo "Checking EXT3 filesystem..."
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/system/boot/oemboot/suse-linuxrc new/kiwi/system/boot/oemboot/suse-linuxrc
--- old/kiwi/system/boot/oemboot/suse-linuxrc 2007-10-24 17:56:56.000000000 +0200
+++ new/kiwi/system/boot/oemboot/suse-linuxrc 2007-10-26 19:20:08.000000000 +0200
@@ -231,7 +231,7 @@
imageName="$imageName.gz"
fi
Echo "Loading $imageName [$imageDevice]..."
- if ! dd if=$imageName of=$imageDevice >/dev/null 2>&1; then
+ if ! dd bs=32k if=$imageName of=$imageDevice >/dev/null 2>&1; then
systemException \
"Failed to install image: $imageName -> $imageDevice" \
"reboot"
@@ -498,20 +498,17 @@
INITRD_MODULES="$INITRD_MODULES reiserfs"
fi
if test "$FSTYPE" = "ext2";then
- Echo "Checking EXT2 filesystem..."
- e2fsck -y -f $deviceRoot
Echo "Resize EXT2 filesystem to full partition space..."
resize2fs -f -F -p $deviceRoot
+ Echo "Checking EXT2 filesystem..."
+ e2fsck -y -f $deviceRoot
INITRD_MODULES="$INITRD_MODULES ext2"
fi
if test "$FSTYPE" = "ext3";then
- Echo "Checking EXT3 filesystem..."
- e2fsck -y -f $deviceRoot
Echo "Resize EXT3 filesystem to full partition space..."
resize2fs -f -F -p $deviceRoot
+ Echo "Checking EXT3 filesystem..."
e2fsck -y -f $deviceRoot
- Echo "Checking EXT3 journal..."
- tune2fs -j $deviceRoot
INITRD_MODULES="$INITRD_MODULES ext3"
fi
fi
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/system/boot/usbboot/suse-linuxrc new/kiwi/system/boot/usbboot/suse-linuxrc
--- old/kiwi/system/boot/usbboot/suse-linuxrc 2007-10-24 17:56:57.000000000 +0200
+++ new/kiwi/system/boot/usbboot/suse-linuxrc 2007-10-26 19:20:09.000000000 +0200
@@ -99,19 +99,21 @@
if test "$FSTYPE" = "squashfs";then
export UNIONFS_CONFIG="$stickRoot"3,"$stickRoot"2,aufs
else
- Echo "Resize filesystem to full partition space..."
if test "$FSTYPE" = "reiserfs";then
+ Echo "Resize Reiser filesystem to full partition space..."
resize_reiserfs $stickDevice
fi
if test "$FSTYPE" = "ext2";then
- e2fsck -y -f $stickDevice
+ Echo "Resize EXT2 filesystem to full partition space..."
resize2fs -f -F -p $stickDevice
+ Echo "Checking EXT2 filesystem..."
+ e2fsck -y -f $stickDevice
fi
if test "$FSTYPE" = "ext3";then
- e2fsck -y -f $stickDevice
+ Echo "Resize EXT3 filesystem to full partition space..."
resize2fs -f -F -p $stickDevice
+ Echo "Checking EXT3 filesystem..."
e2fsck -y -f $stickDevice
- tune2fs -j $stickDevice
fi
fi
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/system/boot/vmxboot/suse-linuxrc new/kiwi/system/boot/vmxboot/suse-linuxrc
--- old/kiwi/system/boot/vmxboot/suse-linuxrc 2007-10-24 17:57:03.000000000 +0200
+++ new/kiwi/system/boot/vmxboot/suse-linuxrc 2007-10-26 19:20:10.000000000 +0200
@@ -133,21 +133,23 @@
if test "$FSTYPE" = "squashfs";then
export UNIONFS_CONFIG="$imageDiskDevice"3,"$imageDiskDevice"2,aufs
else
- Echo "Resize filesystem to full partition space..."
if test "$FSTYPE" = "reiserfs";then
+ Echo "Resize Reiser filesystem to full partition space..."
resize_reiserfs $imageRootDevice
INITRD_MODULES="$INITRD_MODULES reiserfs"
fi
if test "$FSTYPE" = "ext2";then
- e2fsck -y -f $imageRootDevice
+ Echo "Resize EXT2 filesystem to full partition space..."
resize2fs -f -F -p $imageRootDevice
+ Echo "Checking EXT2 filesystem..."
+ e2fsck -y -f $imageRootDevice
INITRD_MODULES="$INITRD_MODULES ext2"
fi
if test "$FSTYPE" = "ext3";then
- e2fsck -y -f $imageRootDevice
+ Echo "Resize EXT3 filesystem to full partition space..."
resize2fs -f -F -p $imageRootDevice
+ Echo "Checking EXT3 filesystem..."
e2fsck -y -f $imageRootDevice
- tune2fs -j $imageRootDevice
INITRD_MODULES="$INITRD_MODULES ext3"
fi
fi
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org