summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/genimage/Makefile26
-rw-r--r--sysutils/genimage/distinfo3
-rw-r--r--sysutils/genimage/files/patch-config.c19
-rw-r--r--sysutils/genimage/files/patch-image-android-sparse.c11
-rw-r--r--sysutils/genimage/files/patch-image-hd.c11
-rw-r--r--sysutils/genimage/files/patch-image-rauc.c11
-rw-r--r--sysutils/genimage/files/patch-image-vfat.c11
-rw-r--r--sysutils/genimage/pkg-descr8
9 files changed, 101 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 5ad5cf480cea..64f22e349622 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -472,6 +472,7 @@
SUBDIR += gdisk
SUBDIR += gdmap
SUBDIR += gdu
+ SUBDIR += genimage
SUBDIR += genisoimage
SUBDIR += geomWatch
SUBDIR += getdelta
diff --git a/sysutils/genimage/Makefile b/sysutils/genimage/Makefile
new file mode 100644
index 000000000000..89037b7f0c86
--- /dev/null
+++ b/sysutils/genimage/Makefile
@@ -0,0 +1,26 @@
+PORTNAME= genimage
+DISTVERSIONPREFIX= v
+DISTVERSION= 16-10
+DISTVERSIONSUFFIX= -g2b9d870
+#MASTER_SITES= https://github.com/pengutronix/genimage/releases/download/v${DISTVERSION}/
+CATEGORIES= sysutils
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Tool to generate multiple filesystem and flash images from a tree
+WWW= https://github.com/pengutronix/genimage
+
+LICENSE= GPLv2
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+LIB_DEPENDS= libconfuse.so:devel/libconfuse
+
+USES= autoreconf gettext-runtime pkgconfig #tar:xz
+
+USE_GITHUB= yes
+GH_ACCOUNT= pengutronix
+
+GNU_CONFIGURE= yes
+
+PLIST_FILES= bin/genimage
+
+.include <bsd.port.mk>
diff --git a/sysutils/genimage/distinfo b/sysutils/genimage/distinfo
new file mode 100644
index 000000000000..266fd2f092b7
--- /dev/null
+++ b/sysutils/genimage/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1673027507
+SHA256 (pengutronix-genimage-v16-10-g2b9d870_GH0.tar.gz) = b6de4e7e14216e1a79a5ea4ee2703c1f5ffa84ec4cfa5b72dc63905bc31fcaed
+SIZE (pengutronix-genimage-v16-10-g2b9d870_GH0.tar.gz) = 87753
diff --git a/sysutils/genimage/files/patch-config.c b/sysutils/genimage/files/patch-config.c
new file mode 100644
index 000000000000..1a1663c75946
--- /dev/null
+++ b/sysutils/genimage/files/patch-config.c
@@ -0,0 +1,19 @@
+--- config.c.orig 2023-01-06 17:56:22 UTC
++++ config.c
+@@ -21,6 +21,7 @@
+ #include <errno.h>
+ #include <getopt.h>
+ #include <unistd.h>
++#include <sys/syslimits.h>
+
+ #include "genimage.h"
+
+@@ -259,7 +260,7 @@ static char *abspath(const char *path)
+ if (*path == '/')
+ return strdup(path);
+
+- xasprintf(&p, "%s/%s", get_current_dir_name(), path);
++ xasprintf(&p, "%s/%s", getcwd(NULL, PATH_MAX), path);
+
+ return p;
+ }
diff --git a/sysutils/genimage/files/patch-image-android-sparse.c b/sysutils/genimage/files/patch-image-android-sparse.c
new file mode 100644
index 000000000000..62644b0a8fd1
--- /dev/null
+++ b/sysutils/genimage/files/patch-image-android-sparse.c
@@ -0,0 +1,11 @@
+--- image-android-sparse.c.orig 2023-01-06 17:52:40 UTC
++++ image-android-sparse.c
+@@ -15,7 +15,7 @@
+ */
+
+ #include <confuse.h>
+-#include <endian.h>
++#include <sys/endian.h>
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <stdlib.h>
diff --git a/sysutils/genimage/files/patch-image-hd.c b/sysutils/genimage/files/patch-image-hd.c
new file mode 100644
index 000000000000..0b3465c91655
--- /dev/null
+++ b/sysutils/genimage/files/patch-image-hd.c
@@ -0,0 +1,11 @@
+--- image-hd.c.orig 2023-01-06 17:53:09 UTC
++++ image-hd.c
+@@ -22,7 +22,7 @@
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <inttypes.h>
+-#include <endian.h>
++#include <sys/endian.h>
+ #include <stdbool.h>
+ #include <unistd.h>
+ #include <sys/types.h>
diff --git a/sysutils/genimage/files/patch-image-rauc.c b/sysutils/genimage/files/patch-image-rauc.c
new file mode 100644
index 000000000000..225db5c40bd0
--- /dev/null
+++ b/sysutils/genimage/files/patch-image-rauc.c
@@ -0,0 +1,11 @@
+--- image-rauc.c.orig 2023-01-06 17:59:29 UTC
++++ image-rauc.c
+@@ -95,7 +95,7 @@ static int rauc_generate(struct image *image)
+ }
+
+ /* create parent directories if target needs it */
+- path = strdupa(target);
++ path = strdup(target); // XXX causes memory leak
+ tmp = strrchr(path, '/');
+ if (tmp) {
+ *tmp = '\0';
diff --git a/sysutils/genimage/files/patch-image-vfat.c b/sysutils/genimage/files/patch-image-vfat.c
new file mode 100644
index 000000000000..e3d524cd9e24
--- /dev/null
+++ b/sysutils/genimage/files/patch-image-vfat.c
@@ -0,0 +1,11 @@
+--- image-vfat.c.orig 2023-01-06 18:01:33 UTC
++++ image-vfat.c
+@@ -47,7 +47,7 @@ static int vfat_generate(struct image *image)
+ struct image *child = image_get(part->image);
+ const char *file = imageoutfile(child);
+ const char *target = part->name;
+- char *path = strdupa(target);
++ char *path = strdup(target); // XXX causes memory leak
+ char *next = path;
+
+ while ((next = strchr(next, '/')) != NULL) {
diff --git a/sysutils/genimage/pkg-descr b/sysutils/genimage/pkg-descr
new file mode 100644
index 000000000000..2198193a3014
--- /dev/null
+++ b/sysutils/genimage/pkg-descr
@@ -0,0 +1,8 @@
+genimage is a tool to generate multiple filesystem and flash/disk images
+from a given root filesystem tree. genimage is intended to be run in a
+fakeroot environment. It also supports creating flash/disk images out of
+different file-system images and files.
+
+Configuration is done in a config file parsed by libconfuse. Options like the
+path to tools can be given via environment variables, the config file or from
+commandline switches.