aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiwi <miwi@FreeBSD.org>2009-10-30 06:19:09 +0800
committermiwi <miwi@FreeBSD.org>2009-10-30 06:19:09 +0800
commitd285e87cf0868aa15c048a8d1193b2ca9cb1d7ae (patch)
tree317c0bff100eaaba070b0bbc11cb932a7d941b8a
parente4348535edfebf9e06f3fa273905d40aa29afa5e (diff)
downloadfreebsd-ports-gnome-d285e87cf0868aa15c048a8d1193b2ca9cb1d7ae.tar.gz
freebsd-ports-gnome-d285e87cf0868aa15c048a8d1193b2ca9cb1d7ae.tar.zst
freebsd-ports-gnome-d285e87cf0868aa15c048a8d1193b2ca9cb1d7ae.zip
fconfig is an application that allows to read and write RedBoot's configuration
parameters. Examples, fconfig -l fconfig -w -n console_baud_rate -x 115200 WWW: http://andrzejekiert.ovh.org/software.html.en PR: ports/139977 Submitted by: thompsa at FreeBSD.org
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/fconfig/Makefile24
-rw-r--r--sysutils/fconfig/distinfo3
-rw-r--r--sysutils/fconfig/files/patch-fconfig94
-rw-r--r--sysutils/fconfig/pkg-descr8
5 files changed, 130 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 79e893de9d93..123f98469e0e 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -208,6 +208,7 @@
SUBDIR += farbot
SUBDIR += fastest_cvsup
SUBDIR += fatback
+ SUBDIR += fconfig
SUBDIR += fcron
SUBDIR += fdupes
SUBDIR += fetchlog
diff --git a/sysutils/fconfig/Makefile b/sysutils/fconfig/Makefile
new file mode 100644
index 000000000000..774df468c1b1
--- /dev/null
+++ b/sysutils/fconfig/Makefile
@@ -0,0 +1,24 @@
+# New ports collection makefile for: fconfig
+# Date created: Oct 26, 2009
+# Whom: thompsa@FreeBSD.org
+#
+# $FreeBSD$
+#
+
+PORTNAME= fconfig
+PORTVERSION= 20080329
+CATEGORIES= sysutils
+MASTER_SITES= http://downloads.openwrt.org/sources/ \
+ http://andrzejekiert.ovh.org/software/fconfig/
+
+MAINTAINER= thompsa@FreeBSD.org
+COMMENT= Read and modify RedBoot embedded boot configuration
+
+WRKSRC= ${WRKDIR}/${PORTNAME}
+USE_GMAKE= yes
+PLIST_FILES= sbin/fconfig
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/fconfig ${PREFIX}/sbin
+
+.include <bsd.port.mk>
diff --git a/sysutils/fconfig/distinfo b/sysutils/fconfig/distinfo
new file mode 100644
index 000000000000..7b67456489c9
--- /dev/null
+++ b/sysutils/fconfig/distinfo
@@ -0,0 +1,3 @@
+MD5 (fconfig-20080329.tar.gz) = dac355e9f2a0f48c414c52e2034b6346
+SHA256 (fconfig-20080329.tar.gz) = 4ff0e8f07e35e46b705c0dbe9d9544ede01ea092a69e3f7db03e55a3f2bb8eb7
+SIZE (fconfig-20080329.tar.gz) = 10179
diff --git a/sysutils/fconfig/files/patch-fconfig b/sysutils/fconfig/files/patch-fconfig
new file mode 100644
index 000000000000..98ac73b568c2
--- /dev/null
+++ b/sysutils/fconfig/files/patch-fconfig
@@ -0,0 +1,94 @@
+diff -urN crunchfc.c crunchfc.c
+--- crunchfc.c 2008-03-30 01:21:47.000000000 +1300
++++ crunchfc.c 2009-10-26 09:13:04.000000000 +1300
+@@ -407,6 +407,7 @@
+ MESSAGE(VERB_HIGH, "Writing %d bytes at offset %d\n",
+ TYPE_SIZE(key.type), offset);
+
++#if !defined(__FreeBSD__)
+ /* do an actual write to the device or file */
+ if (lseek(data->fd, data->offset+offset, SEEK_SET) == -1) {
+ MESSAGE(VERB_LOW, "lseek() failed\n");
+@@ -416,6 +417,7 @@
+ MESSAGE(VERB_LOW, "write() failed\n");
+ return -1;
+ }
++#endif
+ /* keep our buffer in sync with the device or file */
+ memcpy(key.dataval, buf, TYPE_SIZE(key.type));
+
+@@ -451,6 +453,7 @@
+
+ MESSAGE(VERB_HIGH, "Writing CRC at offset %d\n", len-4);
+
++#if !defined(__FreeBSD__)
+ /* do an actual write to the device or file */
+ if (lseek(data->fd, data->offset+len-4, SEEK_SET) == -1) {
+ MESSAGE(VERB_LOW, "CRC: lseek() failed\n");
+@@ -460,6 +463,7 @@
+ MESSAGE(VERB_LOW, "CRC: write() failed\n");
+ return;
+ }
++#endif
+ /* keep our buffer in sync with the device or file */
+ memcpy(buf+len-4, &crc, sizeof(crc));
+
+diff -urN fconfig.c fconfig.c
+--- fconfig.c 2008-03-30 01:21:48.000000000 +1300
++++ fconfig.c 2009-10-26 10:11:01.000000000 +1300
+@@ -45,6 +45,8 @@
+ #include "ftypes.h"
+ #include "crunchfc.h"
+
++#define REDBOOT_DEV "/dev/redboot/RedBoot config"
++
+ /*
+ * Parse type name, return type ID.
+ * Type ID is the type number in the type table.
+@@ -163,6 +165,16 @@
+
+ recalculate_crc(&data);
+
++#if defined(__FreeBSD__)
++ /* FreeBSD needs to do a full sector write */
++ if (lseek(data.fd, 0, SEEK_SET) == -1) {
++ MESSAGE(VERB_LOW, "lseek() failed\n");
++ return -1;
++ }
++ if (write(data.fd, data.buf, MAX_CONFIG_DATA) == -1) {
++ MESSAGE(VERB_LOW, "write() failed\n");
++ }
++#endif
+ close_fconfig_handle(&data);
+ return 0;
+
+@@ -292,8 +304,12 @@
+ }
+
+ if (device == NULL) {
++#if defined(__FreeBSD__)
++ device = REDBOOT_DEV;
++#else
+ MESSAGE(VERB_LOW, "You must provide a device name.\n");
+ exit(1);
++#endif
+ }
+
+ switch (mode) {
+diff -urN ftypes.c ftypes.c
+--- ftypes.c 2006-03-15 03:18:18.000000000 +1300
++++ ftypes.c 2009-10-26 10:07:04.000000000 +1300
+@@ -21,8 +21,13 @@
+ #include <arpa/inet.h>
+
+ /* For ether_aton */
++#if defined(__FreeBSD__)
++#include <sys/types.h>
++#include <net/ethernet.h>
++#else
+ #include <net/ethernet.h>
+ #include <netinet/ether.h>
++#endif
+
+ #include <stdlib.h>
+ #include <stdio.h>
diff --git a/sysutils/fconfig/pkg-descr b/sysutils/fconfig/pkg-descr
new file mode 100644
index 000000000000..5a2b74cc93a7
--- /dev/null
+++ b/sysutils/fconfig/pkg-descr
@@ -0,0 +1,8 @@
+fconfig is an application that allows to read and write RedBoot's configuration
+parameters.
+
+Examples,
+ fconfig -l
+ fconfig -w -n console_baud_rate -x 115200
+
+WWW: http://andrzejekiert.ovh.org/software.html.en