diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2009-10-29 22:19:09 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2009-10-29 22:19:09 +0000 |
commit | c00ced85cc086ffdc60d97f0e2325aa7176ccdf4 (patch) | |
tree | 63bd1076055ef2f4d21bf47a3bf11cb9dda5cef4 | |
parent | ee23a798c71f960aa4e4291af384efe3dd747780 (diff) | |
download | ports-c00ced85cc086ffdc60d97f0e2325aa7176ccdf4.tar.gz ports-c00ced85cc086ffdc60d97f0e2325aa7176ccdf4.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
Notes
Notes:
svn path=/head/; revision=243490
-rw-r--r-- | sysutils/Makefile | 1 | ||||
-rw-r--r-- | sysutils/fconfig/Makefile | 24 | ||||
-rw-r--r-- | sysutils/fconfig/distinfo | 3 | ||||
-rw-r--r-- | sysutils/fconfig/files/patch-fconfig | 94 | ||||
-rw-r--r-- | sysutils/fconfig/pkg-descr | 8 |
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 |