Automatic Activation, Hotplug and UDEV, Configuration
-
uto.ughi
- Posts: 17
- Joined: 25 Jun 2011, 11:47
Post
by uto.ughi » 11 Oct 2015, 14:34
I've updated my usbmodeswitch installation but but something went wrong. help me joshua
Linux hp 3.13.0-63-generic #103-Ubuntu SMP Fri Aug 14 21:43:30 UTC 2015 i686 i686 i686 GNU/Linux but went wrong also on another 64bit
Code: Select all
sudo make install
sed 's_!/usr/bin/tclsh_!'"/usr/bin/jimsh"'_' < usb_modeswitch.tcl > usb_modeswitch_dispatcher
cc -o usb_modeswitch usb_modeswitch.c -Wall `pkg-config --libs --cflags libusb-1.0`
usb_modeswitch.c: In function ‘main’:
usb_modeswitch.c:500:3: warning: implicit declaration of function ‘libusb_error_name’ [-Wimplicit-function-declaration]
fprintf(stderr, "Error: Failed to initialize libusb. %s (%d)\n\n", libusb_error_name(libusbError), libusbError);
^
usb_modeswitch.c:500:3: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘int’ [-Wformat=]
/tmp/ccmB7x4w.o: nella funzione "main":
usb_modeswitch.c:(.text+0x1afe): riferimento non definito a "libusb_error_name"
collect2: error: ld returned 1 exit status
make: *** [usb_modeswitch] Errore 1
hp@hp:~/usb-modeswitch-2.2.5$ lsusb
Bus 001 Device 007: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 010: ID 1bbb:0165 T & A Mobile Phones
Bus 001 Device 015: ID 12d1:14fe Huawei Technologies Co., Ltd. Modem (Mass Storage Mode)
[ 1804.928201] usb 1-3.3.3: new high-speed USB device number 15 using ehci-pci
[ 1805.023370] usb 1-3.3.3: New USB device found, idVendor=12d1, idProduct=14fe
[ 1805.023385] usb 1-3.3.3: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[ 1805.023395] usb 1-3.3.3: Product: HUAWEI Mobile
[ 1805.023403] usb 1-3.3.3: Manufacturer: HUAWEI
[ 1805.030627] usb-storage 1-3.3.3:1.0: USB Mass Storage device detected
[ 1805.033161] scsi4 : usb-storage 1-3.3.3:1.0
[ 1806.033540] scsi 4:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
[ 1806.036649] sr0: scsi-1 drive
[ 1806.036662] cdrom: Uniform CD-ROM driver Revision: 3.20
[ 1806.040748] sr 4:0:0:0: Attached scsi CD-ROM sr0
[ 1806.041268] sr 4:0:0:0: Attached scsi generic sg3 type 5
[ 1808.682738] ISO 9660 Extensions: Microsoft Joliet Level 1
[ 1808.730137] ISOFS: changing to secondary root
[ 1843.136370] net_ratelimit: 18 callbacks suppressed
thx in forward
-
Josh
- Site Admin
- Posts: 6593
- Joined: 03 Nov 2007, 00:30
Post
by Josh » 12 Oct 2015, 22:43
This looks like your libusb version is somewhat outdated.
Just go into the source code (usb_modeswitch.c) and edit line 500. Replace this
Code: Select all
fprintf(stderr, "Error: Failed to initialize libusb. %s (%d)\n\n", libusb_error_name(libusbError), libusbError);
with this
Code: Select all
fprintf(stderr, "Error: Failed to initialize libusb (%d)\n\n", libusbError);
It's just an error report, doesn't affect the rest of the program.
-
uto.ughi
- Posts: 17
- Joined: 25 Jun 2011, 11:47
Post
by uto.ughi » 14 Oct 2015, 13:48
Josh wrote:This looks like your libusb version is somewhat outdated.
Just go into the source code (usb_modeswitch.c) and edit line 500. Replace this
Code: Select all
fprintf(stderr, "Error: Failed to initialize libusb. %s (%d)\n\n", libusb_error_name(libusbError), libusbError);
with this
Code: Select all
fprintf(stderr, "Error: Failed to initialize libusb (%d)\n\n", libusbError);
It's just an error report, doesn't affect the rest of the program.
And what about this error.
Code: Select all
root@kali:~/usb-modeswitch-2.2.5# make install
sed 's_!/usr/bin/tclsh_!'"/usr/bin/tclsh"'_' < usb_modeswitch.tcl > usb_modeswitch_dispatcher
cc -o usb_modeswitch usb_modeswitch.c -Wall `pkg-config --libs --cflags libusb-1.0`
/bin/sh: 1: pkg-config: not found
In file included from usb_modeswitch.c:59:0:
usb_modeswitch.h:26:20: fatal error: libusb.h: File o directory non esistente
compilation terminated.
make: *** [usb_modeswitch] Error 1
root@kali:~/usb-modeswitch-2.2.5# uname -a
Linux kali 3.18.0-kali3-amd64 #1 SMP Debian 3.18.6-1~kali2 (2015-03-02) x86_64 GNU/Linux
root@kali:~/usb-modeswitch-2.2.5#
-
Josh
- Site Admin
- Posts: 6593
- Joined: 03 Nov 2007, 00:30
Post
by Josh » 14 Oct 2015, 13:51
I did not notice the first time ...
It seems like you have not installed the development package of libusb1. Look for a package named "libusb1-dev" or "libusbx-dev" and install it.
-
uto.ughi
- Posts: 17
- Joined: 25 Jun 2011, 11:47
Post
by uto.ughi » 14 Oct 2015, 14:12
Josh wrote:I did not notice the first time ...
It seems like you have not installed the development package of libusb1. Look for a package named "libusb1-dev" or "libusbx-dev" and install it.
Solved on a 686 xubuntu Linux hp 3.13.0-63-generic #103-Ubuntu SMP Fri Aug 14 21:43:30 UTC 2015 i686 i686 i686 GNU/Linux and connected via usb hub powered so I need to manual launch
Code: Select all
sudo usb_modeswitch -v 0x12d1 -p 0x14fe -V 0x12d1 -P 0x1506 -J
to change state
On the x64 xubuntu Linux hp 3.13.0-63-generic I uncommented the delay in the conf to solve recognition on usb 3.0 port. When connected to usb 2.0 needs to launch
Code: Select all
sudo usb_modeswitch -v 0x12d1 -p 0x14fe -V 0x12d1 -P 0x1506 -J
still persist problem with kali
Code: Select all
root@kali:~# apt-get install libusb-dev libusb-1.0-0-dev --reinstall
Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze [/color]
Lettura informazioni sullo stato... Fatto
I seguenti pacchetti sono stati installati automaticamente e non sono più richiesti:
libnl-cli-3-200 libnl-nf-3-200
Usare "apt-get autoremove" per rimuoverli.
0 aggiornati, 0 installati, 2 reinstallati, 0 da rimuovere e 0 non aggiornati.
È necessario scaricare 0 B/104 kB di archivi.
Dopo quest'operazione, verranno occupati 0 B di spazio su disco.
(Lettura del database... 154747 file e directory attualmente installati.)
Preparativi per sostituire libusb-1.0-0-dev:amd64 v.2:1.0.17-1~bpo70+1 (utilizzando .../libusb-1.0-0-dev_2%3a1.0.17-1~bpo70+1_amd64.deb)...
Estrazione del sostituto di libusb-1.0-0-dev:amd64...
Preparativi per sostituire libusb-dev v.2:0.1.12-20+nmu1 (utilizzando .../libusb-dev_2%3a0.1.12-20+nmu1_amd64.deb)...
Estrazione del sostituto di libusb-dev...
Elaborazione dei trigger per man-db...
Configurazione di libusb-1.0-0-dev:amd64 (2:1.0.17-1~bpo70+1)...
Configurazione di libusb-dev (2:0.1.12-20+nmu1)...
[color=#BF4000]root@kali:~# cd usb-modeswitch-2.2.5/ && make install
sed 's_!/usr/bin/tclsh_!'"/usr/bin/tclsh"'_' < usb_modeswitch.tcl > usb_modeswitch_dispatcher
cc -o usb_modeswitch usb_modeswitch.c -Wall `pkg-config --libs --cflags libusb-1.0`
/bin/sh: 1: pkg-config: not found
In file included from usb_modeswitch.c:59:0:
usb_modeswitch.h:26:20: fatal error: libusb.h: File o directory non esistente
compilation terminated.[/color]
make: *** [usb_modeswitch] Error 1
uname -a
Linux kali 3.18.0-kali3-amd64 #1 SMP Debian 3.18.6-1~kali2 (2015-03-02) x86_64 GNU/Linux
-
Josh
- Site Admin
- Posts: 6593
- Joined: 03 Nov 2007, 00:30
Post
by Josh » 14 Oct 2015, 16:39
Check the folder /usr/include - does the file "libusb.h" exist?
-
uto.ughi
- Posts: 17
- Joined: 25 Jun 2011, 11:47
Post
by uto.ughi » 14 Oct 2015, 16:42
Josh wrote:Check the folder /usr/include - does the file "libusb.h" exist?
no
Code: Select all
ls /usr/include/lib
libgen.h libintl.h libio.h libusb-1.0/
ls /usr/include/libusb-1.0/libusb.h
/usr/include/libusb-1.0/libusb.h
I suppose that it's the sub dir libusb-1.0 but how to fix it?
SOLVED
missing pkg-config
Code: Select all
ed Oct 14 16:41:13 2015 from 192.168.1.8
root@kali:~# apt-get install pkg-config
Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze
Lettura informazioni sullo stato... Fatto
I seguenti pacchetti sono stati installati automaticamente e non sono più richiesti:
libnl-cli-3-200 libnl-nf-3-200
Usare "apt-get autoremove" per rimuoverli.
I seguenti pacchetti NUOVI saranno installati:
pkg-config
0 aggiornati, 1 installati, 0 da rimuovere e 0 non aggiornati.
È necessario scaricare 59,5 kB di archivi.
Dopo quest'operazione, verranno occupati 172 kB di spazio su disco.
Scaricamento di:1 http://http.kali.org/kali/ kali/main pkg-config amd64 0.26-1 [59,5 kB]
Recuperati 59,5 kB in 2s (21,8 kB/s)
Selezionato il pacchetto pkg-config non precedentemente selezionato.
(Lettura del database... 154747 file e directory attualmente installati.)
Estrazione di pkg-config (da .../pkg-config_0.26-1_amd64.deb)...
Elaborazione dei trigger per man-db...
Configurazione di pkg-config (0.26-1)...
root@kali:~# cd usb-modeswitch-2.2.5/
root@kali:~/usb-modeswitch-2.2.5# make install
sed 's_!/usr/bin/tclsh_!'"/usr/bin/tclsh"'_' < usb_modeswitch.tcl > usb_modeswitch_dispatcher
cc -o usb_modeswitch usb_modeswitch.c -Wall `pkg-config --libs --cflags libusb-1.0`
install -D --mode=755 usb_modeswitch /usr/sbin/usb_modeswitch
install -D --mode=755 usb_modeswitch.sh /lib/udev/usb_modeswitch
install -D --mode=644 usb_modeswitch.conf /etc/usb_modeswitch.conf
install -D --mode=644 usb_modeswitch.1 /usr/share/man/man1/usb_modeswitch.1
install -D --mode=644 usb_modeswitch_dispatcher.1 /usr/share/man/man1/usb_modeswitch_dispatcher.1
install -D --mode=755 usb_modeswitch_dispatcher /usr/sbin/usb_modeswitch_dispatcher
install -d /var/lib/usb_modeswitch
test -d /etc/init -a -e /sbin/initctl && install --mode=644 usb-modeswitch-upstart.conf /etc/init || test 1
test -d /etc/systemd/system -a \( -e /usr/bin/systemctl -o -e /bin/systemctl \) && install --mode=644 usb_modeswitch@.service /etc/systemd/system || test 1