From 86bfedb6897489d9cf27416b5cd61492334524798c25778b81ebb12962e4661b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Date: Wed, 22 Jun 2016 19:08:28 +0000 Subject: [PATCH] Accepting request 404088 from home:cbosdonnat:branches:Virtualization - Fix virt-filesystem -l for btrfs. bsc#980092 - Add p2v support (fate#316274) OBS-URL: https://build.opensuse.org/request/show/404088 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=360 --- 0000-hotfix.patch | 865 +++++++++++++++++++++++++++++++++++++++++++++ libguestfs.changes | 6 + libguestfs.spec | 47 ++- 3 files changed, 905 insertions(+), 13 deletions(-) diff --git a/0000-hotfix.patch b/0000-hotfix.patch index bc10c38..e823029 100644 --- a/0000-hotfix.patch +++ b/0000-hotfix.patch @@ -1274,3 +1274,868 @@ Index: libguestfs-1.32.4/v2v/test-v2v-i-ova-subfolders.sh +diff -u test-v2v-i-ova-subfolders.expected $d/source + +rm -rf $d +Index: libguestfs-1.32.4/cat/filesystems.c +=================================================================== +--- libguestfs-1.32.4.orig/cat/filesystems.c ++++ libguestfs-1.32.4/cat/filesystems.c +@@ -477,9 +477,28 @@ do_output_filesystems (void) + } + } + if ((columns & COLUMN_SIZE)) { +- size = guestfs_blockdev_getsize64 (g, fses[i]); +- if (size == -1) ++ CLEANUP_FREE char *device = guestfs_mountable_device (g, fses[i]); ++ CLEANUP_FREE char *subvolume = NULL; ++ ++ guestfs_push_error_handler (g, NULL, NULL); ++ ++ subvolume = guestfs_mountable_subvolume (g, fses[i]); ++ if (subvolume == NULL && guestfs_last_errno (g) != EINVAL) { ++ fprintf (stderr, ++ _("%s: cannot determine the subvolume for %s: %s: %s\n"), ++ guestfs_int_program_name, fses[i], ++ guestfs_last_error (g), ++ strerror (guestfs_last_errno (g))); + exit (EXIT_FAILURE); ++ } ++ ++ guestfs_pop_error_handler (g); ++ ++ if (!device || !subvolume) { ++ size = guestfs_blockdev_getsize64 (g, fses[i]); ++ if (size == -1) ++ exit (EXIT_FAILURE); ++ } + } + + if (is_md (fses[i])) +Index: libguestfs-1.32.4/.gitignore +=================================================================== +--- libguestfs-1.32.4.orig/.gitignore ++++ libguestfs-1.32.4/.gitignore +@@ -321,6 +321,7 @@ Makefile.in + /p2v/stamp-virt-p2v.pod + /p2v/stamp-virt-p2v-make-disk.pod + /p2v/stamp-virt-p2v-make-kickstart.pod ++/p2v/stamp-virt-p2v-make-kiwi.pod + /p2v/test-virt-p2v-pxe.id_rsa + /p2v/test-virt-p2v-pxe.id_rsa.pub + /p2v/test-virt-p2v-pxe.img +@@ -335,6 +336,8 @@ Makefile.in + /p2v/virt-p2v-make-disk.1 + /p2v/virt-p2v-make-kickstart + /p2v/virt-p2v-make-kickstart.1 ++/p2v/virt-p2v-make-kiwi ++/p2v/virt-p2v-make-kiwi.1 + /perl/_build + /perl/bindtests.pl + /perl/blib +Index: libguestfs-1.32.4/configure.ac +=================================================================== +--- libguestfs-1.32.4.orig/configure.ac ++++ libguestfs-1.32.4/configure.ac +@@ -159,6 +159,8 @@ AC_CONFIG_FILES([p2v/virt-p2v-make-disk] + [chmod +x,-w p2v/virt-p2v-make-disk]) + AC_CONFIG_FILES([p2v/virt-p2v-make-kickstart], + [chmod +x,-w p2v/virt-p2v-make-kickstart]) ++AC_CONFIG_FILES([p2v/virt-p2v-make-kiwi], ++ [chmod +x,-w p2v/virt-p2v-make-kiwi]) + AC_CONFIG_FILES([php/extension/php-for-tests.sh], + [chmod +x,-w php/extension/php-for-tests.sh]) + AC_CONFIG_FILES([pick-guests.pl], +Index: libguestfs-1.32.4/p2v/Makefile.am +=================================================================== +--- libguestfs-1.32.4.orig/p2v/Makefile.am ++++ libguestfs-1.32.4/p2v/Makefile.am +@@ -21,6 +21,8 @@ EXTRA_DIST = \ + HACKING \ + dependencies.m4 \ + issue \ ++ kiwi-config.sh \ ++ kiwi-config.xml.in \ + launch-virt-p2v.in \ + p2v.ks.in \ + p2v.service \ +@@ -28,15 +30,19 @@ EXTRA_DIST = \ + virt-p2v-make-disk.in \ + virt-p2v-make-disk.pod \ + virt-p2v-make-kickstart.in \ +- virt-p2v-make-kickstart.pod ++ virt-p2v-make-kickstart.pod \ ++ virt-p2v-make-kiwi.in \ ++ virt-p2v-make-kiwi.pod + + CLEANFILES = \ + stamp-virt-p2v.pod \ + stamp-virt-p2v-make-disk.pod \ + stamp-virt-p2v-make-kickstart.pod \ ++ stamp-virt-p2v-make-kiwi.pod \ + virt-p2v.1 \ + virt-p2v-make-disk.1 \ +- virt-p2v-make-kickstart.1 ++ virt-p2v-make-kickstart.1 \ ++ virt-p2v-make-kiwi.1 + + # Although virt-p2v is a regular binary, it is not usually installed + # in /usr/bin since it only functions when contained in an ISO or PXE +@@ -83,7 +89,7 @@ virt_p2v_LDADD = \ + ../gnulib/lib/libgnu.la + + # Scripts to build the disk image, USB key, or kickstart. +-bin_SCRIPTS = virt-p2v-make-disk virt-p2v-make-kickstart ++bin_SCRIPTS = virt-p2v-make-disk virt-p2v-make-kickstart virt-p2v-make-kiwi + + dependencies_files = \ + dependencies.archlinux \ +@@ -103,6 +109,8 @@ virtp2vdatadir = $(datadir)/virt-p2v + virtp2vdata_DATA = \ + $(dependencies_files) \ + issue \ ++ kiwi-config.sh \ ++ kiwi-config.xml.in \ + launch-virt-p2v \ + p2v.ks.in \ + p2v.service +@@ -118,12 +126,14 @@ launch-virt-p2v: launch-virt-p2v.in + man_MANS = \ + virt-p2v.1 \ + virt-p2v-make-disk.1 \ +- virt-p2v-make-kickstart.1 ++ virt-p2v-make-kickstart.1 \ ++ virt-p2v-make-kiwi.1 + + noinst_DATA = \ + $(top_builddir)/website/virt-p2v.1.html \ + $(top_builddir)/website/virt-p2v-make-disk.1.html \ +- $(top_builddir)/website/virt-p2v-make-kickstart.1.html ++ $(top_builddir)/website/virt-p2v-make-kickstart.1.html \ ++ $(top_builddir)/website/virt-p2v-make-kiwi.1.html + + virt-p2v.1 $(top_builddir)/website/virt-p2v.1.html: stamp-virt-p2v.pod + +@@ -156,6 +166,17 @@ stamp-virt-p2v-make-kickstart.pod: virt- + --license GPLv2+ \ + --warning safe \ + $< ++ touch $@ ++ ++virt-p2v-make-kiwi.1 $(top_builddir)/website/virt-p2v-make-kiwi.1.html: stamp-virt-p2v-make-kiwi.pod ++ ++stamp-virt-p2v-make-kiwi.pod: virt-p2v-make-kiwi.pod ++ $(PODWRAPPER) \ ++ --man virt-p2v-make-kiwi.1 \ ++ --html $(top_builddir)/website/virt-p2v-make-kiwi.1.html \ ++ --license GPLv2+ \ ++ --warning safe \ ++ $< + touch $@ + + # Tests. +Index: libguestfs-1.32.4/p2v/dependencies.m4 +=================================================================== +--- libguestfs-1.32.4.orig/p2v/dependencies.m4 ++++ libguestfs-1.32.4/p2v/dependencies.m4 +@@ -90,16 +90,18 @@ ifelse(SUSE,1, + pcre + libxml2 + gtk2 +- /usr/bin/ssh +- /usr/bin/qemu-nbd ++ qemu-tools ++ openssh + curl + hwdata +- /usr/bin/xinit +- /usr/bin/Xorg ++ xinit ++ xorg-x11-server + xf86-video-* +- metacity + NetworkManager +- nm-connection-editor +- network-manager-applet +- dbus-x11 ++ xf86-input-* ++ icewm-lite ++ dbus-1-x11 ++ yast2-network ++ libyui-qt ++ SuSEfirewall2 + ) +Index: libguestfs-1.32.4/p2v/gui.c +=================================================================== +--- libguestfs-1.32.4.orig/p2v/gui.c ++++ libguestfs-1.32.4/p2v/gui.c +@@ -381,7 +381,10 @@ test_connection_thread (void *data) + static void + configure_network_button_clicked (GtkWidget *w, gpointer data) + { +- ignore_value (system ("nm-connection-editor &")); ++ if (access ("/sbin/yast2", X_OK) >= 0) ++ ignore_value (system ("yast2 lan &")); ++ else ++ ignore_value (system ("nm-connection-editor &")); + } + + static void +Index: libguestfs-1.32.4/p2v/kiwi-config.sh +=================================================================== +--- /dev/null ++++ libguestfs-1.32.4/p2v/kiwi-config.sh +@@ -0,0 +1,73 @@ ++#!/bin/bash ++#================ ++# FILE : config.sh ++#---------------- ++# PROJECT : OpenSuSE KIWI Image System ++# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved ++# : ++# AUTHOR : Marcus Schaefer ++#====================================== ++# Functions... ++#-------------------------------------- ++test -f /.kconfig && . /.kconfig ++test -f /.profile && . /.profile ++ ++#====================================== ++# Greeting... ++#-------------------------------------- ++echo "Configure image: [$kiwi_iname]..." ++ ++#====================================== ++# Mount system filesystems ++#-------------------------------------- ++baseMount ++ ++#====================================== ++# Setup baseproduct link ++#-------------------------------------- ++suseSetupProduct ++ ++#====================================== ++# Add missing gpg keys to rpm ++#-------------------------------------- ++suseImportBuildKey ++ ++#====================================== ++# Activate services ++#-------------------------------------- ++suseInsertService p2v ++ ++#====================================== ++# Setup default target, multi-user ++#-------------------------------------- ++baseSetRunlevel 3 ++ ++#========================================== ++# remove package docs ++#------------------------------------------ ++rm -rf /usr/share/doc/packages/* ++rm -rf /usr/share/doc/manual/* ++rm -rf /opt/kde* ++ ++# Update the default getty target to login automatically as root without ++# prompting for a password ++sed -i 's/^ExecStart=\(.*\)/ExecStart=\1 -a root/' \ ++ /usr/lib/systemd/system/getty@.service ++ ++# Reserve tty1 as a getty so we can document it clearly ++echo ReserveVT=1 >> /etc/systemd/logind.conf ++ ++sed -i 's/^ROOT_USES_LANG=.*$/ROOT_USES_LANG="yes"/' \ ++ /etc/sysconfig/language ++ ++#====================================== ++# SuSEconfig ++#-------------------------------------- ++suseConfig ++ ++#====================================== ++# Umount kernel filesystems ++#-------------------------------------- ++baseCleanMount ++ ++exit 0 +Index: libguestfs-1.32.4/p2v/kiwi-config.xml.in +=================================================================== +--- /dev/null ++++ libguestfs-1.32.4/p2v/kiwi-config.xml.in +@@ -0,0 +1,92 @@ ++ ++ ++ ++ Marcus Schäfer ++ ms@suse.com ++ P2V __PACKAGE_VERSION__ ++ ++ ++ ++ ++ ++ ++ ++ __PACKAGE_VERSION__ ++ zypper ++ en_US ++ us.map.gz ++ utc ++ __BRANDING__ ++ __BRANDING__ ++ true ++ false ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +Index: libguestfs-1.32.4/p2v/launch-virt-p2v.in +=================================================================== +--- libguestfs-1.32.4.orig/p2v/launch-virt-p2v.in ++++ libguestfs-1.32.4/p2v/launch-virt-p2v.in +@@ -22,8 +22,20 @@ + # and virt-p2v. + if [ "$1" = "run" ]; then + cd / +- metacity & +- nm-applet & ++ ID= ++ if test -f /etc/os-release; then ++ . /etc/os-release ++ fi ++ ++ case "$ID" in ++ sles|opensuse) ++ # not all versions of SLE / openSUSE ship metacity and nm-applet ++ icewm & ++ ;; ++ *) ++ metacity & ++ nm-applet & ++ esac + exec @libexecdir@/virt-p2v + else + xinit "$0" run +Index: libguestfs-1.32.4/p2v/utils.c +=================================================================== +--- libguestfs-1.32.4.orig/p2v/utils.c ++++ libguestfs-1.32.4/p2v/utils.c +@@ -143,7 +143,7 @@ get_if_vendor (const char *if_name, int + */ + + /* XXX We could make this configurable. */ +-#define NETWORK_ONLINE_COMMAND "nm-online -t 30" ++#define NETWORK_ONLINE_COMMAND "nm-online -t 30 -x" + + void + wait_network_online (const struct config *config) +Index: libguestfs-1.32.4/p2v/virt-p2v-make-disk.pod +=================================================================== +--- libguestfs-1.32.4.orig/p2v/virt-p2v-make-disk.pod ++++ libguestfs-1.32.4/p2v/virt-p2v-make-disk.pod +@@ -148,6 +148,7 @@ L above). If not set, a compile + + L, + L, ++L, + L, + L. + +Index: libguestfs-1.32.4/p2v/virt-p2v-make-kiwi.in +=================================================================== +--- /dev/null ++++ libguestfs-1.32.4/p2v/virt-p2v-make-kiwi.in +@@ -0,0 +1,228 @@ ++#!/bin/bash - ++# @configure_input@ ++# virt-p2v-make-kiwi ++# Copyright (C) 2016 SUSE. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++ ++unset CDPATH ++ ++program="virt-p2v-make-kiwi" ++version="@PACKAGE_VERSION@" ++ ++TEMP=`getopt \ ++ -o o:V \ ++ --long help,inject-ssh-identity:,output:,version \ ++ -n $program -- "$@"` ++if [ $? != 0 ]; then ++ echo "$program: problem parsing the command line arguments" ++ exit 1 ++fi ++eval set -- "$TEMP" ++ ++usage () ++{ ++ echo "Usage:" ++ echo " $program [--options] [-o kiwi-folder]" ++ echo ++ echo "Read $program(1) man page for more information." ++ exit $1 ++} ++ ++output=p2v.kiwi ++ssh_identity= ++ ++while true; do ++ case "$1" in ++ --inject-ssh-identity) ++ ssh_identity="$2" ++ shift 2;; ++ -o|--output) ++ output="$2" ++ shift 2;; ++ -V|--version) ++ echo "$program $version" ++ exit 0;; ++ --help) ++ usage 0;; ++ --) ++ shift ++ break;; ++ *) ++ echo "internal error ($1)" ++ exit 1;; ++ esac ++done ++ ++set -e ++ ++# Deal with stupid autotools libexecdir-not-expandable crap. ++prefix="@prefix@" ++exec_prefix="@exec_prefix@" ++libexecdir="@libexecdir@" ++ ++if [ -n "$VIRT_P2V_DATA_DIR" ]; then ++ datadir="$VIRT_P2V_DATA_DIR" ++ host_libexecdir="$VIRT_P2V_DATA_DIR" ++else ++ datadir="@datadir@/virt-p2v" ++ host_libexecdir="@libexecdir@" ++fi ++ ++# Dependencies. Since kiwi is SUSE-specific, only include ++# dependencies.suse here. ++depsfile="$datadir/dependencies.suse" ++if [ ! -f "$depsfile" ]; then ++ echo "$0: cannot find dependencies file ($depsfile)" ++ exit 1 ++fi ++dependencies= ++while read line; do ++ if [ -n "$line" ]; then ++ depname=$(echo $line | awk '{gsub(/ /, "", $0); print}') ++ pkg=" " ++ if [ -z "$dependencies" ]; then ++ dependencies="$pkg" ++ else ++ dependencies="$dependencies ++$pkg" ++ fi ++ fi ++done < $depsfile ++ ++# Compute the distro-dependent pieces for kiwi ++branding= ++release_pkg= ++base_pattern= ++kiwi_boot= ++repos= ++. /etc/os-release ++case "$NAME" in ++ SLES) ++ branding="SLE" ++ release_pkg="sles-release" ++ base_pattern="patterns-sles-Minimal" ++ case "$VERSION_ID" in ++ 12) ++ kiwi_boot="SLES12" ++ repos="http://download.suse.de/ibs/SUSE:/SLE-12:/Update/standard ++ http://download.suse.de/ibs/SUSE:/SLE-12:/GA/standard" ++ ;; ++ 12.1) ++ kiwi_boot="SLES12" ++ repos="http://download.suse.de/ibs/SUSE:/SLE-12-SP1:/Update/standard ++ http://download.suse.de/ibs/SUSE:/SLE-12-SP1:/GA/standard ++ http://download.suse.de/ibs/SUSE:/SLE-12:/Update/standard ++ http://download.suse.de/ibs/SUSE:/SLE-12:/GA/standard" ++ ;; ++ *) ++ echo "Unsupported distribution $NAME $VERSION_ID" ++ exit 1;; ++ esac;; ++ openSUSE*) ++ branding="openSUSE" ++ release_pkg="openSUSE-release" ++ base_pattern="patterns-openSUSE-base" ++ case "$VERSION" in ++ 13.1\ *) ++ kiwi_boot="13.1" ++ repos="obs://13.1/repo/oss" ++ ;; ++ 13.2\ *) ++ kiwi_boot="13.2" ++ repos="obs://13.2/repo/oss" ++ ;; ++ 42.1) ++ kiwi_boot="leap42.1" ++ repos="obs://leap/42.1/repo/oss" ++ ;; ++ *\ \(Tumbleweed\)) ++ kiwi_boot="leap42.1" ++ repos="obs://openSUSE:Factory/standard" ++ ;; ++ *) ++ echo "Unsupported distribution $NAME $VERSION_ID" ++ exit 1;; ++ esac;; ++ *) ++ echo "Unsupported distribution $NAME $VERSION" ++ exit 1;; ++esac ++ ++# Compute the repos ++repos_xml= ++for repo in $repos; do ++ repos_xml=" \n \n \n$repos_xml" ++done ++ ++mkdir $output ++cp $datadir/kiwi-config.sh $output/config.sh ++ ++mkdir -p $output/root/etc/sysconfig/network ++cat >$output/root/etc/sysconfig/network/ifcfg-eth0 << EOF ++BOOTPROTO='dhcp' ++MTU='' ++REMOTE_IPADDR='' ++STARTMODE='onboot' ++EOF ++ ++mkdir -p $output/root/etc/systemd/system ++cp $datadir/p2v.service $output/root/etc/systemd/system ++ ++mkdir -p $output/root/etc/udev/rules.d ++cat >$output/root/etc/udev/rules.d/70-persistent-net.rules </, dependencies); ++ gsub (/__LIBEXECDIR__/, libexecdir); ++ gsub (/__BRANDING__/, branding); ++ gsub (/__RELEASE_PKG__/, release_pkg); ++ gsub (/__BASE_PATTERN__/, base_pattern); ++ gsub (/__KIWI_BOOT__/, kiwi_boot); ++ gsub (//, repos); ++ print; ++ }' \ ++ $datadir/kiwi-config.xml.in > $output/config.xml ++ ++echo "kiwi config folder written to $output" +Index: libguestfs-1.32.4/p2v/virt-p2v-make-kiwi.pod +=================================================================== +--- /dev/null ++++ libguestfs-1.32.4/p2v/virt-p2v-make-kiwi.pod +@@ -0,0 +1,184 @@ ++=head1 NAME ++ ++virt-p2v-make-kiwi - Build the virt-p2v kiwi configuration ++ ++=head1 SYNOPSIS ++ ++ virt-p2v-make-kiwi [--inject-ssh-identity path] [-o kiwi-folder] ++ ++=head1 DESCRIPTION ++ ++L converts a physical machine to run virtualized on KVM, ++managed by libvirt, OpenStack, oVirt, Red Hat Enterprise ++Virtualisation (RHEV), or one of the other targets supported by ++L. ++ ++Kiwi is a tool used mainly by SUSE Linux Enterprise and openSUSE to ++build live CDs, make appliances and so on. It is driven by a few files ++including an xml description of the machine. ++ ++virt-p2v-make-kiwi builds a folder containing all the pieces needed for ++kiwi to build a bootable P2V live CD ISO, USB key, or PXE image. This tool ++only builds the kiwi configuration, but this manual page describes some of ++the ways you can use the kickstart file. ++ ++=head1 BUILDING THE KIWI CONFIGURATION ++ ++Using virt-p2v-make-kiwi is very simple: ++ ++ virt-p2v-make-kiwi ++ ++will build a kiwi configuration based on the current machine's distribution. ++ ++To control the name of the output folder, use the I<-o> parameter. ++ ++=head1 BUILDING A LIVE CD / ISO ++ ++Once you have the kiwi configuration folder, you can use L to make a ++live CD: ++ ++ sudo kiwi --build p2v.kiwi -d build --type iso ++ ++Before running this, you may have to tweak the C file ++to change the locale and keyboard mapping to the one you need. ++ ++If running on a SUSE Linux Entreprise Server, add the path to your packages repositories ++using the C<--ignore-repos> and C<--add-repo> kiwi parameters. ++ ++The generated ISO image will be placed in the C folder. ++ ++=head1 BUILDING A BOOTABLE USB KEY ++ ++Use the L program to write the ISO created above to a USB key: ++ ++ sudo dd if=path/to/p2v.iso of=/dev/sdX ++ ++=head1 BUILDING A PXE BOOT IMAGE ++ ++To create a PXE boot image, run kiwi in such a way: ++ ++ sudo kiwi --build $PWD/p2v.kiwi -d build --add-profile netboot --type pxe ++ ++For more details on how to use the generated image, report to the kiwi documentation ++on PXE images: L ++ ++=head1 ADDING AN SSH IDENTITY ++ ++You can inject an SSH identity (private key) file to the kiwi config and ++hence into the ISO using the I<--inject-ssh-identity> option. Note ++that you I inject a key once the ISO has been built. ++ ++First create a key pair. It must have an empty passphrase: ++ ++ ssh-keygen -t rsa -N '' -f id_rsa ++ ++This creates a private key (C) and a public key ++(C) pair. The public key should be appended to the ++C file on the virt-v2v conversion server (usually to ++C). ++ ++The private key should be added to the kiwi config and then ++discarded: ++ ++ virt-p2v-make-kiwi [...] --inject-ssh-identity id_rsa ++ rm id_rsa ++ ++The ISO can then be built from the kickstart in the usual way (see ++above), and it will contain the embedded SSH identity ++(F). ++ ++When booting virt-p2v, specify the URL of the injected file like this: ++ ++ │ User name: [root_____________________________] │ ++ │ │ ++ │ Password: [ ] │ ++ │ │ ++ │ SSH Identity URL: [file:///var/tmp/id_rsa___________] │ ++ ++or if using the kernel command line, add: ++ ++ p2v.identity=file:///var/tmp/id_rsa ++ ++For more information, see L. ++ ++=head1 OPTIONS ++ ++=over 4 ++ ++=item B<--help> ++ ++Display help. ++ ++=item B<--inject-ssh-identity> id_rsa ++ ++Add an SSH identity (private key) file into the kickstart. ++See L above. ++ ++=item B<-o> OUTPUT ++ ++=item B<--output> OUTPUT ++ ++Write kiwi configuration to the C folder. If not specified, the default is ++F in the current directory. ++ ++=item B<-V> ++ ++=item B<--version> ++ ++Display version number and exit. ++ ++=back ++ ++=head1 FILES ++ ++=over 4 ++ ++=item F<$libexecdir/virt-p2v> ++ ++The L binary which is copied into the kiwi configuration. ++ ++The location of the binary can be changed by setting the ++C environment variable. ++ ++=item F<$datadir/virt-p2v/issue> ++ ++=item F<$datadir/virt-p2v/launch-virt-p2v.in> ++ ++=item F<$datadir/virt-p2v/kiwi> ++ ++=item F<$datadir/virt-p2v/p2v.service> ++ ++Various data files that are used to make the kiwi appliance. ++ ++The location of these files can be changed by setting the ++C environment variable. ++ ++=back ++ ++=head1 ENVIRONMENT VARIABLES ++ ++=over 4 ++ ++=item C ++ ++The directory where virt-p2v-make-kiwi looks for data files and ++the virt-p2v binary (see L above). If not set, a compiled-in ++location is used. ++ ++=back ++ ++=head1 SEE ALSO ++ ++L, ++L, ++L, ++L, ++L. ++ ++=head1 AUTHORS ++ ++Cédric Bosdonnat ++ ++=head1 COPYRIGHT ++ ++Copyright (C) 2016 SUSE Ltd. +Index: libguestfs-1.32.4/p2v/virt-p2v.pod +=================================================================== +--- libguestfs-1.32.4.orig/p2v/virt-p2v.pod ++++ libguestfs-1.32.4/p2v/virt-p2v.pod +@@ -725,6 +725,7 @@ control connection to be displayed in th + + L, + L, ++L, + L, + L, + L, diff --git a/libguestfs.changes b/libguestfs.changes index 7b66df3..2b1d8f6 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jun 8 13:02:30 UTC 2016 - cbosdonnat@suse.com + +- Fix virt-filesystem -l for btrfs. bsc#980092 +- Add p2v support (fate#316274) + ------------------------------------------------------------------- Mon Mar 14 08:41:08 UTC 2016 - cbosdonnat@suse.com diff --git a/libguestfs.spec b/libguestfs.spec index fb66c33..c21b697 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -48,7 +48,6 @@ Release: 0 %bcond_without zerofree %bcond_with ext4_writeable %endif -%define with_p2v 0 %bcond_without fuse @@ -58,6 +57,8 @@ Release: 0 %bcond_with ruby_bindings %endif +%bcond_with p2v + %if %suse_version >= 1230 %bcond_without bash_completion %else @@ -122,7 +123,7 @@ Release: 0 # Name: libguestfs %if "%{?_ignore_exclusive_arch}" == "" -ExclusiveArch: x86_64 ppc64 ppc64le s390x aarch64 +ExclusiveArch: x86_64 i586 ppc64 ppc64le s390x aarch64 %endif %{ocaml_preserve_bytecode} BuildRequires: aaa_base @@ -188,7 +189,7 @@ BuildRequires: hivex BuildRequires: hivex-devel %endif # -%if %{with_p2v} +%if %{with p2v} BuildRequires: gtk2-devel %endif # @@ -540,6 +541,19 @@ virt-v2v is a tool for converting and importing virtual machines to libvirt-managed KVM, or Red Hat Enterprise Virtualization. It can import a variety of guest operating systems from libvirt-managed hosts and VMware ESX. +%if %{with p2v} +%package -n virt-p2v +Summary: Convert a virtual machine to run on KVM +License: GPL-2.0 +Group: System/Management +Requires: virt-v2v = %{version} + +%description -n virt-p2v +virt-v2v is a tool for converting and importing virtual machines to +libvirt-managed KVM, or Red Hat Enterprise Virtualization. It can import a +variety of guest operating systems from libvirt-managed hosts and VMware ESX. +%endif + %prep : _ignore_exclusive_arch '%{?_ignore_exclusive_arch}' %setup -q -a 789653 @@ -570,15 +584,8 @@ else CFLAGS="$CFLAGS -DGUESTFS_QEMU_NO_VIRTIO_BLK" CXXFLAGS="$CXXFLAGS -DGUESTFS_QEMU_NO_VIRTIO_BLK" fi -am_version="`automake --version | awk '/^automake \(GNU automake\) / { print $4 }'`" -if test -n "${am_version}" -then - case "${am_version}" in - 1.10) ;; - 1.10.*) ;; - *) autoreconf -fi ;; - esac -fi +autoreconf -fi + # %configure \ --help || : @@ -674,6 +681,11 @@ rm -rf $RPM_BUILD_ROOT/tmp %endif %endif +%if %{with p2v} +# Remove the kickstart files from p2v package +rm $RPM_BUILD_ROOT/%{_datadir}/virt-p2v/p2v.ks.in +%endif + %clean rm -rf $RPM_BUILD_ROOT @@ -765,6 +777,7 @@ rm -rf $RPM_BUILD_ROOT %{_sbindir}/libguestfs-make-fixed-appliance %{_bindir}/* %exclude %{_bindir}/virt-v2v +%exclude %{_bindir}/virt-p2v-* %config(noreplace) /etc/libguestfs-tools.conf /etc/virt-builder %dir /etc/xdg/virt-builder @@ -776,6 +789,7 @@ rm -rf $RPM_BUILD_ROOT %endif %{_mandir}/man1/* %exclude %{_mandir}/man1/virt-v2v.* +%exclude %{_mandir}/man1/virt-p2v* %{_mandir}/man5/* %files -n virt-v2v @@ -783,9 +797,16 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/virt-v2v %{_datadir}/bash-completion/*/virt-v2v %{_mandir}/man1/virt-v2v.* -%if %{with_p2v} + +%if %{with p2v} +%files -n virt-p2v +%defattr(-,root,root) %{_prefix}/lib/virt-p2v %{_datadir}/virt-p2v +%{_bindir}/virt-p2v-make-kiwi +%{_bindir}/virt-p2v-make-disk +%{_mandir}/man1/virt-p2v-make-kiwi* +%{_mandir}/man1/virt-p2v-make-disk* %endif %changelog