Hey juiceme, OK, got a dead battery. And put it to charger. Checked again and now return value is "0", so everything okay! This time bootreason=usb. When I got the 255 the bootreason was sw_rst. Maybe this caused the 255? IDK. - I still have sometimes weird restart behavior, i.e. after decoupling battery (nemo did not start) it needed a few attempts. It seems bootreason=pwr_off? Maybe change the bootreason in command_line also? - Charging does not take place when connected charger to powered off phone. it goes to ubi console and does not charge. Maybe wait for 60s and when there was no telnet connection established (do not know how to detect) then boot to Harmattan (bootreason=act_dead) and let it charge?
# if boot reason is USB or RTC, boot up directly to default Harmattan bootreason=$(cat /proc/original_cmdline | cut -d' ' -f12 | cut -d'=' -f2) if [ "$bootreason" != "pwr_key" ]; then if [ -r /boot/menu/select_default_os.sh ]; then mount /mnt/2 /boot/menu/select_default_os.sh if [ $? -eq 0 ]; then /usr/bin/disable_pm # restart to the default Harmattan OS kexec -e ; echo $? ; sleep 10 fi fi fi