Hello community,
here is the log from the commit of package kiwi for openSUSE:Factory
checked in at Thu Oct 6 17:23:05 CEST 2011.
--------
--- openSUSE:Factory/kiwi/kiwi.changes 2011-09-26 10:07:03.000000000 +0200
+++ /mounts/work_src_done/STABLE/kiwi/kiwi.changes 2011-10-06 15:40:09.000000000 +0200
@@ -1,0 +2,123 @@
+Thu Oct 6 15:32:11 CEST 2011 - ms@suse.de
+
+- removed %pre section from spec, does not work with older distros
+
+-------------------------------------------------------------------
+Thu Oct 6 14:17:23 CEST 2011 - ms@suse.de
+
+- fixed %pre script and filelist
+
+-------------------------------------------------------------------
+Thu Oct 6 13:27:46 CEST 2011 - ms@suse.de
+
+- fixed doc upgrade, added pre-install script for kiwi-doc
+ and also reverted the spec changes for the commits 275a601c
+ and ced64858
+
+-------------------------------------------------------------------
+Thu Oct 6 12:19:31 CEST 2011 - ms@suse.de
+
+- v4.97.3 released
+
+-------------------------------------------------------------------
+Wed Oct 5 18:07:24 CEST 2011 - ms@suse.de
+
+- added support for detecting multiple occurrences of the same
+ MBR ID in searchBIOSBootDevice. Also make sure that this does
+ not happen by writing a default MBR ID of 0xffffffff into
+ the MBR when the bootloader is installed
+
+-------------------------------------------------------------------
+Wed Oct 5 16:57:04 CEST 2011 - ms@suse.de
+
+- rewrote function CDMount into more clear parts, also fixed
+ the waitForUSBDeviceScan which only checks dmesg for a string
+ which doesn't appear anymore on newer kernels
+
+-------------------------------------------------------------------
+Wed Oct 5 14:38:47 CEST 2011 - ms@suse.de
+
+- DB: update documentation, better intro page and contributor list
+
+-------------------------------------------------------------------
+Wed Oct 5 12:13:55 CEST 2011 - ms@suse.de
+
+- added support for creating luks encoded squashfs images
+
+-------------------------------------------------------------------
+Tue Oct 4 18:07:18 CEST 2011 - ms@suse.de
+
+- make sure luks devices are evaluated first
+
+-------------------------------------------------------------------
+Tue Oct 4 17:01:13 CEST 2011 - ms@suse.de
+
+- added level sorting for LVM volumes to make sure e.g /opt is
+ mounted before /opt/bob
+
+-------------------------------------------------------------------
+Tue Oct 4 15:12:45 CEST 2011 - ms@suse.de
+
+- fixed spec file, make sure doc files get the %doc macro assigned
+
+-------------------------------------------------------------------
+Tue Oct 4 15:08:03 CEST 2011 - ms@suse.de
+
+- fixed spec file, wrong use of %doc on directory causes
+ the kiwi-doc package to fail the installation on upgrade
+ with 'cpio: rename failed - Is a directory'
+
+-------------------------------------------------------------------
+Tue Oct 4 11:39:10 CEST 2011 - ms@suse.de
+
+- fixed typo, missing eol
+
+-------------------------------------------------------------------
+Tue Oct 4 11:12:06 CEST 2011 - ms@suse.de
+
+- added mailing list info to README file
+
+-------------------------------------------------------------------
+Tue Oct 4 10:58:36 CEST 2011 - ms@suse.de
+
+- fixed typo and wrote Linus correctly, Oh Oh sorry Linus
+
+-------------------------------------------------------------------
+Thu Sep 29 11:48:02 CEST 2011 - ms@suse.de
+
+- make setupConsole code more clear
+
+-------------------------------------------------------------------
+Thu Sep 29 09:16:45 CEST 2011 - ms@suse.de
+
+- let kiwi exit if a package setup script returns with ecode != 0
+
+-------------------------------------------------------------------
+Wed Sep 28 16:29:27 CEST 2011 - ms@suse.de
+
+- DB: update documentation, new showlicense element
+
+-------------------------------------------------------------------
+Wed Sep 28 15:54:42 CEST 2011 - ms@suse.de
+
+- added support for the new <showlicense>name</showlicense> element as
+ part of the preferences section. This element allows to specify the
+ base name of a license file which is displayed in oem images before
+ the installation happens. It's possible to add more <showlicense>
+ sections to display more licenses one after the other. If no such
+ element is specified the default 'license' and 'EULA' files are
+ searched to keep the system backward compatible
+
+-------------------------------------------------------------------
+Wed Sep 28 11:44:45 CEST 2011 - ms@suse.de
+
+- added runtime check which makes sure that there are no bogus
+ files included in archives. So far we check for YaST2 license
+ files in /etc/YaST2/licenses
+
+-------------------------------------------------------------------
+Tue Sep 27 11:52:29 CEST 2011 - ms@suse.de
+
+- added support for RHEL splashimage (redhat-logos)
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kiwi.spec ++++++
--- /var/tmp/diff_new_pack.ckTyI8/_old 2011-10-06 17:22:57.000000000 +0200
+++ /var/tmp/diff_new_pack.ckTyI8/_new 2011-10-06 17:22:57.000000000 +0200
@@ -69,7 +69,7 @@
%endif
%endif
Summary: OpenSuSE - KIWI Image System
-Version: 4.97.2
+Version: 4.97.3
Release: 1
Group: System/Management
License: GPLv2
@@ -446,13 +446,13 @@
%files -n kiwi-doc
%defattr(-, root, root)
%dir %{_defaultdocdir}/kiwi
-%doc %{_defaultdocdir}/kiwi/COPYING
-%doc %{_defaultdocdir}/kiwi/examples
-%doc %{_defaultdocdir}/kiwi/images
-%doc %{_defaultdocdir}/kiwi/kiwi.pdf
-%doc %{_defaultdocdir}/kiwi/kiwi.html
-%doc %{_defaultdocdir}/kiwi/susebooks.css
-%doc %{_defaultdocdir}/kiwi/schema
+%{_defaultdocdir}/kiwi/COPYING
+%{_defaultdocdir}/kiwi/examples
+%{_defaultdocdir}/kiwi/images
+%{_defaultdocdir}/kiwi/kiwi.pdf
+%{_defaultdocdir}/kiwi/kiwi.html
+%{_defaultdocdir}/kiwi/susebooks.css
+%{_defaultdocdir}/kiwi/schema
#=================================================
# KIWI instsource...
#-------------------------------------------------
++++++ kiwi-docu.tar.bz2 ++++++
openSUSE:Factory/kiwi/kiwi-docu.tar.bz2 /mounts/work_src_done/STABLE/kiwi/kiwi-docu.tar.bz2 differ: char 11, line 1
++++++ kiwi-repo.tar.bz2 ++++++
++++++ kiwi.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/.revision new/kiwi/.revision
--- old/kiwi/.revision 2011-09-16 14:03:53.000000000 +0200
+++ new/kiwi/.revision 2011-10-03 00:00:06.000000000 +0200
@@ -1 +1 @@
-71e47f2c2e9184d28777d6a72ee2852fd3b6b509
+ce16c5e467e8871a162a59cbcaeb212534b44774
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/README new/kiwi/README
--- old/kiwi/README 2011-07-15 16:58:11.000000000 +0200
+++ new/kiwi/README 2011-10-06 12:21:56.000000000 +0200
@@ -29,6 +29,11 @@
kvm -cdrom /tmp/myimage/*.iso
+Mailing list
+------------
+
+ http://groups.google.com/group/kiwi-images
+
Contributing
------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIBoot.pm new/kiwi/modules/KIWIBoot.pm
--- old/kiwi/modules/KIWIBoot.pm 2011-09-23 14:28:22.000000000 +0200
+++ new/kiwi/modules/KIWIBoot.pm 2011-10-06 12:21:56.000000000 +0200
@@ -119,7 +119,7 @@
if (defined $system) {
if ((-f $system) || (-b $system)) {
my %fsattr = $main::global -> checkFileSystem ($system);
- if ($fsattr{readonly}) {
+ if (($fsattr{readonly}) || ($fsattr{type} eq "luks")) {
$syszip = $main::global -> isize ($system);
} else {
$syszip = 0;
@@ -2163,23 +2163,47 @@
#------------------------------------------
if (($lvm) && (%lvmparts)) {
my $VGroup = $this->{lvmgroup};
+ my @paths = ();
+ my %phash = ();
+ #==========================================
+ # Create path names in correct order
+ #------------------------------------------
+ sub numeric {
+ ($a <=> $b) || ($a cmp $b);
+ }
foreach my $name (keys %lvmparts) {
- my $device = "/dev/$VGroup/LV$name";
my $pname = $name; $pname =~ s/_/\//g;
- $status = qxx ("mkdir -p $loopdir/$pname 2>&1");
- $result = $? >> 8;
- if ($result != 0) {
- $kiwi -> error ("Can't create mount point $loopdir/$pname");
- $this -> cleanLoop ();
- return undef;
- }
- if (! $this -> setupFilesystem ($FSTypeRO,$device,$pname)) {
- $this -> cleanLoop ();
- return undef;
- }
- if (! $main::global -> mount ($device, "$loopdir/$pname")) {
- $this -> cleanLoop ();
- return undef;
+ $pname =~ s/^\///;
+ $pname =~ s/\s*$//;
+ push @paths,$pname;
+ }
+ foreach my $name (@paths) {
+ my $part = split (/\//,$name);
+ push @{$phash{$part}},$name;
+ }
+ #==========================================
+ # Create filesystems and Mount LVM volumes
+ #------------------------------------------
+ foreach my $level (sort numeric keys %phash) {
+ foreach my $pname (@{$phash{$level}}) {
+ my $lname = $pname; $lname =~ s/\//_/g;
+ my $device = "/dev/$VGroup/LV$lname";
+ $status = qxx ("mkdir -p $loopdir/$pname 2>&1");
+ $result = $? >> 8;
+ if ($result != 0) {
+ $kiwi -> error ("Can't create mount point $loopdir/$pname");
+ $this -> cleanLoop ();
+ return undef;
+ }
+ if (! $this -> setupFilesystem ($FSTypeRO,$device,$pname)) {
+ $this -> cleanLoop ();
+ return undef;
+ }
+ $kiwi -> loginfo ("Mounting logical volume: $pname\n");
+ if (! $main::global -> mount ($device, "$loopdir/$pname")) {
+ $this -> cleanLoop ();
+ return undef;
+ }
}
}
}
@@ -3046,8 +3070,12 @@
print FD "timeout $bootTimeout\n";
if ($type =~ /^KIWI (CD|USB)/) {
my $dev = $1 eq 'CD' ? '(cd)' : '(hd0,0)';
- if ((! $type{fastboot}) && (-e "$tmpdir/boot/message")) {
- print FD "gfxmenu $dev/boot/message\n";
+ if (! $type{fastboot}) {
+ if (-e "$tmpdir/boot/grub/splash.xpm.gz") {
+ print FD "splashimage=$dev/boot/grub/splash.xpm.gz\n"
+ } elsif (-e "$tmpdir/boot/message") {
+ print FD "gfxmenu $dev/boot/message\n";
+ }
}
print FD "title Boot from Hard Disk\n";
if ($dev eq '(cd)') {
@@ -3070,7 +3098,9 @@
print FD "title $title\n";
} else {
$title = $this -> makeLabel ("$label [ $type ]");
- if (-e "$tmpdir/boot/message") {
+ if (-e "$tmpdir/boot/grub/splash.xpm.gz") {
+ print FD "splashimage=(hd0,$bootpart)/boot/grub/splash.xpm.gz\n"
+ } elsif (-e "$tmpdir/boot/message") {
print FD "gfxmenu (hd0,$bootpart)/boot/message\n";
}
print FD "title $title\n";
@@ -4380,7 +4410,7 @@
}
}
$kiwi -> loginfo (
- "PARTED input: $device [@p_cmd]"
+ "PARTED input: $device [@p_cmd]\n"
);
my $align="";
$status = qxx ("$parted_exec --help | grep -q align=");
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 2011-09-23 14:28:22.000000000 +0200
+++ new/kiwi/modules/KIWIConfig.sh 2011-10-03 00:00:06.000000000 +0200
@@ -1039,6 +1039,21 @@
}
#======================================
+# rhelSplashToGrub
+#--------------------------------------
+function rhelSplashToGrub {
+ local grub_stage=/usr/lib/grub
+ local rhel_logos=/boot/grub/splash.xpm.gz
+ if [ ! -e $rhel_logos ];then
+ return
+ fi
+ if [ ! -d $grub_stage ];then
+ mkdir -p $grub_stage
+ fi
+ mv $rhel_logos $grub_stage
+}
+
+#======================================
# suseGFXBoot
#--------------------------------------
function suseGFXBoot {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIGlobals.pm new/kiwi/modules/KIWIGlobals.pm
--- old/kiwi/modules/KIWIGlobals.pm 2011-09-23 14:28:22.000000000 +0200
+++ new/kiwi/modules/KIWIGlobals.pm 2011-10-06 12:21:56.000000000 +0200
@@ -40,7 +40,7 @@
# Globals (generic)
#------------------------------------------
my %data;
- $data{Version} = "4.97.2";
+ $data{Version} = "4.97.3";
$data{Publisher} = "SUSE LINUX Products GmbH";
$data{Preparer} = "KIWI - http://kiwi.berlios.de";
$data{ConfigName} = "config.xml";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIImage.pm new/kiwi/modules/KIWIImage.pm
--- old/kiwi/modules/KIWIImage.pm 2011-09-08 15:58:26.000000000 +0200
+++ new/kiwi/modules/KIWIImage.pm 2011-10-06 12:21:56.000000000 +0200
@@ -227,6 +227,7 @@
# Store general data
#------------------------------------------
$changeset{"packagemanager"} = $src_xml->getPackageManager();
+ $changeset{"showlicense"} = $src_xml->getLicenseNames();
$changeset{"domain"} = $src_xml->getXenDomain();
$changeset{"displayname"} = $src_xml->getImageDisplayName();
$changeset{"locale"} = $src_xml->getLocale();
@@ -815,6 +816,7 @@
my $this = shift;
my $kiwi = $this->{kiwi};
my $xml = $this->{xml};
+ my %type = %{$xml->getImageTypeAndAttributes()};
#==========================================
# PRE filesystem setup
#------------------------------------------
@@ -837,7 +839,6 @@
#==========================================
# Compress image using gzip
#------------------------------------------
- my %type = %{$xml->getImageTypeAndAttributes()};
if (($type{compressed}) && ($type{compressed} eq 'true')) {
if (! $this -> compressImage ($name)) {
return undef;
@@ -2783,9 +2784,9 @@
# Create logical extend
#------------------------------------------
if (! defined $haveExtend) {
- if (! $this -> buildLogicalExtend ($name,$mBytes."M")) {
- return undef;
- }
+ if (! $this -> buildLogicalExtend ($name,$mBytes."M")) {
+ return undef;
+ }
}
return $name;
}
@@ -3756,8 +3757,6 @@
$tree = $imageTree;
}
if ($type{luks}) {
- $kiwi -> warning ("LUKS extension not supported for squashfs");
- $kiwi -> skipped ();
$this -> restoreImageDest();
}
unlink ("$this->{imageDest}/$name");
@@ -3771,8 +3770,50 @@
$kiwi -> error ($data);
return undef;
}
+ #==========================================
+ # Check for LUKS extension
+ #------------------------------------------
+ if ($type{luks}) {
+ my $outimg = $this->{imageDest}."/".$name;
+ my $squashimg = $outimg.".squashfs";
+ my $cipher = "$type{luks}";
+ my $data = qxx ("mv $outimg $squashimg 2>&1");
+ my $code = $? >> 8;
+ if ($code != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("Failed to rename squashfs image");
+ $kiwi -> failed ();
+ return undef;
+ }
+ my $bytes = int ((-s $squashimg) * 1.1);
+ $data = qxx (
+ "dd if=/dev/zero of=$outimg bs=1 seek=$bytes count=1 2>&1"
+ );
+ $code = $? >> 8;
+ if ($code != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("Failed to create luks loop container");
+ $kiwi -> failed ();
+ return undef;
+ }
+ if (! $this -> setupEncoding ($name.".squashfs",$outimg,$cipher)) {
+ return undef;
+ }
+ $data = qxx (
+ "dd if=$squashimg of=$this->{imageDest}/$name.squashfs 2>&1"
+ );
+ $code = $? >> 8;
+ if ($code != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("Failed to dump squashfs to luks loop: $data");
+ $kiwi -> failed ();
+ $this -> cleanLuks();
+ return undef;
+ }
+ }
$this -> restoreImageDest();
$data = qxx ("chmod 644 $this->{imageDest}/$name");
+ $data = qxx ("rm -f $this->{imageDest}/$name.squashfs");
$data = qxx ("cd $this->{imageDest} && ln -vs $name $name.squashfs 2>&1");
$this -> remapImageDest();
$kiwi -> loginfo ($data);
@@ -4390,6 +4431,8 @@
if (-d $spldir) {
qxx ("rm -rf $spldir 2>&1");
}
+ $this -> cleanMount();
+ $this -> cleanLuks();
return $this;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWILinuxRC.sh new/kiwi/modules/KIWILinuxRC.sh
--- old/kiwi/modules/KIWILinuxRC.sh 2011-09-23 14:28:22.000000000 +0200
+++ new/kiwi/modules/KIWILinuxRC.sh 2011-10-06 12:21:56.000000000 +0200
@@ -749,8 +749,9 @@
"*** boot loader install for $arch-$loader not implemented ***" \
"reboot"
esac
+ masterBootID=0xffffffff
if [ ! -z "$masterBootID" ];then
- Echo "writing MBR ID back to master boot record: $masterBootID"
+ Echo "writing default MBR ID to master boot record: $masterBootID"
masterBootIDHex=$(echo $masterBootID |\
sed 's/^0x\(..\)\(..\)\(..\)\(..\)$/\\x\4\\x\3\\x\2\\x\1/')
echo -e -n $masterBootIDHex | dd of=$imageDiskDevice \
@@ -1889,7 +1890,9 @@
# create menu.lst file
#--------------------------------------
echo "timeout $KIWI_BOOT_TIMEOUT" > $menu
- if [ -f /image/loader/message ] || [ -f /boot/message ];then
+ if [ -f $mountPrefix/boot/grub/splash.xpm.gz ];then
+ echo "splashimage=$gdev/boot/grub/splash.xpm.gz" >> $menu
+ elif [ -f /image/loader/message ] || [ -f /boot/message ];then
echo "gfxmenu $gdev/boot/message" >> $menu
fi
local count=1
@@ -2757,13 +2760,15 @@
#--------------------------------------
function waitForUSBDeviceScan {
local devices=0
+ local s1="usb-storage: device scan complete"
+ local s2="usbcore: registered new interface driver usb-storage"
if [ ! "$HAVE_USB" = "yes" ];then
return
fi
if [ ! "$SCAN_USB" = "complete" ];then
Echo -n "Waiting for USB device scan to complete..."
while \
- [ $(dmesg|grep -c 'usb-storage: device scan complete') -lt 1 ] && \
+ [ $(dmesg|grep -c -E "$s1|$s2") -lt 1 ] && \
[ $devices -lt 15 ]
do
echo -n .
@@ -2959,7 +2964,7 @@
test -z $cddev && cddev=$i || cddev=$cddev:$i
fi
done
- if [ ! -z "$cddev" ] || [ $count -eq 12 ]; then
+ if [ ! -z "$cddev" ] || [ $count -eq 4 ]; then
break
else
echo -n .
@@ -2969,15 +2974,6 @@
udevPending
done
echo
- if [ -z "$cddev" ];then
- USBStickDevice
- if [ $stickFound = 0 ];then
- systemException \
- "Failed to detect CD/DVD or USB drive !" \
- "reboot"
- fi
- cddev=$stickDevice
- fi
}
#======================================
# USBStickDevice
@@ -3131,6 +3127,110 @@
echo "1"
}
#======================================
+# searchImageCDMedia
+#--------------------------------------
+function searchImageCDMedia {
+ # /.../
+ # search for the first CD/DVD device which
+ # contains a KIWI image signature
+ # ----
+ local IFS
+ #======================================
+ # lookup devices from hwinfo
+ #--------------------------------------
+ CDDevice
+ if [ -z "$cddev" ];then
+ return
+ fi
+ #======================================
+ # check device contents
+ #--------------------------------------
+ Echo -n "Checking CD/DVD device(s)..."
+ while true;do
+ IFS=":" ; for i in $cddev;do
+ cdopt=$(CDMountOption $i)
+ if [ -x /usr/bin/driveready ];then
+ driveready $i&& eval mount $cdopt -o ro $i /cdrom >/dev/null
+ else
+ eval mount $cdopt -o ro $i /cdrom >/dev/null
+ fi
+ if [ -f $LIVECD_CONFIG ];then
+ cddev=$i; echo
+ umount $i &>/dev/null
+ return
+ fi
+ umount $i &>/dev/null
+ done
+ if [ $count -eq 3 ]; then
+ break
+ else
+ echo -n .
+ sleep 1
+ fi
+ count=$(($count + 1))
+ done
+ unset cddev
+ echo "not found"
+}
+#======================================
+# searchImageUSBMedia
+#--------------------------------------
+function searchImageUSBMedia {
+ # /.../
+ # search for the first USB device which
+ # contains a KIWI image signature
+ # ----
+ USBStickDevice
+ Echo -n "Checking USB device(s)..."
+ if [ ! $stickFound = 0 ];then
+ cddev=$stickDevice; echo
+ return
+ fi
+ echo "not found"
+}
+#======================================
+# searchImageHybridMedia
+#--------------------------------------
+function searchImageHybridMedia {
+ # /.../
+ # search for the first disk device which
+ # contains a KIWI image signature
+ # ----
+ local ecode
+ local hddev
+ #======================================
+ # check for hybrid configuration
+ #--------------------------------------
+ if [ -z "$kiwi_hybrid" ];then
+ return
+ fi
+ #======================================
+ # check for hybrid mbr ID
+ #--------------------------------------
+ searchBIOSBootDevice
+ ecode=$?
+ Echo -n "Checking Hybrid disk device(s)..."
+ if [ ! $ecode = 0 ];then
+ if [ $ecode = 2 ];then
+ systemException "$biosBootDevice" "reboot"
+ fi
+ echo "not found"
+ return
+ fi
+ #======================================
+ # check image signature
+ #--------------------------------------
+ hddev=$(ddn "${biosBootDevice}" "$(GetBootable "${biosBootDevice}")")
+ kiwiMount "$hddev" "/cdrom" "-o ro"
+ if [ -f $LIVECD_CONFIG ];then
+ cddev=$hddev; echo
+ umount $cddev &>/dev/null
+ return
+ fi
+ umount $hddev &>/dev/null
+ echo "not found"
+}
+#======================================
# CDMount
#--------------------------------------
function CDMount {
@@ -3139,110 +3239,80 @@
# the CD configuration on. This also includes hybrid
# devices which appears as a disk
# ----
- local count=0
- local ecode=0
- local cdopt
+ local mode=$1
mkdir -p /cdrom
#======================================
- # check for hybrid mbr ID
+ # 1) CD/DVD devices
#--------------------------------------
- if [ ! -z "$kiwi_hybrid" ];then
- searchBIOSBootDevice
- ecode=$?
- if [ ! $ecode = 0 ];then
- if [ $ecode = 2 ];then
- systemException "$biosBootDevice" "reboot"
- fi
- unset kiwi_hybrid
+ searchImageCDMedia
+ if [ ! -z "$cddev" ];then
+ eval mount $cdopt -o ro $cddev /cdrom 1>&2
+ if [ "$mode" = "install" ];then
+ # /.../
+ # if we found an install CD/DVD any disk device
+ # is free to serve as install target
+ # ----
+ unset imageDiskDevice
fi
+ return
fi
#======================================
- # walk through media
+ # 2) hybrid disk devices
#--------------------------------------
- if [ -z "$kiwi_hybrid" ];then
- #======================================
- # search for CD/DVD devices
- #--------------------------------------
- CDDevice
- Echo -n "Mounting live boot drive..."
- while true;do
- IFS=":"; for i in $cddev;do
- cdopt=$(CDMountOption $i)
- if [ -x /usr/bin/driveready ];then
- driveready $i&& eval mount $cdopt -o ro $i /cdrom >/dev/null
- else
- eval mount $cdopt -o ro $i /cdrom >/dev/null
- fi
- if [ -f $LIVECD_CONFIG ];then
- cddev=$i; echo
- #======================================
- # run mediacheck if requested and boot
- #--------------------------------------
- if [ "$mediacheck" = 1 ]; then
- test -e /proc/splash && echo verbose > /proc/splash
- checkmedia $cddev
- Echo -n "Press ENTER for reboot: "; read nope
- /sbin/reboot -f -i >/dev/null
- fi
- #======================================
- # device found go with it
- #--------------------------------------
- IFS=$IFS_ORIG
- return
- fi
- umount $i &>/dev/null
- done
- IFS=$IFS_ORIG
- if [ $count -eq 12 ]; then
- break
- else
- echo -n .
- sleep 1
- fi
- count=`expr $count + 1`
- done
- else
- #======================================
- # search for hybrid device
- #--------------------------------------
- if [ "$kiwi_hybridpersistent" = "yes" ];then
- protectedDevice=$(echo $biosBootDevice | sed -e s@/dev/@@)
- protectedDisk=$(cat /sys/block/$protectedDevice/ro)
- if [ $protectedDisk = "0" ];then
- createHybridPersistent $biosBootDevice
- fi
- fi
- cddev=$(ddn "${biosBootDevice}" "$(GetBootable "${biosBootDevice}")")
- Echo -n "Mounting hybrid live boot drive ${cddev}..."
- kiwiMount "$cddev" "/cdrom" "-o ro"
- if [ -f $LIVECD_CONFIG ];then
- echo
- #======================================
- # run mediacheck if requested and boot
- #--------------------------------------
- if [ "$mediacheck" = 1 ]; then
- test -e /proc/splash && echo verbose > /proc/splash
- checkmedia $cddev
- Echo -n "Press ENTER for reboot: "; read nope
- /sbin/reboot -f -i >/dev/null
- fi
- #======================================
- # search hybrid for a write partition
- #--------------------------------------
- export HYBRID_RW=$(ddn $biosBootDevice $HYBRID_PERSISTENT_PART)
- #======================================
- # LIVECD_CONFIG found go with it
- #--------------------------------------
- return
- fi
- umount $cddev &>/dev/null
+ searchImageHybridMedia
+ if [ ! -z "$cddev" ];then
+ kiwiMount "$cddev" "/cdrom" "-o ro" 1>&2
+ return
fi
- echo
+ #======================================
+ # Bad news
+ #--------------------------------------
systemException \
"Couldn't find Live image configuration file" \
"reboot"
}
#======================================
+# runMediaCheck
+#--------------------------------------
+function runMediaCheck {
+ # /.../
+ # run checkmedia program on the specified device
+ # ----
+ local device=$1
+ if [ ! "$mediacheck" = 1 ]; then
+ return
+ fi
+ test -e /proc/splash && echo verbose > /proc/splash
+ checkmedia $device
+ Echo -n "Press ENTER for reboot: "; read nope
+ /sbin/reboot -f -i >/dev/null
+}
+#======================================
+# setupHybridFeatures
+#--------------------------------------
+function setupHybridPersistent {
+ # /.../
+ # create a write partition for hybrid images if requested
+ # and store the device name in HYBRID_RW
+ # ----
+ local protectedDevice
+ local protectedDisk
+ #======================================
+ # create write partition for hybrid
+ #--------------------------------------
+ if [ "$kiwi_hybridpersistent" = "yes" ];then
+ protectedDevice=$(echo $biosBootDevice | sed -e s@/dev/@@)
+ protectedDisk=$(cat /sys/block/$protectedDevice/ro)
+ if [ $protectedDisk = "0" ];then
+ createHybridPersistent $biosBootDevice
+ fi
+ fi
+ #======================================
+ # store hybrid write partition device
+ #--------------------------------------
+ export HYBRID_RW=$(ddn $biosBootDevice $HYBRID_PERSISTENT_PART)
+}
+#======================================
# CDUmount
#--------------------------------------
function CDUmount {
@@ -3420,6 +3490,7 @@
# Compare ID with MBR entry
#--------------------------------------
ifix=0
+ match_count=0
for curd in $ddevs;do
if [ ! -b $curd ];then
continue
@@ -3429,6 +3500,7 @@
if [ "$mbrML" = "$mbrI" ] || [ "$mbrMB" = "$mbrI" ];then
ifix=1
matched=$curd
+ match_count=$(($match_count + 1))
if [ "$mbrML" = "$mbrI" ];then
export masterBootID=$mbrML
fi
@@ -3441,6 +3513,10 @@
fi
fi
done
+ if [ $match_count -gt 1 ];then
+ export biosBootDevice="multiple devices matches same identifier: $mbrI"
+ return 2
+ fi
if [ $ifix -eq 1 ];then
export biosBootDevice=$matched
return 0
@@ -4661,10 +4737,10 @@
local mountDevice=$1
local loopf=$2
local roDevice=$mountDevice
- if [ "$haveLVM" = "yes" ]; then
- local rwDevice="/dev/$VGROUP/LVRoot"
- elif [ "$haveLuks" = "yes" ]; then
+ if [ "$haveLuks" = "yes" ]; then
local rwDevice="/dev/mapper/luksReadWrite"
+ elif [ "$haveLVM" = "yes" ]; then
+ local rwDevice="/dev/$VGROUP/LVRoot"
else
local rwDevice=`getNextPartition $mountDevice`
fi
@@ -6138,52 +6214,47 @@
function displayEULA {
# /.../
# display in a dialog window the text part of the
- # selected language file or the default file
- # /license.txt or /EULA.txt
+ # selected language file(s). The files are searched
+ # by the names in kiwi_showlicense
# ----
local code=$(echo $DIALOG_LANG | cut -f1 -d_)
- #======================================
- # check license files
- #--------------------------------------
- local files=$(find /license.*txt 2>/dev/null)
- if [ -z "$files" ];then
- return
+ if [ -z "$kiwi_showlicense" ];then
+ kiwi_showlicense="license EULA"
fi
- #======================================
- # use selected file or default
- #--------------------------------------
- code=/license.$code.txt
- if [ ! -f $code ];then
- code=/license.txt
+ for name in $kiwi_showlicense;do
+ #======================================
+ # select license file by name
+ #--------------------------------------
+ code=/$name.$code.txt
if [ ! -f $code ];then
- code=/EULA.txt
+ code=/$name.txt
fi
- fi
- #======================================
- # check selected file and show it
- #--------------------------------------
- if [ ! -f $code ];then
- Echo "License file $code not found... skipped"
- return
- fi
- while true;do
- Dialog --textbox $code 20 70 \
- --and-widget --extra-button \
- --extra-label "$TEXT_NO" \
- --ok-label "$TEXT_YES" \
- --cancel-label "$TEXT_CANCEL" \
- --yesno "\"$TEXT_LICENSE\"" \
- 5 45
- case $? in
- 0 ) break
- ;;
- 1 ) continue
- ;;
- * ) systemException \
- "License not accepted... reboot" \
- "reboot"
- ;;
- esac
+ if [ ! -f $code ];then
+ Echo "License with basename $name not found... skipped"
+ continue
+ fi
+ #======================================
+ # show license until accepted
+ #--------------------------------------
+ while true;do
+ Dialog --textbox $code 20 70 \
+ --and-widget --extra-button \
+ --extra-label "$TEXT_NO" \
+ --ok-label "$TEXT_YES" \
+ --cancel-label "$TEXT_CANCEL" \
+ --yesno "\"$TEXT_LICENSE\"" \
+ 5 45
+ case $? in
+ 0 ) break
+ ;;
+ 1 ) continue
+ ;;
+ * ) systemException \
+ "License not accepted... reboot" \
+ "reboot"
+ ;;
+ esac
+ done
done
}
#======================================
@@ -7487,28 +7558,36 @@
# ----
local itab=/etc/inittab
local stty=/etc/securetty
+ local xvc="X0:12345:respawn:/sbin/mingetty --noclear xvc0 linux"
+ local hvc="H0:12345:respawn:/sbin/mingetty --noclear hvc0 linux"
+ #======================================
+ # create tty nodes if not done
+ #--------------------------------------
setupTTY
+ #======================================
+ # setup xvc console (xen)
+ #--------------------------------------
if [ -e /sys/class/tty/xvc0 ];then
if ! cat $itab | grep -v '^#' | grep -q xvc0;then
- echo "X0:12345:respawn:/sbin/mingetty --noclear xvc0 linux" >> $itab
- echo xvc0 >> $stty
+ echo "$xvc" >> $itab
+ echo "xvc0" >> $stty
fi
fi
+ #======================================
+ # setup hvc console (kvm)
+ #--------------------------------------
if [ -e /sys/class/tty/hvc0 ];then
if ! cat $itab | grep -v '^#' | grep -q hvc0;then
- echo "H0:12345:respawn:/sbin/mingetty --noclear hvc0 linux" >> $itab
- echo hvc0 >> $stty
+ echo "$hvc" >> $itab
+ echo "hvc0" >> $stty
fi
fi
+ #======================================
+ # remove ttyS0 if not present
+ #--------------------------------------
if [ ! -e /sys/class/tty/ttyS0 ];then
cat $itab | grep -vi 'ttyS0' > $itab.new && mv $itab.new $itab
fi
- if [ "$arch" = "ppc64" ];then
- if [ -e /sys/class/tty/ttyS0 -a ! -e /sys/class/tty/hvc0 ];then
- cat $itab | grep -vi 'ttyS0' > $itab.new && mv $itab.new $itab
- echo "S0:12345:respawn:/sbin/agetty -L 19200 ttyS0 vt102" >> $itab
- fi
- fi
}
#======================================
# cleanPartitionTable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIRoot.pm new/kiwi/modules/KIWIRoot.pm
--- old/kiwi/modules/KIWIRoot.pm 2011-09-08 15:58:26.000000000 +0200
+++ new/kiwi/modules/KIWIRoot.pm 2011-10-03 00:00:06.000000000 +0200
@@ -1090,6 +1090,7 @@
$kiwi -> failed ();
$kiwi -> info ($data);
$kiwi -> failed ();
+ return undef;
} else {
$kiwi -> loginfo ("$script: $data");
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIRuntimeChecker.pm new/kiwi/modules/KIWIRuntimeChecker.pm
--- old/kiwi/modules/KIWIRuntimeChecker.pm 2011-05-20 09:55:51.000000000 +0200
+++ new/kiwi/modules/KIWIRuntimeChecker.pm 2011-10-03 00:00:06.000000000 +0200
@@ -25,7 +25,7 @@
require Exporter;
use KIWILocator;
use KIWILog;
-
+use KIWIQX;
#==========================================
# Exports
@@ -127,12 +127,62 @@
if (! $this -> __checkRootRecycleCapability()) {
return undef;
}
+ if (! $this -> __hasValidArchives()) {
+ return undef;
+ }
return 1;
}
#==========================================
# Private helper methods
#------------------------------------------
+#==========================================
+# __hasValidArchives
+#------------------------------------------
+sub __hasValidArchives {
+ # ...
+ # check if the optional given archives doesn't
+ # include bogus files
+ # ---
+ my $this = shift;
+ my $kiwi = $this->{kiwi};
+ my $xml = $this->{xml};
+ my $cmdL = $this->{cmdArgs};
+ my @list = $xml -> getArchiveList();
+ my $desc = $cmdL-> getConfigDir();
+ my @nogo = ('^etc\/YaST2\/licenses\/.*');
+ #==========================================
+ # check for origin of image description
+ #------------------------------------------
+ if (open FD,"$desc/image/main::Prepare") {
+ $desc = <FD>; close FD;
+ }
+ #==========================================
+ # check archive contents
+ #------------------------------------------
+ foreach my $ar (@list) {
+ if (! -f "$desc/$ar") {
+ $kiwi -> warning ("specified archive $ar doesn't exist in $desc");
+ $kiwi -> skipped ();
+ next;
+ }
+ my $contents = qxx ("tar -tf $desc/$ar 2>&1");
+ foreach my $exp (@nogo) {
+ if (grep (/$exp/,$contents)) {
+ $kiwi -> error ("bogus archive contents in $ar");
+ $kiwi -> failed ();
+ $kiwi -> error ("archive matches: $exp");
+ $kiwi -> failed ();
+ return undef;
+ }
+ }
+ }
+ return 1;
+}
+
+#==========================================
+# __haveValidTypeString
+#------------------------------------------
sub __haveValidTypeString {
# ...
# if the commandline data set contains buildtype
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 2011-09-08 15:58:26.000000000 +0200
+++ new/kiwi/modules/KIWISchema.rnc 2011-10-03 00:00:06.000000000 +0200
@@ -1390,6 +1390,25 @@
}
#==========================================
+# common element <showlicense>
+#
+div {
+ k.showlicense.attlist = empty
+ k.showlicense =
+ ## Setup showlicense
+ [
+ db:para [
+ "Image license setup. The specfied license name\x{a}"~
+ "will be displayed in a dialog window on boot."
+ ]
+ ]
+ element showlicense {
+ k.showlicense.attlist,
+ text
+ }
+}
+
+#==========================================
# common element <timezone>
#
div {
@@ -2397,6 +2416,7 @@
k.rpm-force? &
k.timezone? &
k.type* &
+ k.showlicense* &
k.version?
}
}
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 2011-09-08 15:58:26.000000000 +0200
+++ new/kiwi/modules/KIWISchema.rng 2011-10-03 00:00:06.000000000 +0200
@@ -1869,6 +1869,25 @@
</div>
<!--
==========================================
+ common element <showlicense>
+
+ -->
+ <div>
+ <define name="k.showlicense.attlist">
+ <empty/>
+ </define>
+ <define name="k.showlicense">
+ <element name="showlicense">
+