aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authortobik <tobik@FreeBSD.org>2017-02-21 04:24:12 +0800
committertobik <tobik@FreeBSD.org>2017-02-21 04:24:12 +0800
commit067ba399125db254eb58c74fd8718adf826ff0d5 (patch)
tree450fc0c20f35d82422926942e3527fc1cfcd1951 /sysutils
parentc319867f85de8e65893a885ba9a0608cfa9ff11f (diff)
downloadfreebsd-ports-gnome-067ba399125db254eb58c74fd8718adf826ff0d5.tar.gz
freebsd-ports-gnome-067ba399125db254eb58c74fd8718adf826ff0d5.tar.zst
freebsd-ports-gnome-067ba399125db254eb58c74fd8718adf826ff0d5.zip
Add patch to turn off the IEXTEN local flag and fix serprog hangs
PR: 214637 Submitted by: Michael Zhiling <mizhka@gmail.com> Approved by: lme (mentor), maintainer timeout (nukama+maintainer@gmail.com, 3 months) Differential Revision: https://reviews.freebsd.org/D9696
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/flashrom/Makefile1
-rw-r--r--sysutils/flashrom/files/patch-serial.c28
2 files changed, 29 insertions, 0 deletions
diff --git a/sysutils/flashrom/Makefile b/sysutils/flashrom/Makefile
index 5920ec96851f..6112e3bcf278 100644
--- a/sysutils/flashrom/Makefile
+++ b/sysutils/flashrom/Makefile
@@ -3,6 +3,7 @@
PORTNAME= flashrom
PORTVERSION= 0.9.9
+PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://download.flashrom.org/releases/
diff --git a/sysutils/flashrom/files/patch-serial.c b/sysutils/flashrom/files/patch-serial.c
new file mode 100644
index 000000000000..ec8572751b11
--- /dev/null
+++ b/sysutils/flashrom/files/patch-serial.c
@@ -0,0 +1,28 @@
+Avoid hang of serprog under FreeBSD
+
+Use case is flashrom+serprog to read SPI flash (MX25L6406) via Arduino
+Nano V3. Actual command is:
+
+/usr/local/bin/flashrom -p serprog:dev=/dev/cuaU0:57600 -c MX25L6406E/MX25L6408E -r tcw770.dump
+
+Using flashrom 0.9.9 it hangs after 5 seconds on read from tty ("ttyin").
+The problem is that kernel method "ttydisc_rint" ignore same bytes. It
+happens due to enabled IEXTEN local flag of termios. TTY cuts few bytes,
+Arduino reads 11264 bytes, but flashrom gets 11244 bytes (corrupted) and
+waits for remaining 20 bytes.
+
+The fix is simple: turn off IEXTEN local flag.
+
+https://patchwork.coreboot.org/patch/4498/
+
+--- serial.c.orig 2016-11-18 19:39:55 UTC
++++ serial.c
+@@ -203,7 +203,7 @@ int serialport_config(fdtype fd, int bau
+ }
+ wanted.c_cflag &= ~(PARENB | CSTOPB | CSIZE | CRTSCTS);
+ wanted.c_cflag |= (CS8 | CLOCAL | CREAD);
+- wanted.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
++ wanted.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG | IEXTEN);
+ wanted.c_iflag &= ~(IXON | IXOFF | IXANY | ICRNL | IGNCR | INLCR);
+ wanted.c_oflag &= ~OPOST;
+ if (tcsetattr(fd, TCSANOW, &wanted) != 0) {