Hello community,

here is the log from the commit of package virt-v2v for openSUSE:Factory 
checked in at 2013-09-16 10:18:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/virt-v2v (Old)
 and      /work/SRC/openSUSE:Factory/.virt-v2v.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "virt-v2v"

Changes:
--------
--- /work/SRC/openSUSE:Factory/virt-v2v/virt-v2v.changes        2013-09-12 
14:28:38.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.virt-v2v.new/virt-v2v.changes   2013-09-16 
10:18:48.000000000 +0200
@@ -1,0 +2,7 @@
+Sat Sep 14 19:08:34 UTC 2013 - mlati...@suse.com
+
+- Replaced grubby functionality with Bootloader::Tools.
+- Removed pre-convert capability as grubby is no longer required.
+- Replaced warning with temporary workaround for bnc836521.
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ add_suse_capabilities.patch ++++++
--- /var/tmp/diff_new_pack.zHSkUz/_old  2013-09-16 10:18:48.000000000 +0200
+++ /var/tmp/diff_new_pack.zHSkUz/_new  2013-09-16 10:18:48.000000000 +0200
@@ -3,8 +3,6 @@
 
   - Adding virtio capabilities for SLES10/11 and openSUSE 10/11/12.
   - Designating the rpm containing the cirrus video driver in SLES/openSUSE
-  - Adding a 'pre-convert' capability to install 'grubby' prior to beginning
-    the convert process.
 
 This patch also adds the following SUSE examples to /etc/virt-v2v.conf:
 
@@ -12,13 +10,13 @@
   - Sample network conversion using SUSE naming defaults (br0 -> default).
 
 ---
- virt-v2v.conf |    8 +++++++
- virt-v2v.db   |   61 
++++++++++++++++++++++++++++++++++++++++++++++------------
- 2 files changed, 57 insertions(+), 12 deletions(-)
+ virt-v2v.conf |    8 ++++++++
+ virt-v2v.db   |   33 +++++++++++++++++++++------------
+ 2 files changed, 29 insertions(+), 12 deletions(-)
 
 diff -Nurp a/v2v/virt-v2v.conf b/v2v/virt-v2v.conf
---- a/v2v/virt-v2v.conf        2013-09-09 15:00:54.628956517 -0600
-+++ b/v2v/virt-v2v.conf        2013-09-09 16:10:04.253725981 -0600
+--- a/v2v/virt-v2v.conf        2013-09-14 13:00:17.148819499 -0600
++++ b/v2v/virt-v2v.conf        2013-09-14 13:00:41.118810452 -0600
 @@ -40,12 +40,20 @@ configuration data in /var/lib/virt-v2v/
    <capability os='linux' distro='rhel' major='6' name='user-install'>
      <dep name='mypackage'/>
@@ -28,7 +26,7 @@
 +    <dep name='mypackage'/>
 +  </capability>
    -->
-
+ 
    <!-- Networks -->
    <!-- Mappings for the defaults in Xen, ESX and libvirt/KVM
         to the default in libvirt/KVM -->
@@ -41,9 +39,9 @@
      <network type='network' name='default'/>
    </network>
 diff -Nurp a/v2v/virt-v2v.db b/v2v/virt-v2v.db
---- a/v2v/virt-v2v.db  2013-09-09 15:01:02.198933701 -0600
-+++ b/v2v/virt-v2v.db  2013-09-09 16:10:12.272696566 -0600
-@@ -11,39 +11,62 @@ the modifications or additions to /etc/v
+--- a/v2v/virt-v2v.db  2013-09-14 13:00:25.755817235 -0600
++++ b/v2v/virt-v2v.db  2013-09-14 13:00:32.478814644 -0600
+@@ -11,39 +11,54 @@ the modifications or additions to /etc/v
    <!-- Capabilities -->
    <!-- RHEL 6 has always supported virtio -->
    <capability os='linux' distro='rhel' major='6' name='virtio'/>
@@ -70,7 +68,7 @@
 -
    <!-- RHEL 4 bundles the cirrus driver with the main X package -->
    <capability os='linux' distro='rhel' major='4' name='cirrus'/>
-
+ 
    <!-- All current versions of Fedora support VirtIO -->
    <capability os='linux' distro='fedora' name='virtio'/>
 -
@@ -79,7 +77,7 @@
    <capability os='linux' distro='fedora' name='cirrus'>
      <dep name='xorg-x11-drv-cirrus'/>
    </capability>
