Hello community,
here is the log from the commit of package kiwi for openSUSE:Factory
checked in at Mon Nov 29 12:23:58 CET 2010.
--------
--- kiwi/kiwi.changes 2010-11-19 16:31:07.000000000 +0100
+++ /mounts/work_src_done/STABLE/kiwi/kiwi.changes 2010-11-26 15:51:23.000000000 +0100
@@ -1,0 +2,145 @@
+Fri Nov 26 15:42:17 CET 2010 - ms@suse.de
+
+- v4.66 released
+
+-------------------------------------------------------------------
+Fri Nov 26 15:41:36 CET 2010 - ms@suse.de
+
+- fixed use of undefined value as an ARRAY reference
+
+-------------------------------------------------------------------
+Fri Nov 26 14:50:40 CET 2010 - ms@suse.de
+
+- removed unused cleanInitrd() function
+
+-------------------------------------------------------------------
+Fri Nov 26 11:12:27 CET 2010 - ms@suse.de
+
+- make sure bootstrap packages are handled when using a cache
+- fixed time when KIWIImage.pm mounts the overlay and provide
+ a function getImageTree() which returns the currently used
+ root tree. Move the recovery creation, profile update, and
+ cleanup after the KIWIImage module creation
+
+-------------------------------------------------------------------
+Fri Nov 26 00:52:00 CET 2010 - ms@suse.de
+
+- fixed overlay setup for KIWIBoot modules. Only if a cow
+ file exists in the given system image path it's required to
+ setup the overlay mount
+
+-------------------------------------------------------------------
+Fri Nov 26 00:45:52 CET 2010 - ms@suse.de
+
+- don't create new kiwi object if there is already one available
+
+-------------------------------------------------------------------
+Thu Nov 25 17:27:56 CET 2010 - ms@suse.de
+
+- check image type only if a preferences section is present
+
+-------------------------------------------------------------------
+Thu Nov 25 17:25:32 CET 2010 - ms@suse.de
+
+- fixed profile check in create mode
+
+-------------------------------------------------------------------
+Thu Nov 25 16:09:29 CET 2010 - ms@suse.de
+
+- cleanup xenconfig setup by removing conditions that no longer apply
+ due to the removal of the xen image type which is now handled
+ by the vmx/oem type flavoured with xen and xenk profiles
+
+-------------------------------------------------------------------
+Thu Nov 25 16:02:59 CET 2010 - ms@suse.de
+
+- make sure the package manager is added only once to the
+ list when in --info mode
+
+-------------------------------------------------------------------
+Thu Nov 25 15:56:42 CET 2010 - ms@suse.de
+
+- fixed dumpsolv regexp which searches for pattern names
+
+-------------------------------------------------------------------
+Thu Nov 25 15:42:02 CET 2010 - ms@suse.de
+
+- fixed creation of boot image caches. It's required to prevent
+ the kernel extraction from the cache because this is done in
+ the preparation process which uses the cache
+
+- don't allow logfile option when in init-cache mode. This is
+ because each cache has its own logfile living in the cache
+ directory
+
+-------------------------------------------------------------------
+Thu Nov 25 12:48:17 CET 2010 - ms@suse.de
+
+- fixed minor code duplication inside the RNC schema
+
+-------------------------------------------------------------------
+Thu Nov 25 12:02:42 CET 2010 - ms@suse.de
+
+- deactivate compression for clicfs caches (faster)
+- fixed and cleaned up profile evaluation and use
+
+-------------------------------------------------------------------
+Thu Nov 25 11:43:17 CET 2010 - adrian@suse.de
+
+ make "mk_listings" call during product generation optional
+
+-------------------------------------------------------------------
+Thu Nov 25 09:50:18 CET 2010 - ms@suse.de
+
+- explicitly call SuSEconfig --module permissions. This module
+ is no longer called by the default SuSEconfig call so we need
+ to call it directly
+
+-------------------------------------------------------------------
+Wed Nov 24 15:20:26 CET 2010 - ms@suse.de
+
+- added the following consistency checks:
+* only 1 profile may be marked as default via import="true"
+* only 1 type per <preference> spec may be set as default via primary="true"
+* only 1 <preference> spec may reference 1 <profile>
+* only 1 <preference> specification without a profiles=... attribute
+* check that all references used via profiles="aName" attribute have
+ a definition of
+
+-------------------------------------------------------------------
+Wed Nov 24 14:15:20 CET 2010 - ms@suse.de
+
+- require specific clicfs version because the version before
+ has severe problems when writing to a cow file
+
+-------------------------------------------------------------------
+Tue Nov 23 13:04:06 CET 2010 - ms@suse.de
+
+- don't preserve rpm database on recovery. This could cause
+ an inconsistent rpm database. Not preserving it could cause
+ an incomplete but consistent database which is better. For
+ reference a copy of the old database is stored in
+ /var/lib/rpm.backup
+
+-------------------------------------------------------------------
+Mon Nov 22 16:39:22 CET 2010 - ms@suse.de
+
+- follow up: make sure system filesystems and mount options corresponds
+ with the default settings we use in a standard installation with yast
+
+-------------------------------------------------------------------
+Mon Nov 22 16:10:47 CET 2010 - ms@suse.de
+
+- fixed cleanImage() function to cleanly umount partitions before
+ calling init. Also make sure cleanImage reports its actions
+ as part of the boot.kiwi logfile
+
+- make sure system filesystems and mount options corresponds with
+ the default settings we use in a standard installation with yast
+
+-------------------------------------------------------------------
+Mon Nov 22 14:58:12 CET 2010 - ms@suse.de
+
+- fixed typo in option description
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kiwi.spec ++++++
--- /var/tmp/diff_new_pack.t9k7oK/_old 2010-11-29 12:22:39.000000000 +0100
+++ /var/tmp/diff_new_pack.t9k7oK/_new 2010-11-29 12:22:39.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package kiwi (Version 4.65)
+# spec file for package kiwi (Version 4.66)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -56,11 +56,11 @@
%ifarch %ix86 x86_64
Requires: master-boot-code
%if %{suse_version} > 1110
-Requires: clicfs
+Requires: clicfs >= 1.3.8
%endif
%endif
Summary: OpenSuSE - KIWI Image System
-Version: 4.65
+Version: 4.66
Release: 1
Group: System/Management
License: GPLv2
++++++ kiwi-docu.tar.bz2 ++++++
kiwi/kiwi-docu.tar.bz2 /mounts/work_src_done/STABLE/kiwi/kiwi-docu.tar.bz2 differ: byte 11, line 1
++++++ 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 2010-11-19 16:26:02.000000000 +0100
+++ new/kiwi/kiwi.pl 2010-11-26 15:48:16.000000000 +0100
@@ -46,7 +46,7 @@
#============================================
# Globals (Version)
#--------------------------------------------
-our $Version = "4.65";
+our $Version = "4.66";
our $Publisher = "SUSE LINUX Products GmbH";
our $Preparer = "KIWI - http://kiwi.berlios.de";
our $openSUSE = "http://download.opensuse.org";
@@ -368,6 +368,14 @@
my $code = kiwiExit (1); return $code;
}
my %type = %{$xml->getImageTypeAndAttributes()};
+ if ($type{type} eq "cpio") {
+ # /.../
+ # set a faked 'clicfs' image type for cpio images to prevent
+ # the kernel extraction from the cache image
+ # ----
+ $xml -> setImageType ("clicfs");
+ %type = %{$xml->getImageTypeAndAttributes()};
+ }
#==========================================
# Create cache(s)...
#------------------------------------------
@@ -399,53 +407,9 @@
}
my %type = %{$xml->getImageTypeAndAttributes()};
#==========================================
- # Check for bootprofile in xml descr.
+ # print boot theme information
#------------------------------------------
- if (! @Profiles) {
- if ($type{"type"} eq "cpio") {
- if ($type{bootprofile}) {
- push @Profiles, split (/,/,$type{bootprofile});
- }
- if ($type{bootkernel}) {
- push @Profiles, split (/,/,$type{bootkernel});
- }
- }
- }
- #==========================================
- # Check for bootkernel in xml descr.
- #------------------------------------------
if ($type{"type"} eq "cpio") {
- my %phash = ();
- my $found = 0;
- my @pname = $xml -> getProfiles();
- foreach my $profile (@pname) {
- my $name = $profile -> {name};
- my $descr= $profile -> {description};
- if ($descr =~ /KERNEL:/) {
- $phash{$name} = $profile -> {description};
- }
- }
- foreach my $profile (@Profiles) {
- if ($phash{$profile}) {
- # /.../
- # ok, a kernel from the profile list is
- # already selected
- # ----
- $found = 1;
- last;
- }
- }
- if (! $found) {
- # /.../
- # no kernel profile selected use standard (std)
- # profile which is defined in each boot image
- # description
- # ----
- push @Profiles, "std";
- }
- if (! $xml -> checkProfiles (\@Profiles)) {
- my $code = kiwiExit (1); return $code;
- }
my $theme = $xml -> getBootTheme();
if ($theme) {
$kiwi -> info ("Using boot theme: $theme");
@@ -540,14 +504,12 @@
$kiwi -> failed ();
my $code = kiwiExit (1); return $code;
}
- if (! defined $CacheRoot) {
- if (! defined $root -> init ()) {
- $kiwi -> error ("Base initialization failed");
- $kiwi -> failed ();
- $root -> copyBroken();
- undef $root;
- my $code = kiwiExit (1); return $code;
- }
+ if (! defined $root -> init ()) {
+ $kiwi -> error ("Base initialization failed");
+ $kiwi -> failed ();
+ $root -> copyBroken();
+ undef $root;
+ my $code = kiwiExit (1); return $code;
}
#==========================================
# Check for pre chroot call
@@ -618,37 +580,16 @@
my $code = kiwiExit (1); return $code;
}
#==========================================
- # Check for bootprofile in xml descr
+ # Process system image description
#------------------------------------------
- my $xml;
- my %attr;
- my $origcreate = $Create;
- if (! @Profiles) {
- $kiwi -> info ("Reading image description [Create]...\n");
- $xml = new KIWIXML (
- $kiwi,"$Create/image",\%ForeignRepo,$SetImageType
- );
- if (! defined $xml) {
- my $code = kiwiExit (1); return $code;
- }
- %attr = %{$xml->getImageTypeAndAttributes()};
- if (($attr{"type"} eq "cpio") && ($attr{bootprofile})) {
- @Profiles = split (/,/,$attr{bootprofile});
- if (! $xml -> checkProfiles (\@Profiles)) {
- my $code = kiwiExit (1); return $code;
- }
- }
- }
+ $kiwi -> info ("Reading image description [Create]...\n");
+ my $xml = new KIWIXML (
+ $kiwi,"$Create/image",\%ForeignRepo,$SetImageType,\@Profiles
+ );
if (! defined $xml) {
- $kiwi -> info ("Reading image description [Create]...\n");
- $xml = new KIWIXML (
- $kiwi,"$Create/image",undef,$SetImageType,\@Profiles
- );
- if (! defined $xml) {
- my $code = kiwiExit (1); return $code;
- }
- %attr = %{$xml->getImageTypeAndAttributes()};
+ my $code = kiwiExit (1); return $code;
}
+ my %attr = %{$xml->getImageTypeAndAttributes()};
#==========================================
# Check for default destination in XML
#------------------------------------------
@@ -768,26 +709,27 @@
undef $main::Upgrade;
}
#==========================================
- # Check for overlay structure
+ # Create KIWIImage object
#------------------------------------------
- my $overlay = new KIWIOverlay (
- $kiwi,$Create,$CacheRoot,$CacheRootMode
+ $image = new KIWIImage (
+ $kiwi,$xml,$Create,$Destination,$StripImage,
+ "/base-system",$Create
);
- if (! defined $overlay) {
- my $code = kiwiExit (1); return $code;
- }
- $Create = $overlay -> mountOverlay();
- if (! defined $Create) {
+ if (! defined $image) {
my $code = kiwiExit (1); return $code;
}
#==========================================
+ # Obtain currently used image tree path
+ #------------------------------------------
+ my $tree = $image -> getImageTree();
+ #==========================================
# Cleanup the tree according to prev runs
#------------------------------------------
- if (-f "$Create/rootfs.tar") {
- qxx ("rm -f $Create/rootfs.tar");
+ if (-f "$tree/rootfs.tar") {
+ qxx ("rm -f $tree/rootfs.tar");
}
- if (-f "$Create/recovery.tar.gz") {
- qxx ("rm -f $Create/recovery.*");
+ if (-f "$tree/recovery.tar.gz") {
+ qxx ("rm -f $tree/recovery.*");
}
#==========================================
# Update .profile env, current type
@@ -795,7 +737,7 @@
$kiwi -> info ("Updating type in .profile environment");
my $type = $attr{type};
qxx (
- "sed -i -e 's#kiwi_type=.*#kiwi_type=\"$type\"#' $Create/.profile"
+ "sed -i -e 's#kiwi_type=.*#kiwi_type=\"$type\"#' $tree/.profile"
);
$kiwi -> done();
#==========================================
@@ -803,7 +745,7 @@
#------------------------------------------
if ($type eq "oem") {
my $configure = new KIWIConfigure (
- $kiwi,$xml,$Create,$Create."/image",$Destination
+ $kiwi,$xml,$tree,$tree."/image",$Destination
);
if (! defined $configure) {
my $code = kiwiExit (1); return $code;
@@ -813,21 +755,6 @@
}
}
#==========================================
- # Close overlay mount if active
- #------------------------------------------
- undef $overlay;
- $Create = $origcreate;
- #==========================================
- # Create KIWIImage object
- #------------------------------------------
- $image = new KIWIImage (
- $kiwi,$xml,$Create,$Destination,$StripImage,
- "/base-system",$Create
- );
- if (! defined $image) {
- my $code = kiwiExit (1); return $code;
- }
- #==========================================
# Initialize logical image extend
#------------------------------------------
my $ok;
@@ -1508,6 +1435,11 @@
$kiwi -> failed ();
my $code = kiwiExit (1); return $code;
}
+ if (($InitCache) && ($LogFile)) {
+ $kiwi -> warning ("Logfile option not supported in init-cache mode");
+ $kiwi -> skipped ();
+ undef $LogFile;
+ }
if (($targetDevice) && (! -b $targetDevice)) {
$kiwi -> error ("Target device $targetDevice doesn't exist");
$kiwi -> failed ();
@@ -1601,7 +1533,7 @@
print " kiwi -c | --create <image-root> -d <destination>\n";
print " [ --type <image-type> ]\n";
print "Image Cache:\n";
- print " kiwi --image-cache <image-path>\n";
+ print " kiwi --init-cache <image-path>\n";
print " [ --cache <dir> ]\n";
print "Image Upgrade:\n";
print " kiwi -u | --upgrade <image-root>\n";
@@ -1832,7 +1764,9 @@
#==========================================
# Create log object
#------------------------------------------
- $kiwi = new KIWILog("tiny");
+ if (! defined $kiwi) {
+ $kiwi = new KIWILog("tiny");
+ }
#==========================================
# Setup logging location
#------------------------------------------
@@ -2979,7 +2913,9 @@
my $name = $xml -> getImageName();
if (($type{boot}) && ($type{boot} =~ /.*\/(.*)/)) {
$CacheDistro = $1;
- } elsif (($type{type} eq "cpio") && ($name =~ /initrd-.*boot-(.*)/)) {
+ } elsif (
+ ($type{type} =~ /clicfs|cpio/) && ($name =~ /initrd-.*boot-(.*)/)
+ ) {
$CacheDistro = $1;
} else {
$kiwi -> warning ("Can't setup cache without a boot type");
@@ -3160,6 +3096,7 @@
#==========================================
# Variable setup and reset function
#------------------------------------------
+ $ENV{MKCLICFS_COMPRESSION} = 0;
sub reset_sub {
my $backupSurvive = $main::Survive;
my @backupProfiles = @main::Profiles;
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 2010-11-19 15:29:38.000000000 +0100
+++ new/kiwi/modules/KIWIBoot.pm 2010-11-26 15:48:16.000000000 +0100
@@ -106,7 +106,7 @@
$kiwi -> error ("Couldn't find image file/directory: $system");
$kiwi -> failed ();
return undef;
- } else {
+ } elsif (-f "$system/kiwi-root.cow") {
#==========================================
# Check for overlay structure
#------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWICollect.pm new/kiwi/modules/KIWICollect.pm
--- old/kiwi/modules/KIWICollect.pm 2010-08-10 13:43:44.000000000 +0200
+++ new/kiwi/modules/KIWICollect.pm 2010-11-26 15:48:16.000000000 +0100
@@ -1757,22 +1757,24 @@
$this->createBootPackageLinks();
## step 9: LISTINGS
- $this->logMsg("I", "Calling mk_listings:");
- my $listings = "/usr/bin/mk_listings";
- if(! (-f $listings or -x $listings)) {
- $this->logMsg("W", "[createMetadata] excutable `$listings` not found. Maybe package `inst-source-utils` is not installed?");
- return;
+ my $make_listings = $this->{m_proddata}->getVar("MAKE_LISTINGS");
+ unless (defined($make_listings) && $make_listings eq "false") {
+ $this->logMsg("I", "Calling mk_listings:");
+ my $listings = "/usr/bin/mk_listings";
+ if(! (-f $listings or -x $listings)) {
+ $this->logMsg("W", "[createMetadata] excutable `$listings` not found. Maybe package `inst-source-utils` is not installed?");
+ return;
+ }
+ my $cmd = "$listings ".$this->{m_basesubdir}->{'1'};
+ @data = qx($cmd);
+ undef $cmd;
+ $this->logMsg("I", "[createMetadata] $listings output:");
+ foreach(@data) {
+ chomp $_;
+ $this->logMsg("I", "\t$_");
+ }
+ @data = (); # clear list
}
- my $cmd = "$listings ".$this->{m_basesubdir}->{'1'};
- @data = qx($cmd);
- undef $cmd;
- $this->logMsg("I", "[createMetadata] $listings output:");
- foreach(@data) {
- chomp $_;
- $this->logMsg("I", "\t$_");
- }
- @data = (); # clear list
-
## step 7: SHA1SUMS
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 2010-11-19 15:29:38.000000000 +0100
+++ new/kiwi/modules/KIWIConfig.sh 2010-11-26 15:48:16.000000000 +0100
@@ -339,6 +339,10 @@
# SuSEconfig
#--------------------------------------
/sbin/SuSEconfig
+ #======================================
+ # SuSEconfig permissions
+ #--------------------------------------
+ SuSEconfig --module permissions
}
#======================================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIImageFormat.pm new/kiwi/modules/KIWIImageFormat.pm
--- old/kiwi/modules/KIWIImageFormat.pm 2010-11-19 15:29:38.000000000 +0100
+++ new/kiwi/modules/KIWIImageFormat.pm 2010-11-26 15:48:16.000000000 +0100
@@ -183,13 +183,8 @@
$kiwi -> skipped ();
return undef;
}
- if (($type{type}) && ($type{type} eq "xen")) {
- $kiwi -> info ("Starting $imgtype image machine configuration\n");
- return $this -> createXENConfiguration();
- } elsif (
- ($type{bootprofile}) && ($type{bootprofile} eq "xen") &&
- ($xend eq "domU")
- ) {
+ if (($type{bootprofile}) && ($type{bootprofile} eq "xen")
+ && ($xend eq "domU")) {
$kiwi -> info ("Starting $imgtype image machine configuration\n");
return $this -> createXENConfiguration();
} elsif ($format eq "vmdk") {
@@ -503,29 +498,16 @@
my $device = $xenconfig{xen_diskdevice};
$device =~ s/\/dev\///;
my $part = $device."1";
- if ($type{type} eq "xen") {
- $device = $device."1";
- }
my $memory = $xenconfig{xen_memory};
- if ($type{type} ne "xen") {
- $image .= ".".$format;
- }
+ $image .= ".".$format;
print $FD '# -*- mode: python; -*-'."\n";
print $FD "name=\"".$this->{xml}->getImageDisplayName()."\"\n";
- if ($type{type} eq "xen") {
- print $FD 'kernel="'.$kernel.'"'."\n";
- print $FD 'ramdisk="'.$initrd.'"'."\n";
- }
print $FD 'memory='.$memory."\n";
- if ($type{type} ne "xen") {
- my $tap = $format;
- if ($tap eq "raw") {
- $tap = "aio";
- }
- print $FD 'disk=[ "tap:'.$tap.':'.$image.','.$device.',w" ]'."\n";
- } else {
- print $FD 'disk=[ "file:'.$image.','.$part.',w" ]'."\n";
+ my $tap = $format;
+ if ($tap eq "raw") {
+ $tap = "aio";
}
+ print $FD 'disk=[ "tap:'.$tap.':'.$image.','.$device.',w" ]'."\n";
#==========================================
# network setup
#------------------------------------------
@@ -553,12 +535,6 @@
print $FD " ]"."\n";
}
#==========================================
- # kernel boot parameters
- #------------------------------------------
- if ($type{type} eq "xen") {
- print $FD 'root="'.$part.' rw"'."\n";
- }
- #==========================================
# Process raw config options
#------------------------------------------
my @userOptSettings;
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 2010-11-19 15:29:38.000000000 +0100
+++ new/kiwi/modules/KIWIImage.pm 2010-11-26 15:48:16.000000000 +0100
@@ -118,6 +118,10 @@
$this->{baseSystem} = $baseSystem;
$this->{arch} = $arch;
#==========================================
+ # Mount overlay tree if required...
+ #------------------------------------------
+ $this -> setupOverlay();
+ #==========================================
# Store a disk label ID for this object
#------------------------------------------
$this -> getMBRDiskLabel();
@@ -129,6 +133,19 @@
}
#==========================================
+# getImageTree
+#------------------------------------------
+sub getImageTree {
+ # ...
+ # return current value of system image tree. Normally
+ # this is the same as given in the module parameter list
+ # but in case of an overlay cache mount the path changes
+ # ---
+ my $this = shift;
+ return $this->{imageTree}
+}
+
+#==========================================
# setupOverlay
#------------------------------------------
sub setupOverlay {
@@ -2817,10 +2834,6 @@
my $haveExtend = shift;
my $quiet = shift;
#==========================================
- # Mount overlay tree if required...
- #------------------------------------------
- $this -> setupOverlay();
- #==========================================
# Get image creation date and name
#------------------------------------------
my $name = $this -> buildImageName ();
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 2010-11-19 15:29:38.000000000 +0100
+++ new/kiwi/modules/KIWILinuxRC.sh 2010-11-26 15:48:16.000000000 +0100
@@ -2085,9 +2085,11 @@
local nfstab=$prefix/etc/fstab
mkdir -p $prefix/etc
cat > $nfstab < /dev/null
- echo "devpts /dev/pts devpts mode=0620,gid=5 0 0" >> $nfstab
- echo "proc /proc proc defaults 0 0" >> $nfstab
- echo "sysfs /sys sysfs noauto 0 0" >> $nfstab
+ echo "devpts /dev/pts devpts mode=0620,gid=5 0 0" >> $nfstab
+ echo "proc /proc proc defaults 0 0" >> $nfstab
+ echo "sysfs /sys sysfs noauto 0 0" >> $nfstab
+ echo "debugfs /sys/kernel/debug debugfs noauto 0 0" >> $nfstab
+ echo "usbfs /proc/bus/usb usbfs noauto 0 0" >> $nfstab
}
#======================================
# updateRootDeviceFstab
@@ -2111,9 +2113,9 @@
# check for device by ID
#--------------------------------------
if [ -z "$UNIONFS_CONFIG" ]; then
- echo "$diskByID / $FSTYPE defaults 0 0" >> $nfstab
+ echo "$diskByID / $FSTYPE defaults 1 1" >> $nfstab
else
- echo "/dev/root / defaults 0 0" >> $nfstab
+ echo "/dev/root / defaults 1 1" >> $nfstab
fi
#======================================
# check for LVM volume setup
@@ -2130,7 +2132,7 @@
[ ! $volume = "Comp" ] && \
[ ! $volume = "Swap" ]
then
- echo "/dev/$VGROUP/LV$volume /$mpoint $FSTYPE defaults 0 0" \
+ echo "/dev/$VGROUP/LV$volume /$mpoint $FSTYPE defaults 1 1" \
>> $nfstab
fi
done
@@ -2147,7 +2149,7 @@
local sdev=$2
local diskByID=`getDiskID $sdev`
local nfstab=$prefix/etc/fstab
- echo "$diskByID swap swap pri=42 0 0" >> $nfstab
+ echo "$diskByID swap swap defaults 0 0" >> $nfstab
}
#======================================
# updateLVMBootDeviceFstab
@@ -2175,7 +2177,7 @@
if [ -z "$FSTYPE" ] || [ "$FSTYPE" = "unknown" ];then
FSTYPE="auto"
fi
- echo "$diskByID $mount $FSTYPE defaults 0 0" >> $nfstab
+ echo "$diskByID $mount $FSTYPE defaults 1 2" >> $nfstab
echo "$mount/boot /boot none bind 0 0" >> $nfstab
if [ ! -z "$FSTYPE_SAVE" ];then
FSTYPE=$FSTYPE_SAVE
@@ -2218,9 +2220,9 @@
local diskByID=`getDiskID $sdev`
local nfstab=$prefix/etc/fstab
if [ $loader = "syslinux" ];then
- echo "$diskByID /syslboot vfat defaults 0 0" >> $nfstab
+ echo "$diskByID /syslboot vfat defaults 1 2" >> $nfstab
else
- echo "$diskByID /syslboot ext2 defaults 0 0" >> $nfstab
+ echo "$diskByID /syslboot ext2 defaults 1 2" >> $nfstab
fi
echo "/syslboot/boot /boot none bind 0 0" >> $nfstab
}
@@ -2256,7 +2258,7 @@
then
device=$(ddn $DISK $count)
probeFileSystem $device
- echo "$device $partMount $FSTYPE defaults 1 1" >> $nfstab
+ echo "$device $partMount $FSTYPE defaults 0 0" >> $nfstab
fi
done
}
@@ -4299,38 +4301,6 @@
rm -rf $tmpdir
}
#======================================
-# cleanInitrd
-#--------------------------------------
-function cleanInitrd {
- cp /usr/bin/chroot /bin
- cp /sbin/halt /bin/reboot
- if [ -x /usr/sbin/klogconsole ];then
- cp /usr/sbin/klogconsole /bin
- fi
- for dir in /*;do
- case "$dir" in
- "/lib") continue ;;
- "/lib64") continue ;;
- "/bin") continue ;;
- "/mnt") continue ;;
- "/read-only") continue ;;
- "/read-write") continue ;;
- "/xino") continue ;;
- "/dev") continue ;;
- esac
- rm -rf $dir/* &>/dev/null
- done
- if test -L /read-only;then
- rm -f /read-only
- fi
- if test -L /read-write;then
- rm -f /read-write
- fi
- # mount opens fstab so we give them one
- touch /etc/fstab
- hash -r
-}
-#======================================
# searchGroupConfig
#--------------------------------------
function searchGroupConfig {
@@ -4958,6 +4928,11 @@
# is called
# ----
#======================================
+ # setup logging in this mode
+ #--------------------------------------
+ exec 2>>$ELOG_FILE
+ set -x
+ #======================================
# kill second utimer and tail
#--------------------------------------
. /iprocs
@@ -4991,22 +4966,37 @@
return
fi
#======================================
- # umount LVM root parts lazy
+ # umount LVM root parts
#--------------------------------------
- if [ "$haveLVM" = "yes" ]; then
- for i in /dev/$VGROUP/LV*;do
- if [ ! -e $i ];then
- continue
- fi
- if \
- [ ! $i = "/dev/$VGROUP/LVRoot" ] && \
- [ ! $i = "/dev/$VGROUP/LVComp" ] && \
- [ ! $i = "/dev/$VGROUP/LVSwap" ]
- then
- umount -l $i &>/dev/null
- fi
- done
- fi
+ for i in /dev/$VGROUP/LV*;do
+ if [ ! -e $i ];then
+ continue
+ fi
+ if \
+ [ ! $i = "/dev/$VGROUP/LVRoot" ] && \
+ [ ! $i = "/dev/$VGROUP/LVComp" ] && \
+ [ ! $i = "/dev/$VGROUP/LVSwap" ]
+ then
+ mpoint=$(echo ${i##/*/LV})
+ umount $mpoint 1>&2
+ fi
+ done
+ #======================================
+ # umount image boot partition if any
+ #--------------------------------------
+ for i in lvmboot btrboot clicboot xfsboot luksboot syslboot;do
+ if [ ! -e /$i ];then
+ continue
+ fi
+ umount /$i 1>&2
+ done
+ umount /boot 1>&2
+ #======================================
+ # turn off swap
+ #--------------------------------------
+ mount -t proc proc /proc
+ swapoff -a 1>&2
+ umount /proc 1>&2
}
#======================================
# bootImage
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 2010-11-19 15:29:38.000000000 +0100
+++ new/kiwi/modules/KIWIRoot.pm 2010-11-26 15:48:16.000000000 +0100
@@ -337,35 +337,37 @@
# Copy/touch some defaults files
#----------------------------------
$kiwi -> info ("Creating default template files for new root system");
- qxx ("mkdir -p $root/dev");
- qxx ("mkdir -m 755 -p $root/dev/pts");
- qxx ("mknod -m 666 $root/dev/null c 1 3");
- qxx ("mknod -m 666 $root/dev/zero c 1 5");
- qxx ("mknod -m 622 $root/dev/full c 1 7");
- qxx ("mknod -m 666 $root/dev/random c 1 8");
- qxx ("mknod -m 644 $root/dev/urandom c 1 9");
- qxx ("mknod -m 666 $root/dev/tty c 5 0");
- qxx ("mknod -m 666 $root/dev/ptmx c 5 2");
- qxx ("ln -s /proc/self/fd $root/dev/fd");
- qxx ("ln -s fd/2 $root/dev/stderr");
- qxx ("ln -s fd/0 $root/dev/stdin");
- qxx ("ln -s fd/1 $root/dev/stdout");
- qxx ("mknod -m 640 $root/dev/loop0 b 7 0");
- qxx ("mknod -m 640 $root/dev/loop1 b 7 1");
- qxx ("mknod -m 640 $root/dev/loop2 b 7 2");
- qxx ("mknod -m 640 $root/dev/loop3 b 7 3");
- qxx ("mkdir -p $root/etc/sysconfig");
- qxx ("mkdir -p $root/var/log/YaST2");
- # for smart we need the dpkg default file
- qxx ("mkdir -p $root/var/lib/dpkg");
- qxx ("touch $root/var/lib/dpkg/status");
- qxx ("mkdir -p $root/var/lib/dpkg/updates");
- qxx ("touch $root/var/lib/dpkg/available");
- # for building in suse autobuild we need the following file
- qxx ("touch $root/.buildenv");
- # need mtab at least empty for mount calls
- qxx ("touch $root/etc/mtab");
- qxx ("touch $root/etc/sysconfig/bootloader");
+ if (! defined $this->{cacheRoot}) {
+ qxx ("mkdir -p $root/dev");
+ qxx ("mkdir -m 755 -p $root/dev/pts");
+ qxx ("mknod -m 666 $root/dev/null c 1 3");
+ qxx ("mknod -m 666 $root/dev/zero c 1 5");
+ qxx ("mknod -m 622 $root/dev/full c 1 7");
+ qxx ("mknod -m 666 $root/dev/random c 1 8");
+ qxx ("mknod -m 644 $root/dev/urandom c 1 9");
+ qxx ("mknod -m 666 $root/dev/tty c 5 0");
+ qxx ("mknod -m 666 $root/dev/ptmx c 5 2");
+ qxx ("ln -s /proc/self/fd $root/dev/fd");
+ qxx ("ln -s fd/2 $root/dev/stderr");
+ qxx ("ln -s fd/0 $root/dev/stdin");
+ qxx ("ln -s fd/1 $root/dev/stdout");
+ qxx ("mknod -m 640 $root/dev/loop0 b 7 0");
+ qxx ("mknod -m 640 $root/dev/loop1 b 7 1");
+ qxx ("mknod -m 640 $root/dev/loop2 b 7 2");
+ qxx ("mknod -m 640 $root/dev/loop3 b 7 3");
+ qxx ("mkdir -p $root/etc/sysconfig");
+ qxx ("mkdir -p $root/var/log/YaST2");
+ # for smart we need the dpkg default file
+ qxx ("mkdir -p $root/var/lib/dpkg");
+ qxx ("touch $root/var/lib/dpkg/status");
+ qxx ("mkdir -p $root/var/lib/dpkg/updates");
+ qxx ("touch $root/var/lib/dpkg/available");
+ # for building in suse autobuild we need the following file
+ qxx ("touch $root/.buildenv");
+ # need mtab at least empty for mount calls
+ qxx ("touch $root/etc/mtab");
+ qxx ("touch $root/etc/sysconfig/bootloader");
+ }
# need user/group files as template
my $groupTemplate = "/etc/group";
my $paswdTemplate = "/etc/passwd";
@@ -396,7 +398,9 @@
#==========================================
# Create package keys
#------------------------------------------
- $manager -> setupPackageKeys();
+ if (! defined $this->{cacheRoot}) {
+ $manager -> setupPackageKeys();
+ }
#==========================================
# Setup shared cache directory
#------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWISchema.rnc new/kiwi/modules/KIWISchema.rnc
--- old/kiwi/modules/KIWISchema.rnc 2010-11-19 16:26:02.000000000 +0100
+++ new/kiwi/modules/KIWISchema.rnc 2010-11-26 15:48:16.000000000 +0100
@@ -2272,10 +2272,7 @@
"bootstrap" | "delete" | "image" | "iso" | "oem" | "pxe" |
"split" | "testsuite" | "usb" | "vmx"
}
- k.packages.profiles.attribute =
- ## Namespace this section applies to. If not specified it
- ## applies to all namespaces
- attribute profiles { text }
+ k.packages.profiles.attribute = k.profiles.attribute
k.packages.patternType.attribute =
## Selection type for patterns. Could be onlyRequired
## plusSuggested or plusRecommended
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWISchema.rng new/kiwi/modules/KIWISchema.rng
--- old/kiwi/modules/KIWISchema.rng 2010-11-19 16:26:02.000000000 +0100
+++ new/kiwi/modules/KIWISchema.rng 2010-11-26 15:48:16.000000000 +0100
@@ -3276,10 +3276,7 @@
</attribute>
</define>
<define name="k.packages.profiles.attribute">
- <attribute name="profiles">
- Namespace this section applies to. If not specified it
-applies to all namespaces
- </attribute>
+ <ref name="k.profiles.attribute"/>
</define>
<define name="k.packages.patternType.attribute">
<attribute name="patternType">
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 2010-11-19 15:29:38.000000000 +0100
+++ new/kiwi/modules/KIWIXML.pm 2010-11-26 15:48:16.000000000 +0100
@@ -18,6 +18,7 @@
# Modules
#------------------------------------------
use strict;
+use warnings;
require Exporter;
use Carp qw (cluck);
use File::Glob ':glob';
@@ -150,6 +151,12 @@
return undef;
}
#==========================================
+ # Check data consistentcy
+ #==========================================
+ if (! $this -> __validateConsistency ()) {
+ return undef;
+ }
+ #==========================================
# Read main XML sections
#------------------------------------------
my $imgnameNodeList = $systemTree -> getElementsByTagName ("image");
@@ -183,7 +190,7 @@
# Check type information from xml input
#------------------------------------------
if ($optionsNodeList) {
- $this -> getImageTypeAndAttributes();
+ $this->{typerecord} = $this -> getImageTypeAndAttributes();
if (! $this->{typeNode}) {
$kiwi -> error ("Boot type: $imageWhat not specified in xml");
$kiwi -> failed ();
@@ -408,12 +415,6 @@
# Store object data (create URL list)
#------------------------------------------
$this -> createURLList ();
- #==========================================
- # Check data consistentcy
- #==========================================
- if (! $this -> __validateConsistency ()) {
- return undef;
- }
return $this;
}
@@ -710,6 +711,9 @@
# getImageTypeAndAttributes
#------------------------------------------
sub getImageTypeAndAttributes {
+ # TODO
+ # This method is should be removed in an effort
+ # to remove state from the XML representation
# ...
# Get the image type and its attributes for beeing
# able to create the appropriate logical extend
@@ -1339,6 +1343,25 @@
}
#==========================================
+# setImageType
+#------------------------------------------
+sub setImageType {
+ # ...
+ # set 'image' attribute of the selected type
+ # ---
+ my $this = shift;
+ my $val = shift;
+ my $kiwi = $this->{kiwi};
+ my $tnode= $this->{typeNode};
+ if ($tnode) {
+ $tnode-> setAttribute ("image","$val");
+ }
+ $this->{imageWhat} = $val;
+ $this -> updateXML();
+ return $this;
+}
+
+#==========================================
# setPackageManager
#------------------------------------------
sub setPackageManager {
@@ -1922,12 +1945,10 @@
my $name = $element -> getAttribute ("name");
my $desc = $element -> getAttribute ("description");
my $incl = $element -> getAttribute ("import");
- if ((defined $import) && ("$incl" ne "true")) {
- next;
- }
my %profile = ();
$profile{name} = $name;
$profile{description} = $desc;
+ $profile{include} = $incl;
push @result, { %profile };
}
return @result;
@@ -1937,21 +1958,60 @@
# setDefaultProfiles
#------------------------------------------
sub setDefaultProfiles {
+ # TODO
+ # This method should be removed in an effort to
+ # remove state from the XML representattion
# ...
# import default profiles if no other profiles
# were set on the commandline
# ---
- my $this = shift;
- my @list = ();
+ my $this = shift;
+ my $kiwi = $this->{kiwi};
+ my @list = ();
+ #==========================================
+ # check for profiles already processed
+ #------------------------------------------
if ((defined $this->{reqProfiles}) && (@{$this->{reqProfiles}})) {
+ my $info = join (",",@{$this->{reqProfiles}});
+ $kiwi -> info ("Using profile(s): $info");
+ $kiwi -> done ();
return $this;
}
- my @profiles = $this -> getProfiles ("default");
+ #==========================================
+ # read from profile section
+ #------------------------------------------
+ my @profiles = $this -> getProfiles ();
foreach my $profile (@profiles) {
- push (@list,$profile->{name});
+ if (($profile->{include}) && ("$profile->{include}" eq "true")) {
+ push (@list,$profile->{name});
+ }
+ }
+ #==========================================
+ # read from type: bootprofile + bootkernel
+ #------------------------------------------
+ my $record = $this -> getImageTypeAndAttributes();
+ if ((defined $record->{type}) && ($record->{"type"} eq "cpio")) {
+ if ($record->{bootprofile}) {
+ push @list, split (/,/,$record->{bootprofile});
+ } else {
+ # apply 'default' profile required for boot images
+ push @list, "default";
+ }
+ if ($record->{bootkernel}) {
+ push @list, split (/,/,$record->{bootkernel});
+ } else {
+ # apply 'std' kernel profile required for boot images
+ push @list, "std";
+ }
}
+ #==========================================
+ # store list
+ #------------------------------------------
if (@list) {
+ my $info = join (",",@list);
+ $kiwi -> info ("Using profile(s): $info");
$this->{reqProfiles} = \@list;
+ $kiwi -> done ();
}
return $this;
}
@@ -1991,11 +2051,6 @@
}
}
}
- if (@prequest) {
- my $info = join (",",@prequest);
- $kiwi -> info ("Using profile(s): $info");
- $kiwi -> done ();
- }
return $this;
}
@@ -2008,8 +2063,9 @@
# a given element is requested to be included
# in this image.
# ---
- my $this = shift;
- my $element = shift;
+ my $this = shift;
+ my $element = shift;
+
if (! defined $element) {
return 1;
}
@@ -2029,12 +2085,14 @@
foreach my $profile (@splitProfiles) {
$profileHash{$profile} = 1;
}
- foreach my $reqprof (@{$this->{reqProfiles}}) {
- # strip whitespace
- $reqprof =~ s/^\s+//s;
- $reqprof =~ s/\s+$//s;
- if (defined $profileHash{$reqprof}) {
- return 1;
+ if (defined $this->{reqProfiles}) {
+ foreach my $reqprof (@{$this->{reqProfiles}}) {
+ # strip whitespace
+ $reqprof =~ s/^\s+//s;
+ $reqprof =~ s/\s+$//s;
+ if (defined $profileHash{$reqprof}) {
+ return 1;
+ }
}
}
return 0;
@@ -2586,7 +2644,9 @@
if (@tstp) {
$result{kiwi_testing} = join(" ",@tstp);
}
- if ((%type) && ($type{compressed} eq "true")) {
+ if ((%type)
+ && (defined $type{compressed})
+ && ($type{compressed} eq "true")) {
$result{kiwi_compressed} = "yes";
}
if (%type) {
@@ -2604,13 +2664,19 @@
if ((%type) && ($type{installboot})) {
$result{kiwi_installboot} = $type{installboot};
}
- if ((%type) && ($type{luks} eq "true")) {
+ if ((%type)
+ && (defined $type{luks})
+ && ($type{luks} eq "true")) {
$result{kiwi_luks} = "yes";
}
- if ((%type) && ($type{hybrid} eq "true")) {
+ if ((%type)
+ && (defined $type{hybrid})
+ && ($type{hybrid} eq "true")) {
$result{kiwi_hybrid} = "yes";
}
- if ((%type) && ($type{hybridpersistent} eq "true")) {
+ if ((%type)
+ && (defined $type{hybridpersistent})
+ && ($type{hybridpersistent} eq "true")) {
$result{kiwi_hybridpersistent} = "yes";
}
if ((%type) && ($type{lvm})) {
@@ -2711,17 +2777,18 @@
my $oemrecoid= $node -> getElementsByTagName ("oem-recoveryID");
my $inplace = $node -> getElementsByTagName ("oem-inplace-recovery");
if ((defined $oempinst) && ("$oempinst" eq "true")) {
- $result{kiwi_oempartition_install} = "yes";
+ $result{kiwi_oempartition_install} = $oempinst;
}
- if ((defined $oemswap) && ("$oemswap" eq "false")) {
- $result{kiwi_oemswap} = "no";
- } elsif ((defined $oemswapMB) && ("$oemswapMB" > 0)) {
- $result{kiwi_oemswapMB} = $oemswapMB;
+ if ((defined $oemswap) && ("$oemswap" eq "true")) {
+ $result{kiwi_oemswap} = $oemswap;
+ if ((defined $oemswapMB) && (int($oemswapMB) > 0)) {
+ $result{kiwi_oemswapMB} = $oemswapMB;
+ }
}
if ((defined $oemalign) && ("$oemalign" eq "true")) {
$result{kiwi_oemalign} = $oemalign;
}
- if ((defined $oemrootMB) && ("$oemrootMB" > 0)) {
+ if ((defined $oemrootMB) && ((int "$oemrootMB") > 0)) {
$result{kiwi_oemrootMB} = $oemrootMB;
}
if ((defined $oemtitle) && ("$oemtitle" ne "")) {
@@ -3521,7 +3588,6 @@
if ($package) {
push @result,$package;
}
- push @result,$main::PackageManager;
}
#==========================================
# Handle pattern names
@@ -3538,6 +3604,13 @@
}
}
}
+ #==========================================
+ # Add packagemanager in any case
+ #------------------------------------------
+ push @result,$main::PackageManager;
+ #==========================================
+ # Run the solver...
+ #------------------------------------------
my $psolve = new KIWISatSolver (
$kiwi,\@result,$this->{urllist},"solve-patterns",
undef,undef
@@ -3550,8 +3623,9 @@
my $solf = $psolve -> getSolfile();
my @solp = $psolve -> getPackages();
my @rpat = qxx (
- "dumpsolv $solf|grep 'name: pattern'|cut -f4 -d :"
+ "dumpsolv $solf|grep 'solvable:name: pattern:'|cut -f4 -d :"
);
+ chomp @rpat;
return (\%meta,\@delete,$solf,\@result,\@solp,\@rpat);
}
@@ -4442,6 +4516,65 @@
# Private helper methods
#------------------------------------------
#==========================================
+# __checkDefaultProfSetting
+#------------------------------------------
+sub __checkDefaultProfSetting {
+ # ...
+ # Make sure only one profile is marked as default.
+ # ---
+ my $this = shift;
+ my $numDefProfs = 0;
+ my $systemTree = $this->{systemTree};
+ my @profiles = $systemTree -> getElementsByTagName('profile');
+ for my $profile (@profiles) {
+ my $import = $profile -> getAttribute('import');
+ if (defined $import && $import eq 'true') {
+ $numDefProfs++;
+ }
+ if ($numDefProfs > 1) {
+ my $kiwi = $this->{kiwi};
+ my $msg = 'Only one profile may be set as the dafault profile by '
+ . 'using the "import" attrinute.';
+ $kiwi -> error($msg);
+ $kiwi -> failed();
+ return undef;
+ }
+ }
+ return 1;
+}
+
+#==========================================
+# __checkDefaultTypeSetting
+#------------------------------------------
+sub __checkDefaultTypeSetting {
+ # ...
+ # Check that only one type is marked as primary per profile
+ # ---
+ my $this = shift;
+ my $systemTree = $this->{systemTree};
+ my @preferences = $systemTree -> getElementsByTagName('preferences');
+ for my $pref (@preferences) {
+ my $hasPrimary = 0;
+ my @types = $pref -> getChildrenByTagName('type');
+ for my $typeN (@types) {
+ my $primary = $typeN -> getAttribute('primary');
+ if (defined $primary && $primary eq 'true') {
+ $hasPrimary++;
+ }
+ if ($hasPrimary > 1) {
+ my $kiwi = $this->{kiwi};
+ my $msg = 'Only one primary type my be specified per '
+ . 'preferences section.';
+ $kiwi -> error ($msg);
+ $kiwi -> failed ();
+ return undef;
+ }
+ }
+ }
+ return 1;
+}
+
+#==========================================
# __checkFilesysSpec
#------------------------------------------
sub __checkFilesysSpec {
@@ -4453,7 +4586,7 @@
my $isInvalid;
my $kiwi = $this->{kiwi};
my @typeNodes = $this->{systemTree} -> getElementsByTagName("type");
- my @typesReqFS = qw /oem usb vmx/;
+ my @typesReqFS = qw /oem pxe usb vmx/;
for my $typeN (@typeNodes) {
my $imgType = $typeN -> getAttribute( "image" );
if (grep /$imgType/, @typesReqFS) {
@@ -4484,8 +4617,7 @@
# ---
my $this = shift;
my @confNodes = $this->{systemTree} -> getElementsByTagName("oemconfig");
- if (@confNodes) {
- my $oemconfig = $confNodes[0];
+ for my $oemconfig (@confNodes) {
my @postDumOpts = qw
/oem-bootwait oem-reboot
oem-reboot-interactive
@@ -4515,6 +4647,83 @@
}
#==========================================
+# __checkPreferencesDefinition
+#------------------------------------------
+sub __checkPreferencesDefinition {
+ # ...
+ # Check that only one <preference> definition exists without
+ # use of the profiles attribute.
+ #
+ my $this = shift;
+ my $kiwi = $this->{kiwi};
+ my $numProfilesAttr = 0;
+ my $systemTree = $this->{systemTree};
+ my @preferences = $systemTree -> getElementsByTagName('preferences');
+ my @usedProfs = ();
+ for my $pref (@preferences) {
+ my $profName = $pref -> getAttribute('profiles');
+ if (! $profName) {
+ $numProfilesAttr++;
+ } else {
+ if (grep /$profName/, @usedProfs) {
+ my $msg = 'Only one <preferences> element may reference a '
+ . "given profile. $profName referenced multiple times.";
+ $kiwi -> error ($msg);
+ $kiwi -> failed ();
+ return undef;
+ } else {
+ push @usedProfs, $profName;
+ }
+ }
+ if ($numProfilesAttr > 1) {
+ my $msg = 'Specify only one <preferences> element without using '
+ . 'the "profiles" attribute.';
+ $kiwi -> error ($msg);
+ $kiwi -> failed();
+ return undef;
+ }
+ }
+ return 1;
+}
+
+#==========================================
+# __checkReferencedProfDefined
+#------------------------------------------
+sub __checkReferencedProfDefined {
+ # ...
+ # Check that any reference of profiles has a defined target, i.e. the
+ # profile must be defined
+ # ---
+ my $this = shift;
+ my $kiwi = $this->{kiwi};
+ my $status = 1;
+ my $systemTree = $this->{systemTree};
+ my @profiles = $systemTree -> getElementsByTagName('profile');
+ my @profNames = ();
+ for my $prof (@profiles) {
+ push @profNames, $prof -> getAttribute('name');
+ }
+ my @nodes = ();
+ push @nodes, $systemTree -> getElementsByTagName('drivers');
+ push @nodes, $systemTree -> getElementsByTagName('packages');
+ push @nodes, $systemTree -> getElementsByTagName('preferences');
+ push @nodes, $systemTree -> getElementsByTagName('repository');
+ for my $node (@nodes) {
+ my $refProf = $node -> getAttribute('profiles');
+ if (defined $refProf) {
+ if (! grep /$refProf/, @profNames) {
+ my $msg = "Found reference to profile $refProf "
+ . 'but this profile does not exist.';
+ $kiwi -> error ($msg);
+ $kiwi -> failed ();
+ $status = undef;
+ }
+ }
+ }
+ return $status;
+}
+
+#==========================================
# __checkRevision
#------------------------------------------
sub __checkRevision {
@@ -4523,9 +4732,11 @@
# ---
my $this = shift;
my $kiwi = $this->{kiwi};
+ my $systemTree = $this->{systemTree};
+ my $imgnameNodeList = $systemTree -> getElementsByTagName ("image");
if (open (my $FD,$main::Revision)) {
my $cur_rev = <$FD>; close $FD;
- my $req_rev = $this->{imgnameNodeList}
+ my $req_rev = $imgnameNodeList
-> get_node(1) -> getAttribute ("kiwirevision");
if ((defined $req_rev) && ($cur_rev < $req_rev)) {
$kiwi -> failed ();
@@ -4540,9 +4751,9 @@
}
#==========================================
-# __checkVersionFormat
+# __checkVersionDefinition
#------------------------------------------
-sub __checkVersionFormat {
+sub __checkVersionDefinition {
# ...
# Check image version format
# This check should be implemented in the schema but there is a
@@ -4550,7 +4761,16 @@
# ---
my $this = shift;
my $kiwi = $this->{kiwi};
- my $version = $this -> getImageVersion();
+ my $systemTree = $this->{systemTree};
+ my @versions = $systemTree -> getElementsByTagName("version");
+ my $numVersions = @versions;
+ if ($numVersions > 1) {
+ my $msg = "Only one <version> definition expected, found $numVersions";
+ $kiwi -> error ($msg);
+ $kiwi -> failed ();
+ return undef;
+ }
+ my $version = $versions[0] -> textContent();
if ($version !~ /^\d+\.\d+\.\d+$/) {
$kiwi -> error ("Invalid version format: $version");
$kiwi -> failed ();
@@ -4623,18 +4843,34 @@
# Validate XML data that cannot be validated through Schema and
# structure validation. This includes conditional presence of
# elements and attributes as well as certain values.
+ # Note that any checks need to work off $this->{systemTree}. The
+ # consistency check occurs prior to this object being porpulated
+ # with XML data. This allows us to basically have no error checking
+ # in any code that populates this object from XML data.
# ---
my $this = shift;
- if (! $this -> __checkRevision()) {
+ if (! $this -> __checkDefaultProfSetting()) {
return undef;
}
- if (! $this -> __checkVersionFormat()) {
+ if (! $this -> __checkDefaultTypeSetting()){
+ return undef;
+ }
+ if (! $this -> __checkFilesysSpec()) {
return undef;
}
if (! $this -> __checkPostDumpAction()) {
return undef;
}
- if (! $this -> __checkFilesysSpec()) {
+ if (! $this -> __checkPreferencesDefinition()) {
+ return undef;
+ }
+ if (! $this -> __checkReferencedProfDefined()) {
+ return undef;
+ }
+ if (! $this -> __checkRevision()) {
+ return undef;
+ }
+ if (! $this -> __checkVersionDefinition()) {
return undef;
}
return 1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/.revision new/kiwi/.revision
--- old/kiwi/.revision 2010-11-19 16:26:02.000000000 +0100
+++ new/kiwi/.revision 2010-11-26 15:48:16.000000000 +0100
@@ -1 +1 @@
-965939ea277408fe99b43497dc84da20fc7b1a7c
+ddd0faf5b07c2c87720543ac109b06a841825b43
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/ix86/oemboot/suse-linuxrc new/kiwi/system/boot/ix86/oemboot/suse-linuxrc
--- old/kiwi/system/boot/ix86/oemboot/suse-linuxrc 2010-11-05 16:47:03.000000000 +0100
+++ new/kiwi/system/boot/ix86/oemboot/suse-linuxrc 2010-11-26 15:48:16.000000000 +0100
@@ -365,9 +365,9 @@
systemException "Failed to store $i" "reboot"
fi
done
- if ! cp -a var/lib/rpm tmp/;then
- rm -rf tmp/rpm; cd / ; umountSystem
- systemException "Failed to store RPM database" "reboot"
+ if ! cp -a var/lib/rpm var/lib/rpm.backup;then
+ rm -rf var/lib/rpm.backup; cd / ; umountSystem
+ systemException "Failed to backup RPM database" "reboot"
fi
fi
#======================================
@@ -468,12 +468,6 @@
systemException "Failed to restore $i" "reboot"
fi
done
- mv /mnt/var/lib/rpm /mnt/var/lib/rpm.backup
- if ! mv /mnt/tmp/rpm /mnt/var/lib/;then
- mv /mnt/var/lib/rpm.backup /mnt/var/lib/rpm
- systemException "Failed to restore RPM database" "reboot"
- fi
- rm -rf /mnt/var/lib/rpm.backup
fi
#======================================
# 16.5) restore boot files 1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org