maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Upgrading (https://talk.maemo.org/forumdisplay.php?f=8)
-   -   Becoming Root (https://talk.maemo.org/showthread.php?t=1912)

c_legaspi 2006-05-03 18:20

Becoming Root
 
I was just reading the guide to becoming root from maemo web site. Is it possible to become root without flashing to enable rd mode. I mean, cant i just use x term to copy the /usr/sbin/gainroot to /media/mmc1 and then modify it and recopy it back.

konttori 2006-05-03 18:57

You need root privileges to do the copy, so nope. You need to flash it. But flashing to rd doesn't mean that your system get's wiped out. It only triggers the system to rd mode. So, it's safe to do at any time. You just need a linux distro to do it. If you already don't have one, I recommend downloading knoppix or similiar rebooting with the cd to linux, download flasher to desktop and then follow instructions on how to enable rd mode. It's really 5 mins tops. Highly recommended!

c_legaspi 2006-05-03 20:15

it let me copy the gainroot but i havent tried to recopy it back. also can you help me clarify what to comment out. here is what my gainroot looks like.

#! /bin/sh -e
trap exit SIGHUP SIGINT SIGTERM
PATH=bin:/bin/usr/bin:/sbin:/usr/sbin
MODE='/usr/sbin/chroot mnt/initfs cal-tool --get-rd-mode
if [ x$MODE = enabled ]
then
echo "Root enabled"
/bin/sh
else
echo "Enabled RD mode if you want to break your device"
fi


How do you do the alternative and modify etc/sudoers

aflegg 2006-05-04 07:46

If you're not comfortable editing files: DON'T! Leave it enabled in R&D mode, or switch to and from when you require it.

Commenting lines out of /usr/sbin/gainroot is much more "dangerous" (in terms of leading to a complete reflash) than anything else, IMHO.

To repeat: if you need to ask "can you help me clarify what to comment out"[1] then leave it alone!

HTH,

Andrew

[1] I'm not saying you shouldn't be helped to learn how to get around in Linux, or learn shell scripting - but /usr/sbin/gainroot is entirely the wrong file to be playing with.

Stickarm 2006-05-04 08:02

Quote:

Originally Posted by aflegg
To repeat: if you need to ask "can you help me clarify what to comment out" then leave it alone!

Well, heck. I was writing a reply when you posted this.

I just went through the process of modifying gainroot the other day and I'd offer that the instructions are pretty vague on the point c_legaspi is asking about.

Having just gone through this whole ordeal recently (successfully, as far as I can tell), I was going to provide an answer that I thought would help clarify the instructions and explain the theory behind which lines to comment out to the extent I understand that theory (which isn't very deeply).

Can you explain your warning any futher or are you just reiterating the warnings provided with the instructions? I'd be honestly surprised if anyone read the already existing warnings and thought that these modifications presented no risk.

aflegg 2006-05-04 08:09

Well, there have been a number of people who've edited it wrongly and lost the ability to become root full-stop, and had to reflash.

Also, I've not yet seen a clear reason why R&D mode should be disabled anyway. Leave it enabled, unless you don't like spanners & green text when booting.

50p (about 92 cents) to anyone who can convince me why R&D mode should be disabled; after editing /usr/sbin/gainroot to disable the R&D check.

konttori 2006-05-04 09:59

I agree with aflegg. I put it to rd mode and it's been running on it ever since. Flashing the latest version has no effect on the rd mode, so if you rd mode enabled on the 2005 version, when you install 2006, it will retain it in rd mode.

c_legaspi 2006-05-04 13:30

i am unsure and thats why im asking. i would like to have root access without having to go thru the reflashing all the time. which lines do i comment out. the maemo instructions are unclear to me

if this is dangerous, then give an alternative solutions.

rattis 2006-05-04 14:40

Quote:

Originally Posted by c_legaspi
i am unsure and thats why im asking. i would like to have root access without having to go thru the reflashing all the time. which lines do i comment out. the maemo instructions are unclear to me

if this is dangerous, then give an alternative solutions.

I found the instructions pretty clear, and you don't have to constently reflash. Just put it in RD mode and leave it there. (Yes I know the instructions said not too, and it sounded like a good idea to me). I was going to paste my config for you, but it seems the unit is dead, and I don't have my power plug with me. I'll paste it when I get home so you can see what works fro me.

c_legaspi 2006-05-04 15:06

thanks, at least it will give me some kind of ideal. Yeah, leaving it in RD is another option. just want to weigh all my options

aflegg 2006-05-04 15:09

As I said, noone's convinced me (or other "power" users, if I may speak for them) as to why you'd ever disable R&D mode.

Leaving it in R&D mode all the time is a lot safer than editing the gainroot script and gets you funky debug text written over your boot screen! How could you lose?! ;-)

rattis 2006-05-04 15:20

Quote:

Originally Posted by aflegg
As I said, noone's convinced me (or other "power" users, if I may speak for them) as to why you'd ever disable R&D mode.

Leaving it in R&D mode all the time is a lot safer than editing the gainroot script and gets you funky debug text written over your boot screen! How could you lose?! ;-)

Well when I flashed mine and edited gainroot, I had only had the thing for a whole of 2 hours. I was inclined to follow the directions to the letter, and actually got worried when I found I skipped a step.

Although debuging text does sound like it could be useful, maybe I'll reflash.

aflegg 2006-05-04 15:24

Yeah, but whoever added the "disable R&D mode after editing gainroot" step to the wiki didn't explain why, or has come forward to say why (AFAIK).

To me it just makes the process more complex and error-prone for non-technical users; and since this seems to be the growing consensus, the wiki will probably be edited to reflect this.

Cheers,

Andrew

rattis 2006-05-04 21:52

sorry it took a while to post it. Actually forgot until halfway though watching doctor who.

#!/bin/sh -e
trap exit SIGHUP SIGINT SIGTERM
PATH=/bin:/usr/bin:/sbin:/usr/sbin
#MODE=`/usr/sbin/chroot /mnt/initfs cal-tool --get-rd-mode`
#if [ x$MODE = xenabled ]
#then
# echo "Root shell enabled"
/bin/sh
#else
# echo "Enable RD mode if you want to break your device"
#fi
#

c_legaspi 2006-05-04 21:57

thanks, I appreciate the help.

also, thanks to all. at least know im trying to get my feet wet in linux without drowning.

Penquin-007 2006-05-09 14:47

Hello,

I'm a new Nokia 770 user, well I haven't even received it yet ;-) But I read a lot on the internet about my future gadget :)

