maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   General (https://talk.maemo.org/forumdisplay.php?f=7)
-   -   A small utility program to soft reboot your tablet (https://talk.maemo.org/showthread.php?t=15223)

bunanson 2008-01-17 06:36

A small utility program to soft reboot your tablet
 
step by step instruction here, http://www.internettablettalk.com/fo...=12863&page=19 thread #186.

It allows one to reboot your tablet without using the tablet power button.

enjoy,

bun

cashel 2008-01-17 07:07

Re: A small utility program to soft reboot your tablet
 
That's a rather roundabout way to execute the reboot command, plus it involves installing an application which is always running. Have you tried just adding a link to the shell script in the application menu?

fanoush 2008-01-17 07:08

Re: A small utility program to soft reboot your tablet
 
You can also edit /etc/systemui/systemui.xml and uncomment reboot item so it in not inside <!-- -->.
After one reboot you have 'reboot' item in power key menu. But true that this can't 'reboot your tablet without using the tablet power buttton'.

bunanson 2008-01-17 07:21

Re: A small utility program to soft reboot your tablet
 
All I want is a .deb file on the desktop that would,

- xterm
- sudo gainroot
- shutdown -r now

My bb3.sh is a very big roundabout way of doing it to get around the f!@#$$king power on problem. I called the script my poorman's programming. Whatever, it works beautifully, I have reboot it more than 20 times just for fun. Now I do not have the "phobia" of NOT able to power on. I am studying the application manu see whether it will allow me to do similar task w less roundabout. Thanks for both Cashel and Fanoush's suggestion. BTW, this is my "Hello world" for the tablet :p.

I also have an Asus EEE running Xandros Linux. Can I use that to compile the .sh into a .deb file and put it on the desktop? Look at the poll, there is more than 25 users having the power on problem.... In fact, maybe a soft reboot should be built-in into the platform in the future tablet release, uh?


bun

Dr Tran 2008-01-17 07:34

Re: A small utility program to soft reboot your tablet
 
Quote:

Originally Posted by fanoush (Post 129192)
You can also edit /etc/systemui/systemui.xml and uncomment reboot item so it in not inside <!-- -->.
After one reboot you have 'reboot' item in power key menu. But true that this can't 'reboot your tablet without using the tablet power buttton'.

Can you walk me through on how to do that?

bunanson 2008-01-17 07:35

Re: A small utility program to soft reboot your tablet
 
Quote:

Originally Posted by Dr Tran (Post 129199)
Can you walk me through on how to do that?


me 2.


bun

fanoush 2008-01-17 09:47

Re: A small utility program to soft reboot your tablet
 
open xterm
sudo gainroot
vi /etc/systemui/systemui.xml
position cursor on beginning of comment <!-- above reboot item, enter dd (press d twice) to delete it
position cursor on end of comment -->, enter dd (press d twice) to delete it
enter ZZ (twice shift + z) to save

It is critical to not to mess this file or your tablet will not boot. Do it slowly. Enter :q! to exit vi without saving if you are not sure what you entered.

You may also just move the comment beginning <!-- below the reboot item to leave other items still disabled but it is harder.

gLobster 2008-01-17 11:25

Re: A small utility program to soft reboot your tablet
 
Also, if you install rootsh, then you can:
> rootsh shutdown -r now

:-)

Dr Tran 2008-01-17 17:21

Re: A small utility program to soft reboot your tablet
 
Quote:

Originally Posted by fanoush (Post 129229)
open xterm
sudo gainroot
vi /etc/systemui/systemui.xml
position cursor on beginning of comment <!-- above reboot item, enter dd (press d twice) to delete it
position cursor on end of comment -->, enter dd (press d twice) to delete it
enter ZZ (twice shift + z) to save

It is critical to not to mess this file or your tablet will not boot. Do it slowly. Enter :q! to exit vi without saving if you are not sure what you entered.

You may also just move the comment beginning <!-- below the reboot item to leave other items still disabled but it is harder.

I got a write error. :(

fanoush 2008-01-17 18:55

Re: A small utility program to soft reboot your tablet
 
Quote:

Originally Posted by Dr Tran (Post 129428)
I got a write error. :(

perhaps 'sudo gainroot' didn't give you root? install becomeroot package
http://eko.one.pl/maemo/dists/bora/u....1-2_armel.deb

qwerty12 2008-01-23 16:22

Re: A small utility program to soft reboot your tablet
 
Quote:

Originally Posted by fanoush (Post 129229)
open xterm
sudo gainroot
vi /etc/systemui/systemui.xml
position cursor on beginning of comment <!-- above reboot item, enter dd (press d twice) to delete it
position cursor on end of comment -->, enter dd (press d twice) to delete it
enter ZZ (twice shift + z) to save

It is critical to not to mess this file or your tablet will not boot. Do it slowly. Enter :q! to exit vi without saving if you are not sure what you entered.

You may also just move the comment beginning <!-- below the reboot item to leave other items still disabled but it is harder.

Does someone have a backup of the N800 OS2008 systemui.xml file please?

I thought I did it properly but it seems not. I have lost all the options on the device mode menu. I can still shut down and take the phone out of wifi but it would be nice to have the file back please.

Note to self, backup files first :rolleyes:

Here's my current systemui. Not sure what is wrong with it:
Code:

<powerkeymenu path="/">
 <title>powerup_application_title</title>
 <po>osso-powerup-shutdown</po>
 <menuitem priority="100" name="powerup_memainmenu_locktouchscreen">
  <return>1</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
 <menuitem priority="90" name="powerup_memainmenu_normalmode" visible="flight">
  <keyfile>/var/lib/mce/mode</keyfile>
  <return>2</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
 <menuitem priority="90" name="powerup_memainmenu_flightmode" visible="normal">
  <keyfile>/var/lib/mce/mode</keyfile>
  <return>3</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
 <menuitem priority="80" name="powerup_memainmenu_lockdevice" disabled="yes">
  <keyfile>/var/run/mce/call</keyfile>
  <return>4</return>
  <po>osso-powerup-shutdown</po>
  <disabled_reason name="powerup_ib_device_lock_not_available">
  <po>osso-powerup-shutdown</po>
  </disabled_reason>
 </menuitem>
 <menuitem priority="20" name="Reboot">
  <return>6</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
 <menuitem priority="10" name="Soft poweroff">
  <return>7</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
 <menuitem priority="5" name="Top in XTerm">
  <callback service="com.nokia.xterm" path="/com/nokia/xterm" interface="com.nokia.xterm" method="run_command" bus="session" autostart="true">
  <argument type="string">/usr/bin/top</argument>
  </callback>
 </menuitem>
  <return>5</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
</powerkeymenu>


fanoush 2008-01-23 16:44

Re: A small utility program to soft reboot your tablet
 
the part

Code:

</menuitem>
  <return>5</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>

is not complete, every <menuitem> needs matching </menuitem> so beginning of osso-powerup-shutdown item is missing. i don't have device now but you are missing one line with something like
Code:

<menuitem priority="1" name="Power Off">
after </menuitem>

qwerty12 2008-01-23 16:51

Re: A small utility program to soft reboot your tablet
 
Thank you for the reply but I found a systemui.xml from OS2007 and I compared it to my broken 2008 one and it seemed mostly the same. Made the right changes and now I have a reboot option and the menu fully works (plus a lot of others but I don't care :D). Thank you for this mod.

james415 2008-01-24 16:04

Re: A small utility program to soft reboot your tablet
 
Quote:

Originally Posted by bunanson (Post 129193)
All I want is a .deb file on the desktop that would,

- xterm
- sudo gainroot
- shutdown -r now

I also have an Asus EEE running Xandros Linux. Can I use that to compile the .sh into a .deb file and put it on the desktop? Look at the poll, there is more than 25 users having the power on problem.... In fact, maybe a soft reboot should be built-in into the platform in the future tablet release, uh?


bun

I don't think what you are asking for is what you really want to do. A .deb file is a debian based application package, consisting of two archives (one for data and one for control). These files are used to install software on the system.

If you want to automate a task (e.g. gainroot and reboot) you are looking for a shell script, which it appear you are already using.

As a side not, you can save a few keystrokes using "reboot" instead of "shutdown -r now" (helpful when you manually type it in)

cheers,
james

bunanson 2008-01-24 20:17

Re: A small utility program to soft reboot your tablet
 
I am not sure what is the technical difference between reboot and shutdown -r now, but the tablet obviously DOES NOT like reboot, the last time I use it, it gives me a statement "....better to use shutdown to avoid...." before I can see what is going on, the tablet rebooted. I agree, you save some keystrokes on typing. Anyhow, I am quite happy with this get around of the power on/off problem.


bun

Snoshrk 2008-06-28 06:10

Re: A small utility program to soft reboot your tablet
 
Ok I have successfully borked my systemui.xml...

I was pretty sure I only deleted the comment markers...but now:

Power button press results in pop up window with "Device Mode" and nothing else...

I'd post the text of the file, but I haven't figured out how...

TIA

caulktel 2008-06-28 14:50

Re: A small utility program to soft reboot your tablet
 
I am curios why everybody uses the "shutdown -r now" command. From root I always just issue the "reboot" command and it reboots, seems shorter to do it my way. Just wondering.

sic0048 2008-06-28 17:09

Re: A small utility program to soft reboot your tablet
 
Quote:

Originally Posted by Snoshrk (Post 196980)
Ok I have successfully borked my systemui.xml...

I was pretty sure I only deleted the comment markers...but now:

Power button press results in pop up window with "Device Mode" and nothing else...

I'd post the text of the file, but I haven't figured out how...

TIA

Here is my file with the reboot modification but otherwise normal. Hopefully you can compare the files and see if anything is different.
Code:

<powerkeymenu path="/">
 <title>powerup_application_title</title>
 <po>osso-powerup-shutdown</po>
 <menuitem priority="100" name="powerup_memainmenu_locktouchscreen">
  <return>1</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
 <menuitem priority="90" name="powerup_memainmenu_normalmode" visible="flight">
  <keyfile>/var/lib/mce/mode</keyfile>
  <return>2</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
 <menuitem priority="90" name="powerup_memainmenu_flightmode" visible="normal">
  <keyfile>/var/lib/mce/mode</keyfile>
  <return>3</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
 <menuitem priority="80" name="powerup_memainmenu_lockdevice" disabled="yes">
  <keyfile>/var/run/mce/call</keyfile>
  <return>4</return>
  <po>osso-powerup-shutdown</po>
  <disabled_reason name="powerup_ib_device_lock_not_available">
  <po>osso-powerup-shutdown</po>
  </disabled_reason>
 </menuitem>
-->
 <menuitem priority="20" name="Reboot">
  <return>6</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
 <menuitem priority="10" name="Soft poweroff">
  <return>7</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
 <menuitem priority="5" name="Top in XTerm">
  <callback service="com.nokia.xterm" path="/com/nokia/xterm" interface="com.nok                                            ia.xterm" method="run_command" bus="session" autostart="true">
  <argument type="string">/usr/bin/top</argument>
  </callback>
 </menuitem>
-->
 <menuitem priority="0" name="powerup_memainmenu_poweroff">
  <return>5</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>
</powerkeymenu>


bunanson 2008-06-28 18:45

Re: A small utility program to soft reboot your tablet
 
Quote:

Originally Posted by caulktel (Post 197048)
I am curios why everybody uses the "shutdown -r now" command. From root I always just issue the "reboot" command and it reboots, seems shorter to do it my way. Just wondering.

2006OS recommends "shutdown" over "reboot", not quite sure why. Upon reboot, there is a warning statement recommend to use shutdown instead. This has ALL been changed since then. Just for your curiosity.


bun

Snoshrk 2008-06-29 05:35

Re: A small utility program to soft reboot your tablet
 
sic0048 -> THANK YOU! :D

I just copied your file and replaced mine...

You don't have any of the options commented out?!?

What do the other entries do:

Lock Device (pretty self explanatory) but how do I change the Lock code?

Soft poweroff Benefits vs locking the screen and keys?

Top in XTerm

Now for the N00B question: what are the "Comment" flags?
From looking at the posts in this thread:

comment start <!--
comment end -->

Is this correct? I tried this a couple of times with no luck


TIA


BTW I am really thankful that "shutdown -r now" was in this post as it was the only way I had to turn off my NiT :o

bunanson 2008-06-29 06:22

Re: A small utility program to soft reboot your tablet
 
1 Attachment(s)
Quote:

Originally Posted by ; Snoshrk
...You don't have any of the options commented out?!?...

Very carefully, move the "<!--" to the last 6th line position, and looked like
.
.
.
</callback>
</menuitem>
<!---->
</menuitem priority="0" ......
<return>5</return>
<po>...
</menuitem>
</powerkeymenu>


This way you got all the options. That is what my tablet look like, see screenshots here, http://www.internettablettalk.com/fo...254#post192254 , thread #2



bun

buma 2008-07-15 18:04

Re: A small utility program to soft reboot your tablet
 
is there a way to comment out specific menu items without affecting the other menu options? For example, I'd like to remove the following items:
lock device
top in x-term

can I just add a "<!--" and a "-->" before / after each <menuitem> / </menuitem> in the systemui.xml?

and too, it seems that when coming back from the softpoweroff option with a long key.press, it restores my network connections - is there a way to:
1. change it to NOT restore my net.connections
2. change it to come back on with a short key press / square button press similar to returning from a lock screen & button menu select?

(as always, small words / simple concepts / long explanations for a linux newbie is always appreciated)

thanks in advance

Benson 2008-07-15 18:24

Re: A small utility program to soft reboot your tablet
 
Yes, you can comment things out exactly that way.

Edit /etc/mce/mce.ini, I think, to change the softpoweroff details. It's got comments explaining what each item does. (I don't think 2. is possible, though...)

buma 2008-07-15 23:33

Re: A small utility program to soft reboot your tablet
 
thanks Benson,
got #1 to work perfectly the first time (surprisingly - had to dig deep to remember my dos-editing days...) so now I have no options to lock my device or go to xterm in my power menu and I got softpoweroff to not restore my connections (double-woohoo!)

just gotta figure out that longkeypress / softpoweroff return-thing now... anyone else have any clues?

lazuli 2008-07-16 14:49

Re: A small utility program to soft reboot your tablet
 
thanks for this tip! however when i resume from soft poweroff the power button and the touchscreen becomes unresponsive.. normal?

qwerty12 2008-07-16 14:50

Re: A small utility program to soft reboot your tablet
 
Yes, it is normal. Just hold down the power key for a few seconds and let go and the buttons work again.

bunanson 2008-07-16 15:16

Re: A small utility program to soft reboot your tablet
 
Quote:

Originally Posted by lazuli (Post 203587)
thanks for this tip! however when i resume from soft poweroff the power button and the touchscreen becomes unresponsive.. normal?

Same here.

bun

nhanquy 2008-07-16 23:56

Re: A small utility program to soft reboot your tablet
 
Quote:

Originally Posted by bunanson (Post 129193)
All I want is a .deb file on the desktop that would,

- xterm
- sudo gainroot
- shutdown -r now

Do you have "Statusbar Graph Control" installed? If you do, add this "shutdown" command:
sh -c 'echo shutdown -r now | sudo gainroot'

bunanson 2008-07-17 00:09

Re: A small utility program to soft reboot your tablet
 
Quote:

Originally Posted by nhanquy (Post 203799)
Do you have "Statusbar Graph Control" installed? If you do, add this "shutdown" command:
sh -c 'echo shutdown -r now | sudo gainroot'

Wow, that is truly amazing. It works like magic. THANK YOU, nhanquy. I like it very much. I think this is the most important app, I used it quite often. I shortened it down just a bit,
sh -c 'echo reboot | sudo gainroot' to save a couple of strokes. Thanks, it is always good to see you hang around, you always have GOOD ideas :)


bun

lazuli 2008-07-19 05:23

Re: A small utility program to soft reboot your tablet
 
Quote:

Originally Posted by qwerty12 (Post 203588)
Yes, it is normal. Just hold down the power key for a few seconds and let go and the buttons work again.

thank you! i just wonder what the short power key press is for. it seems to power on the device but leaves the tablet in offline mode, correct? or does it serve another purpose like underclock the processor or something?


All times are GMT. The time now is 23:45.

vBulletin® Version 3.8.8