Compare commits
No commits in common. "rawhide" and "f25" have entirely different histories.
7 changed files with 132 additions and 200 deletions
29
0001-Fix-crash-on-early-fail.patch
Normal file
29
0001-Fix-crash-on-early-fail.patch
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
From 73001792b29f080fcabc57f30d6030bedb2a24b0 Mon Sep 17 00:00:00 2001
|
||||
From: Lubomir Rintel <lkundrak@v3.sk>
|
||||
Date: Wed, 20 Jul 2016 21:14:10 +0200
|
||||
Subject: [PATCH] Fix crash on early fail
|
||||
|
||||
Don't uninitialize libusb if it has not been initialized yet.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1358472
|
||||
---
|
||||
usb_modeswitch.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/usb_modeswitch.c b/usb_modeswitch.c
|
||||
index cbb8c28..f9c8b2e 100644
|
||||
--- a/usb_modeswitch.c
|
||||
+++ b/usb_modeswitch.c
|
||||
@@ -2021,7 +2021,8 @@ void close_all()
|
||||
libusb_close(devh);
|
||||
// libusb_exit will crash on Raspbian 7, crude protection
|
||||
#ifndef __ARMEL__
|
||||
- libusb_exit(NULL);
|
||||
+ if (ctx)
|
||||
+ libusb_exit(NULL);
|
||||
#endif
|
||||
if (sysmode)
|
||||
closelog();
|
||||
--
|
||||
2.7.4
|
||||
|
||||
34
0001-usb_modeswitch-don-t-return-a-value-from-stack.patch
Normal file
34
0001-usb_modeswitch-don-t-return-a-value-from-stack.patch
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
From 93686f8ba8c1ed6bf559dbfda53f9c7d702c76b5 Mon Sep 17 00:00:00 2001
|
||||
From: Lubomir Rintel <lkundrak@v3.sk>
|
||||
Date: Thu, 21 Jul 2016 18:13:58 +0200
|
||||
Subject: [PATCH] usb_modeswitch: don't return a value from stack
|
||||
|
||||
The memory is not allocated anymore when the function returns and that
|
||||
causes no end of mayhem and undefined behavior.
|
||||
|
||||
Let's make it static so that it's perserved after the return. It wastes
|
||||
LINE_DIM bytes of memory and requires the caller to consume the value
|
||||
before another call, but that's no problem.
|
||||
|
||||
http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=2&t=2557
|
||||
---
|
||||
usb_modeswitch.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/usb_modeswitch.c b/usb_modeswitch.c
|
||||
index f9c8b2e..3373ccf 100644
|
||||
--- a/usb_modeswitch.c
|
||||
+++ b/usb_modeswitch.c
|
||||
@@ -1855,7 +1855,8 @@ char* ReadParseParam(const char* FileName, char *VariableName)
|
||||
char *FirstQuote, *LastQuote, *P1, *P2;
|
||||
int Line=0;
|
||||
unsigned Len=0, Pos=0;
|
||||
- char Str[LINE_DIM], *token, *configPos;
|
||||
+ static char Str[LINE_DIM];
|
||||
+ char *token, *configPos;
|
||||
FILE *file = NULL;
|
||||
|
||||
// Reading and storing input during the first call
|
||||
--
|
||||
2.7.4
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
23
rhbz948451-fix-manual-pages.patch
Normal file
23
rhbz948451-fix-manual-pages.patch
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
diff --git a/usb_modeswitch.c b/usb_modeswitch.c
|
||||
index 52598f7..cbb8c28 100644
|
||||
--- a/usb_modeswitch.c
|
||||
+++ b/usb_modeswitch.c
|
||||
@@ -2060,7 +2060,8 @@ void printHelp()
|
||||
" -g, --device-num NUM system device number (for hard ID)\n"
|
||||
" -m, --message-endpoint NUM direct the message transfer there (optional)\n"
|
||||
" -M, --message-content <msg> message to send (hex number as string)\n"
|
||||
- " -2 <msg>, -3 <msg> additional messages to send (-n recommended)\n"
|
||||
+ " -2, --message-content2 <msg> additional messages to send (-n recommended)\n"
|
||||
+ " -3, --message-content3 <msg> additional messages to send (-n recommended)\n"
|
||||
" -w, --release-delay NUM wait NUM ms before releasing the interface\n"
|
||||
" -n, --need-response obsolete, no effect (always on)\n"
|
||||
" -r, --response-endpoint NUM read response from there (optional)\n"
|
||||
@@ -2084,7 +2085,7 @@ void printHelp()
|
||||
" -Q, --quiet don't show progress or error messages\n"
|
||||
" -W, --verbose print all settings and debug output\n"
|
||||
" -D, --sysmode specific result and syslog message\n"
|
||||
- " -s, --success <seconds> switching result check with timeout\n"
|
||||
+ " -s, --check-success <seconds> switching result check with timeout\n"
|
||||
" -I, --inquire obsolete, no effect\n\n"
|
||||
" -c, --config-file <filename> load long configuration from file\n\n"
|
||||
" -t, --stdinput read long configuration from stdin\n\n"
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (usb-modeswitch-2.6.2.tar.bz2) = adaedf89de3c5f9dc55da7bb5bb3fe8165c0424cffacb00f83876094b7abdc386ced9959e5dbdf46ab06aa1d03fbfca13df539421489ef4d2dd0f72742057f3d
|
||||
6e1640db47768bb9012f91b7593116ef usb-modeswitch-2.4.0.tar.bz2
|
||||
|
|
|
|||
|
|
@ -1,49 +0,0 @@
|
|||
From e3cf80c95a1c67d05dded68ec171bfde4686003f Mon Sep 17 00:00:00 2001
|
||||
From: Lubomir Rintel <lkundrak@v3.sk>
|
||||
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@<port>.service
|
||||
- usb_modeswitch@<port>.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@<port>.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
|
||||
|
||||
|
|
@ -1,29 +1,31 @@
|
|||
%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.4.0
|
||||
Release: 5%{?dist}
|
||||
Summary: USB Modeswitch gets mobile broadband cards in operational mode
|
||||
Summary(de): USB Modeswitch aktiviert UMTS-Karten
|
||||
Group: Applications/System
|
||||
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
|
||||
|
||||
# http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=2&t=2546
|
||||
Patch0: rhbz948451-fix-manual-pages.patch
|
||||
# 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
|
||||
Patch1: device_reference-utf8.patch
|
||||
# http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=2&t=2556
|
||||
Patch2: 0001-Fix-crash-on-early-fail.patch
|
||||
# http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=2&t=2557
|
||||
Patch3: 0001-usb_modeswitch-don-t-return-a-value-from-stack.patch
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc
|
||||
BuildRequires: libusbx-devel
|
||||
# "tcl" or "jimsh"), use the light-weight installation:
|
||||
#BuildRequires: jimtcl-devel
|
||||
BuildRequires: systemd
|
||||
Requires: usb_modeswitch-data >= 20121109
|
||||
Requires: systemd
|
||||
BuildRequires: libusbx-devel
|
||||
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 +34,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,23 +45,22 @@ 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 -p1 -b .manpage
|
||||
%patch1 -p0 -b .utf8
|
||||
%patch2 -p1 -b .libusb_exit
|
||||
%patch3 -p1 -b .stack
|
||||
|
||||
|
||||
%build
|
||||
%{set_build_flags}
|
||||
# this will require jimtcl-devel
|
||||
#make_build all-with-dynlink-dispatcher
|
||||
%make_build
|
||||
CFLAGS="$RPM_OPT_FLAGS" make %{?_smp_mflags}
|
||||
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}%{_unitdir}
|
||||
%make_install \
|
||||
SYSDIR=%{buildroot}%{_unitdir} \
|
||||
SBINDIR=%{buildroot}%{_sbindir} \
|
||||
UDEVDIR=%{buildroot}%{_prefix}/lib/udev
|
||||
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
|
||||
make install \
|
||||
DESTDIR=$RPM_BUILD_ROOT \
|
||||
SYSDIR=$RPM_BUILD_ROOT%{_unitdir} \
|
||||
UDEVDIR=$RPM_BUILD_ROOT%{_prefix}/lib/udev
|
||||
|
||||
|
||||
%files
|
||||
|
|
@ -70,114 +71,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 <releng@fedoraproject.org> - 2.6.2-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
|
||||
|
||||
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.2-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
|
||||
|
||||
* Thu Aug 14 2025 Lubomir Rintel <lkundrak@v3.sk> - 2.6.2-4
|
||||
- Do not let the unit send SIGTERM to usb_modeswitch mid-switch.
|
||||
|
||||
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.2-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
|
||||
|
||||
* Thu Feb 27 2025 Sérgio Basto <sergio@serjux.com> - 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 <sergio@serjux.com> - 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 <releng@fedoraproject.org> - 2.6.1-12
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
|
||||
|
||||
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
|
||||
|
||||
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Thu Nov 2 2023 Íñigo Huguet <ihuguet@redhat.com> - 2.6.1-9
|
||||
- Really use SPDX license specifier
|
||||
|
||||
* Thu Aug 24 2023 Till Maas <opensource@till.name> - 2.6.1-8
|
||||
- Cleanup spec: use %%license, use %%patch 0
|
||||
- Use spdx license specifier
|
||||
|
||||
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Wed Nov 18 2020 Sérgio Basto <sergio@serjux.com> - 2.6.1-1
|
||||
- Update usb_modeswitch to 2.6.1
|
||||
- Drop patch1, http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=2&t=2733
|
||||
- Drop BR jimtcl-devel, if we don't install dynlink-dispatcher
|
||||
|
||||
* Tue Sep 29 2020 Sérgio Basto <sergio@serjux.com> - 2.6.0-3
|
||||
- Use make macros (https://src.fedoraproject.org/rpms/usb_modeswitch/pull-request/1)
|
||||
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
|
||||
|
||||
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.0-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Tue Mar 24 2020 Lubomir Rintel <lkundrak@v3.sk> - 2.6.0-1
|
||||
- New 2.6.0 release
|
||||
|
||||
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.2-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.2-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.2-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.2-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Wed Feb 28 2018 Lubomir Rintel <lkundrak@v3.sk> - 2.5.2-1
|
||||
- New 2.5.2 release
|
||||
|
||||
* Fri Feb 23 2018 Florian Weimer <fweimer@redhat.com> - 2.5.1-3
|
||||
- Use LDFLAGS from redhat-rpm-config
|
||||
|
||||
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Fri Aug 18 2017 Lubomir Rintel <lkundrak@v3.sk> - 2.5.1-1
|
||||
- New 2.5.1 release
|
||||
|
||||
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||
|
||||
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||
|
||||
* Fri Jul 29 2016 Lubomir Rintel <lkundrak@v3.sk> - 2.4.0-5
|
||||
- Bump the release number to be higher than in Fedora 24
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue