[urjtag] initial import

Scott Tsai scottt at fedoraproject.org
Tue Jan 24 03:24:57 UTC 2012


commit 5845dfa5e9e744e4afdc7aaad6bd2bbfdb482148
Author: Scott Tsai <scottt.tw at gmail.com>
Date:   Tue Jan 24 11:25:23 2012 +0800

    initial import

 .gitignore                                         |    1 +
 ...-svf-guard-against-chain-cable-being-NULL.patch |   48 +++++++++
 sources                                            |    1 +
 urjtag.spec                                        |  111 ++++++++++++++++++++
 4 files changed, 161 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..d8379e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/urjtag-20111215-git-e1a4227.tar.bz2
diff --git a/0001-svf-guard-against-chain-cable-being-NULL.patch b/0001-svf-guard-against-chain-cable-being-NULL.patch
new file mode 100644
index 0000000..dacec66
--- /dev/null
+++ b/0001-svf-guard-against-chain-cable-being-NULL.patch
@@ -0,0 +1,48 @@
+From 84eeef108d36c7aa725e6b8098960937c5d1b38e Mon Sep 17 00:00:00 2001
+From: Scott Tsai <scottt.tw at gmail.com>
+Date: Fri, 16 Dec 2011 05:56:39 +0800
+Subject: [PATCH] svf: guard against chain->cable being NULL
+
+While processing:
+cable ft2232 vid=0x0403 pid=0x6011
+bsdl path .
+detect
+svf ./orpsoc_top.svf stop progress
+quit
+
+If the specified cable isn't present, jtag would SEGFAULT with this backtrace:
+ #0  urj_tap_cable_get_frequency (cable=0x0) at cable.c:529
+ #1  0x00007fefd4f4803a in urj_svf_run (chain=0x20562a0, SVF_FILE=0x20567b0, stop_on_mismatch=1, ref_freq=0) at svf.c:1117
+ #2  0x00007fefd4f40681 in cmd_svf_run (chain=0x20562a0, params=0x20565a0) at cmd_svf.c:83
+ #3  0x00007fefd4f3e9ad in urj_cmd_run (chain=0x20562a0, params=0x20565a0) at cmd_cmd.c:276
+ #4  0x00007fefd4f4438d in urj_parse_line (chain=0x20562a0, line=0x2056520 "svf ./orpsoc_top.svf stop progress") at parse.c:165
+ #5  0x00007fefd4f44447 in urj_parse_stream (chain=0x20562a0, f=0x20562e0) at parse.c:207
+ #6  0x00007fefd4f4456b in urj_parse_file (chain=0x20562a0, filename=0x7fff90576b92 "./program_fpga.jtag") at parse.c:235
+ #7  0x00000000004016c1 in main (argc=2, argv=<optimized out>) at jtag.c:486
+
+This patch changes urj_svf_run to guard against chain->cable being NULL.
+---
+ urjtag/src/svf/svf.c |    7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/urjtag/src/svf/svf.c b/urjtag/src/svf/svf.c
+index 9552a6d..2282c77 100644
+--- a/urjtag/src/svf/svf.c
++++ b/urjtag/src/svf/svf.c
+@@ -1114,7 +1114,12 @@ urj_svf_run (urj_chain_t *chain, FILE *SVF_FILE, int stop_on_mismatch,
+     urj_svf_parser_priv_t priv;
+     int c = ~EOF;
+     int num_lines;
+-    uint32_t old_frequency = urj_tap_cable_get_frequency (chain->cable);
++    uint32_t old_frequency;
++
++    if (chain == NULL || chain->cable == NULL)
++    	return  URJ_STATUS_FAIL;
++
++    old_frequency = urj_tap_cable_get_frequency (chain->cable);
+ 
+     /* get number of lines in svf file so we can give user some feedback on long
+        files or slow cables */
+-- 
+1.7.7.5
+
diff --git a/sources b/sources
index e69de29..47fa95a 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+c212f353a991db4b569fd938709efb34  urjtag-20111215-git-e1a4227.tar.bz2
diff --git a/urjtag.spec b/urjtag.spec
new file mode 100644
index 0000000..afd2f08
--- /dev/null
+++ b/urjtag.spec
@@ -0,0 +1,111 @@
+Name:           urjtag
+Version:        0.10
+Release:        2%{?dist}.20111215gite1a4227
+Summary:        A tool for communicating over JTAG with flash chips and CPUs
+Group:          Development/Tools
+
+License:        GPLv2+
+URL:            http://urjtag.org
+# Snapshot from official git-svn mirror
+# git://urjtag.git.sourceforge.net/gitroot/urjtag/urjtag
+Source0:        urjtag-20111215-git-e1a4227.tar.bz2
+# NOTE:
+# The upstream git-svn repo contains two directories: 'web' and 'urjtag'.
+# We're only interested in packaging the later.
+# Yet urjtag's configure script calls git to get the snapshot version,
+# (grep for SVN_REVISION in the source)
+# thus we preserve the .git, web and urjtag directory structure in our snapshot tarballs.
+# The presense of this extra level of 'urjtag' dir causes some awkwardness in this spec.
+
+# 0001-svf-guard-against-chain-cable-being-NULL.patch
+# Sent to the urjtag-development list on Jan 24, 2012:
+# http://sourceforge.net/mailarchive/forum.php?thread_name=1327375235-16426-1-git-send-email-scottt.tw%40gmail.com&forum_name=urjtag-development
+Patch0:         0001-svf-guard-against-chain-cable-being-NULL.patch
+
+# We do autoreconf for the git snapshot
+BuildRequires:  gettext-devel
+BuildRequires:  libtool
+BuildRequires:  readline-devel
+BuildRequires:  libftdi-devel
+BuildRequires:  swig
+BuildRequires:  python-devel
+
+%description
+UrJTAG aims to create an enhanced, modern tool for communicating
+over JTAG with flash chips, CPUs, and many more.
+
+%package        devel
+Summary:        Development files for %{name}
+Group:          Development/Libraries
+Requires:       %{name} = %{version}-%{release}
+
+
+%description    devel
+The %{name}-devel package contains libraries and header files for
+developing applications that use %{name}.
+
+%package        python
+Summary:        Python bindings for %{name}
+Group:          Development/Libraries
+Requires:       %{name} = %{version}-%{release}
+
+
+%description    python
+Python bindings and examples for %{name}.
+
+
+
+%prep
+%setup -q -n %{name}-20111215-git-e1a4227
+
+
+%build
+cd urjtag
+autoreconf -i -s -v -f
+%configure --enable-stapl
+# V=1: verbose build, disables AM_SILENT_RULES
+make %{?_smp_mflags} V=1
+
+
+%install
+rm -rf %{buildroot}
+cd urjtag
+make install DESTDIR=%{buildroot}
+rm -f %{buildroot}%{_libdir}/*.la
+rm -f %{buildroot}%{_libdir}/*.a
+%find_lang %{name}
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+ 
+%files -f urjtag/%{name}.lang
+%doc urjtag/README urjtag/NEWS urjtag/ChangeLog urjtag/COPYING urjtag/AUTHORS
+%doc urjtag/doc/howto_add_support_for_more_flash.txt
+%doc urjtag/doc/README.ejtag urjtag/doc/README.pld urjtag/doc/README.stapl
+%doc urjtag/doc/UrJTAG.txt
+%{_bindir}/jtag
+%{_bindir}/bsdl2jtag
+%{_libdir}/liburjtag.so.*
+%dir %{_datadir}/urjtag/
+%{_datadir}/urjtag/*
+%{_mandir}/man1/jtag.1*
+%{_mandir}/man1/bsdl2jtag.1*
+
+%files devel
+%dir %{_includedir}/urjtag
+%{_includedir}/urjtag/*.h
+%{_libdir}/liburjtag.so
+%{_libdir}/pkgconfig/urjtag.pc
+
+%files python
+%{_libdir}/python*/site-packages/urjtag*.egg-info
+%{_libdir}/python*/site-packages/urjtag.so
+%doc urjtag/doc/urjtag-python.txt 
+%doc urjtag/bindings/python/t_urjtag_chain.py
+%doc urjtag/bindings/python/t_srst.py
+
+
+%changelog
+* Thu Dec 15 2011 Scott Tsai <scottt.tw at gmail.com> 0.10-2.20111215gite1a4227
+- Initial RPM release


More information about the scm-commits mailing list