summaryrefslogtreecommitdiff
path: root/sys-fs/wpflash
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-fs/wpflash
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-fs/wpflash')
-rw-r--r--sys-fs/wpflash/Manifest6
-rw-r--r--sys-fs/wpflash/files/wpflash-gentoo.patch223
-rw-r--r--sys-fs/wpflash/metadata.xml8
-rw-r--r--sys-fs/wpflash/wpflash-0.ebuild30
4 files changed, 267 insertions, 0 deletions
diff --git a/sys-fs/wpflash/Manifest b/sys-fs/wpflash/Manifest
new file mode 100644
index 000000000000..2152807fe6ac
--- /dev/null
+++ b/sys-fs/wpflash/Manifest
@@ -0,0 +1,6 @@
+AUX wpflash-gentoo.patch 5050 SHA256 cc029c69cd7b318faa66b42301c078c2c2b68bc43a080d284f43117e598b03b8 SHA512 1d6be3acd401a27917ed8da6a773505a3a54983db0e958422d3f75f2042f50d43ef1c5cf6f81a73a9a109f2cbaf5cc0179a5651ff47a224855cbd12583030cee WHIRLPOOL fd115288fbc358353f2839c8dc62ad5e7ed08e78251d90df4196e921ab11d15ee6cd3236c663e5e378945d3fa6f0124780eefa4502407eab597d3f23b8d5ea0a
+DIST wpflash.c 25813 SHA256 9c2158b14a77ba2baf9e0a136288367f402c60366084288615a459566a046ee3 SHA512 b0605b15d29a96d8dae052131f0a55b09eb230d05543c8a25a727ac3820397459d108c9b19fa95726ca7df12b4a733480f5c01587deee24a5fb8be9d1a0beeba WHIRLPOOL d1e36735255ffe341c0731a2c08379c24c24f01ea376e0191387a7fd7ca24662575ac027d69f29ee2347047402931590887adea2a53e2da453002070ccfca2fe
+EBUILD wpflash-0.ebuild 531 SHA256 a022c3aa905e8faad2c0f26ed9db43b569c753ea85542428ae9ca1d28f2adb2b SHA512 4c1cec44e50284b95cef30ce1abfb5d983d16d6768544db8d678a8206dfed2aeecc4f55e06f2316eed69ba799779ca40d6bb48c044d5e6ee1d6a3cec16ca6c75 WHIRLPOOL 4f534450e57813ec7120f3af7a10f056b9927d95916230469897f4ac2d51b9d6455d4bfd1452f0f310f4e9ee43d26d5f2634026663124aa27c6656863b8409bc
+MISC ChangeLog 2446 SHA256 8449b9ce5e9588dd4b5c5818780bf4e1c31b46b085052c09ad5682163114233c SHA512 95cae1cb90a25fcc0c555ef72ea75eb5aecc26bd82188bee220510273ba3a6c752a96fe07b793b5c65af9ab4cb7fcd409be98448908eb8a64364be0628cadee0 WHIRLPOOL 2ef191c92f606ef99ebc6f1eb563b30ac236d91be8b423011fc74c1ddd83ca3c0233b7e21ca11792615f94b98efad93b5b3680236844e340076b0185d5ae803f
+MISC ChangeLog-2015 431 SHA256 b062caab31b20b2febc007664ca3a0476fb6460e1f47007f46cd131d17567661 SHA512 2683ea61aa2abbefe6bca0bf8bd20b85bf516d57838115d1fd40c726b8fbba9d3cc9fd76769a5eb66d55df6afebbe967bb7d3d3a66a4a53fb56a1423892612bd WHIRLPOOL 0f6643ed40bea2e8389900e7a2d5b9d2aeb6cb7fa17f0de3343eb16193afcb126c1fa2f1af29d375f5bb1cf6e3b174634061fde8c7aa26303f0505fddbfc6b49
+MISC metadata.xml 255 SHA256 2329f28bac0cd2e531f9e28d5d16d6c2f0a20878723e101565aefc5233b33531 SHA512 4408b5018e974df4d7508f29e255f318bbd09b4056927cae6406ff1f427c06d5d655f677a28440cb84af04e411c88e4582f9ad1ea76829afeee0bbe4e3841c2f WHIRLPOOL fc074050885e70dd142f3d3de3b966b62dd7bb1d095e6ab94f78962d8a1adebc6297fa3889093c3752e82afe170baece19e8458e9e2387b5ed52dbb6efe66e09
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..3101c4efc863
--- /dev/null
+++ b/sys-fs/wpflash/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>arm@gentoo.org</email>
+ <name>Gentoo Linux ARM Development</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-fs/wpflash/wpflash-0.ebuild b/sys-fs/wpflash/wpflash-0.ebuild
new file mode 100644
index 000000000000..b3d5b9b7cd8a
--- /dev/null
+++ b/sys-fs/wpflash/wpflash-0.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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
+}