maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Maemo 5] Problems with Rootsh (https://talk.maemo.org/showthread.php?t=50510)

nokian-series 2010-04-19 22:54

[Maemo 5] Problems with Rootsh
 
Hi all, I've tried to send a PM to QWERTY12, the guy who has ported to N900 the ROOTSH. I cant send the PM to him, i hope he can see here or anyone can help me. Here is my problem (A copy of message i tried to send to QWERTY12)

"
Hi,
I've been talking with a lot of members of maemo.talk, and i cant solve my problem.

I just reflashed my N900 (First the flash image, then the EMMC, without rebooting, all goes good there).

Then, i tried to install rootsh (1.5 and 1.8), it says install sucessfull but i can use it well.

When i use sudo <command> sometimes it say i dont have permissions, other times prompt for password.

I've this problem since last 4 days, i'm getting crazy, the only thing i make was reflash my device :(

If i do this on x-terminal:
sudo gainroot
dpkg -l rootsh

The output is:
BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso26+0m5) built-in shell (ash)
Enter 'help' for a list of built-in commands.
/home/user # dpkg -l rootsh
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii rootsh 1.8 Enable root access, via the "sudo gainroot"
/home/user #


I've tryed already to:

sudo gainroot
dpkg --purge rootsh
apt-get install rootsh

But stills the same problems, stills the same information with erros.

Can you please help me..i'm so tired, my last 62 hours was reading and talking with people, no one can help me.
I just reflash my device, i've tried to do again 2 ou 3 times, but the same problem.

Qwerty12..please can you help me..i'll be appreciat to the rest of my life :(

I'm so sad..help me please.."

cpitchford 2010-04-19 23:12

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
install rootsh (you've done that)
sudo gainroot (gets you a root shell)

that is all..

it doesn't do any thing else.

sudo other-command

won't work because only a few commands are defined in /etc/sudoers..

From what you've posted, I can't see a problem.. it looks like it is working correctly

you can ONLY use

sudo gainroot

NokiaRocks 2010-04-19 23:15

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
I dont rly see a problem too dude.

nokian-series 2010-04-19 23:31

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
I cannot use some commands for exemple, from here:
http://talk.maemo.org/showpost.php?p...postcount=2718

sudo rm -f /etc/default/kernel-power
sudo ln -s /usr/share/kernel-power-settings/ideal /etc/default/kernel-power
sudo /usr/sbin/kernel-load

It returns me:

~$ sudo /usr/sbin/kernel-load
Password:
~$

~$ sudo rm -f /etc/default/kernel-power
Password:

... So, have i to type Sudo <command> or not? :( is there..in the wiki..and i do that before reflash..

I already put 'user ALL = PASSWORD: ALL' on the sudoers file, for testing..ok, password disapear, but it says permission denied.

Please..i know my english is not so good, but..i know what i do on my n900 before reflash and now..i cant do anything...please help..yes its a problem...that dpkg output for rootsh its wrong..just try on your phones..

Please..help me :'(



Quote:

Originally Posted by cpitchford (Post 618549)
install rootsh (you've done that)
sudo gainroot (gets you a root shell)

that is all..

it doesn't do any thing else.

sudo other-command

won't work because only a few commands are defined in /etc/sudoers..

From what you've posted, I can't see a problem.. it looks like it is working correctly

you can ONLY use

sudo gainroot


MohammadAG 2010-04-19 23:44

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
Just type root, hit enter, and type the command without the sudo part.

ndi 2010-04-19 23:44

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
The post said:
"Ideally, you would install it and then as user (remove "sudo" before the command if you are root)"

Edit: Man you're fast.

geneven 2010-04-19 23:46

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
nokian-series:

I would just forget the sudo stuff if I were you.

Just do this.

1. Open xterm.
2. Type root and hit enter.

You are root now and can do commands without sudo.

Just to make sure type whoami and hit enter.

You should get the response that you are root.

nokian-series 2010-04-20 06:40

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
I've tryed to do:
sudo gainroot

then the commands:

/usr/sbin/kernel-load /usr/share/kernel-power-settings/ideal
(ok, conky is showing + Mhz)
but, if i try to:
rm -f /etc/default/kernel-power
ln -s /usr/share/kernel-power-settings/ideal /etc/default/kernel-power
/usr/sbin/kernel-load

Then reboot..when i boot up..i have the default config. to 600 Mhz max.
I can't apply those commands as root (yes, i've done whoami, it says root).

I think it's here something really strange :(

After reflash, i can do all of this.

But, tell me, can anyone do in your phone who have rootsh installed:

sudo gainroot
dpkg -l rootsh

and put here the output?

I might have filesystem corrupted or something strange :S

Big Phat Jan 2010-04-20 07:18

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
Quote:

Originally Posted by nokian-series (Post 618568)
I already put 'user ALL = PASSWORD: ALL' on the sudoers file, for testing..ok, password disapear, but it says permission denied.

You need to be careful when you edit your sudoers file. If you mess it up you may not be able to perform any commands as a superuser (including fixing the sudoers file!).

Make sure you always use the visudo command as root rather than directly editing the file and it will warn you of syntax errors.

To get the behaviour you seem to want you need to change the line above (using visudo) to:

user ALL = NOPASSWD: ALL

It seems that rootsh is doing it's job correctly, i.e. giving you root access when you type root or sudo gainroot. The output from dpkg -I rootsh tells you this (the ii in the first column means installed).

It seems your only problem is with your clock settings resetting to default when you reboot - are you sure this isn't expected behaviour? If it's not you'll probably find much more informed help on the overclock thread than here.

Cheers,
Jan

rebhana 2010-04-20 07:19

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
Quote:

Originally Posted by nokian-series (Post 618859)
But, tell me, can anyone do in your phone who have rootsh installed:

sudo gainroot
dpkg -l rootsh

and put here the output?

The result from dpkg -l rootsh that you posted above looks exactly as it should and is identical to mine, apart from the fact that I have version 1.5.

Did you really ever have been asked for a password when typing "sudo gainroot" as you said in your first post?

nokian-series 2010-04-20 07:56

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
Quote:

Originally Posted by rebhana (Post 618889)
The result from dpkg -l rootsh that you posted above looks exactly as it should and is identical to mine, apart from the fact that I have version 1.5.

Did you really ever have been asked for a password when typing "sudo gainroot" as you said in your first post?

Sorry for my bad sentence, i've corrected my first thread.
When i do like it is on: http://talk.maemo.org/showpost.php?p...postcount=2718

sudo rm -f /etc/default/kernel-power

it asks me for a password.

Before reflashing, it not ask, i can do those commands with success, now, i can't, thats my problem! :(

cpitchford 2010-04-20 11:33

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
It has been mentioned a few times..

sudo rm won't work
sudo ls won't work
sudo some-other-command won't work

ONLY:

sudo gainroot

will work

This gives you a root shell.. from that you can run whatever you like

sudo gainroot
# NOW YOU ARE ROOT

rm -f /etc/default/kernel-power

If you run

sudo rm

sudo has not been configured to allow you to run rm, so it asks for a password or tells you permission denied..

nokian-series 2010-04-20 12:07

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
If Sudo <Command> dont work, why can i do that before reflash ?!

If Sudo <Command> dont work, why is it here http://talk.maemo.org/showpost.php?p...postcount=2718 and everyone use it sucessfull ?

Sorry but dont make sense...I'm not crazy, i know what i've done before on X-terminal.

Before reflash, i save .txt files with my script commands, and theres a lot of 'sudo <command>' that worked..

Maybe some software i've installed with an old version..not chroot or rootsh..other software..dont know.. : \

Quote:

Originally Posted by cpitchford (Post 619173)
It has been mentioned a few times..

sudo rm won't work
sudo ls won't work
sudo some-other-command won't work

ONLY:

sudo gainroot

will work

This gives you a root shell.. from that you can run whatever you like

sudo gainroot
# NOW YOU ARE ROOT

rm -f /etc/default/kernel-power

If you run

sudo rm

sudo has not been configured to allow you to run rm, so it asks for a password or tells you permission denied..


nokian-series 2010-04-20 12:09

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
Ohh..and here, on the WIKI: http://wiki.maemo.org/Overclocking
At "Set maximum CPU frequency", it says:

From root terminal:
rootsh echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq | echo ""

It gives me permission dennied too ! . . .

geneven 2010-04-20 12:19

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
What happens if you

Open an xterm

Type root and hit enter

Type whoami and hit enter

?

qwerty12 2010-04-20 12:21

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
You do know that rootsh's description says to use "root", right? It does not mention anything about sudo.

The uninstall thing? Well, that was me being a tosser. I did fix it in later versions, however.

GameboyRMH 2010-04-20 12:23

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
Sounds like the real "problem" is that rootsh doesn't work like you want it to.

Either run "sudo gainroot" for a root shell or "rootsh (command)" to run one command as root. Sudo doesn't work in maemo like it does in other linux distros.

cpitchford 2010-04-20 12:28

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
My first thought would be it was shorthand, or a ploy to stop inexperienced users from doing things to their phone.

If you don't understand that

sudo rm /etc/somefile
and
sudo gainroot
rm /etc/somefile

are conceptually the same things, then you've fallen at the first hurdle!!

There are very few commands you can run using sudo on Maemo5.. rm is not one of them, nor is echo

From root terminal:
rootsh echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq | echo ""
Is actually nonsensical and would NEVER work unless you were already root

If you need to do things that report "permission denied", run
sudo gainroot
first and you will be fine..

geneven 2010-04-20 12:32

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
When I just tried that rootsh command as listed in message #14 above, I got a response that it was deprecated.

AlMehdi 2010-04-20 13:11

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
Quote:

Originally Posted by nokian-series (Post 619226)
If Sudo <Command> dont work, why can i do that before reflash ?!

If Sudo <Command> dont work, why is it here http://talk.maemo.org/showpost.php?p...postcount=2718 and everyone use it sucessfull ?

Sorry but dont make sense...I'm not crazy, i know what i've done before on X-terminal.

Before reflash, i save .txt files with my script commands, and theres a lot of 'sudo <command>' that worked..

Maybe some software i've installed with an old version..not chroot or rootsh..other software..dont know.. : \

As it has been said a numerous times.. you need to become root.

root is a super user and have more privileges than normal user. In other systems you normaly need a password to become that user.. that is not needed in Maemo. Just type root or sudo gainroot and you become root.

Why Titan writes sudo in his explanations i do not know.. probably just to tell you that you need to be root and have root privileges.

Why the OC'ing are working for everyone is because they go root when they need to do it. They know not to sudo before the commands. Of what i understand you have successfully OC'd with the temporary settings but need to do them permanent. So you are doing something wrong when attempting doing them permanent.

MohammadAG 2010-04-20 13:20

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
Quote:

Originally Posted by nokian-series (Post 619226)
If Sudo <Command> dont work, why can i do that before reflash ?!

There's a package in -devel that somehow enables sudo to work (I'm not sure if it's cause I changed the password for user, or the pass for root).
If you want to try to see which application it is be my guest.

Quote:

BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso26+0m5) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ $ sudo su


BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso26+0m5) built-in shell (ash)
Enter 'help' for a list of built-in commands.

/home/user # exit
~ $ whoami
user
~ $ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
avahi-daemon extcalllog kernel kernel-flasher kernel-modules
libpulse-mainloop-glib0 libpulse0 mplayer pulseaudio
pulseaudio-esound-compat pulseaudio-module-bluetooth pulseaudio-module-gconf
pulseaudio-module-hal pyside-qt4-core pyside-qt4-gui xulrunner
0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.
Edit: it's one of these http://pastebin.com/1mA5JbHF

nokian-series 2010-04-20 13:41

Re: QWERTY12 (ROOTSH) - I Need help PLEASE
 
Quote:

Originally Posted by MohammadAG (Post 619337)
There's a package in -devel that somehow enables sudo to work (I'm not sure if it's cause I changed the password for user, or the pass for root).
If you want to try to see which application it is be my guest.



Edit: it's one of these http://pastebin.com/1mA5JbHF

WOW, so ... it really exists a package that actualy do that!
But no one knows it.. hum .. right...

nokian-series 2010-04-21 20:30

Re: [Maemo 5] Problems with Rootsh
 
Hey all..
I think i discover the problem.
Somehow, before reflash, my \sys\* is on read\write\execute to my user.
But actualy, i cant modify it (i can, but before restart, everything goes back to read only).

Any one knows how to change it ?

I've googled a little but..nothing..

Rob1n 2010-04-21 20:56

Re: [Maemo 5] Problems with Rootsh
 
Quote:

Originally Posted by nokian-series (Post 621547)
Hey all..
I think i discover the problem.
Somehow, before reflash, my \sys\* is on read\write\execute to my user.
But actualy, i cant modify it (i can, but before restart, everything goes back to read only).

Any one knows how to change it ?

I've googled a little but..nothing..

What are you actually trying to do? /sys is a virtual file system giving access into the internals of the kernel/modules. The permissions are set by the kernel/modules so can't be messed around with by the user (even as root).

nokian-series 2010-04-21 21:17

Re: [Maemo 5] Problems with Rootsh
 
I'm trying to change the value on, for exemple:
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
with this command:
sudo echo 1000000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
using: queen beecon widget

Please dont tell me it doesent work..i've donne it before re-flash my device as you can easly see by editing my queen_beecon file on:
http://www.4shared.com/dir/37234484/...on_Widget.html

If that permissions are set by kernel-modules..maybe..before i was using maemo 23 i thing with OC ..now i'm using maemo25 (are that modules included on that you're talking?)

