svn commit: r351863 - in head/sysutils: . vhdtool vhdtool/files
Glen Barber
gjb at FreeBSD.org
Tue Apr 22 16:53:18 UTC 2014
Author: gjb
Date: Tue Apr 22 16:53:16 2014
New Revision: 351863
URL: http://svnweb.freebsd.org/changeset/ports/351863
QAT: https://qat.redports.org/buildarchive/r351863/
Log:
Add sysutils/vhdtool, a utility to create VHD files from
raw disk images.
Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Added:
head/sysutils/vhdtool/
head/sysutils/vhdtool/Makefile (contents, props changed)
head/sysutils/vhdtool/distinfo (contents, props changed)
head/sysutils/vhdtool/files/
head/sysutils/vhdtool/files/patch-Makefile (contents, props changed)
head/sysutils/vhdtool/files/patch-vhdtool.c (contents, props changed)
head/sysutils/vhdtool/pkg-descr (contents, props changed)
Modified:
head/sysutils/Makefile
Modified: head/sysutils/Makefile
==============================================================================
--- head/sysutils/Makefile Tue Apr 22 16:38:29 2014 (r351862)
+++ head/sysutils/Makefile Tue Apr 22 16:53:16 2014 (r351863)
@@ -975,6 +975,7 @@
SUBDIR += vagrant
SUBDIR += vbetool
SUBDIR += vcp
+ SUBDIR += vhdtool
SUBDIR += videogen
SUBDIR += vii
SUBDIR += vils
Added: head/sysutils/vhdtool/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/sysutils/vhdtool/Makefile Tue Apr 22 16:53:16 2014 (r351863)
@@ -0,0 +1,32 @@
+# $FreeBSD$
+
+PORTNAME= vhdtool
+PORTVERSION= 0.1
+CATEGORIES= sysutils
+MASTER_SITES= http://www.glenbarber.us/ports/${CATEGORIES}/${PORTNAME}/ \
+ LOCAL/gjb/${PORTNAME}
+
+MAINTAINER= gjb at FreeBSD.org
+COMMENT= Convert raw disk images to VHD files
+
+LICENSE= GPLv2
+
+USE_LDCONFIG= yes
+LIB_DEPENDS= libuuid.so:${PORTSDIR}/misc/e2fsprogs-libuuid
+CFLAGS+= -I${LOCALBASE}/include \
+ -L${LOCALBASE}/lib \
+ -I${LOCALBASE}/lib \
+ -luuid
+
+PLIST_FILES= bin/${PORTNAME}
+PORTDOCS= README
+
+pre-install:
+ ${MKDIR} ${STAGEDIR}${PREFIX}
+ ${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+.for D in ${PORTDOCS}
+ ${INSTALL_MAN} ${WRKSRC}/${D} ${STAGEDIR}${DOCSDIR}
+.endfor
+
+.include <bsd.port.mk>
Added: head/sysutils/vhdtool/distinfo
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/sysutils/vhdtool/distinfo Tue Apr 22 16:53:16 2014 (r351863)
@@ -0,0 +1,2 @@
+SHA256 (vhdtool-0.1.tar.gz) = cf33bb358904da73a81da1ffa7fa254b620bf0bbbdf4ea36dd2758b5806852f9
+SIZE (vhdtool-0.1.tar.gz) = 6104
Added: head/sysutils/vhdtool/files/patch-Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/sysutils/vhdtool/files/patch-Makefile Tue Apr 22 16:53:16 2014 (r351863)
@@ -0,0 +1,23 @@
+diff --git a/Makefile b/Makefile
+index 78abe03..9cde1f0 100644
+--- Makefile
++++ Makefile
+@@ -1,14 +1,11 @@
+-CC := gcc
+-CFLAGS := -O2 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -g2
+-LDFLAGS := -luuid
+
+ all: vhdtool
+
+-vhdtool: vhdtool.o
+- $(CC) $^ $(LDFLAGS) -o $@
+-
+-vhdtool.o: vhdtool.c
++vhdtool:
++ $(CC) $(CFLAGS) $(LDFLAGS) -o vhdtool vhdtool.c
+
+ clean:
+ rm -f vhdtool vhdtool.o
+
++install:
++ # Nope.
Added: head/sysutils/vhdtool/files/patch-vhdtool.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/sysutils/vhdtool/files/patch-vhdtool.c Tue Apr 22 16:53:16 2014 (r351863)
@@ -0,0 +1,40 @@
+diff --git a/vhdtool.c b/vhdtool.c
+index af4d0eb..04c54c1 100644
+--- vhdtool.c
++++ vhdtool.c
+@@ -23,7 +23,7 @@
+
+ #include <errno.h>
+ #include <stdio.h>
+-#include <endian.h>
++#include <sys/endian.h>
+ #include <inttypes.h>
+ #include <string.h>
+ #include <getopt.h>
+@@ -34,6 +34,8 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+
++#define off64_t __int64_t
++
+ #define COOKIE(x) (*(uint64_t *) x)
+ #define COOKIE32(x) (*(uint32_t *) x)
+ #define FOOTER_FEAT_RSVD (2)
+@@ -152,7 +154,7 @@ int vhd_read(struct vhd *vhd,
+ void *buf,
+ size_t size)
+ {
+- if (lseek64(vhd->fd, vhd->offset, SEEK_SET) != vhd->offset) {
++ if (lseek(vhd->fd, vhd->offset, SEEK_SET) != vhd->offset) {
+ fprintf(stderr, "Error: couldn't seek '%s': %s\n",
+ vhd->name, strerror(errno));
+ return -1;
+@@ -172,7 +174,7 @@ int vhd_write(struct vhd *vhd,
+ void *buf,
+ size_t size)
+ {
+- if (lseek64(vhd->fd, vhd->offset, SEEK_SET) != vhd->offset) {
++ if (lseek(vhd->fd, vhd->offset, SEEK_SET) != vhd->offset) {
+ fprintf(stderr, "Error: couldn't seek '%s': %s\n",
+ vhd->name, strerror(errno));
+ return -1;
Added: head/sysutils/vhdtool/pkg-descr
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/sysutils/vhdtool/pkg-descr Tue Apr 22 16:53:16 2014 (r351863)
@@ -0,0 +1,10 @@
+vmdktool converts raw filesystems to VMDK files and vice versa.
+
+VMDK files can be imported directly into most Virtual Machine servers
+as guest filesystems. Automatic machine deployments into products
+such as VMware's ESXi and VirtualBox requires the ability to construct
+VMDK files as the initial filesystem images for the created guests.
+
+vmdktool is free.
+
+Contact the author with any questions or comments.
More information about the svn-ports-head
mailing list