Powering on a N9 with a broken power key

Tue, 02 Sep 2025 12:00:00 +0000

If your N9 is broken, but you have SSH access via USB networking, you can modify getbootstate to unconditionally return "USER" and cause the device to power on whenever USB power is connected.

The N9 I have here has a broken power key, meaning it doesn't react to power button presses to turn on. Connecting a USB cable does bring up the device to a point where it charges (internally, it actually boots up the Linux kernel, but stays UI-wise in the fittingly named ACT_DEAD mode).

Connecting a USB cable to a PC brings up USB networking, and allows me to SSH into the device (you probably have to set this up first, possibly after a reflash and in that case definitely before turning off the device).

If USB networking DOES come up, your host PC should have the manual IP address 192.168.2.14 (with netmask of /24) configured. You should then be able to SSH into your N9 (even in actdead mode) using the IP address 192.168.2.15 (username user, the default N9 user).

To query what caused the device to boot up, use:

# /sbin/getbootstate 2>/dev/null
ACT_DEAD

Notably, getbootstate is part of DSME, which is still maintained and used in Sailfish OS. Although it's been some time, the Git history of the file shows that nothing much has changed since 2011.

Now, where does it access the getbootstate binary?

# grep -r getbootstate /etc/
/etc/init.conf:mandatorybinary /sbin/getbootstate
/etc/init/ttyS0.conf:   [ "x$(getbootstate 2>/dev/null)" = "xFLASH" ] && exit 99
/etc/init/dsme.conf:        boot_state=`getbootstate  2>/dev/null`
/etc/init/dsme.conf:        export BOOTSTATE=`getbootstate -f 2>/dev/null`
/etc/init/rc-default.conf:  BOOTSTATE=`getbootstate 2>/dev/null`
/etc/init/flash-check.conf:    if [ "x$(getbootstate 2>/dev/null)" = "xFLASH" ]; then

This brings up - among other things - dsme, going further:

# cat /var/lib/dsme/saved_state
ACT_DEAD

Now, if this content is modified:

# echo -n USER > /var/lib/dsme/saved_state

Then the tool reports:

# /sbin/getbootstate
getbootstate: User requested reboot (saved_state=USER, bootreason=sw_rst)
USER

And finally using this incantation, you can boot the N9:

# /sbin/reboot

However, when just using a USB charger, you might get:

# /sbin/getbootstate
getbootstate: User attached charger
ACT_DEAD

The next step requires an open mode kernel to not get into MALF state and require a reflash. Use disclaimer-cal remove View-openmode for the best experience, which is also a nice search term to find open mode kernel downloads and flashing instructions.

With an open mode kernel running, create a simple shell script like this:

#!/bin/sh
echo -n USER

Move the original one out of the way for safekeeping, place the shell script above into /sbin/getbootstate and make it executable:

mv /sbin/getbootstate /sbin/getbootstate.orig
# ... put the above shell script into /sbin/getbootstate ...
chmod +x /sbin/getbootstate

How to power it off? Open the Terminal app, become root using devel-su and then use /sbin/poweroff (note that /sbin/ is not in your $PATH, so you need to specify the full path).

Additional links:

Resurrect Your N9 on Maemo Wiki (web.archive.org)

Resurrect a Nokia N9 (2019 article)