Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 07-01-2015, 08:50 AM   #1
la_tristesse
Member
la_tristesse began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Oct 2011
Device: Kindle Paperwhite 2
udev rule for kindle paperwhite 2 with usbnet doesnt work

I'm running Ubunut 15.04 on a 64-bit System with a Kindle Paperwhite 2. Here's my usbnet config:

Code:
$ cat /mnt/base-us/usbnet/etc/config
#!/bin/sh
#
# $Id: config 9688 2013-08-10 00:30:05Z NiLuJe $
#

# WARNING: Take note that we're essentially a shell script, se we absolutely *MUST* use UNIX line endings!
# WARNING: To avoid leaving your system in an undefined state,
#          do *NOT* modify this file while usb over ethernet is enabled!
#          (That means when the the auto enable feature is in use, too!)

# Tweak this to your liking (IPv4 only, no hostname aliases)
KINDLE_IP=192.168.15.244

# Allow SSH over WiFi
# NOTE: If you set this to true, the SSHD *WILL* check your passwords!
# Make sure you know your root password, or auth via shared keys!
USE_WIFI="true"

# Don't switch to Ethernet over USB, and only launch SSHD
# NOTE: Make sure you're able to properly login over SSH before enabling this...
# It's obviously only useful with WiFi devices, so leave to false on non-WiFi devices
USE_WIFI_SSHD_ONLY="false"

# Use OpenSSH instead of dropbear (somewhat faster login)
# NOTE: OpenSSH *WILL* check your passwords!
# Make sure you know your root password, or auth via shared keys!
USE_OPENSSH="true"

# Don't let dropbear print the banner at each login
QUIET_DROPBEAR="false"

# Use a custom NIC field for the MAC adresses.
# Will mostly be of use to people needing to plug multiple Kindles on the same computer/network.
TWEAK_MAC_ADDRESS="false"
I followed the instructions at https://wiki.mobileread.com/wiki/Kindle_Touch_Hacking about about "Preventing networkmanager to connect to device".

Here are the steps I performed:

Code:
$ sudo nano /etc/udev/rules.d/90-local.rules
ACTION=="add", KERNEL=="usb0", ATTRS{manufacturer}==""Linux 3.0.35-lab126 with fsl-usb2-udc", RUN+="/etc/udev/scripts/kindle"
$ sudo mkdir -p  /etc/udev/scripts/
$ sudo nano /etc/udev/scripts/kindle
#!/bin/bash
ifconfig usb0 down
ifconfig usb0 hw ether 48:b3:35:3e:96:9b
ifconfig usb0 192.168.15.201
ifconfig usb0 up
$ sudo chmod  +x /etc/udev/scripts/kindle
$ sudo udevadm control --reload 
$ sudo nano /etc/NetworkManager/NetworkManager.conf
[keyfile]
unmanaged-devices=mac:48:b3:35:3e:96:9b
Because i wasnt able to connect to ssh after I plugged the pw2 back into the usb-port I begann monitoring udev with:

Code:
$ udevadm monitor --kernel
KERNEL[15829.836665] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.6/1-4.6:1.0/net/usb0/queues/rx-0 (queues)
KERNEL[15829.836712] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.6/1-4.6:1.0/net/usb0/queues/tx-0 (queues)
KERNEL[15829.836738] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.6/1-4.6:1.0/net/usb0 (net)
KERNEL[15829.868418] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.6/1-4.6:1.0 (usb)
KERNEL[15829.868465] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.6/1-4.6:1.1 (usb)
KERNEL[15829.872928] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.6 (usb)
KERNEL[15840.111293] add      /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.6 (usb)
KERNEL[15840.113088] add      /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.6/1-4.6:1.0 (usb)
KERNEL[15840.116244] add      /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.6/1-4.6:1.0/net/usb0 (net)
KERNEL[15840.116278] add      /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.6/1-4.6:1.0/net/usb0/queues/rx-0 (queues)
KERNEL[15840.116304] add      /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.6/1-4.6:1.0/net/usb0/queues/tx-0 (queues)
KERNEL[15840.117149] add      /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.6/1-4.6:1.1 (usb)
I then altered the udev-rule to the following:

Code:
$ sudo nano /etc/udev/rules.d/90-local.rules
KERNEL=="usb[0-9]*", DEVPATH=="/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.6/1-4.6:1.0/net/usb0", ACTION=="add", RUN+="/etc/udev/scripts/kindle"
Both rules didnt succeed. I cant connect to ssh. So I'm left wondering what I did wrong. Any suggestions?
la_tristesse is offline   Reply With Quote
Old 07-01-2015, 09:08 AM   #2
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
First suspect is timing.

I.E: udev runs when the device is detected, which is very likely to be before the device itself is ready.

Note: A common problem with udev and USB devices.
knc1 is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Paperwhite 2 usbnet asks for root password cokolokolo Kindle Developer's Corner 2 09-07-2014 04:51 PM
'page-break-before|after: always' doesnt work sadhu44 ePub 18 06-18-2014 04:28 PM
USBNet not working Paperwhite 5.3.6 futsoulja Kindle Developer's Corner 11 06-29-2013 09:41 PM
usb doesnt work, want to use SD only bookeenbart Bookeen 8 02-04-2010 11:16 AM
Dictionary look up doesnt work... Chrikow Bookeen 0 11-16-2008 08:01 PM


All times are GMT -4. The time now is 03:08 AM.


MobileRead.com is a privately owned, operated and funded community.