diff --git a/0001-usb_modeswitch-count-the-target-devices-from-zero.patch b/0001-usb_modeswitch-count-the-target-devices-from-zero.patch new file mode 100644 index 0000000..822ee72 --- /dev/null +++ b/0001-usb_modeswitch-count-the-target-devices-from-zero.patch @@ -0,0 +1,26 @@ +From 99cade3624c432a478e624f278692cdedf4e0450 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Fri, 18 Aug 2017 10:40:41 +0200 +Subject: [PATCH] usb_modeswitch: count the target devices from zero + +Most likely a typo here. +--- + usb_modeswitch.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/usb_modeswitch.c b/usb_modeswitch.c +index 3239946..1b3bf9d 100644 +--- a/usb_modeswitch.c ++++ b/usb_modeswitch.c +@@ -1582,7 +1582,7 @@ int checkSuccess() + * description is read for syslog message + */ + // Wait counter passed on from previous loop +- for (i=i; i < CheckSuccess; i++) { ++ for (i=0; i < CheckSuccess; i++) { + SHOW_PROGRESS(output," Search for target devices ...\n"); + dev = search_devices(&newTargetCount, TargetVendor, TargetProductList, + TargetClass, 0, SEARCH_TARGET); +-- +2.14.3 + diff --git a/device_reference.txt b/device_reference.txt index d3065d9..d34ec3e 100644 --- a/device_reference.txt +++ b/device_reference.txt @@ -1,16 +1,16 @@ # # Device Reference (UTF-8 encoding used) # -# Last modified: 2017-02-05 +# Last modified: 2014-05-29 # # Collection of configurations for usb_modeswitch, a mode switching # tool for controlling flip flop (multiple mode) USB devices # # Detailed instructions and a friendly forum on the homepage: # http://www.draisberghof.de/usb_modeswitch -# -# Note that new devices are no longer added to this file. See the -# config files included with the data package for these +# +# You may want to check for a newer version of this file at: +# http://www.draisberghof.de/usb_modeswitch/device_reference.txt # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @@ -21,10 +21,9 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# For a parameter reference see file REFERENCE in the data package or -# http://www.draisberghof.de/usb_modeswitch/parameter_reference.txt +# For a parameter reference see file REFERENCE in the data package # -# If you find new working codes and configurations, please report +# If you find working codes and configurations, please contribute # them! @@ -32,7 +31,6 @@ ####################################################### # Option GlobeSurfer Icon (aka "Vodafone EasyBox") -# This is the thing that started it all ... # # The MessageContent is identical for all Option devices diff --git a/sources b/sources index 6e90156..85020d3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (usb-modeswitch-2.6.2.tar.bz2) = adaedf89de3c5f9dc55da7bb5bb3fe8165c0424cffacb00f83876094b7abdc386ced9959e5dbdf46ab06aa1d03fbfca13df539421489ef4d2dd0f72742057f3d +SHA512 (usb-modeswitch-2.6.1.tar.bz2) = 5d800b45257ca1182a13155dc37b614ee2d93273ed226cc9d05b6ae423f9e88b7c9aca6829604bdb86f68707ddf2c51c9ad2bcf898b8261b2c5bb56a21351e1e diff --git a/usb_modeswitch-2.6.2-SIGTERM.patch b/usb_modeswitch-2.6.2-SIGTERM.patch deleted file mode 100644 index ce4352b..0000000 --- a/usb_modeswitch-2.6.2-SIGTERM.patch +++ /dev/null @@ -1,49 +0,0 @@ -From e3cf80c95a1c67d05dded68ec171bfde4686003f Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Thu, 14 Aug 2025 16:35:56 +0200 -Subject: [PATCH] service: Do not ever send SIGTERM to the unit - -Following happens when modem 03f0:a31d (HP lt4132 LTE/HSPA+ 4G Module) is -plugged: - -- systemd-udevd emits "add" action -- The "add" action triggers restart of usb_modeswitch@.service -- usb_modeswitch@.service starts usb_modeswitch -- Another udev rule renames the network interface from usb0 to enp0... -- Above causes systemd-udevd emit "change" action for the device -- The "change" action triggers another restart of usb_modeswitch@.service -- usb_modeswitch run initially gets terminated mid-air -- Device drops off the bus -- Infinite sadness - -Possible solutions: - -- The udev rule could just emit the "change" action. I have no idea why - it handles "change" actions, but it looks intentional -> No touchy - from me. -- usb_modeswitch could just trap TERM and shut down gracefully. This - involves Tcl -> No touchy. -- The systemd unit could just send an innocent signal instead of TERM - and just let usb_modeswitch end its life journey naturally. - Let's do this, because it involves least brain. - -Anybody please feel free to send this upstream. ---- - usb_modeswitch@.service | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/usb_modeswitch@.service b/usb_modeswitch@.service -index 22d2ea7..23d4ed0 100644 ---- a/usb_modeswitch@.service -+++ b/usb_modeswitch@.service -@@ -7,3 +7,7 @@ ExecStart=/usr/sbin/usb_modeswitch_dispatcher --switch-mode %i - # Testing - #ExecStart=/bin/echo "usb_modeswitch.service: device name is %i" - -+# Do not ever terminate violently on restart -- interrupting the switching -+# transaction will crash some modems! We'll terminate shortly anyways. -+# If we hang, FinalKillSignal (defaults to SIGKILL) will take care of that. -+KillSignal=SIGCONT --- -2.50.1 - diff --git a/usb_modeswitch.spec b/usb_modeswitch.spec index b4fa0c0..4356975 100644 --- a/usb_modeswitch.spec +++ b/usb_modeswitch.spec @@ -1,29 +1,27 @@ -%define source_name usb-modeswitch +%define source_name usb-modeswitch -Name: usb_modeswitch -Version: 2.6.2 -Release: 6%{?dist} -Summary: USB Modeswitch gets mobile broadband cards in operational mode -Summary(de): USB Modeswitch aktiviert UMTS-Karten -License: GPL-2.0-or-later -URL: http://www.draisberghof.de/usb_modeswitch/ +Name: usb_modeswitch +Version: 2.6.1 +Release: 5%{?dist} +Summary: USB Modeswitch gets mobile broadband cards in operational mode +Summary(de): USB Modeswitch aktiviert UMTS-Karten +License: GPLv2+ +URL: http://www.draisberghof.de/usb_modeswitch/ -Source0: http://www.draisberghof.de/%{name}/%{source_name}-%{version}.tar.bz2 -Source1: http://www.draisberghof.de/usb_modeswitch/device_reference.txt +Source0: http://www.draisberghof.de/%{name}/%{source_name}-%{version}.tar.bz2 +Source1: http://www.draisberghof.de/usb_modeswitch/device_reference.txt # Submitted upstream (2014-11-24) Patch0: device_reference-utf8.patch -# Not submitted upstream due to lack of courage -Patch1: usb_modeswitch-2.6.2-SIGTERM.patch -BuildRequires: make +BuildRequires: make BuildRequires: gcc -BuildRequires: libusbx-devel +BuildRequires: libusbx-devel # "tcl" or "jimsh"), use the light-weight installation: -#BuildRequires: jimtcl-devel -BuildRequires: systemd -Requires: usb_modeswitch-data >= 20121109 -Requires: systemd +#BuildRequires: jimtcl-devel +BuildRequires: systemd +Requires: usb_modeswitch-data >= 20121109 +Requires: systemd %description USB Modeswitch brings up your datacard into operational mode. When plugged @@ -32,7 +30,7 @@ installation files. This tool deactivates this cdrom-device and enables the real communication device. It supports most devices built and sold by Huawei, T-Mobile, Vodafone, Option, ZTE, Novatel. -%description -l de +%description -l de USB Modeswitch deaktiviert die CDROM-Emulation einiger UMTS-Karten. Dadurch erkennt Linux die Datenkarte und kann damit Internet- Verbindungen aufbauen. Die gängigen Karten von Huawei, T-Mobile, @@ -43,8 +41,7 @@ Vodafone, Option, ZTE und Novatell werden unterstützt. %setup -q -n %{source_name}-%{version} cp -f %{SOURCE1} device_reference.txt -%patch 0 -p0 -%patch 1 -p1 +%patch0 -p0 %build @@ -55,11 +52,10 @@ cp -f %{SOURCE1} device_reference.txt %install -mkdir -p %{buildroot}%{_unitdir} +mkdir -p $RPM_BUILD_ROOT%{_unitdir} %make_install \ - SYSDIR=%{buildroot}%{_unitdir} \ - SBINDIR=%{buildroot}%{_sbindir} \ - UDEVDIR=%{buildroot}%{_prefix}/lib/udev + SYSDIR=$RPM_BUILD_ROOT%{_unitdir} \ + UDEVDIR=$RPM_BUILD_ROOT%{_prefix}/lib/udev %files @@ -70,54 +66,10 @@ mkdir -p %{buildroot}%{_unitdir} %{_prefix}/lib/udev/usb_modeswitch %{_unitdir}/usb_modeswitch@.service %config(noreplace) %{_sysconfdir}/usb_modeswitch.conf -%doc README ChangeLog device_reference.txt -%license COPYING +%doc COPYING README ChangeLog device_reference.txt %changelog -* Fri Jul 17 2026 Fedora Release Engineering - 2.6.2-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild - -* Sat Jan 17 2026 Fedora Release Engineering - 2.6.2-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild - -* Thu Aug 14 2025 Lubomir Rintel - 2.6.2-4 -- Do not let the unit send SIGTERM to usb_modeswitch mid-switch. - -* Fri Jul 25 2025 Fedora Release Engineering - 2.6.2-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Thu Feb 27 2025 Sérgio Basto - 2.6.2-2 -- Revert the move of usb_modeswitch to /usr/lib/udev/rules.d, usb_modeswitch is - not an rule - -* Thu Feb 20 2025 Sérgio Basto - 2.6.2-1 -- Update usb_modeswitch to 2.6.2 -- Resolves: rhbz#2346392 -- Fix build related to /usr/sbin move - -* Sun Jan 19 2025 Fedora Release Engineering - 2.6.1-12 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Sat Jul 20 2024 Fedora Release Engineering - 2.6.1-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Sat Jan 27 2024 Fedora Release Engineering - 2.6.1-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Thu Nov 2 2023 Íñigo Huguet - 2.6.1-9 -- Really use SPDX license specifier - -* Thu Aug 24 2023 Till Maas - 2.6.1-8 -- Cleanup spec: use %%license, use %%patch 0 -- Use spdx license specifier - -* Sat Jul 22 2023 Fedora Release Engineering - 2.6.1-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Sat Jan 21 2023 Fedora Release Engineering - 2.6.1-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - * Sat Jul 23 2022 Fedora Release Engineering - 2.6.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild