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

Revision history [back]

click to hide/show revision 1
initial version

posted 2015-11-09 15:07:36 +0200

Is starting developer mode on USB connection without unlocking possible?

I would like to be able just connect jolla via USB to my desktop PC and have all jolla files at hand on PC. Right now it almost works:

  1. "Default USB mode" is set to "Developer mode";
  2. Whenever PC notices USB connection from Jolla it mounts jolla FS via sshfs

But pretty often manual interaction is required as developer mode does not start while the device is locked.

Is it possible to make developer mode start regardless of locked state? It really does not make much sense to add extra protection as SSH connection requires at least providing proper password.

Is starting Starting developer mode on USB connection without unlocking possible?unlocking

I would like to be able just connect jolla via USB to my desktop PC and have all jolla files at hand on PC. Right now it almost works:

  1. "Default USB mode" is set to "Developer mode";
  2. Whenever PC notices USB connection from Jolla it mounts jolla FS via sshfs

But pretty often manual interaction is required as developer mode does not start while the device is locked.

Is it possible to make developer mode start regardless of locked state? It really does not make much sense to add extra protection as SSH connection requires at least providing proper password.

Solution

USB behaviour is controlled by usb_moded daemon. [According to documentation](https://git.merproject.org/mer-core

When started with -r usb_moded will always enable developer mode (networking) if it can. This is a debug feature and should not be used in production software.

Looks exactly as what I looked for! So how do we force this daemon to run with -r flag? Service unit file contains following config:

$ grep -FA10 '[Service]' /lib/systemd/system/usb-moded.service
[Service]
Type=notify
TimeoutSec=15
EnvironmentFile=-/var/lib/environment/usb-moded/*.conf
EnvironmentFile=-/run/usb-moded/*.conf
ExecStart=/usr/sbin/usb_moded --systemd --force-syslog $USB_MODED_ARGS
Restart=always
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=basic.target

I decided to create environment file:

$ cat /var/lib/environment/usb-moded/alwaysdevmode.conf
USB_MODED_ARGS=-r

And of course restart daemon with new environment # systemctl daemon-reload && systemctl restart usb-moded.service And now my Jolla always starts developer USB mode right after attaching to USB port regardless of whether it locked or not. Problem solved :)

Starting developer mode on USB connection without unlocking

I would like to be able just connect jolla via USB to my desktop PC and have all jolla files at hand on PC. Right now it almost works:

  1. "Default USB mode" is set to "Developer mode";
  2. Whenever PC notices USB connection from Jolla it mounts jolla FS via sshfs

But pretty often manual interaction is required as developer mode does not start while the device is locked.

Is it possible to make developer mode start regardless of locked state? It really does not make much sense to add extra protection as SSH connection requires at least providing proper password.

Solution

USB behaviour is controlled by usb_moded daemon. [According to documentation](https://git.merproject.org/mer-coreAccording to documentation

When started with -r usb_moded will always enable developer mode (networking) if it can. This is a debug feature and should not be used in production software.

Looks exactly as what I looked for! So how do we force this daemon to run with -r flag? Service unit file contains following config:

$ grep -FA10 '[Service]' /lib/systemd/system/usb-moded.service
[Service]
Type=notify
TimeoutSec=15
EnvironmentFile=-/var/lib/environment/usb-moded/*.conf
EnvironmentFile=-/run/usb-moded/*.conf
ExecStart=/usr/sbin/usb_moded --systemd --force-syslog $USB_MODED_ARGS
Restart=always
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=basic.target

I decided to create environment file:

$ cat /var/lib/environment/usb-moded/alwaysdevmode.conf
USB_MODED_ARGS=-r

And of course restart daemon with new environment # systemctl daemon-reload && systemctl restart usb-moded.service And now my Jolla always starts developer USB mode right after attaching to USB port regardless of whether it locked or not. Problem solved :)

Starting developer mode on USB connection without unlocking

I would like to be able just connect jolla via USB to my desktop PC and have all jolla files at hand on PC. Right now it almost works:

  1. "Default USB mode" is set to "Developer mode";
  2. Whenever PC notices USB connection from Jolla it mounts jolla FS via sshfs

But pretty often manual interaction is required as developer mode does not start while the device is locked.

Is it possible to make developer mode start regardless of locked state? It really does not make much sense to add extra protection as SSH connection requires at least providing proper password.

Solution

USB behaviour is controlled by usb_moded daemon. According to documentation

When started with -r usb_moded will always enable developer mode (networking) if it can. This is a debug feature and should not be used in production software.

Looks exactly as what I looked for! So how do we force this daemon to run with -r flag? Service unit file contains following config:

$ grep -FA10 '[Service]' /lib/systemd/system/usb-moded.service
[Service]
Type=notify
TimeoutSec=15
EnvironmentFile=-/var/lib/environment/usb-moded/*.conf
EnvironmentFile=-/run/usb-moded/*.conf
ExecStart=/usr/sbin/usb_moded --systemd --force-syslog $USB_MODED_ARGS
Restart=always
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=basic.target

I decided to create environment file:

$ cat /var/lib/environment/usb-moded/alwaysdevmode.conf
USB_MODED_ARGS=-r

And of course restart daemon with new environment # systemctl daemon-reload && systemctl restart usb-moded.service And now my Jolla always starts developer USB mode right after attaching to USB port regardless of whether it locked or not. Problem solved :)

Update 2017-06-03: Since SailfishOS 2.1.0.11 (Iijoki) me solution no longer works :(

Starting developer mode on USB connection without unlocking

I would like to be able just connect jolla via USB to my desktop PC and have all jolla files at hand on PC. Right now it almost works:

  1. "Default USB mode" is set to "Developer mode";
  2. Whenever PC notices USB connection from Jolla it mounts jolla FS via sshfs

But pretty often manual interaction is required as developer mode does not start while the device is locked.

Is it possible to make developer mode start regardless of locked state? It really does not make much sense to add extra protection as SSH connection requires at least providing proper password.

Solution

USB behaviour is controlled by usb_moded daemon. According to documentation

When started with -r usb_moded will always enable developer mode (networking) if it can. This is a debug feature and should not be used in production software.

Looks exactly as what I looked for! So how do we force this daemon to run with -r flag? Service unit file contains following config:

$ grep -FA10 '[Service]' /lib/systemd/system/usb-moded.service
[Service]
Type=notify
TimeoutSec=15
EnvironmentFile=-/var/lib/environment/usb-moded/*.conf
EnvironmentFile=-/run/usb-moded/*.conf
ExecStart=/usr/sbin/usb_moded --systemd --force-syslog $USB_MODED_ARGS
Restart=always
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=basic.target

I decided to create environment file:

$ cat /var/lib/environment/usb-moded/alwaysdevmode.conf
USB_MODED_ARGS=-r

And of course restart daemon with new environment # systemctl daemon-reload && systemctl restart usb-moded.service And now my Jolla always starts developer USB mode right after attaching to USB port regardless of whether it locked or not. Problem solved :)

Update 2017-06-03: Since SailfishOS 2.1.0.11 (Iijoki) me my solution no longer works :(