diff options
author | gjb <gjb@FreeBSD.org> | 2014-04-23 00:53:16 +0800 |
---|---|---|
committer | gjb <gjb@FreeBSD.org> | 2014-04-23 00:53:16 +0800 |
commit | b46146e4a67a178991478b3f828aa6ef1fffeb09 (patch) | |
tree | 984c3b19cc4041e43da19c88fb44c77072722ba2 /sysutils | |
parent | 4662ded45e92fba46057de87ce30eac547290730 (diff) | |
download | freebsd-ports-gnome-b46146e4a67a178991478b3f828aa6ef1fffeb09.tar.gz freebsd-ports-gnome-b46146e4a67a178991478b3f828aa6ef1fffeb09.tar.zst freebsd-ports-gnome-b46146e4a67a178991478b3f828aa6ef1fffeb09.zip |
Add sysutils/vhdtool, a utility to create VHD files from
raw disk images.
Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/Makefile | 1 | ||||
-rw-r--r-- | sysutils/vhdtool/Makefile | 32 | ||||
-rw-r--r-- | sysutils/vhdtool/distinfo | 2 | ||||
-rw-r--r-- | sysutils/vhdtool/files/patch-Makefile | 23 | ||||
-rw-r--r-- | sysutils/vhdtool/files/patch-vhdtool.c | 40 | ||||
-rw-r--r-- | sysutils/vhdtool/pkg-descr | 10 |
6 files changed, 108 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile index f5b3fbc80342..7eda0c88ae85 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -975,6 +975,7 @@ SUBDIR += vagrant SUBDIR += vbetool SUBDIR += vcp + SUBDIR += vhdtool SUBDIR += videogen SUBDIR += vii SUBDIR += vils diff --git a/sysutils/vhdtool/Makefile b/sysutils/vhdtool/Makefile new file mode 100644 index 000000000000..0ee4048116b9 --- /dev/null +++ b/sysutils/vhdtool/Makefile @@ -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@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> diff --git a/sysutils/vhdtool/distinfo b/sysutils/vhdtool/distinfo new file mode 100644 index 000000000000..0216058e4f1b --- /dev/null +++ b/sysutils/vhdtool/distinfo @@ -0,0 +1,2 @@ +SHA256 (vhdtool-0.1.tar.gz) = cf33bb358904da73a81da1ffa7fa254b620bf0bbbdf4ea36dd2758b5806852f9 +SIZE (vhdtool-0.1.tar.gz) = 6104 diff --git a/sysutils/vhdtool/files/patch-Makefile b/sysutils/vhdtool/files/patch-Makefile new file mode 100644 index 000000000000..2a8d3e338b8a --- /dev/null +++ b/sysutils/vhdtool/files/patch-Makefile @@ -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. diff --git a/sysutils/vhdtool/files/patch-vhdtool.c b/sysutils/vhdtool/files/patch-vhdtool.c new file mode 100644 index 000000000000..33074a2772b1 --- /dev/null +++ b/sysutils/vhdtool/files/patch-vhdtool.c @@ -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; diff --git a/sysutils/vhdtool/pkg-descr b/sysutils/vhdtool/pkg-descr new file mode 100644 index 000000000000..a94f43e3a36f --- /dev/null +++ b/sysutils/vhdtool/pkg-descr @@ -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. |