I would like to know if it is possible to gain root access without having a desktop PC with linux or MacOs installed?

Can I use something like the "damn small pc" linux distribution to run linux "inside" windows or from a USB boot drive?

Thanks

rattis 2006-05-09 16:44

Quote:

Originally Posted by Penquin-007
Hello,

I'm a new Nokia 770 user, well I haven't even received it yet ;-) But I read a lot on the internet about my future gadget :)

I would like to know if it is possible to gain root access without having a desktop PC with linux or MacOs installed?

Can I use something like the "damn small pc" linux distribution to run linux "inside" windows or from a USB boot drive?

Thanks

DSL-live cd, then again most live cds, should be able to do the trick. The howto has a hard way of doing it, and I think it's windows based but not sure, that should work too. I've also seen other people say it's possible to flash to rd for gainroot, without windows. I say go dl knoppix or some other live cd, and just use that.

aflegg 2006-05-09 17:06

There's also the firmware binary patch which has been mentioned here.

c_legaspi 2006-05-09 18:16

ive done it using the flash and ubuntu live cd. i sure am learning alot about this linux. kind of reminds me of the old days of ms dos.

Neil McAllister 2006-05-09 18:48

Mine's been in R&D mode the whole time and I've never questioned it, even after flashing the latest firmware. The cosmetic "issues" on bootup are nothing to people who have been using Linux for a while. Why worry?

fpp 2006-05-09 19:17

Knoppix works just fine for a quick flash :-)


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

vBulletin® Version 3.8.8