forked from vmware/photon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add utlity to create vhd file from raw disk image. Removes the depend…
…ency on qemu for azure
- Loading branch information
1 parent
3ca41d4
commit 6a5f8f0
Showing
3 changed files
with
811 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.