maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   A equivilent of a .bat file on the n900? (https://talk.maemo.org/showthread.php?t=39165)

DaveQB 2010-01-04 00:33

Re: A equivilent of a .bat file on the n900
 
Quote:

Originally Posted by texaslabrat (Post 451853)
That's not how it's done in maemo as far as I can tell. Take a look at /etc/sudoers.d. But you have the right idea, though for the OP's issue I still think just setuid'ing the file is the cleanest/most straightforward way to do it, but that's just my opinion.

Perhaps.
I saw the sudoers.d dir but didn't get back to looking in there. I'll give it a peek.
Thanks.

ewan 2010-01-04 00:35

Re: A equivilent of a .bat file on the n900
 
Quote:

Originally Posted by texaslabrat (Post 451853)
I still think just setuid'ing the file is the cleanest/most straightforward way to do it, but that's just my opinion.

Linux, as with most modern unixes, doesn't support suid shell scripts, only binaries.

jaeezzy 2010-01-04 00:42

Re: A equivilent of a .bat file on the n900
 
On top, to make life more easier and thats what I did in my n810 but haven't tried it in n900 as I don't own it yet (but for different purpose), you can, according to this, create a .desktop file in /usr/share/applications/hildon and this will create an icon in the main menu which you can just click and get the job done. Easy :)

DaveQB 2010-01-04 00:52

Re: A equivilent of a .bat file on the n900
 
Quote:

Originally Posted by jaeezzy (Post 451911)
On top, to make life more easier and thats what I did in my n810 but haven't tried it in n900 as I don't own it yet (but for different purpose), you can, according to this, create a .desktop file in /usr/share/applications/hildon and this will create an icon in the main menu which you can just click and get the job done. Easy :)

http://talk.maemo.org/showthread.php...2&goto=newpost

LozBlake 2010-01-04 00:54

Re: A equivilent of a .bat file on the n900
 
Quote:

Originally Posted by jaeezzy (Post 451886)
Sorry, here's what you do:

1. Open up xterm.
2. In xterm type: vi powerlevel.sh
3. Press "i" key it will activate "Insert" mode.
4. Type as it is there (every line is a new line so there is enter after every line however, you don't press space in the front).
5. After you have finished typing everything, press the esc key and then ":" followed by "wq" (without double quotes) and hit enter.
6. It will save your file as powerlevel.sh in the same directory you are currently working.
7. Again in the xterm type: chmod +x powerlevel.sh
8. To execute: ./powerlevel.sh

That's it.

thank you for typing the out for me!

I've done this and the file saved fine, i checked the contents with cat powerlevel.sh and it was correct, however when running it it doesn't change the powerlevel, any idea why? it looks fine to me and i did the chmod to, a message saying root enabled comes up when i run the file as user so it looks like its calling the correct file.

On a side note when following your instructions i had to type sudo gainroot to run the commands, would this have caused a problem?

texaslabrat 2010-01-04 00:56

Re: A equivilent of a .bat file on the n900
 
Quote:

Originally Posted by ewan (Post 451902)
Linux, as with most modern unixes, doesn't support suid shell scripts, only binaries.

ah, well been a while since I've gone that route so I didn't notice the change. Good to know ;)

DaveQB 2010-01-04 01:02

Re: A equivilent of a .bat file on the n900
 
Quote:

Originally Posted by LozBlake (Post 451924)
thank you for typing the out for me!

I've done this and the file saved fine, i checked the contents with cat powerlevel.sh and it was correct, however when running it it doesn't change the powerlevel, any idea why? it looks fine to me and i did the chmod to, a message saying root enabled comes up when i run the file as user so it looks like its calling the correct file.

On a side note when following your instructions i had to type sudo gainroot to run the commands, would this have caused a problem?

This might help you:
http://talk.maemo.org/showpost.php?p...4&postcount=91

jaeezzy 2010-01-04 01:33

Re: A equivilent of a .bat file on the n900
 
Quote:

Originally Posted by LozBlake (Post 451924)
On a side note when following your instructions i had to type sudo gainroot to run the commands, would this have caused a problem?

which command required you to hit "sudo gainroot". You should be able to create, chmod & execute (everything) as normal user. Try other commands that requires being root and see if they work coz I've no idea why it's not working for you.(in my n810 i'm restarting my device, change host/otg mode(not yet supported in n900 as far as I know) with similar scripts but not this one). Hope you are pointing to the right place.

mnaveed 2010-04-14 10:27

Re: A equivilent of a .bat file on the n900?
 
i did the following thing in xterminal without going in to sudo gainroot

Quote:

echo "#!/bin/sh" > oc.sh

echo "sudo gainroot; echo 124999 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq; echo 899999 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;" >> oc.sh

chmod +x oc.sh



is it going to work when i write this command in xterm

./oc.sh

EDIT: i tried this with the ./oc.sh command with and without sudo gainroot but an error is shown with " permission denied"

can some body point oit my mistake, please.

DaveQB 2010-04-27 15:59

Re: A equivilent of a .bat file on the n900?
 
Permission denied usually means the executable bit is not set [you seemed to have taken care of that] or the underlying File System has noexec enabled, or it is a FAT or other weird FS.

Try

Code:

sh oc.sh


All times are GMT. The time now is 00:47.

vBulletin® Version 3.8.8