Hello community, here is the log from the commit of package kiwi for openSUSE:Factory checked in at 2015-06-09 12:24:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kiwi (Old) and /work/SRC/openSUSE:Factory/.kiwi.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kiwi" Changes: -------- --- /work/SRC/openSUSE:Factory/kiwi/kiwi.changes 2015-05-23 12:55:33.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.kiwi.new/kiwi.changes 2015-06-09 12:24:20.000000000 +0200 @@ -1,0 +2,93 @@ +Fri Jun 5 16:11:28 CEST 2015 - [email protected] + +- v7.02.53 released + +------------------------------------------------------------------- +Fri Jun 5 15:56:44 CEST 2015 - [email protected] + +- Follow up fix for btrfs grub2 boot path + + For iso media the adaption of the boot path to /@/... is wrong + because in this case we read from iso9660 and not from btrfs. + This is related to (bnc#933664) + +------------------------------------------------------------------- +Fri Jun 5 12:04:17 CEST 2015 - [email protected] + +- Fixed grub2 setup on btrfs without boot partition + + If the image is built with btrfs and no extra boot partition is requested + the grub2 btrfs module is used to read the boot data from the filesystem. + However in kiwi we setup a btrfs filesystem in a way that all subvolumes + are nested below a master '@' volume. Within the scope of grub2 it's + required to adapt any path in the filesystem to match this because it's + not possible to specify a subvolume set-default here. Because of this + /boot/grub2/grub.cfg becomes /@/boot/grub2/grub.cfg within grub2. + This fixes (bnc#933664) + +------------------------------------------------------------------- +Wed Jun 3 16:02:14 CEST 2015 - [email protected] + +- v7.02.52 released + +------------------------------------------------------------------- +Thu May 28 16:05:37 CEST 2015 - [email protected] + +- Fixed result tracking from ovftool + + The temporary directory created for this has the same name + as the ovf file created inside of it. On move of the data + to the result dir this causes trouble which is fixed by + this commit + +------------------------------------------------------------------- +Thu May 28 12:16:06 CEST 2015 - [email protected] + +- Added target_blocksize attribute in type section + + In preparation to support custom blocksize values for loops + the attribute target_blocksize was implemented like the folowing + example shows: + + <type ... target_blocksize="4096"/> + + This will set a 4k blocksize used for all loops setup during + image build and on first boot of the image. The actual code to + apply the blocksize to the loop is not yet implemented because + we are still waiting for the loop driver to support it. This is + related to (bnc#931634) + +------------------------------------------------------------------- +Wed May 27 22:31:26 CEST 2015 - [email protected] + +- Added pointer to XML description for loop_setup + + In preparation to support custom blocksize values for loops + access to the XML description is needed to read the specified + target_blocksize value once support for this value will be + added + +------------------------------------------------------------------- +Wed May 27 18:35:55 CEST 2015 - [email protected] + +- Fixed ova guestOS value for 13.2 JeOS + +------------------------------------------------------------------- +Wed May 27 18:25:50 CEST 2015 - [email protected] + +- Cleanup use of losetup + + In preparation to support custom blocksize values for loops + global methods to loop setup/delete has been added. This + is related to (bnc#931634) + +------------------------------------------------------------------- +Wed May 27 10:35:32 CEST 2015 - [email protected] + +- Added runtime check for overlay systems + + The __checkBootPartitionOverlaySystem runtime check makes sure + the use of a boot partition is not switched off. If the root + system is a read-only location the boot space must be writable + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kiwi.spec ++++++ --- /var/tmp/diff_new_pack.zFTeFF/_old 2015-06-09 12:24:22.000000000 +0200 +++ /var/tmp/diff_new_pack.zFTeFF/_new 2015-06-09 12:24:22.000000000 +0200 @@ -27,7 +27,7 @@ Name: kiwi License: GPL-2.0 Group: System/Management -Version: 7.02.51 +Version: 7.02.53 Provides: kiwi-schema = 6.2 Provides: kiwi-image:aci Provides: kiwi-image:lxc ++++++ kiwi-docu.tar.bz2 ++++++ ++++++ 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 2014-12-15 14:32:44.000000000 +0100 +++ new/kiwi/.revision 2014-12-15 14:32:44.000000000 +0100 @@ -1 +1 @@ -dd9a53006914dc220d11bccf707c041840e1240c +e74edab65d8aff3dd277952b7d248025754924a8 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 2015-05-07 12:05:02.000000000 +0200 +++ new/kiwi/modules/KIWIBoot.pm 2015-06-05 15:53:55.000000000 +0200 @@ -1356,7 +1356,7 @@ # Copy boot data on first partition #------------------------------------------ $kiwi -> info ("Installing boot data to disk"); - if (! KIWIGlobals -> instance() -> mount ($boot, $loopdir)) { + if (! KIWIGlobals -> instance() -> mount ($boot, $loopdir, undef, $xml)) { $kiwi -> failed (); $kiwi -> error ("Couldn't mount boot partition: $status"); $kiwi -> failed (); @@ -1422,7 +1422,7 @@ $kiwi -> info ("Installing image data to disk"); if (! KIWIGlobals -> instance() - -> mount ($data, $loopdir)) { + -> mount ($data, $loopdir, undef, $xml)) { $kiwi -> failed (); $kiwi -> error ("Couldn't mount data partition: $status"); $kiwi -> failed (); @@ -2586,7 +2586,8 @@ #------------------------------------------ if (! KIWIGlobals -> instance() - -> mount ($root,$loopdir,$type->{fsmountoptions})) { + -> mount ($root, $loopdir, $type->{fsmountoptions}, $xml + )) { $this -> cleanStack (); return; } @@ -2826,7 +2827,7 @@ #========================================== # Mount boot space on this disk #------------------------------------------ - if (! KIWIGlobals -> instance() -> mount ($boot, $loopdir)) { + if (! KIWIGlobals -> instance() -> mount ($boot, $loopdir, undef, $xml)) { $kiwi -> failed (); $kiwi -> error ("Couldn't mount image boot device: $boot"); $kiwi -> failed (); @@ -2843,7 +2844,9 @@ } my $jump = $deviceMap{jump}; KIWIQX::qxx ("mkdir -p $loopdir/$subdir"); - if (! KIWIGlobals -> instance() -> mount ($jump, "$loopdir/$subdir")) { + if (! KIWIGlobals -> instance() -> mount ( + $jump, "$loopdir/$subdir", undef, $xml + )) { $kiwi -> failed (); $kiwi -> error ("Couldn't mount image jump device: $boot"); $kiwi -> failed (); @@ -3677,13 +3680,17 @@ $kiwi -> failed (); return; } + my $bootpath = '/boot'; + if (($typeinfo->{filesystem} eq 'btrfs') && ($type ne 'iso')) { + $bootpath = '/@/boot'; + } if ($uuid) { print $bpfd "search --fs-uuid --set=root $uuid"; } else { - print $bpfd "search --file --set=root /boot/$this->{mbrid}"; + print $bpfd "search --file --set=root $bootpath/$this->{mbrid}"; } print $bpfd "\n"; - print $bpfd 'set prefix=($root)/boot/grub2'."\n"; + print $bpfd 'set prefix=($root)'.$bootpath.'/grub2'."\n"; $bpfd -> close(); #========================================== # Get Grub2 stage and theming files @@ -4351,6 +4358,11 @@ my $theme = $xml -> getPreferences() -> getBootLoaderTheme(); my $ascii = 'ascii.pf2'; my $fodir = '/boot/grub2/themes/'; + my $bootpath = '/boot'; + if (($type->{filesystem} eq 'btrfs') && (! $iso)) { + $bootpath = '/@/boot'; + $fodir = '/@/boot/grub2/themes/'; + } my @fonts = ( "DejaVuSans-Bold14.pf2", "DejaVuSans10.pf2", @@ -4417,9 +4429,9 @@ if ($uuid) { print $FD "search --fs-uuid --set=root $uuid"."\n"; } else { - print $FD "search --file --set=root /boot/$this->{mbrid}"."\n"; + print $FD "search --file --set=root $bootpath/$this->{mbrid}"."\n"; } - print $FD 'set prefix=($root)/boot/grub2'."\n"; + print $FD 'set prefix=($root)'.$bootpath.'/grub2'."\n"; # print $FD "set debug=all\n"; print $FD 'set linux=linux'."\n"; print $FD 'set initrd=initrd'."\n"; @@ -4431,7 +4443,7 @@ print $FD ' fi'."\n"; print $FD 'fi'."\n"; print $FD "set default=$defaultBootNr\n"; - print $FD "set font=/boot/unicode.pf2"."\n"; + print $FD "set font=$bootpath/unicode.pf2"."\n"; # setup to use boot graphics. If this is unwanted # you can disable it with the following alternative # console setup @@ -4483,7 +4495,7 @@ if ($dev eq '(cd)') { print $FD "\t".'chainloader +1'."\n"; } else { - print $FD "\t".'chainloader /boot/grub2/bootnext'."\n"; + print $FD "\t"."chainloader $bootpath/grub2/bootnext"."\n"; my $bootnext = $this -> addBootNext ( "$tmpdir/boot/grub2/bootnext", hex $this->{mbrid} ); @@ -4511,51 +4523,51 @@ if ($iso) { print $FD "\t"."echo Loading linux...\n"; print $FD "\t"."set gfxpayload=$gfx"."\n"; - print $FD "\t".'$linux /boot/linux'; + print $FD "\t".'$linux '.$bootpath.'/linux'; print $FD ' ramdisk_size=512000 ramdisk_blocksize=4096'; print $FD " cdinst=1"; } elsif (($topic=~ /^KIWI USB/)||($imgtype=~ /vmx|oem|split/)) { print $FD "\t"."echo Loading linux.vmx...\n"; print $FD "\t"."set gfxpayload=$gfx"."\n"; - print $FD "\t".'$linux /boot/linux.vmx'; + print $FD "\t".'$linux '.$bootpath.'/linux.vmx'; } else { print $FD "\t"."echo Loading linux...\n"; print $FD "\t"."set gfxpayload=$gfx"."\n"; - print $FD "\t".'$linux /boot/linux'; + print $FD "\t".'$linux '.$bootpath.'/linux'; } print $FD $cmdline; if ($iso) { print $FD "\t"."echo Loading initrd...\n"; - print $FD "\t".'$initrd /boot/initrd'."\n"; + print $FD "\t".'$initrd '.$bootpath.'/initrd'."\n"; } elsif (($topic=~ /^KIWI USB/)||($imgtype=~ /vmx|oem|split/)) { print $FD "\t"."echo Loading initrd.vmx...\n"; - print $FD "\t".'$initrd /boot/initrd.vmx'."\n"; + print $FD "\t".'$initrd '.$bootpath.'/initrd.vmx'."\n"; } else { print $FD "\t"."echo Loading initrd...\n"; - print $FD "\t".'$initrd /boot/initrd'."\n"; + print $FD "\t".'$initrd '.$bootpath.'/initrd'."\n"; } print $FD "}\n"; } else { if ($iso) { print $FD "\t"."echo Loading Xen\n"; - print $FD "\t"."multiboot /boot/xen.gz dummy\n"; + print $FD "\t"."multiboot $bootpath/xen.gz dummy\n"; print $FD "\t"."echo Loading linux...\n"; print $FD "\t"."set gfxpayload=$gfx"."\n"; - print $FD "\t"."module /boot/linux dummy"; + print $FD "\t"."module $bootpath/linux dummy"; print $FD ' ramdisk_size=512000 ramdisk_blocksize=4096'; print $FD " cdinst=1"; } elsif (($topic=~ /^KIWI USB/)||($imgtype=~ /vmx|oem|split/)) { print $FD "\t"."echo Loading Xen\n"; - print $FD "\t"."multiboot /boot/xen.gz dummy\n"; + print $FD "\t"."multiboot $bootpath/xen.gz dummy\n"; print $FD "\t"."echo Loading linux.vmx...\n"; print $FD "\t"."set gfxpayload=$gfx"."\n"; - print $FD "\t".'module /boot/linux.vmx dummy'; + print $FD "\t"."module $bootpath/linux.vmx dummy"; } else { - print $FD 'set prefix=($root)/boot/grub2'."\n"; + print $FD 'set prefix=($root)'.$bootpath.'/grub2'."\n"; } # print $FD "set debug=all\n"; print $FD "set default=$defaultBootNr\n"; - print $FD "set font=/boot/unicode.pf2"."\n"; + print $FD "set font=$bootpath/unicode.pf2"."\n"; # setup to use boot graphics. If this is unwanted # you can disable it with the following alternative # console setup @@ -4609,7 +4621,7 @@ if ($dev eq '(cd)') { print $FD "\t".'chainloader +1'."\n"; } else { - print $FD "\t".'chainloader /boot/grub2/bootnext'."\n"; + print $FD "\t"."chainloader $bootpath/grub2/bootnext\n"; my $bootnext = $this -> addBootNext ( "$tmpdir/boot/grub2/bootnext", hex $this->{mbrid} ); @@ -4627,7 +4639,7 @@ $title = $this -> quoteLabel ("Install $label"); } else { print $FD "\t"."echo Loading initrd...\n"; - print $FD "\t"."module /boot/initrd dummy\n"; + print $FD "\t"."module $bootpath/initrd dummy\n"; } print $FD "}\n"; } @@ -4642,7 +4654,7 @@ if ($iso) { print $FD "\t"."echo Loading linux...\n"; print $FD "\t"."set gfxpayload=$gfx"."\n"; - print $FD "\t".'$linux /boot/linux'; + print $FD "\t".'$linux '.$bootpath.'/linux'; print $FD ' ramdisk_size=512000 ramdisk_blocksize=4096'; print $FD " cdinst=1"; } elsif ( @@ -4651,35 +4663,35 @@ ) { print $FD "\t"."echo Loading linux.vmx...\n"; print $FD "\t"."set gfxpayload=$gfx"."\n"; - print $FD "\t".'$linux /boot/linux.vmx'; + print $FD "\t".'$linux '.$bootpath.'/linux.vmx'; } else { print $FD "\t"."echo Loading linux...\n"; print $FD "\t"."set gfxpayload=$gfx"."\n"; - print $FD "\t".'$linux /boot/linux'; + print $FD "\t".'$linux '.$bootpath.'/linux'; } print $FD " @failsafe"; print $FD $cmdline; if ($iso) { print $FD "\t"."echo Loading initrd...\n"; - print $FD "\t".'$initrd /boot/initrd'."\n"; + print $FD "\t".'$initrd '.$bootpath.'/initrd'."\n"; } elsif ( ($topic=~ /^KIWI USB/) || ($imgtype=~ /vmx|oem|split/) ) { print $FD "\t"."echo Loading initrd.vmx...\n"; - print $FD "\t".'$initrd /boot/initrd.vmx'."\n"; + print $FD "\t".'$initrd '.$bootpath.'/initrd.vmx'."\n"; } else { print $FD "\t"."echo Loading initrd...\n"; - print $FD "\t".'$initrd /boot/initrd'."\n"; + print $FD "\t".'$initrd '.$bootpath.'/initrd'."\n"; } print $FD "}\n"; } else { if ($iso) { print $FD "\t"."echo Loading Xen\n"; - print $FD "\t"."multiboot /boot/xen.gz dummy\n"; + print $FD "\t"."multiboot $bootpath/xen.gz dummy\n"; print $FD "\t"."echo Loading linux...\n"; print $FD "\t"."set gfxpayload=$gfx"."\n"; - print $FD "\t"."module /boot/linux dummy"; + print $FD "\t"."module $bootpath/linux dummy"; print $FD ' ramdisk_size=512000 ramdisk_blocksize=4096'; print $FD " cdinst=1"; } elsif ( @@ -4687,31 +4699,31 @@ ($imgtype=~ /vmx|oem|split/) ) { print $FD "\t"."echo Loading Xen\n"; - print $FD "\t"."multiboot /boot/xen.gz dummy\n"; + print $FD "\t"."multiboot $bootpath/xen.gz dummy\n"; print $FD "\t"."echo Loading linux.vmx...\n"; print $FD "\t"."set gfxpayload=$gfx"."\n"; - print $FD "\t".'module /boot/linux.vmx dummy'; + print $FD "\t"."module $bootpath/linux.vmx dummy"; } else { print $FD "\t"."echo Loading Xen\n"; - print $FD "\t"."multiboot /boot/xen.gz dummy\n"; + print $FD "\t"."multiboot $bootpath/xen.gz dummy\n"; print $FD "\t"."echo Loading linux...\n"; print $FD "\t"."set gfxpayload=$gfx"."\n"; - print $FD "\t".'module /boot/linux dummy'; + print $FD "\t"."module $bootpath/linux dummy"; } print $FD " @failsafe"; print $FD $cmdline; if ($iso) { print $FD "\t"."echo Loading initrd...\n"; - print $FD "\t"."module /boot/initrd dummy\n"; + print $FD "\t"."module $bootpath/initrd dummy\n"; } elsif ( ($topic=~ /^KIWI USB/) || ($imgtype=~ /vmx|oem|split/) ) { print $FD "\t"."echo Loading initrd.vmx...\n"; - print $FD "\t"."module /boot/initrd.vmx dummy\n"; + print $FD "\t"."module $bootpath/initrd.vmx dummy\n"; } else { print $FD "\t"."echo Loading initrd...\n"; - print $FD "\t"."module /boot/initrd dummy\n"; + print $FD "\t"."module $bootpath/initrd dummy\n"; } print $FD "}\n"; } @@ -5610,7 +5622,9 @@ #========================================== # Mount boot partition #------------------------------------------ - if (! KIWIGlobals -> instance() -> mount ($bootdev, $mount)) { + if (! KIWIGlobals -> instance() -> mount ( + $bootdev, $mount, undef, $xml + )) { $kiwi -> error ("Couldn't mount boot partition: $bootdev"); $kiwi -> failed (); return; @@ -5939,7 +5953,9 @@ $result = $? >> 8; } else { $kiwi -> info ("Installing extlinux on device: $bootdev"); - if (KIWIGlobals -> instance() -> mount ($bootdev, $mount)) { + if (KIWIGlobals -> instance() -> mount ( + $bootdev, $mount, undef, $xml + )) { $status = KIWIQX::qxx ( "extlinux --install $mount/boot/syslinux 2>&1" ); @@ -5996,7 +6012,9 @@ #========================================== # mount boot device... #------------------------------------------ - if (! KIWIGlobals -> instance() -> mount ($bootdev, $mount)) { + if (! KIWIGlobals -> instance() -> mount ( + $bootdev, $mount, undef, $xml + )) { $kiwi -> error ("Can't mount boot partition: $status"); $kiwi -> failed (); $this -> cleanStack (); @@ -6174,47 +6192,15 @@ my $system = shift; my $kiwi = $this->{kiwi}; my @cStack = @{$this->{cleanupStack}}; + my $global = KIWIGlobals -> instance(); my $status; my $result; - my $loop; #========================================== # bind file to loop device #------------------------------------------ - $status = KIWIQX::qxx ( - "/sbin/losetup -f --show $system 2>/dev/null" - ); - $result = $? >> 8; - chomp $status; - if ($result != 0) { - # /.../ - # first losetup call has failed, try to find free loop - # device manually even though it's most likely that this - # search will fail too. The following is only useful for - # older version of losetup which doesn't understand the - # option combination -f --show - # ---- - my $loopfound = 0; - for (my $id=0;$id<=7;$id++) { - $status.= KIWIQX::qxx ( "/sbin/losetup /dev/loop$id $system 2>&1" ); - $result = $? >> 8; - if ($result == 0) { - $loopfound = 1; - $loop = "/dev/loop".$id; - $this->{loop} = $loop; - push @cStack,"losetup -d $loop"; - $this->{cleanupStack} = \@cStack; - last; - } - } - if (! $loopfound) { - $kiwi -> loginfo ("Failed binding loop device: $status"); - return; - } - return $this; - } - $loop = $status; + my $loop = $global -> loop_setup($system, $this->{xml}); $this->{loop} = $loop; - push @cStack,"losetup -d $loop"; + push @cStack, $global -> loop_delete_command($loop); $this->{cleanupStack} = \@cStack; return $this; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIFilesystemBuilderBase.pm new/kiwi/modules/KIWIFilesystemBuilderBase.pm --- old/kiwi/modules/KIWIFilesystemBuilderBase.pm 2015-04-30 10:28:21.000000000 +0200 +++ new/kiwi/modules/KIWIFilesystemBuilderBase.pm 2015-05-28 11:28:11.000000000 +0200 @@ -277,19 +277,8 @@ return; } $this -> p_addCreatedFile($imgName); - my $losetup = $locator -> getExecPath('losetup'); - if (! $losetup) { - my $msg = 'Could not locate loop setup tool, losetup'; - $kiwi -> error($msg); - $kiwi -> failed (); - return; - } - $device = KIWIQX::qxx("$losetup -f --show $imgPath 2>&1"); - chomp $device; - $code = $? >> 8; - if ($code != 0) { - $kiwi -> error ("Couldn't loop bind logical extend: $device"); - $kiwi -> failed (); + $device = $global -> loop_setup($imgPath, $xml); + if (! $device) { return; } return $device; @@ -449,9 +438,8 @@ my $umount = $locator -> getExecPath('umount'); if (! $umount) { my $msg = 'Could not find umount command. Your system is in an ' - . 'inconsistent state, as root us "mount" and "losetup" commands ' - . 'To determine the extra mounts created by kiwi. Check for ' - . $mntPnt; + . 'inconsistent state. To determine the extra mounts created by ' + . "kiwi. Check for $mntPnt"; $kiwi -> error($msg); $kiwi -> failed(); return; 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 2015-05-22 14:45:19.000000000 +0200 +++ new/kiwi/modules/KIWIGlobals.pm 2015-06-05 16:11:24.000000000 +0200 @@ -158,6 +158,87 @@ } #========================================== +# loop_setup +#------------------------------------------ +sub loop_setup { + # /.../ + # implements a generic losetup method for different block sizes + # --- + my $this = shift; + my $source = shift; + my $xml = shift; + my $kiwi = $this->{kiwi}; + my $locator = KIWILocator -> instance(); + my $losetup_exec = $locator -> getExecPath("losetup"); + if (! $losetup_exec) { + $kiwi -> error("losetup not found on build system"); + $kiwi -> failed(); + return; + } + my $result = KIWIQX::qxx ( + "$losetup_exec -f --show $source 2>&1" + ); + my $status = $? >> 8; + if ($status != 0) { + $kiwi -> error("Couldn't loop bind file $source: $status"); + $kiwi -> failed(); + return; + } + chomp $result; + if ($xml) { + my $bldType = $xml -> getImageType(); + my $blocksize = $bldType -> getTargetBlockSize(); + if (($blocksize) && ($blocksize > 512)) { + # Once there is a loop driver with custom block size setup + # available check here for a configured target_blocksize and + # apply the value to the loop + } + } + return $result; +} + +#========================================== +# loop_delete +#------------------------------------------ +sub loop_delete { + # /.../ + # implements a generic loop deletion method + # --- + my $this = shift; + my $loop = shift; + my $kiwi = $this->{kiwi}; + my $locator = KIWILocator -> instance(); + my $losetup_exec = $locator -> getExecPath("losetup"); + if (! $losetup_exec) { + $kiwi -> error("losetup not found on build system"); + $kiwi -> failed(); + return; + } + my $result = KIWIQX::qxx ( + "$losetup_exec -d $loop 2>&1" + ); + my $status = $? >> 8; + if ($status != 0) { + $kiwi -> error("Couldn't delete loop $loop: $status"); + $kiwi -> failed(); + return; + } + return $this; +} + +#========================================== +# loop_delete_command +#------------------------------------------ +sub loop_delete_command { + # /.../ + # implements a generic loop deletion command creation method + # --- + my $this = shift; + my $loop = shift; + return "losetup -d $loop" +} + +#========================================== # mount #------------------------------------------ sub mount { @@ -169,6 +250,7 @@ my $source = shift; my $dest = shift; my $opts = shift; + my $xml = shift; my $kiwi = $this->{kiwi}; my $salt = int (rand(20)); my $cipher = $this->{data}->{LuksCipher}; @@ -222,21 +304,12 @@ } $source = $pdev; } else { - $status = KIWIQX::qxx ( - "/sbin/losetup -f --show $source 2>/dev/null" - ); - chomp $status; - $result = $? >> 8; - if ($result != 0) { - $kiwi -> error ( - "Couldn't loop bind disk file: $status" - ); - $kiwi -> failed (); + my $loop = $this -> loop_setup($source, $xml); + if (! $loop) { $this -> umount(); return; } - my $loop = $status; - push @UmountStack,"losetup -d $loop"; + push @UmountStack, $this -> loop_delete_command($loop); $this->{UmountStack} = \@UmountStack; $status = KIWIQX::qxx ("kpartx -sa $loop 2>&1"); $result = $? >> 8; @@ -297,19 +370,12 @@ #------------------------------------------ if ($type eq "luks") { if (-f $source) { - $status = KIWIQX::qxx ( - "/sbin/losetup -f --show $source 2>/dev/null" - ); - chomp $status; - $result = $? >> 8; - if ($result != 0) { - $kiwi -> error ("Couldn't loop bind logical extend: $status"); - $kiwi -> failed (); + $source = $this -> loop_setup($source, $xml); + if (! $source) { $this -> umount(); return; } - $source = $status; - push @UmountStack,"losetup -d $source"; + push @UmountStack, $this -> loop_delete_command($source); $this->{UmountStack} = \@UmountStack; } if ($cipher) { @@ -1875,7 +1941,7 @@ # Globals (generic) #------------------------------------------ my %data; - $data{Version} = "7.02.51"; + $data{Version} = "7.02.53"; $data{Publisher} = "SUSE LINUX GmbH"; $data{Preparer} = "KIWI - http://opensuse.github.com/kiwi"; $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 2015-04-30 10:28:21.000000000 +0200 +++ new/kiwi/modules/KIWIImage.pm 2015-05-28 11:28:11.000000000 +0200 @@ -3697,12 +3697,8 @@ return; } if (! $device) { - $data = KIWIQX::qxx ("/sbin/losetup -f --show $out 2>/dev/null"); - $code = $? >> 8; - chomp $data; - if ($code != 0) { - $kiwi -> error ("Couldn't loop bind logical extend: $data"); - $kiwi -> failed (); + $data = KIWIGlobals -> instance() -> loop_setup($out, $this->{xml}); + if (! $data) { return; } } else { @@ -4914,7 +4910,7 @@ } if ($loop) { foreach my $ldev (@{$loop}) { - KIWIQX::qxx ("losetup -d $ldev 2>&1"); + KIWIGlobals -> instance() -> loop_delete($ldev); } } return; 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 2015-05-12 15:36:28.000000000 +0200 +++ new/kiwi/modules/KIWIImageFormat.pm 2015-05-28 16:00:28.000000000 +0200 @@ -1142,6 +1142,7 @@ my $ovfdir = $this->{ovfdir}; my $format = $this->{format}; my $base = basename $this->{image}; + my $destdir= dirname $this->{image}; my $ovf; my $vmdk; #========================================== @@ -1199,7 +1200,6 @@ #========================================== # create OVA tarball #------------------------------------------ - my $destdir = dirname $this->{image}; my $ovaimage = basename $ovfdir; $ovaimage =~ s/\.ovf$/\.ova/; my $ovabasis = $ovaimage; @@ -1241,17 +1241,14 @@ "tar -h -C $ovfdir -xf $destdir/$ovaimage $extract 2>&1" ); $result = $? >> 8; - if ($result == 0) { - $status = KIWIQX::qxx ( - "mv $ovfdir/$extract $destdir/$ovabasis.vmdk 2>&1" - ); - $result = $? >> 8; - } if ($result != 0) { $kiwi -> error ("Couldn't unpack vmdk file: $status"); $kiwi -> failed (); return; } + KIWIQX::qxx ( + "mv $ovfdir/$ovabasis-disk1.vmdk $ovfdir/$ovabasis.vmdk" + ); $kiwi -> info ( "Replacing kiwi's ovf file with version from generated OVA\n" ); @@ -1262,12 +1259,15 @@ ); $result = $? >> 8; if ($result != 0) { - $kiwi -> error ("Couldn't unpack ovf and mf file: $status"); + $kiwi -> error ("Couldn't unpack ovf file: $status"); $kiwi -> failed (); return; } } } + KIWIQX::qxx ("mv $ovfdir $ovfdir.tmp"); + KIWIQX::qxx ("mv -f $ovfdir.tmp/* $destdir"); + KIWIQX::qxx ("rmdir $ovfdir.tmp"); return $ovf; } 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 2015-05-21 12:32:27.000000000 +0200 +++ new/kiwi/modules/KIWILinuxRC.sh 2015-05-28 12:19:18.000000000 +0200 @@ -4079,7 +4079,7 @@ "Failed to mount ISO storage device !" \ "reboot" fi - biosBootDevice=$(losetup -f --show /isofrom/$isofrom_system) + biosBootDevice=$(loop_setup /isofrom/$isofrom_system) if [ ! $? = 0 ];then systemException \ "Failed to loop setup ISO system !" \ @@ -6090,7 +6090,7 @@ # decide for a mount method #-------------------------------------- if [ ! -z "$lop" ];then - src=$(losetup -f --show $lop) + src=$(loop_setup $lop) if [ ! -e $src ]; then return 1 fi @@ -8780,7 +8780,7 @@ #====================================== # loop setup cow space #-------------------------------------- - kiwi_cowdevice=$(losetup -f --show /cow/$kiwi_cowsystem) + kiwi_cowdevice=$(loop_setup /cow/$kiwi_cowsystem) if [ ! -e $kiwi_cowdevice ];then systemException \ "Failed to loop setup cow file !" \ @@ -10904,6 +10904,32 @@ dd if=$device bs=1 count=$(((128 * pcount) + 1024)) } #====================================== +# loop_setup +#-------------------------------------- +function loop_setup { + local IFS=$IFS_ORIG + local target=$1 + local loop=$(losetup -f --show $target) + if [ ! -e "$loop" ];then + return 1 + fi + if [ "0$kiwi_target_blocksize" -gt 512 ];then + # Once there is a loop driver with custom block size setup + # available check here for a configured target_blocksize and + # apply the value to the loop + : + fi + echo $loop +} +#====================================== +# loop_delete +#-------------------------------------- +function loop_delete { + local IFS=$IFS_ORIG + local target=$1 + losetup -d $target +} +#====================================== # initialize #-------------------------------------- function initialize { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIProfileFile.pm new/kiwi/modules/KIWIProfileFile.pm --- old/kiwi/modules/KIWIProfileFile.pm 2015-05-21 10:07:55.000000000 +0200 +++ new/kiwi/modules/KIWIProfileFile.pm 2015-05-28 12:19:18.000000000 +0200 @@ -111,6 +111,7 @@ kiwi_oemunattended_id kiwi_profiles kiwi_ramonly + kiwi_target_blocksize kiwi_revision kiwi_showlicense kiwi_splash_theme @@ -377,6 +378,7 @@ $data{kiwi_hybrid} = $type -> getHybrid(); $data{kiwi_hybridpersistent} = $type -> getHybridPersistent(); $data{kiwi_ramonly} = $type -> getRAMOnly(); + $data{kiwi_target_blocksize} = $type -> getTargetBlockSize(); $data{kiwi_cmdline} = $type -> getKernelCmdOpts(); $data{kiwi_firmware} = $type -> getFirmwareType(); $data{kiwi_bootloader} = $type -> getBootLoader(); 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 2015-05-18 14:27:53.000000000 +0200 +++ new/kiwi/modules/KIWIRuntimeChecker.pm 2015-05-27 10:34:30.000000000 +0200 @@ -108,6 +108,9 @@ # Runtime checks specific to the create step # --- my $this = shift; + if (! $this -> __checkBootPartitionOverlaySystem()) { + return; + } if (! $this -> __checkVMConfigExist()) { return; } @@ -188,6 +191,9 @@ # Runtime checks specific to the prepare step # --- my $this = shift; + if (! $this -> __checkBootPartitionOverlaySystem()) { + return; + } if (! $this -> __checkVMConfigExist()) { return; } @@ -1526,6 +1532,40 @@ } #========================================== +# __checkBootPartitionOverlaySystem +#------------------------------------------ +sub __checkBootPartitionOverlaySystem { + # ... + # Check the boot partition setup for overlay systems + # + my $this = shift; + my $kiwi = $this->{kiwi}; + my $locator = $this->{locator}; + my $xml = $this->{xml}; + my $bldType = $xml -> getImageType(); + if (! $bldType) { + return 1; + } + my $typename = $bldType -> getTypeName(); + my $bootpartition = $bldType -> getBootPartition(); + my $filesystem = $bldType -> getFilesystem(); + if ((! $bootpartition) || ($bootpartition eq "true")) { + return 1; + } + if ($filesystem !~ /overlayfs|clicfs/) { + return 1; + } + my $msg = "The system is explicitly configured to work as root overlay "; + $msg.= "system without a boot partition for the $filesystem filesystem. "; + $msg.= "However the the boot location must be writable and can't be "; + $msg.= "part of the read only root filesystem. Please delete the "; + $msg.= "bootpartition attribute from your $typename build type"; + $kiwi -> error($msg); + $kiwi -> failed(); + return; +} + +#========================================== # __checkDeprecatedFilesystem #------------------------------------------ sub __checkDeprecatedFilesystem { 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 2015-05-21 09:53:29.000000000 +0200 +++ new/kiwi/modules/KIWISchema.rnc 2015-05-28 12:19:18.000000000 +0200 @@ -1630,12 +1630,19 @@ ## information is passed as add-profile option attribute bootkernel { text } k.type.bootloader.attribute = - ## Specifies the bootloader used for booting the image." + ## Specifies the bootloader used for booting the image. ## At the moment grub, zipl and sys|extlinux are supported attribute bootloader { "extlinux" | "grub" | "grub2" | "syslinux" | "zipl" | "yaboot" | "uboot" | "berryboot" } + k.type.target_blocksize = + ## Specifies the image blocksize in bytes which has to match + ## the logical (SSZ) blocksize of the target storage device. + ## By default 512 byte is used which works on many disks + ## However 4096 byte disks are coming. You can check the + ## desired target by calling: blockdev --report device + attribute target_blocksize { xsd:nonNegativeInteger } k.type.zipl_targettype.attribute = ## The device type of the disk zipl should boot. On zFCP ## devices use SCSI, on DASD devices use CDL or LDL on @@ -1885,6 +1892,7 @@ k.type.mdraid.attribute? & k.type.primary.attribute? & k.type.ramonly.attribute? & + k.type.target_blocksize? & k.type.vga.attribute? & k.type.vhdfixedtag.attribute? & k.type.volid.attribute? & 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 2015-05-21 09:53:30.000000000 +0200 +++ new/kiwi/modules/KIWISchema.rng 2015-05-28 12:19:18.000000000 +0200 @@ -2130,7 +2130,7 @@ </define> <define name="k.type.bootloader.attribute"> <attribute name="bootloader"> - <a:documentation>Specifies the bootloader used for booting the image." + <a:documentation>Specifies the bootloader used for booting the image. At the moment grub, zipl and sys|extlinux are supported</a:documentation> <choice> <value>extlinux</value> @@ -2144,6 +2144,16 @@ </choice> </attribute> </define> + <define name="k.type.target_blocksize"> + <attribute name="target_blocksize"> + <a:documentation>Specifies the image blocksize in bytes which has to match +the logical (SSZ) blocksize of the target storage device. +By default 512 byte is used which works on many disks +However 4096 byte disks are coming. You can check the +desired target by calling: blockdev --report device</a:documentation> + <data type="nonNegativeInteger"/> + </attribute> + </define> <define name="k.type.zipl_targettype.attribute"> <attribute name="zipl_targettype"> <a:documentation>The device type of the disk zipl should boot. On zFCP @@ -2638,6 +2648,9 @@ <ref name="k.type.ramonly.attribute"/> </optional> <optional> + <ref name="k.type.target_blocksize"/> + </optional> + <optional> <ref name="k.type.vga.attribute"/> </optional> <optional> 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 2015-05-21 10:03:19.000000000 +0200 +++ new/kiwi/modules/KIWIXML.pm 2015-05-28 12:19:18.000000000 +0200 @@ -3945,6 +3945,7 @@ 'luks', 'luksOS', 'ramonly', + 'target_blocksize', 'mdraid', 'vga', 'vhdfixedtag', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/modules/KIWIXMLTypeData.pm new/kiwi/modules/KIWIXMLTypeData.pm --- old/kiwi/modules/KIWIXMLTypeData.pm 2015-05-18 13:10:35.000000000 +0200 +++ new/kiwi/modules/KIWIXMLTypeData.pm 2015-05-28 12:19:18.000000000 +0200 @@ -95,6 +95,7 @@ # size = '' # sizeadd = '' # sizeunit = '' + # target_blocksize = '' # vga = '' # vhdfixedtag = '' # volid = '' @@ -163,6 +164,7 @@ size sizeadd sizeunit + target_blocksize vga vhdfixedtag volid @@ -228,6 +230,7 @@ $this->{vga} = $init->{vga}; $this->{vhdfixedtag} = $init->{vhdfixedtag}; $this->{volid} = $init->{volid}; + $this->{target_blocksize} = $init->{target_blocksize}; $this->{zfsoptions} = $init->{zfsoptions}; # Set default values if (! $init->{bootloader} ) { @@ -312,6 +315,17 @@ } #========================================== +# getTargetBlockSize +#------------------------------------------ +sub getTargetBlockSize { + # ... + # Return the configured target blocksize + # --- + my $this = shift; + return $this->{target_blocksize}; +} + +#========================================== # getBootPartitionSize #------------------------------------------ sub getBootPartitionSize { @@ -885,6 +899,10 @@ $element -> setAttribute('bootloader', $loader); } } + my $target_blocksize = $this -> getTargetBlockSize(); + if ($target_blocksize) { + $element -> setAttribute('target_blocksize', $target_blocksize); + } my $zipl_targettype = $this -> getZiplTargetType(); if ($zipl_targettype) { $element -> setAttribute('zipl_targettype', $zipl_targettype); @@ -1152,6 +1170,27 @@ return $this; } +#========================================== +# setTargetBlockSize +#------------------------------------------ +sub setTargetBlockSize { + # ... + # Set the configuration for the target blocksize + # --- + my $this = shift; + my $target_blocksize = shift; + if (! $target_blocksize ) { + my $kiwi = $this->{kiwi}; + my $msg = 'setTargetBlockSize: no blocksize given, retaining current ' + . 'data.'; + $kiwi -> error($msg); + $kiwi -> failed(); + return; + } + $this->{target_blocksize} = $target_blocksize; + return $this; +} + #========================================== # setBootPartitionSize #------------------------------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/armv7l/oemboot/suse-dump new/kiwi/system/boot/armv7l/oemboot/suse-dump --- old/kiwi/system/boot/armv7l/oemboot/suse-dump 2015-05-21 12:35:50.000000000 +0200 +++ new/kiwi/system/boot/armv7l/oemboot/suse-dump 2015-05-27 18:27:15.000000000 +0200 @@ -351,16 +351,7 @@ #-------------------------------------- info=/tmp/partinfo wmrc=/wmrc - loop=$(losetup -f --show $imageName) - if [ $? != 0 ];then - # /.../ - # old version of losetup doesn't know about - # the --find option therefore we set a fixed - # loop device name and setup this - # ---- - loop=/dev/loop1 - losetup $loop $imageName - fi + loop=$(loop_setup -f --show $imageName) loop=$(echo $loop | sed -e s@^/dev/@@) if ! kpartx -sa /dev/$loop;then systemException \ @@ -758,7 +749,7 @@ #-------------------------------------- if [ ! -z "$kiwi_oempartition_install" ];then dmsetup remove_all - losetup -d /dev/$loop + loop_delete /dev/$loop fi #====================================== # Check the md5sum of the raw disk diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/ix86/oemboot/rhel-dump new/kiwi/system/boot/ix86/oemboot/rhel-dump --- old/kiwi/system/boot/ix86/oemboot/rhel-dump 2015-05-21 12:36:54.000000000 +0200 +++ new/kiwi/system/boot/ix86/oemboot/rhel-dump 2015-05-27 18:27:15.000000000 +0200 @@ -351,16 +351,7 @@ #-------------------------------------- info=/tmp/partinfo wmrc=/wmrc - loop=$(losetup -f --show $imageName) - if [ $? != 0 ];then - # /.../ - # old version of losetup doesn't know about - # the --find option therefore we set a fixed - # loop device name and setup this - # ---- - loop=/dev/loop1 - losetup $loop $imageName - fi + loop=$(loop_setup $imageName) loop=$(echo $loop | sed -e s@^/dev/@@) if ! kpartx -sa /dev/$loop;then systemException \ @@ -758,7 +749,7 @@ #-------------------------------------- if [ ! -z "$kiwi_oempartition_install" ];then dmsetup remove_all - losetup -d /dev/$loop + loop_delete /dev/$loop fi #====================================== # Check the md5sum of the raw disk diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/ix86/oemboot/suse-dump new/kiwi/system/boot/ix86/oemboot/suse-dump --- old/kiwi/system/boot/ix86/oemboot/suse-dump 2015-05-21 12:35:16.000000000 +0200 +++ new/kiwi/system/boot/ix86/oemboot/suse-dump 2015-05-27 18:27:15.000000000 +0200 @@ -351,16 +351,7 @@ #-------------------------------------- info=/tmp/partinfo wmrc=/wmrc - loop=$(losetup -f --show $imageName) - if [ $? != 0 ];then - # /.../ - # old version of losetup doesn't know about - # the --find option therefore we set a fixed - # loop device name and setup this - # ---- - loop=/dev/loop1 - losetup $loop $imageName - fi + loop=$(loop_setup -f --show $imageName) loop=$(echo $loop | sed -e s@^/dev/@@) if ! kpartx -sa /dev/$loop;then systemException \ @@ -758,7 +749,7 @@ #-------------------------------------- if [ ! -z "$kiwi_oempartition_install" ];then dmsetup remove_all - losetup -d /dev/$loop + loop_delete /dev/$loop fi #====================================== # Check the md5sum of the raw disk diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/ppc/oemboot/suse-dump new/kiwi/system/boot/ppc/oemboot/suse-dump --- old/kiwi/system/boot/ppc/oemboot/suse-dump 2015-05-21 12:35:40.000000000 +0200 +++ new/kiwi/system/boot/ppc/oemboot/suse-dump 2015-05-27 18:27:15.000000000 +0200 @@ -351,16 +351,7 @@ #-------------------------------------- info=/tmp/partinfo wmrc=/wmrc - loop=$(losetup -f --show $imageName) - if [ $? != 0 ];then - # /.../ - # old version of losetup doesn't know about - # the --find option therefore we set a fixed - # loop device name and setup this - # ---- - loop=/dev/loop1 - losetup $loop $imageName - fi + loop=$(loop_setup -f --show $imageName) loop=$(echo $loop | sed -e s@^/dev/@@) if ! kpartx -sa /dev/$loop;then systemException \ @@ -758,7 +749,7 @@ #-------------------------------------- if [ ! -z "$kiwi_oempartition_install" ];then dmsetup remove_all - losetup -d /dev/$loop + loop_delete /dev/$loop fi #====================================== # Check the md5sum of the raw disk diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/system/boot/s390/oemboot/suse-dump new/kiwi/system/boot/s390/oemboot/suse-dump --- old/kiwi/system/boot/s390/oemboot/suse-dump 2015-05-21 12:35:30.000000000 +0200 +++ new/kiwi/system/boot/s390/oemboot/suse-dump 2015-05-27 18:27:15.000000000 +0200 @@ -351,16 +351,7 @@ #-------------------------------------- info=/tmp/partinfo wmrc=/wmrc - loop=$(losetup -f --show $imageName) - if [ $? != 0 ];then - # /.../ - # old version of losetup doesn't know about - # the --find option therefore we set a fixed - # loop device name and setup this - # ---- - loop=/dev/loop1 - losetup $loop $imageName - fi + loop=$(loop_setup -f --show $imageName) loop=$(echo $loop | sed -e s@^/dev/@@) if ! kpartx -sa /dev/$loop;then systemException \ @@ -758,7 +749,7 @@ #-------------------------------------- if [ ! -z "$kiwi_oempartition_install" ];then dmsetup remove_all - losetup -d /dev/$loop + loop_delete /dev/$loop fi #====================================== # Check the md5sum of the raw disk diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/template/ix86/suse-13.2-JeOS/config.xml new/kiwi/template/ix86/suse-13.2-JeOS/config.xml --- old/kiwi/template/ix86/suse-13.2-JeOS/config.xml 2015-05-21 17:01:53.000000000 +0200 +++ new/kiwi/template/ix86/suse-13.2-JeOS/config.xml 2015-06-05 12:02:22.000000000 +0200 @@ -48,7 +48,7 @@ </preferences> <preferences profiles="vmxFlavour"> <type image="vmx" filesystem="ext3" boot="vmxboot/suse-13.2" format="ova" bootloader="grub2" kernelcmdline="splash" firmware="efi"> - <machine memory="4096" guestOS="sles12-64" HWversion="7" arch="x86_64" ovftype="vmware"> + <machine memory="4096" guestOS="sles-64" HWversion="7" arch="x86_64" ovftype="vmware"> <vmdisk controller="lsilogic" id="0" diskmode="streamOptimized"/> <vmdvd controller="ide" id="0"/> <vmnic driver="vmxnet3" interface="0" mode="bridged"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi/tests/unit/lib/Test/kiwiXMLTypeData.pm new/kiwi/tests/unit/lib/Test/kiwiXMLTypeData.pm --- old/kiwi/tests/unit/lib/Test/kiwiXMLTypeData.pm 2015-04-08 12:45:29.000000000 +0200 +++ new/kiwi/tests/unit/lib/Test/kiwiXMLTypeData.pm 2015-05-28 12:19:18.000000000 +0200 @@ -933,6 +933,27 @@ } #========================================== +# test_getTargetBlockSize +#------------------------------------------ +sub test_getTargetBlockSize { + # ... + # Test the getTargetBlockSize method + # --- + my $this = shift; + my $kiwi = $this -> {kiwi}; + my $typeDataObj = $this -> __getTypeObj(); + my $blocksize = $typeDataObj -> getTargetBlockSize(); + my $msg = $kiwi -> getMessage(); + $this -> assert_str_equals('No messages set', $msg); + my $msgT = $kiwi -> getMessageType(); + $this -> assert_str_equals('none', $msgT); + my $state = $kiwi -> getState(); + $this -> assert_str_equals('No state set', $state); + $this -> assert_str_equals('4096', $blocksize); + return; +} + +#========================================== # test_getBootLoaderDefault #------------------------------------------ sub test_getBootLoaderDefault { @@ -1893,6 +1914,7 @@ . 'bootfilesystem="fat32" ' . 'bootkernel="xenk" ' . 'bootloader="grub2" ' + . 'target_blocksize="4096" ' . 'zipl_targettype="FBA" ' . 'bootpartsize="512" ' . 'bootpartition="true" ' @@ -2175,6 +2197,35 @@ } #========================================== +# test_setTargetBlockSize +#------------------------------------------ +sub test_setTargetBlockSize { + # ... + # Test the setTargetBlockSize method + # --- + my $this = shift; + my $kiwi = $this -> {kiwi}; + my $typeDataObj = $this -> __getTypeObj(); + $typeDataObj = $typeDataObj -> setTargetBlockSize('512'); + my $msg = $kiwi -> getMessage(); + $this -> assert_str_equals('No messages set', $msg); + my $msgT = $kiwi -> getMessageType(); + $this -> assert_str_equals('none', $msgT); + my $state = $kiwi -> getState(); + $this -> assert_str_equals('No state set', $state); + $this -> assert_not_null($typeDataObj); + my $blocksize = $typeDataObj -> getTargetBlockSize(); + $msg = $kiwi -> getMessage(); + $this -> assert_str_equals('No messages set', $msg); + $msgT = $kiwi -> getMessageType(); + $this -> assert_str_equals('none', $msgT); + $state = $kiwi -> getState(); + $this -> assert_str_equals('No state set', $state); + $this -> assert_str_equals('512', $blocksize); + return; +} + +#========================================== # test_setBootLoaderInvalidArg #------------------------------------------ sub test_setBootLoaderInvalidArg { @@ -5282,6 +5333,7 @@ bootkernel => 'xenk', bootloader => 'grub2', zipl_targettype => 'FBA', + target_blocksize => '4096', bootpartition => 'true', bootpartsize => '512', bootprofile => 'std',
