We have moved to a new Sailfish OS Forum. Please start new discussions there.
1

Setting up network interface on PC for usb developer mode

asked 2014-01-10 18:53:17 +0300

evk gravatar image

Anyone handy with udev rules?

I tried the following:

ACTION=="add", SUBSYSTEM=="net", ATTRS{ID_VENDOR_ID}=="2931", RUN+="/sbin/ifconfig usb0 192.168.2.1"

Doesn't work though, but I do admit that my udev skills are very limited.

edit retag flag offensive close delete

Comments

Isn't at this point (net/add) device already renamed?

koudi ( 2014-01-10 20:21:56 +0300 )edit

@evk Try and replace ATTRS{ID_VENDOR_ID}==.... by ENV{ID_VENDOR_ID}==....

SebM ( 2019-10-29 02:52:28 +0300 )edit

2 Answers

Sort by » oldest newest most voted
2

answered 2015-01-30 15:03:12 +0300

Self-Perfection gravatar image

Following rule works for me:

$ cat /etc/udev/rules.d/98-jolla.rules 
SUBSYSTEM=="net", ACTION=="add", ENV{ID_MODEL}=="Sailfish", ENV{ID_SERIAL_SHORT}=="PUT_YOUR_ID_HERE", RUN+="/usr/bin/ifconfig $env{INTERFACE} 192.168.2.13"

You have to remove ID_SERIAL_SHORT checking part or put there ID of your device. You can check ID of your device by running sudo udevadm monitor --environment --udev and [un]plugging your device.

Note that filename of rules file have to end with .rules

You probably need to reload udev daemon config. Under Arch linux I've run

sudo systemctl restart systemd-udevd

just in case.

edit flag offensive delete publish link more
1

answered 2014-01-10 20:22:25 +0300

javispedro gravatar image

updated 2014-01-10 20:22:34 +0300

You can also use NetworkManager for this. Whenever you plug the Jolla, a new "wired connection" appears. Configure it with a static IP address as you would with any other ethernet connection.

edit flag offensive delete publish link more

Comments

Seems like I disabled NetworkManager on my machine, cause it's not running. But for most users that probably is the best answer.

evk ( 2014-01-10 21:05:04 +0300 )edit

@evk you might also use your distro's normal networking tools, depending on it. (e.g. /etc/network/interfaces on Debian).

javispedro ( 2014-01-10 21:09:42 +0300 )edit
Login/Signup to Answer

Question tools

Follow
1 follower

Stats

Asked: 2014-01-10 18:53:17 +0300

Seen: 838 times

Last updated: Jan 30 '15