Files
fxload/fxload-2013_01_03-prefer_DEVNAME.patch
Marcus Meissner cd4771354d Accepting request 924809 from home:polslinux:branches:Base:System
- Update to v2013_01_03:
  * Switch to a more updated codebase, since the previous one
    has been unmaintained for years and do not support newer devices.
    This codebase is the same as the old fxload but with some small
    changes made by Steven J. Magnani that add support for
    Cypress FX3 USB 3.0 devices.
    This package is needed, for example, by most of the recent
    astronomical cameras (e.g QHY, ZWO, etc), otherwise the OS
    will not be able to recognize them.
- Rebase and rename fxload-2013_01_03-prefer_DEVNAME.patch

OBS-URL: https://build.opensuse.org/request/show/924809
OBS-URL: https://build.opensuse.org/package/show/Base:System/fxload?expand=0&rev=20
2021-10-15 12:24:50 +00:00

54 lines
2.0 KiB
Diff

--- fx3load-2013_01_03/main.c.orig 2021-10-07 16:21:12.459576894 +0200
+++ fx3load-2013_01_03/main.c 2021-10-07 16:23:05.868024865 +0200
@@ -35,7 +35,7 @@
*
* -L <path> -- Create a symbolic link to the device.
* -m <mode> -- Set the permissions on the device after download.
- * -D <path> -- Use this device, instead of $DEVICE
+ * -D <path> -- Use this device, instead of $DEVNAME or $DEVICE
*
* -V -- Print version ID for program
*
@@ -44,10 +44,10 @@
* expects these environment variables which are passed by hotplug to
* its sub-scripts:
*
- * DEVICE=<path>
- * This is the path to the device is /proc/bus/usb. It is the
- * complete path to the device, that I can pass to open and
- * manipulate as a USB device.
+ * DEVNAME=<path>, DEVICE=<path>
+ * This is the path to the device in /dev/bus/usb or
+ * /proc/bus/usb. It is the complete path to the device, that
+ * I can pass to open and manipulate as a USB device.
*/
# include <stdlib.h>
@@ -92,13 +92,16 @@
{
const char *link_path = 0;
const char *ihex_path = 0;
- const char *device_path = getenv("DEVICE");
+ const char *device_path = getenv("DEVNAME");
const char *type = 0;
const char *stage1 = 0;
mode_t mode = 0;
int opt;
int config = -1;
+ if (!device_path)
+ device_path = getenv("DEVICE");
+
while ((opt = getopt (argc, argv, "2vV?D:I:L:c:lm:s:t:")) != EOF)
switch (opt) {
@@ -193,7 +196,7 @@
fputs ("\t\t[-I firmware_hexfile] ", stderr);
fputs ("[-s loader] [-c config_byte]\n", stderr);
fputs ("\t\t[-L link] [-m mode]\n", stderr);
- fputs ("... [-D devpath] overrides DEVICE= in env\n", stderr);
+ fputs ("... [-D devpath] overrides DEVNAME= and DEVICE= in env\n", stderr);
fputs ("... device types: one of an21, fx, fx2, fx2lp, fx3\n", stderr);
fputs ("... at least one of -I, -L, -m is required\n", stderr);
return -1;