1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Dismiss Notice

Software Reboot command

Discussion in 'I need help' started by Drumaster78, Apr 19, 2017.

  1. Drumaster78

    Drumaster78 Still Fresh

    Joined:
    Aug 24, 2016
    Messages:
    38
    Hello everyone,

    I'm trying to get a command (or an executable) that would allow me to reboot the Wiz. Is it possible?

    I found a way to shut it down on openhandhelds.org but can't find a way to reboot it and 'sbin/reboot' does not work on Wiz, it only leads to a black screen (like only the UI is shut down).

    Thanks for your help.
     
    Tags:
  2. Willhelm

    Willhelm Very Active Member

    Joined:
    Aug 19, 2014
    Messages:
    169
    Location:
    Munich
    reboot? :oops:
     
  3. Drumaster78

    Drumaster78 Still Fresh

    Joined:
    Aug 24, 2016
    Messages:
    38
    ? (please don't tell me to use the side button of Wiz... which is not a reboot but turn off/on button by the way).

    I'm interested here in doing it by software only (just in case that would not be clear :)).
     
    Last edited: Apr 19, 2017
  4. canseco

    canseco Very Active Member

    Joined:
    Jun 1, 2004
    Messages:
    769
    Location:
    Spain
    I recently did this for Albert launcher reboot option, "shutdown -r now"
     
  5. Drumaster78

    Drumaster78 Still Fresh

    Joined:
    Aug 24, 2016
    Messages:
    38
    Thanks but when I try to put that in a script, it leads to a black screen without rebooting nor shutting down.

    Here an example of what I tried:


    #!/bin/sh

    /sbin/shutdown -r now


    What am I doing wrong?

    I would need either a compiled prpgram (already compiled, I have not the environment to do that) or either the command to put in a gpe script.

    Thanks.
     
  6. Drumaster78

    Drumaster78 Still Fresh

    Joined:
    Aug 24, 2016
    Messages:
    38
    No one can help on this?
     
  7. levi

    levi Still fresh, damnit!

    Joined:
    Oct 6, 2008
    Messages:
    7,529
    Location:
    Somewhere off the coast of the EU
    The -r flag in the shutdown command is intended to make the device reboot. Use -h instead, which stands for halt.

    On pre-system-d systems I've used, invoking shutdown without the -h flag does indeed lead to a state where the machine is stopped but not turned off. That flag has fixed that for me in the past.

    Edit: My apologies, I'd forgotten even the title of this thread - you're trying to make it reboot! Still, I see it didn't work, which is a shame :(
     
    Last edited: Apr 22, 2017
  8. Drumaster78

    Drumaster78 Still Fresh

    Joined:
    Aug 24, 2016
    Messages:
    38
    I tried -h and -r and it does not work, even under a terminal and gpe script. This Linux distribution does not seem to react to those commands.

    If anyone has a solution... would be appreciated.
     
  9. lukey

    lukey Rare Species

    Joined:
    Jun 17, 2015
    Messages:
    441
    Location:
    Germany
  10. sebt3

    sebt3 homebrew player (P. & C.)

    Joined:
    Sep 9, 2008
    Messages:
    4,575
    Location:
    France
    File permission ?
    If you want the script to be executed, it need the execution permission ;)

    chmod 755 myscript.sh

    You should also make sure the script is actually started, add something like this :
    echo "script started" >>/tmp/myscript.log
     
  11. Drumaster78

    Drumaster78 Still Fresh

    Joined:
    Aug 24, 2016
    Messages:
    38
    Since when do we need file permission to execute a wrapper script (.gpe here)?
     
  12. Drumaster78

    Drumaster78 Still Fresh

    Joined:
    Aug 24, 2016
    Messages:
    38
    I tried this in a gpe wrapper script, does not work. Leads to a black screen as well as my previous attempts. Is it the way to proceed?
     
  13. hmn

    hmn Member

    Joined:
    Mar 8, 2010
    Messages:
    192
    There is no "/sbin/shutdown" on the Wiz, only "/sbin/reboot" (which is what Willhelm might have meant).
     
  14. Drumaster78

    Drumaster78 Still Fresh

    Joined:
    Aug 24, 2016
    Messages:
    38
    Yes, I saw that but calling /sbin/reboot just leads to a black screen and nothing happens. Seems like GPH blocked those command.
     
  15. hmn

    hmn Member

    Joined:
    Mar 8, 2010
    Messages:
    192
    Confirmed, /sbin/reboot etc. don't seem to do anything. They probably didn't so much block them, but rather did not implement the required functionality proper. One could investigate how they implemented the power button (which performs a shutdown).
     
  16. Drumaster78

    Drumaster78 Still Fresh

    Joined:
    Aug 24, 2016
    Messages:
    38
    FYI, chrisvcpp successfully implemented a software shutdown button in his Win2X firmware. When decompiling his Win2X, I cannot find any internal shell command for that action (other shell commands as rm, cp... can be easily found) as it seems to be some compiled code, a kind of hack I guess.

    The source of this command can be found here (don't know if it's from chrisvcpp though):
    http://dl.openhandhelds.org/cgi-bin/wiz.cgi?0,0,0,0,46,416

    But once again, it's about shutdown, not reboot. :(
     
  17. levi

    levi Still fresh, damnit!

    Joined:
    Oct 6, 2008
    Messages:
    7,529
    Location:
    Somewhere off the coast of the EU
    In most linuxes, /sbin/reboot is a symlink to whatever tool does the normal power control stuff. So it's likely it's that that's broken, as you've already proven, shutdown -r doesn't reboot.

    Although if it's doing nothing at all, then the linkage between reboot and shutdown -r seems broken also.
     
  18. hmn

    hmn Member

    Joined:
    Mar 8, 2010
    Messages:
    192
    This is interesting - the tool invokes ioctl 2 on /dev/GPIO, which modifies a pin on the SOC (GPA18, signalling a power control chip?). The power button meanwhile has it's own driver, which runs "/etc/hotplug.d/default/default.hotplug power_off" in userland when it is triggered.
     

Share This Page

Loading...