Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)

    Reply
    Page 19 of 20 | Prev | 9   17     18   19   20   | Next
    qwerty12 | # 181 | 2010-02-26, 17:09 | Report

    Originally Posted by fatalsaint View Post
    although I don't think depending on rootsh is a good idea.
    Precisely. Place a file in /etc/sudoers.d with a command that you want whitelisted for running as root via sudo (standard sudoers syntax), instead, and run "update-sudoers" in the postinst and postrm scripts of the package.

    Originally Posted by fatalsaint View Post
    There must be some kind of API in dbus or somewhere to tell the device to reboot properly instead of running shell commands.
    Code:
    run-standalone.sh dbus-send --system --type=method_call --dest="com.nokia.mce" --print-reply "/com/nokia/mce/request" com.nokia.mce.request.req_reboot
    Put the equivalent of that into your favourite solution for using D-Bus in an app (DBus-GLib, libosso, python-osso, python-dbus, libdbus, QDBus, ..)
    http://maemo.org/api_refs/5.0/5.0-fi...-names_8h.html explains some more of the method calls available to you.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by qwerty12; 2010-02-26 at 17:24.
    The Following 4 Users Say Thank You to qwerty12 For This Useful Post:
    attila77, fatalsaint, noobmonkey, Rob1n

     
    noobmonkey | # 182 | 2010-02-26, 17:16 | Report

    wow very helpful - just need to understand Dbus now! ... hmmmmmm

    Edit | Forward | Quote | Quick Reply | Thanks

     
    noobmonkey | # 183 | 2010-02-26, 17:18 | Report

    getting a dbus.error.UnknownMethod "req_reboot" with signature "" on interface "com.nokia.mce.request" doesn't exist.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    qwerty12 | # 184 | 2010-02-26, 17:22 | Report

    Originally Posted by noobmonkey View Post
    getting a dbus.error.UnknownMethod "req_reboot" with signature "" on interface "com.nokia.mce.request" doesn't exist.
    Apologies. It got moved to DSME. Try:
    Code:
    run-standalone.sh dbus-send --system --type=method_call --dest="com.nokia.dsme" --print-reply "/com/nokia/dsme/request" com.nokia.dsme.request.req_reboot

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to qwerty12 For This Useful Post:
    fatalsaint, noobmonkey

     
    noobmonkey | # 185 | 2010-02-26, 17:25 | Report

    Originally Posted by qwerty12 View Post
    Apologies. It got moved to DSME. Try:
    Code:
    run-standalone.sh dbus-send --system --type=method_call --dest="com.nokia.dsme" --print-reply "/com/nokia/dsme/request" com.nokia.dsme.request.req_reboot
    Lol - don't apologise - by getting it wrong you did actually force me to hunt the answer out

    Just tested it and works fine! - wohooo! - slowly getting there - i think i've bitten of a little mor ethen i should have for my first project - but it is still fun!!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    noobmonkey | # 186 | 2010-02-26, 17:27 | Report

    But you have got me wanting to test this bit now!!

    Vibrator interface D-Bus methods

    Edit | Forward | Quote | Quick Reply | Thanks

     
    noobmonkey | # 187 | 2010-02-26, 17:35 | Report

    Qwerty... thats got me thinking, as i have a load of other commands i'd like to run.... - may be best for me to seek alternatives...

    apt-get clean
    apt-get install pymaemo-optify (possibly)

    even looking at using the cleanup script to run externally as part of the application....
    Code:
    #!/bin/sh
    # Nokia N900 Maemo 5 Script to free up space on rootfs
    # ignoring errors when creating dirs that may already exist
    
    # Moving themes to /home/opt
    mkdir -p /home/opt/usr/share/themes 2> /dev/null
    cp -r /usr/share/themes/* /home/opt/usr/share/themes
    rm -r /usr/share/themes
    ln -s /home/opt/usr/share/themes /usr/share/themes
    
    # Moving ?? icons to /home/opt
    mkdir -p /home/opt/usr/share/icons 2> /dev/null
    cp -r /usr/share/icons/* /home/opt/usr/share/icons
    rm -r /usr/share/icons
    ln -s /home/opt/usr/share/icons /usr/share/icons
    
    # Moving video on start-up to /home/opt
    mkdir -p /home/opt/usr/share/hildon-welcome 2> /dev/null
    cp -r /usr/share/hildon-welcome/* /home/opt/usr/share/hildon-welcome
    rm -r /usr/share/hildon-welcome
    ln -s /home/opt/usr/share/hildon-welcome /usr/share/hildon-welcome
    
    # ??
    mkdir -p /home/opt/usr/share/pixmaps 2> /dev/null
    cp -r /usr/share/pixmaps/* /home/opt/usr/share/pixmaps
    rm -r /usr/share/pixmaps
    ln -s /home/opt/usr/share/pixmaps /usr/share/pixmaps
    
    # Moving 'apt cache' to /home/opt - Valid until Bug 5746 is fixed.
    mkdir -p /home/opt/var/cache/apt 2> /dev/null
    cp -r /var/cache/apt/* /home/opt/var/cache/apt
    rm -r /var/cache/apt
    ln -s /home/opt/var/cache/apt /var/cache/apt

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to noobmonkey For This Useful Post:
    qwerty12

     
    fatalsaint | # 188 | 2010-02-26, 18:24 | Report

    Originally Posted by qwerty12 View Post
    Apologies. It got moved to DSME. Try:
    Code:
    run-standalone.sh dbus-send --system --type=method_call --dest="com.nokia.dsme" --print-reply "/com/nokia/dsme/request" com.nokia.dsme.request.req_reboot
    I knew it existed.. just couldn't look it up.

    Thanks for the save.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to fatalsaint For This Useful Post:
    noobmonkey, qwerty12

     
    noobmonkey | # 189 | 2010-02-26, 19:23 | Report

    Is this call still valid?

    Just not returning anything for me?
    Code:
    run-standalone.sh dbus-send --system --type=signal /com/nokia/mce/signal com.nokia.mce.signal.sig_device_orientation_ind

    Edit | Forward | Quote | Quick Reply | Thanks

     
    noobmonkey | # 190 | 2010-02-26, 19:34 | Report

    hmmm does nothing at all in terminal either.... am i missing an import?!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 19 of 20 | Prev | 9   17     18   19   20   | Next
vBulletin® Version 3.8.8
Normal Logout