-
+ 
 +  <!-- SLES 11 has always supported virtio -->
 +  <capability os='linux' distro='sles' major='11' name='virtio'/>
 +  <capability os='linux' distro='sles' major='10' name='virtio'>
@@ -89,10 +87,6 @@
 +  <capability os='linux' distro='sles' name='cirrus'>
 +    <dep name='xorg-x11-driver-video'/>
 +  </capability>
-+  <!-- Packages required for SLES conversions -->
-+  <capability os='linux' distro='sles' name='pre-convert'>
-+    <dep name='grubby'/>
-+  </capability>
 +
 +  <!-- openSUSE 11/12 has always supported virtio -->
 +  <capability os='linux' distro='opensuse' major='12' name='virtio'/>
@@ -104,18 +98,14 @@
 +  <capability os='linux' distro='opensuse' name='cirrus'>
 +    <dep name='xorg-x11-driver-video'/>
 +  </capability>
-+  <!-- Packages required for openSUSE conversions -->
-+  <capability os='linux' distro='opensuse' name='pre-convert'>
-+    <dep name='grubby'/>
-+  </capability>
 +
    <!-- RHEL clones: copied from above with distro altered -->
    <!-- CentOS -->
    <capability os='linux' distro='centos' major='6' name='virtio'/>
-@@ -83,12 +106,6 @@ the modifications or additions to /etc/v
+@@ -83,12 +98,6 @@ the modifications or additions to /etc/v
    </capability>
    <capability os='linux' distro='scientificlinux' major='4' name='cirrus'/>
-
+ 
 -  <!-- All current versions of fedora package the cirrus driver in
 -       xorg-x11-drv-cirrus -->
 -  <capability os='linux' distro='fedora' name='cirrus'>
@@ -125,30 +115,3 @@
    <!-- This is a place-holder for the 'user-custom' capability, which allows
         the user to install custom packages during linux conversions. Don't 
edit
         this entry; instead add a more specific match rule containing custom