titan 2010-04-21 21:49

Re: [Maemo 5] Problems with Rootsh
 
/sys is a virtual file system where you cannot store files. it is just for the communication with the kernel.
changing permissions on /sys is pointless. there were no changes on /sys in the different kernels version.

I have removed the remaining occurrences of "sudo" before commands in my tutorials - it was a mistake. sudo works only with specific commands but not with echo etc.

If you really want to use "sudo" with scripts, create a script which will run as root (i.e. no sudo in the script) and put an entry in /etc/suders.d so that can run the script using
"sudo script"

nokian-series 2010-04-21 22:25

Re: [Maemo 5] Problems with Rootsh
 
Actualy, what i need is to use Queen Beecon Widget with some CMDs like: echo 900000 > /sys/devices/.../scaling_max_freq.

So, what it's needed to do ?

Add the executable of Queen Beecon Widget t Sudoers file?
It's that? If is...what to put in suddoers, please.

Actualy, to use the "scripts" i've created on Queen Beecon Widget, i need to change permissions on that files /sys/devices/.../scaling_max_frq , and thats boring because when i reboot the phone, i need to set them again and again.

Queen Beecon Widget dont allow you to put CMDs with root or sudo gaind root.

* I still dont undurstanding why i can do it before re-flash, but, if i go throught the problem..dont worrie *

