From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Oct 25 23:40:01 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8AE71065697 for ; Sun, 25 Oct 2009 23:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A4CEC8FC18 for ; Sun, 25 Oct 2009 23:40:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n9PNe0TO015420 for ; Sun, 25 Oct 2009 23:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n9PNe0Zu015419; Sun, 25 Oct 2009 23:40:00 GMT (envelope-from gnats) Resent-Date: Sun, 25 Oct 2009 23:40:00 GMT Resent-Message-Id: <200910252340.n9PNe0Zu015419@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Andrew Thompson Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F353106566B for ; Sun, 25 Oct 2009 23:32:04 +0000 (UTC) (envelope-from thompsa@citylink.fud.org.nz) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id F21E48FC12 for ; Sun, 25 Oct 2009 23:32:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 04EB21002B for ; Mon, 26 Oct 2009 12:15:21 +1300 (NZDT) Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hd-6nFB2zCPf for ; Mon, 26 Oct 2009 12:15:15 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP for ; Mon, 26 Oct 2009 12:15:15 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 8114411475; Mon, 26 Oct 2009 12:15:15 +1300 (NZDT) Message-Id: <20091025231515.8114411475@citylink.fud.org.nz> Date: Mon, 26 Oct 2009 12:15:15 +1300 (NZDT) From: Andrew Thompson To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/139977: new port: sysutils/fconfig X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Andrew Thompson List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 23:40:02 -0000 >Number: 139977 >Category: ports >Synopsis: new port: sysutils/fconfig >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Sun Oct 25 23:40:00 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Andrew Thompson >Release: FreeBSD 9.0-CURRENT i386 >Organization: >Environment: System: FreeBSD burger.fud.org.nz 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r198348M: Fri Oct 23 08:58:52 NZDT 2009 thompsa@burger.fud.org.nz:/usr/obj/home/thompsa/scratch/fbsvn/head/sys/BURGER i386 >Description: Add fconfig for managing RedBoot embedded boot config. >How-To-Repeat: >Fix: Also available at http://people.freebsd.org/~thompsa/fconfig.tar # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # sysutils # sysutils/fconfig # sysutils/fconfig/Makefile # sysutils/fconfig/distinfo # sysutils/fconfig/pkg-descr # sysutils/fconfig/files # sysutils/fconfig/files/patch-fconfig.diff # echo c - sysutils mkdir -p sysutils > /dev/null 2>&1 echo c - sysutils/fconfig mkdir -p sysutils/fconfig > /dev/null 2>&1 echo x - sysutils/fconfig/Makefile sed 's/^X//' >sysutils/fconfig/Makefile << 'df88c006be046ec06ddb3d9e9ee7072a' X# New ports collection makefile for: fconfig X# Date created: Oct 26, 2009 X# Whom: thompsa@FreeBSD.org X# X# $FreeBSD$ X# X XPORTNAME= fconfig XPORTVERSION= 20080329 XCATEGORIES= sysutils XMASTER_SITES= http://downloads.openwrt.org/sources/ \ X http://andrzejekiert.ovh.org/software/fconfig/ X XMAINTAINER= thompsa@FreeBSD.org XCOMMENT= Read and modify RedBoot embedded boot configuration X XWRKSRC= ${WRKDIR}/${PORTNAME} XUSE_GMAKE= yes XPLIST_FILES= sbin/fconfig X Xdo-install: X ${INSTALL_PROGRAM} ${WRKSRC}/fconfig ${PREFIX}/sbin X X.include df88c006be046ec06ddb3d9e9ee7072a echo x - sysutils/fconfig/distinfo sed 's/^X//' >sysutils/fconfig/distinfo << 'd2298dd089beb180a9a57594cba39088' XMD5 (fconfig-20080329.tar.gz) = dac355e9f2a0f48c414c52e2034b6346 XSHA256 (fconfig-20080329.tar.gz) = 4ff0e8f07e35e46b705c0dbe9d9544ede01ea092a69e3f7db03e55a3f2bb8eb7 XSIZE (fconfig-20080329.tar.gz) = 10179 d2298dd089beb180a9a57594cba39088 echo x - sysutils/fconfig/pkg-descr sed 's/^X//' >sysutils/fconfig/pkg-descr << '2f1d2fb3743b8f870439911feb359754' Xfconfig is an application that allows to read and write RedBoot's configuration Xparameters. X XExamples, X fconfig -l X fconfig -w -n console_baud_rate -x 115200 X XWWW: http://andrzejekiert.ovh.org/software.html.en 2f1d2fb3743b8f870439911feb359754 echo c - sysutils/fconfig/files mkdir -p sysutils/fconfig/files > /dev/null 2>&1 echo x - sysutils/fconfig/files/patch-fconfig.diff sed 's/^X//' >sysutils/fconfig/files/patch-fconfig.diff << '881cf4ebcb2e08596c43706cdd954c21' Xdiff -urN crunchfc.c crunchfc.c X--- crunchfc.c 2008-03-30 01:21:47.000000000 +1300 X+++ crunchfc.c 2009-10-26 09:13:04.000000000 +1300 X@@ -407,6 +407,7 @@ X MESSAGE(VERB_HIGH, "Writing %d bytes at offset %d\n", X TYPE_SIZE(key.type), offset); X X+#if !defined(__FreeBSD__) X /* do an actual write to the device or file */ X if (lseek(data->fd, data->offset+offset, SEEK_SET) == -1) { X MESSAGE(VERB_LOW, "lseek() failed\n"); X@@ -416,6 +417,7 @@ X MESSAGE(VERB_LOW, "write() failed\n"); X return -1; X } X+#endif X /* keep our buffer in sync with the device or file */ X memcpy(key.dataval, buf, TYPE_SIZE(key.type)); X X@@ -451,6 +453,7 @@ X X MESSAGE(VERB_HIGH, "Writing CRC at offset %d\n", len-4); X X+#if !defined(__FreeBSD__) X /* do an actual write to the device or file */ X if (lseek(data->fd, data->offset+len-4, SEEK_SET) == -1) { X MESSAGE(VERB_LOW, "CRC: lseek() failed\n"); X@@ -460,6 +463,7 @@ X MESSAGE(VERB_LOW, "CRC: write() failed\n"); X return; X } X+#endif X /* keep our buffer in sync with the device or file */ X memcpy(buf+len-4, &crc, sizeof(crc)); X Xdiff -urN fconfig.c fconfig.c X--- fconfig.c 2008-03-30 01:21:48.000000000 +1300 X+++ fconfig.c 2009-10-26 10:11:01.000000000 +1300 X@@ -45,6 +45,8 @@ X #include "ftypes.h" X #include "crunchfc.h" X X+#define REDBOOT_DEV "/dev/redboot/RedBoot config" X+ X /* X * Parse type name, return type ID. X * Type ID is the type number in the type table. X@@ -163,6 +165,16 @@ X X recalculate_crc(&data); X X+#if defined(__FreeBSD__) X+ /* FreeBSD needs to do a full sector write */ X+ if (lseek(data.fd, 0, SEEK_SET) == -1) { X+ MESSAGE(VERB_LOW, "lseek() failed\n"); X+ return -1; X+ } X+ if (write(data.fd, data.buf, MAX_CONFIG_DATA) == -1) { X+ MESSAGE(VERB_LOW, "write() failed\n"); X+ } X+#endif X close_fconfig_handle(&data); X return 0; X X@@ -292,8 +304,12 @@ X } X X if (device == NULL) { X+#if defined(__FreeBSD__) X+ device = REDBOOT_DEV; X+#else X MESSAGE(VERB_LOW, "You must provide a device name.\n"); X exit(1); X+#endif X } X X switch (mode) { Xdiff -urN ftypes.c ftypes.c X--- ftypes.c 2006-03-15 03:18:18.000000000 +1300 X+++ ftypes.c 2009-10-26 10:07:04.000000000 +1300 X@@ -21,8 +21,13 @@ X #include X X /* For ether_aton */ X+#if defined(__FreeBSD__) X+#include X+#include X+#else X #include X #include X+#endif X X #include X #include 881cf4ebcb2e08596c43706cdd954c21 exit >Release-Note: >Audit-Trail: >Unformatted: