diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-08-18 02:48:24 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-08-18 02:48:24 +0000 |
commit | 2d539be5614d6b311ac5aca505db86ab5a342fb6 (patch) | |
tree | 47da6ac6684f6b0c7771240ee152c9d65f8ad9cf /sys-fs | |
parent | Missing sys-devel/bc dependency added; Resolves Bug #102796. (diff) | |
download | gentoo-2-2d539be5614d6b311ac5aca505db86ab5a342fb6.tar.gz gentoo-2-2d539be5614d6b311ac5aca505db86ab5a342fb6.tar.bz2 gentoo-2-2d539be5614d6b311ac5aca505db86ab5a342fb6.zip |
initial import
(Portage version: 2.0.51.22-r2)
Diffstat (limited to 'sys-fs')
-rw-r--r-- | sys-fs/wpflash/ChangeLog | 8 | ||||
-rw-r--r-- | sys-fs/wpflash/Manifest | 2 | ||||
-rw-r--r-- | sys-fs/wpflash/files/digest-wpflash-0 | 1 | ||||
-rw-r--r-- | sys-fs/wpflash/files/wpflash-gentoo.patch | 223 | ||||
-rw-r--r-- | sys-fs/wpflash/metadata.xml | 5 | ||||
-rw-r--r-- | sys-fs/wpflash/wpflash-0.ebuild | 31 |
6 files changed, 270 insertions, 0 deletions
diff --git a/sys-fs/wpflash/ChangeLog b/sys-fs/wpflash/ChangeLog new file mode 100644 index 000000000000..15dee1c82973 --- /dev/null +++ b/sys-fs/wpflash/ChangeLog @@ -0,0 +1,8 @@ +# ChangeLog for sys-fs/wpflash +# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/wpflash/ChangeLog,v 1.1 2005/08/18 02:48:24 vapier Exp $ + +*wpflash-0 (17 Aug 2005) + + 17 Aug 2005; Mike Frysinger <vapier@gentoo.org> : + Initial import. Ebuild submitted by me. diff --git a/sys-fs/wpflash/Manifest b/sys-fs/wpflash/Manifest new file mode 100644 index 000000000000..bc7a652a2793 --- /dev/null +++ b/sys-fs/wpflash/Manifest @@ -0,0 +1,2 @@ +MD5 bff06990a18b3c10d30a2866d6cceaf7 wpflash-0.ebuild 417 +MD5 a8ef40c2fd547f4584c86ce34e128777 files/digest-wpflash-0 53 diff --git a/sys-fs/wpflash/files/digest-wpflash-0 b/sys-fs/wpflash/files/digest-wpflash-0 new file mode 100644 index 000000000000..e31868fe74b5 --- /dev/null +++ b/sys-fs/wpflash/files/digest-wpflash-0 @@ -0,0 +1 @@ +MD5 1fec9594c8dc23e35b906a029d9b3a3d wpflash.c 25813 diff --git a/sys-fs/wpflash/files/wpflash-gentoo.patch b/sys-fs/wpflash/files/wpflash-gentoo.patch new file mode 100644 index 000000000000..8706b9ceec36 --- /dev/null +++ b/sys-fs/wpflash/files/wpflash-gentoo.patch @@ -0,0 +1,223 @@ +--- wpflash.c ++++ wpflash.c +@@ -5,6 +5,9 @@ + #include <termios.h> + #include <linux/ppdev.h> + #include <sys/ioctl.h> ++#include <unistd.h> ++#include <stdlib.h> ++#include <string.h> + + int do_write(int, void *, int); + int do_read(int, void *, int); +@@ -74,6 +77,13 @@ struct partition_table { + struct partition modified; + struct partition *find_partition(char *); + ++void usage(); ++void bad_partition(char *name); ++int erase_sector(int addr); ++int read_object(char *filename, char *memory, int rom_size); ++int read_raw(char *filename, char *memory, int rom_size); ++int write_flash(int addr, char *buffer, int length); ++int read_flash(int addr, char *buffer, int length); + + /* This structure defines the sectors + on the FLASH */ +@@ -199,7 +209,8 @@ find_partition(char *name) + return fixup_partition(partition); + partition++; + } +- bad_partition(); ++ bad_partition(name); ++ return NULL; + } + + /* Initialize a "cmd" structure */ +@@ -224,6 +235,7 @@ set_cmd(struct cmd *cmd, char type, int + waiting for "CONTROL-A" to signal it should jump + to the programming code */ + ++void + wait_boot_prompt() + { + char line[256], *s; +@@ -236,7 +248,7 @@ wait_boot_prompt() + else if (*s == '\n') { + *s = 0; + if (strcmp(line, "Enter CTRL-A to enter programmer.") == 0) +- return 1; ++ return; + s = line; + } else { + s++; +@@ -246,6 +258,7 @@ wait_boot_prompt() + + /* Erase a partition */ + ++int + erase_partition(char *name) { + + struct partition *partition = find_partition(name); +@@ -328,16 +341,18 @@ erase_partition(char *name) { + } + } + printf("done.\n"); ++ ++ return 0; + } + + /* Program a partition */ + + ++int + program_partition(char *name, char *filename, int hexdump) + { + struct partition *partition = find_partition(name); + int addr, maxaddr, maxpgm, addrincr, startaddr; +- int i; + + /* Load data to be programmed in either hex or binary + format */ +@@ -384,6 +399,7 @@ program_partition(char *name, char *file + + /* Read a partition */ + ++int + read_partition(char *name, char *filename) + { + struct partition *partition = find_partition(name); +@@ -421,13 +437,17 @@ read_partition(char *name, char *filenam + return(0); + } + ++int pp_open(); ++int hello(); ++int initialize(); ++int device_id(int *deviceID1, int *deviceID2); ++int device_id_v0(int *deviceID1, int *deviceID2); ++int double_wide(); ++int parse_flash_params(char *filename); ++ ++int + main(int argc, char **argv) { +- struct termios termios; +- char c; +- int i; +- int cpid; +- int count; +- int maxcount; ++ struct termios termios; + int version; + int deviceID1, deviceID2; + struct flash_chip *f; +@@ -607,6 +627,8 @@ main(int argc, char **argv) { + /* If we got to here, an invalid operation was specified */ + + usage(); ++ ++ return 0; + } + + /* Reads a block of data from the flash. +@@ -632,7 +654,7 @@ read_flash(int addr, char *buffer, int l + for (count = 0; count < length + 1; count = count + readl) { + readl = do_read(sfd, buffer+count, length+1-count); + if (readl == 0) +- exit; ++ exit(0); + } + + /* Check checksum at end of data */ +@@ -662,7 +684,6 @@ write_flash(int addr, char *buffer, int + struct cmd cmd; + int count; + int checksum; +- int readl; + char checksumbuf[1]; + + /* Build and send "W" command to programmer. +@@ -705,6 +726,7 @@ write_flash(int addr, char *buffer, int + + /* Send initialize command */ + ++int + initialize() { + struct cmd cmd; + char checksumbuf[1]; +@@ -770,6 +792,7 @@ int device_id_v0(int *deviceID1, int *de + Note supported on Version 0 programmers. */ + + ++int + double_wide() { + struct cmd cmd; + char checksumbuf[1]; +@@ -835,6 +858,7 @@ hello() { + + /* Send erase (whole flash) command */ + ++int + erase() { + struct cmd cmd; + char checksumbuf[1]; +@@ -857,6 +881,7 @@ erase() { + + /* Send erase sector command */ + ++int + erase_sector(int addr) { + struct cmd cmd; + char checksumbuf[1]; +@@ -900,7 +925,7 @@ hex(char c) { + + int parse_line(char *buffer, char *mem, int rom_size, int *max_mem) { + char *c = buffer; +- unsigned int address, word_addr; ++ unsigned int address; + unsigned int length,type; + unsigned int checksum = 0; + int count = 0; +@@ -1020,10 +1045,7 @@ int + read_raw(char *filename, char *memory, int rom_size) + { + FILE *f; +- char line[80]; +- int lines_read = 0; + int count = 0; +- int bytes ; + static int max_mem; + + max_mem = 0; +@@ -1042,7 +1064,7 @@ read_raw(char *filename, char *memory, i + exit(1); + } + +- while (count = fread(memory, 1, 1024, f)) { ++ while ((count = fread(memory, 1, 1024, f))) { + memory += count; + max_mem += count; + } +@@ -1053,12 +1075,13 @@ read_raw(char *filename, char *memory, i + return max_mem; //return highest memory address used + } + +-bad_partition(char *name) ++void bad_partition(char *name) + { + fprintf(stderr, "Unknown partition: %s\n\n", name); + usage(); + } + ++void + usage() { + struct partition *partition = partition_table; + +@@ -1077,6 +1100,7 @@ usage() { + exit(1); + } + ++void + pp_write(int fd, char value) + { + u_char d = value; diff --git a/sys-fs/wpflash/metadata.xml b/sys-fs/wpflash/metadata.xml new file mode 100644 index 000000000000..5454528f2093 --- /dev/null +++ b/sys-fs/wpflash/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>arm</herd> +</pkgmetadata> diff --git a/sys-fs/wpflash/wpflash-0.ebuild b/sys-fs/wpflash/wpflash-0.ebuild new file mode 100644 index 000000000000..0e7ba345fcc7 --- /dev/null +++ b/sys-fs/wpflash/wpflash-0.ebuild @@ -0,0 +1,31 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/wpflash/wpflash-0.ebuild,v 1.1 2005/08/18 02:48:24 vapier Exp $ + +inherit eutils + +DESCRIPTION="flash the firmware on a Webpal" +HOMEPAGE="http://webpal.bigbrd.com/" +SRC_URI="http://webpal.bigbrd.com/wpflash.c" + +LICENSE="public-domain" +SLOT="0" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="" + +DEPEND="" + +S=${WORKDIR} + +src_unpack() { + cp "${DISTDIR}"/${A} "${WORKDIR}"/ || die + epatch "${FILESDIR}"/${PN}-gentoo.patch +} + +src_compile() { + emake wpflash || die +} + +src_install() { + dosbin wpflash || die +} |