[Pkg-voip-commits] [dahdi-firmware] 49/71: The missing patch.

tzafrir at debian.org tzafrir at debian.org
Thu Mar 31 20:24:19 UTC 2016


This is an automated email from the git hooks/post-receive script.

tzafrir pushed a commit to branch master
in repository dahdi-firmware.

commit 235a75bcf6ff93d213d5086949ef1165d410b952
Author: Tzafrir Cohen <tzafrir at debian.org>
Date:   Tue Jan 29 22:03:42 2013 +0000

    The missing patch.
    
    
    git-svn-id: svn://anonscm.alioth.debian.org/svn/pkg-voip/dahdi-firmware/trunk@10089 5e74be4b-f5d6-0310-a852-e9e23c5afa6a
---
 debian/patches/make-binary-bitfiles | 73 +++++++++++++++++++++++++++++++++++++
 debian/patches/series               |  1 +
 2 files changed, 74 insertions(+)

diff --git a/debian/patches/make-binary-bitfiles b/debian/patches/make-binary-bitfiles
new file mode 100644
index 0000000..cc116b4
--- /dev/null
+++ b/debian/patches/make-binary-bitfiles
@@ -0,0 +1,73 @@
+Author: Ben Hutchings <ben at decadent.org.uk>
+Description: Add makefw -b option to enable binary output
+Bug-Debian: http://bugs.debian.org/699104
+
+We can't compile these bitfiles into the drivers in the free
+dahdi-source package.  Add the -b option to write a binary
+instead of a C array.
+
+---
+--- a/drivers/dahdi/makefw.c
++++ b/drivers/dahdi/makefw.c
+@@ -1,6 +1,7 @@
+ /* Xilinx firmware convertor program.
+  *
+  * Written by Jim Dixon <jim at lambdatel.com>.
++ * Binary output adde by Ben Hutchings <ben at decadent.org.uk>.
+  *
+  * Copyright (C) 2001 Jim Dixon / Zapata Telephony.
+  * Copyright (C) 2001-2008 Digium, Inc.
+@@ -34,10 +35,12 @@ FILE *fp;
+ int i,j,nbytes;
+ unsigned char c;
+ char	buf[300];
++int bin;
+ 
+ 	if (argc < 3)
+ 	   {
+ 		puts("Usage... makefw  filename.rbt  array_name");
++		puts("         makefw  filename.rbt  -b");
+ 		exit(1);
+ 	   }	
+ 
+@@ -47,8 +50,10 @@ char	buf[300];
+ 		perror("bit file open");
+ 		exit(1);
+ 	   }
++	bin = !strcmp(argv[2], "-b");
+ 	nbytes = 0;
+-	printf("static unsigned char %s[] = {\n",argv[2]);
++	if (!bin)
++		printf("static unsigned char %s[] = {\n",argv[2]);
+ 	i = 0;
+ 	while(fgets(buf,sizeof(buf) - 1,fp))
+ 	   {
+@@ -66,17 +71,22 @@ char	buf[300];
+ 			if ((j & 7) == 7)
+ 			   {
+ 				nbytes++;
+-				if (i) printf(",");				
+-				printf("0x%02x",c);
+-				if (i++ == SWATH) {
+-					printf(",\n");
+-					i = 0;
++				if (bin) {
++					putchar(c);
++				} else {
++					if (i) printf(",");
++					printf("0x%02x",c);
++					if (i++ == SWATH) {
++						printf(",\n");
++						i = 0;
++					}
+ 				}
+ 				c = 0;
+ 			   }
+ 		   }
+ 	   }
+-	printf("\n};\n\n");
++	if (!bin)
++		printf("\n};\n\n");
+ 	fprintf(stderr,"Loaded %d bytes from file\n",nbytes);
+ 	fclose(fp);
+ 	exit(0);
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..8398284
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+make-binary-bitfiles

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/dahdi-firmware.git



More information about the Pkg-voip-commits mailing list