Skip to content

Commit

Permalink
Add utlity to create vhd file from raw disk image. Removes the depend…
Browse files Browse the repository at this point in the history
…ency on qemu for azure
  • Loading branch information
suezzelur authored and sjohngeorge committed Aug 28, 2015
1 parent 3ca41d4 commit 6a5f8f0
Show file tree
Hide file tree
Showing 3 changed files with 811 additions and 2 deletions.
9 changes: 7 additions & 2 deletions support/cloud-image-builder/azure/mk-azure-image.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

PHOTON_IMG_OUTPUT_PATH=$1
qemu-img create -f vpc -o subformat=fixed $PHOTON_IMG_OUTPUT_PATH/photon-azure.vhd 2G
qemu-img convert -f raw -O vpc $PHOTON_IMG_OUTPUT_PATH/photon-azure.raw $PHOTON_IMG_OUTPUT_PATH/photon-azure.vhd
SRC_ROOT=$2
cd $SRC_ROOT/tools/src/imgconverter
mkdir -p $SRC_ROOT/tools/bin
make clean
make
$SRC_ROOT/tools/bin/imgconverter -i $PHOTON_IMG_OUTPUT_PATH/photon-azure.raw -v vhd -o $PHOTON_IMG_OUTPUT_PATH/photon-azure.vhd
exit 0
10 changes: 10 additions & 0 deletions tools/src/imgconverter/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
INLUDEDIR=/usr/include
LIBDIR=/usr/lib

all: img-converter

clean:
$(RM) ../../bin/imgconverter

img-converter: imgConverter.c
$(CXX) -o ../../bin/imgconverter -I$(INCLUDEDIR) -L$(LIBDIR) $? -ldl -lz -luuid
Loading

0 comments on commit 6a5f8f0

Please sign in to comment.