Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
p2v: virt-p2v-make-disk: Allow --arch parameter to be supplied.
This allows you to easily build a 32 bit virt-p2v USB key, even on a
64 bit host.
  • Loading branch information
rwmjones committed Jan 18, 2016
1 parent 727ac63 commit d723b35
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
6 changes: 5 additions & 1 deletion p2v/virt-p2v-make-disk.in
Expand Up @@ -24,7 +24,7 @@ version="@PACKAGE_VERSION@"

TEMP=`getopt \
-o o:V \
--long help,inject-ssh-identity:,output:,version \
--long arch:,help,inject-ssh-identity:,output:,version \
-n $program -- "$@"`
if [ $? != 0 ]; then
echo "$program: problem parsing the command line arguments"
Expand All @@ -46,6 +46,9 @@ usage ()

while true; do
case "$1" in
--arch)
arch="--arch $2"
shift 2;;
--inject-ssh-identity)
upload="--upload $2:/var/tmp/id_rsa"
shift 2;;
Expand Down Expand Up @@ -155,6 +158,7 @@ done < $depsfile
# could provide a sysvinit fallback if required.
virt-builder "$osversion" \
--output "$output" \
$arch \
--update \
--install "$install" \
--root-password password:p2v \
Expand Down
20 changes: 20 additions & 0 deletions p2v/virt-p2v-make-disk.pod
Expand Up @@ -36,6 +36,13 @@ is erased), using Fedora 20 as the base distribution:

virt-p2v-make-disk -o /dev/sdX fedora-20

Use a 32 bit Fedora environment, useful for converting older hardware
(note that 32 bit virt-p2v can convert 64 bit physical machines and
can interoperate with 64 bit virt-v2v and 64 bit hypervisors just
fine):

virt-p2v-make-disk -o /dev/sdX --arch i686 fedora-20

Write a virt-p2v bootable virtual disk image, and boot it under qemu:

virt-p2v-make-disk -o /var/tmp/p2v.img fedora-20
Expand Down Expand Up @@ -88,6 +95,19 @@ For more information, see L<virt-p2v(1)/SSH IDENTITIES>.

Display help.

=item B<--arch> ARCH

Set the architecture of the virt-p2v ISO.

This is most usefully set to I<--arch i686>, which builds a 32 bit
virt-p2v environment that will work on older hardware. 32 bit
virt-p2v can convert 64 bit physical machines and can interoperate
with 64 bit virt-v2v and 64 bit hypervisors, so there's no downside to
using this option.

If this option is not supplied, then the default is to use the same
architecture as the host that is running virt-p2v-make-disk.

=item B<--inject-ssh-identity> id_rsa

Add an SSH identity (private key) file into the image.
Expand Down

0 comments on commit d723b35

Please sign in to comment.