Thank you all for helping.

Quote:

Originally Posted by titan (Post 621629)
/sys is a virtual file system where you cannot store files. it is just for the communication with the kernel.
changing permissions on /sys is pointless. there were no changes on /sys in the different kernels version.

I have removed the remaining occurrences of "sudo" before commands in my tutorials - it was a mistake. sudo works only with specific commands but not with echo etc.

If you really want to use "sudo" with scripts, create a script which will run as root (i.e. no sudo in the script) and put an entry in /etc/suders.d so that can run the script using
"sudo script"


Rob1n 2010-04-22 08:00

Re: [Maemo 5] Problems with Rootsh
 
Quote:

Originally Posted by nokian-series (Post 621601)
I'm trying to change the value on, for exemple:
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
with this command:
sudo echo 1000000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
using: queen beecon widget

That command line won't work because you're just using sudo to run "echo" with su privileges - the redirect happens with normal user privileges so fails.

Try "echo 1000000 | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"

You may need to add "tee" to the sudoers configuration first.

nokian-series 2010-04-22 20:43

Re: [Maemo 5] Problems with Rootsh
 
just used:

echo "echo 900000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq" | sudo gainroot

it works...so, finaly, i've back my own Overclock UI..like i had before reflash my n900. Still strange why it works before and this time it takes 4 times (x) more commands, but..just fine..it works...hardly, but..it works... thank you for all of you that help me sugesting me to try some commands and explaining me some things.

Sorry to QWERTY12, maybe not a rootsh problem ( :

Cheers to all.
Thread may be closed!

SOLVED. (Workarrounded but solved, aftar 5 days without sleep.. : \ lol :P )


All times are GMT. The time now is 09:37.

vBulletin® Version 3.8.8