-@@ -184,6 +201,26 @@ the modifications or additions to /etc/v
-     <path>rhel/4/kernel-largesmp-2.6.9-89.EL.x86_64.rpm</path>
-   </app>
-
-+  <!-- SLES
-+       These RPMs are available from the openSUSE Build Service
-+       (https://build.opensuse.org) -->
-+  <app os='linux' distro='sles' major='11' arch='x86_64' name='grubby'>
-+    <path>sles/11/grubby-8.25-10.1.x86_64.rpm</path>
-+  </app>
-+  <app os='linux' distro='sles' major='11' arch='i586' name='grubby'>
-+    <path>sles/11/grubby-8.25-10.1.i586.rpm</path>
-+  </app>
-+
-+  <!-- openSUSE
-+       These RPMs are available from the openSUSE Build Service
-+       (https://build.opensuse.org) -->
-+  <app os='linux' distro='opensuse' major='12' arch='x86_64' name='grubby'>
-+    <path>sles/11/grubby-8.25-10.1.x86_64.rpm</path>
-+  </app>
-+  <app os='linux' distro='opensuse' major='12' arch='i586' name='grubby'>
-+    <path>sles/11/grubby-8.25-10.1.i586.rpm</path>
-+  </app>
-+
-   <!-- Windows -->
-
-   <!-- Each of these should point to the directory containing the appropriate

++++++ add_suse_converter.patch ++++++
--- /var/tmp/diff_new_pack.zHSkUz/_old  2013-09-16 10:18:48.000000000 +0200
+++ /var/tmp/diff_new_pack.zHSkUz/_new  2013-09-16 10:18:48.000000000 +0200
@@ -3,13 +3,13 @@
 
 ---
  MANIFEST                              |    1 
- lib/Sys/VirtConvert/Converter/SUSE.pm | 2406 
++++++++++++++++++++++++++++++++++
- 2 files changed, 2407 insertions(+)
+ lib/Sys/VirtConvert/Converter/SUSE.pm | 2476 
++++++++++++++++++++++++++++++++++
+ 2 files changed, 2477 insertions(+)
 
 diff -Nurp a/lib/Sys/VirtConvert/Converter/SUSE.pm 
b/lib/Sys/VirtConvert/Converter/SUSE.pm
 --- a/lib/Sys/VirtConvert/Converter/SUSE.pm    1969-12-31 17:00:00.000000000 
-0700
-+++ b/lib/Sys/VirtConvert/Converter/SUSE.pm    2013-09-09 16:58:39.555995226 
-0600
-@@ -0,0 +1,2406 @@
++++ b/lib/Sys/VirtConvert/Converter/SUSE.pm    2013-09-14 12:53:52.113423914 
-0600
+@@ -0,0 +1,2476 @@
 +# Sys::VirtConvert::Converter::SUSE
 +# Copyright (C) 2009-2012 SUSE Inc.
 +#
@@ -33,8 +33,8 @@
 +use warnings;
 +
 +
-+# Functions supported by grubby, and therefore common between grub legacy and
-+# grub2
++# Functions common between grub legacy and grub2. All bootloader
++# interactions should eventually go through Bootloader::Tools.
 +package Sys::VirtConvert::Converter::SUSE::Grub;
 +
 +use Sys::VirtConvert::Util;
@@ -47,13 +47,55 @@
 +
 +    my $g = $self->{g};
 +
-+    foreach my $line ($g->command_lines(['grubby', '--info', $path])) {
-+        return $1 if $line =~ /^initrd=(\S+)/;
++    # The default name of the initrd is the same as the kernel name, with
++    # initrd replacing vmlinuz. This can be confirmed with grubby, or
++    # Bootloader::Tools->GetSection, but for now just do the replacement
++    # if the file exists.
++    my $initrd;
++    ($initrd = $path) =~ s/vmlinuz/initrd/;
++    if ($g->exists($initrd)) {
++        return $initrd;
 +    }
 +
 +    v2vdie __x('Didn\'t find initrd for kernel {path}', path => $path);
 +}
 +
++sub get_default_image
++{
++    my $self = shift;
++    my ($path) = @_;
++
++    my $g = $self->{g};
++
++    my $default = $g->command(['/usr/bin/perl',
++                  '-MBootloader::Tools',
++                  '-e', 'InitLibrary(); '.
++                  'my $default=Bootloader::Tools::GetDefaultSection(); '.
++                  'print $default->{image};']);
++    $default =~ s/^\(hd.*\)//;
++
++    return $default;
++}
++
++sub set_default_image
++{
++    my $self = shift;
++    my ($path) = @_;
++
++    my $g = $self->{g};
++
++    # Using the image path to set a default image is not always reliable.
++    # To be safe, get the image name, then set that as the default image.
++    $g->command(['/usr/bin/perl',
++           '-MBootloader::Tools',
++           '-e', 'InitLibrary(); '.
++           'my @sections = '.
++           'GetSectionList(type=>image, image=>"'.$path.'"); '.
++           'my $section = GetSection(@sections); '.
++           'my $newdefault = $section->{name}; '.
++           'SetGlobals(default, "$newdefault");']);
++}
++
 +sub check_efi
 +{
 +    my $self = shift;
@@ -196,13 +238,6 @@
 +        # Prepend the grub filesystem to the kernel path
 +        $kernel = "$grub_fs$kernel" if defined $grub_fs;
 +
-+        # Due to bnc#836521, root can be set to (hd*), instead of (hd*,*)
-+        # when installing a kernel under guestfs.
-+        if ($kernel =~ s/^\(hd.*\)//) {
-+            v2vdie __x('Kernel entry in menu.lst ({kernel}) is not on a '.
-+                        'on a partition. See bnc#836521.', kernel => $kernel);
-+        }
-+
 +        # Check the kernel exists
 +        if ($g->exists($kernel)) {
 +            push(@kernels, $kernel);
@@ -378,7 +413,7 @@
 +    eval { $g->aug_load() };
 +    augeas_error($g, $@) if ($@);
 +
-+    $g->command(['grub-install', $device]);
++    $g->command(['grub-install.unsupported', $device]);
 +}
 +
 +
@@ -428,8 +463,7 @@
 +    my @kernels;
 +
 +    # Start by adding the default kernel
-+    my $default = $g->command(['grubby', '--default-kernel']);
-+    chomp($default);
++    my $default = $self->get_default_image;
 +    push(@kernels, $default) if length($default) > 0;
 +
 +    # This is how the grub2 config generator enumerates kernels
@@ -484,11 +518,16 @@
 +
 +    my $g = $self->{g};
 +
-+    my $default = $g->command(['grubby', '--default-kernel']);
-+    chomp($default);
++    my $default = $self->get_default_image;
 +
 +    if ($default ne $path) {
-+        $g->command(['grubby', '--set-default', $path]);
++        eval {
++            $self->set_default_image($path);
++        };
++        if ($@) {
++            logmsg WARN, __x('Unable to set default kernel to {path}',
++                             path => $path);
++        }
 +    }
 +}
 +
@@ -627,12 +666,6 @@
 +
 +    _init_network($g);
 +
-+    # Install packages required for conversion through a 'pre-convert'
-+    # capability.
-+    if (! _install_capability('pre-convert', $g, $root, $config, $meta, '')) {
-+        v2vdie __('Unable to install packages required for conversion.');
-+    }
-+
 +    my $grub;
 +    $grub = eval
 +        { Sys::VirtConvert::Converter::SUSE::Grub2->new($g, $root, $config) };
@@ -706,8 +739,8 @@
 +    };
 +
 +    if ($@) {
-+        logmsg WARN, __x('Failed to obtain an IP address. Disabling online '.
-+                         'updates. Error message was: {error}', error => $@);
++        logmsg WARN, __x('Failed to obtain an IP address. '.
++                         'Error message was: {error}', error => $@);
 +        return 0;
 +    }
 +
@@ -775,8 +808,7 @@
 +    my ($g, $virtio, $modpath) = @_;
 +
 +    # Make a note of whether we've added scsi_hostadapter
-+    # We need this on RHEL 4/virtio because mkinitrd can't detect root on
-+    # virtio. For simplicity we always ensure this is set for virtio disks.
++    # For simplicity we always ensure this is set for virtio disks.
 +    my $scsi_hostadapter = 0;
 +
 +    eval {
@@ -1618,6 +1650,10 @@
 +    # If we're installing a kernel, check which kernels are there first
 +    my @k_before = $g->glob_expand('/boot/vmlinuz-*') if defined($kernel);
 +
++    # Due to bnc#836521, root can be set to (hd*), instead of (hd*,*)
++    # For the time being, workaround the problem
++    my $pbl_fix = _modify_perlBootloader($g) if defined($kernel);
++
 +    my $success = 0;
 +    eval {
 +        # Try to fetch these dependencies using the guest's native update
@@ -1631,12 +1667,15 @@
 +    };
 +    warn($@) if $@;
 +
++    # Restore the previous bootloader file if previously fixed (to ensure
++    # future updates don't complain
++    _restore_perlBootloader($g) if ($pbl_fix == 1);
++
 +    # Make augeas reload to pick up any altered configuration
 +    eval { $g->aug_load() };
 +    augeas_error($g, $@) if ($@);
 +
-+    # Installing a new kernel in RHEL 5 under libguestfs fails to add a grub
-+    # entry. Find the kernel we installed and ensure it has a grub entry.
++    # Check that the kernel we installed has a grub entry.
 +    if (defined($kernel)) {
 +        foreach my $k ($g->glob_expand('/boot/vmlinuz-*')) {
 +            if (!grep(/^$k$/, @k_before)) {
@@ -2396,6 +2435,37 @@
 +    return 1;
 +}
 +
++# The next two functions create a temporary workaround to bnc#836521. The 
actual
++# fix is in a new perl-Bootloader, which will likely not be on most guests.
++sub _modify_perlBootloader
++{
++    my ($g) = @_;
++    my $module = $g->sh("rpm -ql perl-Bootloader | grep GRUB.pm");
++    chomp($module);
++    my $module_bak = "$module.v2vtmp";
++
++    if ($g->grep('/dev/(?:vx', "$module")) {
++        $g->mv($module, $module_bak);
++        $g->sh("/usr/bin/sed -e's/vx/xv/' $module_bak > $module");
++
++        return 1;
++    }
++
++    return 0;
++}
++
++sub _restore_perlBootloader
++{
++    my ($g) = @_;
++    my $module = $g->sh("rpm -ql perl-Bootloader | grep GRUB.pm");
++    chomp($module);
++    my $module_bak = "$module.v2vtmp";
++
++    if ($g->exists($module_bak)) {
++        $g->mv($module_bak, $module);
++    }
++}
++
 +=back
 +
 +=head1 COPYRIGHT
@@ -2417,8 +2487,8 @@
 +
 +1;
 diff -Nurp a/MANIFEST b/MANIFEST
---- a/MANIFEST 2013-09-09 16:58:21.541042127 -0600
-+++ b/MANIFEST 2013-09-09 16:58:29.861020477 -0600
+--- a/MANIFEST 2013-09-14 12:53:18.321119962 -0600
++++ b/MANIFEST 2013-09-14 12:53:34.471271204 -0600
 @@ -17,6 +17,7 @@ lib/Sys/VirtConvert/Connection/VMwareOVA
  lib/Sys/VirtConvert/Connection/Volume.pm
  lib/Sys/VirtConvert/Converter.pm

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to