Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package uhubctl for openSUSE:Factory checked in at 2021-02-15 23:19:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/uhubctl (Old) and /work/SRC/openSUSE:Factory/.uhubctl.new.28504 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "uhubctl" Mon Feb 15 23:19:20 2021 rev:5 rq:872134 version:2.4.0 Changes: -------- --- /work/SRC/openSUSE:Factory/uhubctl/uhubctl.changes 2020-12-14 18:10:14.283691957 +0100 +++ /work/SRC/openSUSE:Factory/.uhubctl.new.28504/uhubctl.changes 2021-02-15 23:21:24.891854145 +0100 @@ -1,0 +2,12 @@ +Sun Feb 14 08:47:13 UTC 2021 - Martin Hauke <mar...@gmx.de> + +- Update to version 2.4.0 + * Support for toggle action (turn power on or off opposite to + current power state). + * More sane error reporting when we enumerate devices which + lack permissions. + * Allow pkg-config override to make some build systems (e.g. + chromium OS) happier. + * Even more supported devices. + +------------------------------------------------------------------- Old: ---- uhubctl-2.3.0.tar.gz New: ---- uhubctl-2.4.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ uhubctl.spec ++++++ --- /var/tmp/diff_new_pack.vQ8sgf/_old 2021-02-15 23:21:25.507855066 +0100 +++ /var/tmp/diff_new_pack.vQ8sgf/_new 2021-02-15 23:21:25.507855066 +0100 @@ -1,7 +1,7 @@ # # spec file for package uhubctl # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: uhubctl -Version: 2.3.0 +Version: 2.4.0 Release: 0 Summary: USB hub per-port power control License: GPL-2.0-only ++++++ uhubctl-2.3.0.tar.gz -> uhubctl-2.4.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uhubctl-2.3.0/Formula/uhubctl.rb new/uhubctl-2.4.0/Formula/uhubctl.rb --- old/uhubctl-2.3.0/Formula/uhubctl.rb 2020-12-13 23:31:05.000000000 +0100 +++ new/uhubctl-2.4.0/Formula/uhubctl.rb 2021-02-14 01:21:16.000000000 +0100 @@ -2,8 +2,8 @@ desc "USB hub per-port power control" homepage "https://github.com/mvp/uhubctl" head "https://github.com/mvp/uhubctl.git" - url "https://github.com/mvp/uhubctl/archive/v2.2.0.tar.gz" - sha256 "e5a722cb41967903bedbab4eea566ab332241a7f05fc7bc9c386b9a5e1762d8b" + url "https://github.com/mvp/uhubctl/archive/v2.3.0.tar.gz" + sha256 "714f733592d3cb6ba8efc84fbc03b1beed2323918ff33aef01cdb956755be7b7" license "GPL-2.0" depends_on "libusb" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uhubctl-2.3.0/Makefile new/uhubctl-2.4.0/Makefile --- old/uhubctl-2.3.0/Makefile 2020-12-13 23:31:05.000000000 +0100 +++ new/uhubctl-2.4.0/Makefile 2021-02-14 01:21:16.000000000 +0100 @@ -10,6 +10,7 @@ INSTALL_DIR := $(INSTALL) -m 755 -d INSTALL_PROGRAM := $(INSTALL) -m 755 RM := rm -rf +PKG_CONFIG ?= pkg-config CC ?= gcc CFLAGS ?= -g -O0 @@ -26,9 +27,9 @@ endif # Use pkg-config if available -ifneq (,$(shell which pkg-config)) - CFLAGS += $(shell pkg-config --cflags libusb-1.0) - LDFLAGS += $(shell pkg-config --libs libusb-1.0) +ifneq (,$(shell which $(PKG_CONFIG))) + CFLAGS += $(shell $(PKG_CONFIG) --cflags libusb-1.0) + LDFLAGS += $(shell $(PKG_CONFIG) --libs libusb-1.0) else # But it should still build if pkg-config is not available (e.g. Linux or Mac homebrew) LDFLAGS += -lusb-1.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uhubctl-2.3.0/README.md new/uhubctl-2.4.0/README.md --- old/uhubctl-2.3.0/README.md 2020-12-13 23:31:05.000000000 +0100 +++ new/uhubctl-2.4.0/README.md 2021-02-14 01:21:16.000000000 +0100 @@ -23,10 +23,11 @@ | AmazonBasics | HU9003V1EBL | 7 | 3.1 |`2109:2817`| 2018 | | | AmazonBasics | HU9002V1SBL, HU9002V1ESL | 10 | 3.1 |`2109:2817`| 2018 | | | AmazonBasics | HUC9002V1SBL, HUC9002V1EBL, HUC9002V1ESL | 10 | 3.1 |`2109:2817`| 2018 | | -| Anker | AK-68ANHUB-BV7A-0004 | 7 | 3.0 |`2109:0812`| 2014 | | +| Anker | AK-68ANHUB-BV7A-0004 ([note](https://git.io/JLnZb)) | 7 | 3.0 |`2109:0812`| 2014 | | | Apple | Thunderbolt Display 27" (internal USB hub) | 6 | 2.0 | | 2011 | 2016 | | Apple | USB Keyboard With Numeric Pad (internal USB hub) | 3 | 2.0 | | 2011 | | | Asus | Z87-PLUS Motherboard (onboard USB hub) | 4 | 3.0 | | 2013 | 2016 | +| Aukey | CB-C59 | 4 | 3.1 |`2109:2813`| 2017 | | | B+B SmartWorx | UHR204 | 4 | 2.0 |`0856:DB00`| 2013 | | | B+B SmartWorx | USH304 | 4 | 3.0 |`04B4:6506`| 2017 | | | Basler | 2000036234 | 4 | 3.0 |`0451:8046`| 2016 | | @@ -37,7 +38,7 @@ | Club3D | CSV-3242HD Dual Display Docking Station | 4 | 3.0 |`2109:2811`| 2015 | | | CyberPower | CP-H420P | 4 | 2.0 |`0409:0059`| 2004 | | | Cypress | CY4608 HX2VL development kit | 4 | 2.0 |`04B4:6570`| 2012 | | -| D-Link | DUB-H4 rev B (silver) | 4 | 2.0 |`05E3:0605`| 2005 | 2010 | +| D-Link | DUB-H4 rev B (silver). Note: rev B7+ not supported | 4 | 2.0 |`05E3:0605`| 2005 | 2010 | | D-Link | DUB-H4 rev D,E (black). Note: rev A,C,F not supported| 4 | 2.0 |`05E3:0608`| 2012 | | | D-Link | DUB-H7 rev A (silver) | 7 | 2.0 |`2001:F103`| 2005 | 2010 | | D-Link | DUB-H7 rev D,E (black). Note: rev B,C,F not supported| 7 | 2.0 |`05E3:0608`| 2012 | | @@ -46,6 +47,7 @@ | Dell | UltraSharp 1704FPT 17" LCD Monitor | 4 | 2.0 |`0424:A700`| 2005 | 2015 | | Dell | UltraSharp U2415 24" LCD Monitor | 5 | 3.0 | | 2014 | | | Elecom | U2H-G4S | 4 | 2.0 | | 2006 | 2011 | +| ExSys | EX-1113HMS | 16 | 3.1 | | 2018 | | | GlobalScale | ESPRESSObin SBUD102 V5 | 1 | 3.0 |`1D6B:0003`| 2017 | | | Hawking Technology | UH214 | 4 | 2.0 | | 2003 | 2008 | | IOI | U3H415E1 | 4 | 3.0 | | 2012 | | @@ -67,6 +69,7 @@ | Plugable | USB3-HUB7BC | 7 | 3.0 |`2109:0813`| 2015 | | | Plugable | USB3-HUB7C | 7 | 3.0 |`2109:0813`| 2015 | | | Plugable | USB3-HUB7-81X | 7 | 3.0 |`2109:0813`| 2012 | | +| Port Inc | NWUSB01 | 4 | 1.1 |`0451:1446`| 1999 | 2003 | | Raspberry Pi | B+, 2B, 3B ([see below](#raspberry-pi-b2b3b)) | 4 | 2.0 | | 2011 | | | Raspberry Pi | 3B+ ([see below](#raspberry-pi-3b)) | 4 | 2.0 |`0424:2514`| 2018 | | | Raspberry Pi | 4B ([see below](#raspberry-pi-4b)) | 4 | 3.0 |`2109:3431`| 2019 | | @@ -76,7 +79,7 @@ | Sanwa Supply | USB-HUB14GPH | 4 | 1.1 | | 2001 | 2003 | | Seagate | Backup Plus Hub STEL8000100 | 2 | 3.0 |`0BC2:AB44`| 2016 | | | Sunix | SHB4200MA | 4 | 2.0 |`0409:0058`| 2006 | 2009 | -| Targus | PAUH212U | 7 | 2.0 | | 2004 | 2009 | +| Targus | PAUH212/PAUH212U | 7 | 2.0 | | 2004 | 2009 | | Texas Instruments | TUSB4041PAPEVM | 4 | 2.1 |`0451:8142`| 2015 | | This table is by no means complete. @@ -163,7 +166,7 @@ uhubctl -a off -p 2 This means operate on default smart hub and turn power off (`-a off`, or `-a 0`) -on port 2 (`-p 2`). Supported actions are `off`/`on`/`cycle` (or `0`/`1`/`2`). +on port 2 (`-p 2`). Supported actions are `off`/`on`/`cycle`/`toggle` (or `0`/`1`/`2`/`3`). `cycle` means turn power off, wait some delay (configurable with `-d`) and turn it back on. Ports can be comma separated list, and may use `-` for ranges e.g. `2`, or `2,4`, or `2-5`, or `1-2,5-8`. @@ -255,6 +258,8 @@ 3. If tests above were successful, please report your hub by opening new issue at https://github.com/mvp/uhubctl/issues, so we can add it to list of supported devices. + Please do not report unsupported hubs, unless it is different + hardware revision of some already listed supported model. #### _USB devices are not removed after port power down on Linux_ @@ -306,7 +311,9 @@ #### _Raspberry Pi turns power off on all ports, not just the one I specified_ -This is limitation of Raspberry Pi hardware design. +This is the limitation of Raspberry Pi hardware design. +As a workaround, you can buy any external USB hub from supported list above, +attach it to any USB port of Raspberry Pi, and control power on its ports independently. For reference, supported Raspberry Pi models have following internal USB topology: @@ -349,10 +356,6 @@ * USB2 hub `3`, 1 port, OTG controller. Power switching is [not supported](https://git.io/JUc5Q). -As a workaround, you can buy any external USB hub from supported list, -attach it to any USB port of Raspberry Pi, and control power on its ports independently. - - Notable projects using uhubctl ============================== @@ -374,6 +377,7 @@ | [USB fan for Raspberry Pi](https://bit.ly/2TRV6sM) | Control USB fan to avoid Raspberry Pi overheating | | [Raspberry Pi Reboot Router](https://bit.ly/3aNbQqs) | Automatically reboot router if internet isn't working | | [Control USB Lamp With Voice](https://bit.ly/2VtW2SX) | Voice Control of USB Lamp using Siri and Raspberry Pi | +| [Control USB LED Strip](https://bit.ly/3oVWfeZ) | Controlling USB powered LED Light Strip | Copyright diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uhubctl-2.3.0/VERSION new/uhubctl-2.4.0/VERSION --- old/uhubctl-2.3.0/VERSION 2020-12-13 23:31:05.000000000 +0100 +++ new/uhubctl-2.4.0/VERSION 2021-02-14 01:21:16.000000000 +0100 @@ -1 +1 @@ -2.3.0 +2.4.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uhubctl-2.3.0/uhubctl.c new/uhubctl-2.4.0/uhubctl.c --- old/uhubctl-2.3.0/uhubctl.c 2020-12-13 23:31:05.000000000 +0100 +++ new/uhubctl-2.4.0/uhubctl.c 2021-02-14 01:21:16.000000000 +0100 @@ -75,6 +75,7 @@ #define POWER_OFF 0 #define POWER_ON 1 #define POWER_CYCLE 2 +#define POWER_TOGGLE 3 #define MAX_HUB_CHAIN 8 /* Per USB 3.0 spec max hub chain is 7 */ @@ -248,7 +249,7 @@ "Without options, show status for all smart hubs.\n" "\n" "Options [defaults in brackets]:\n" - "--action, -a - action to off/on/cycle (0/1/2) for affected ports.\n" + "--action, -a - action to off/on/cycle/toggle (0/1/2/3) for affected ports.\n" "--ports, -p - ports to operate on [all hub ports].\n" "--location, -l - limit hub by location [all smart hubs].\n" "--level -L - limit hub by location level (e.g. a-b.c is level 3).\n" @@ -876,15 +877,15 @@ hub_phys_count++; } } + if (perm_ok == 0 && hub_phys_count == 0) { #ifdef __gnu_linux__ - if (perm_ok == 0 && geteuid() != 0) { - fprintf(stderr, - "There were permission problems while accessing USB.\n" - "Follow https://git.io/JIB2Z for a fix!\n" - ); - } + if (geteuid() != 0) { + fprintf(stderr, + "There were permission problems while accessing USB.\n" + "Follow https://git.io/JIB2Z for a fix!\n" + ); + } #endif - if (perm_ok == 0 && hub_phys_count == 0) { return LIBUSB_ERROR_ACCESS; } return hub_phys_count; @@ -942,6 +943,9 @@ if (!strcasecmp(optarg, "cycle") || !strcasecmp(optarg, "2")) { opt_action = POWER_CYCLE; } + if (!strcasecmp(optarg, "toggle") || !strcasecmp(optarg, "3")) { + opt_action = POWER_TOGGLE; + } break; case 'd': opt_delay = atof(optarg); @@ -1029,6 +1033,9 @@ continue; if (k == 1 && opt_action == POWER_KEEP) continue; + // if toggle requested, do it only once when `k == 0` + if (k == 1 && opt_action == POWER_TOGGLE) + continue; int i; for (i=0; i<hub_count; i++) { if (hubs[i].actionable == 0) @@ -1053,15 +1060,16 @@ int port_status = get_port_status(devh, port); int power_mask = hubs[i].super_speed ? USB_SS_PORT_STAT_POWER : USB_PORT_STAT_POWER; - if (k == 0 && !(port_status & power_mask)) + int powered_on = port_status & power_mask; + if (opt_action == POWER_TOGGLE) { + request = powered_on ? LIBUSB_REQUEST_CLEAR_FEATURE + : LIBUSB_REQUEST_SET_FEATURE; + } + if (k == 0 && !powered_on && opt_action != POWER_TOGGLE) continue; - if (k == 1 && (port_status & power_mask)) + if (k == 1 && powered_on) continue; - int repeat = 1; - if (k == 0) - repeat = opt_repeat; - if (!(port_status & ~power_mask)) - repeat = 1; + int repeat = powered_on ? opt_repeat : 1; while (repeat-- > 0) { rc = libusb_control_transfer(devh, LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_OTHER,