Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,731,985 Members 41,216 Now Online
XDA Developers Android and Mobile Development Forum

Minimal rooting - back to basics

Tip us?
 
Renate NST
Old
#1  
Renate NST's Avatar
Recognized Contributor / Recognized Developer - OP
Thanks Meter 781
Posts: 1,947
Join Date: Feb 2012
Location: Boston
Default Minimal rooting - back to basics

There are many tools and "Super-Ultra-Mega-Rooters" and things to root your Nook.
They will install 23 different things on your Nook.
If you like them, use them.

What is "rooting"?
At the most basic level, "rooting" is managing to get a root (all-powerful) shell (command line interpreter).
When your Nook is sitting there with a prompt saying # then you are rooted.
Alright, a prompt #, but on where?
On your desktop computer, which has to be linked somehow to your Nook.
The way we link Android devices to desktop computers is with ADB (Android Debug Bridge).
Every Android device has this capability built in, but sometimes it's disabled.
Sometimes they make it easy to enable, sometimes they make it hard.
On the Nook, it's fairly easy because the Nook will boot up off an external SD card.

How to root any Nook
The configuration for the Nook is stored in a filesystem called uRamdisk inside the boot partition.
If we can get a copy of uRamdisk, modify it, then replace the copy in the boot partition we can root.

Copy uRamdisk to the desktop
There are two easy ways to get a copy of uRamdisk:
  • Put noogie on an SD card, boot up, connect the USB and a disk will appear on your desktop.
    This will be the boot partition, copy uRamdisk.
  • Get the update zip from B&N and unzip it.
    They call the file ramdisk.img, but it's uRamdisk.

Modify uRamdisk
You need to extract two files out of uRamdisk then replace them.
There is a utility for Win32 called bootutil.exe in the signature below.
Code:
bootutil /x /v uRamdisk init.rc default.prop
This should say that it extracted two files.
Using an editor you need to edit the two files.
Don't use Windows Notepad (it's miserable and doesn't understand Unix end-of-lines).
Try Notepad++ if you don't have a good text editor.
Comment out a few lines in init.rc (additions in red):
Code:
service adbd /sbin/adbd
#    disabled

...

# adbd on at boot in emulator
on property:ro.kernel.qemu=1
#    start adbd

on property:persist.service.adb.enable=1
#    start adbd

on property:persist.service.adb.enable=0
#    stop adbd
You can use ADB over WiFi or USB.
Over WiFi can be easier because you don't need to configure desktop drivers.
As so far modified the ADB would use USB.
If you want it to work over WiFi instead, delete the comment # mark:
Code:
#    setprop service.adb.tcp.port 5555
Now a minor modification to default.prop.
Change it so that it reads only (no other lines):
Code:
ro.secure=0
ro.allow.mock.location=1
ro.debuggable=1
To put these two files back into the desktop's copy of uRamdisk:
Code:
bootutil /v /r uRamdisk init.rc default.prop
This should say that it replaced two files.

Copy uRamdisk to the Nook
Use noogie as in step one and just copy the uRamdisk over the old copy.
Reboot. Make sure that your WiFi is turned on and connected.

Use ADB
Get adb.exe from the Android SDK.
You connect to your Nook using either an IP address or a host name if you defined one in your C:\Windows\System32\drivers\etc\hosts.
Code:
adb connect nook or whatever you named it
adb shell
or
Code:
adb connect 192.168.1.2 or whatever the IP is
adb shell
Then you will get your # prompt.
You can do whatever you want.
Usually the point of all this is to allow you to modify something in the system.
To do this, you have to "remount" the system partition.
Code:
# mount -o rw,remount /dev/block/mmcblk0p5 /system
The rest is up to you!

The Following 3 Users Say Thank You to Renate NST For This Useful Post: [ Click to Expand ]
 
nobricks
Old
#2  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Dec 2012
Can you release a version of this utility for linux?
 
Renate NST
Old
#3  
Renate NST's Avatar
Recognized Contributor / Recognized Developer - OP
Thanks Meter 781
Posts: 1,947
Join Date: Feb 2012
Location: Boston
Quote:
Originally Posted by nobricks View Post
Can you release a version of this utility for linux?
In Unix (as always) you can accomplish your purpose by chaining together a half dozen commands with obscure case-sensitive parameters.

I don't know the exact parameters, but the general drift of things is here.

The Following User Says Thank You to Renate NST For This Useful Post: [ Click to Expand ]
 
nobricks
Old
#4  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Dec 2012
Thanks for pointing me in the right direction.

Did some further searching on the forums and found this post with the proceedure for modifying uRamdisk under linux.
 
ApokrifX
Old
(Last edited by ApokrifX; 8th March 2014 at 10:07 PM.)
#5  
Senior Member
Thanks Meter 46
Posts: 410
Join Date: May 2011
Quote:
Originally Posted by Renate NST View Post
Over WiFi can be easier because you don't need to configure desktop drivers.
Renate,
Question about NST USB drivers for ADB.
In short: I got 2 NSTs, they do have "slightly" different hardware, I guess. Or might be, internal SD card size is different only?
First was rooted long time ago, and my WinXP see it as ADB device (backup size 1,958,739,968 bytes)
NST modded ADB driver was installed long time ago.
Another one is a bit newer (backup size 1,962,934,272 bytes)
I’ve decided to root second one, followed instruction to the letter.
It was not detected as ADB device, only ADB via WiFi worked.
Apparently, /sbin/adbd was started, but I was not able to adb connect via USB at all, but only via WiFi with following line was uncommented (obviosly):
setprop service.adb.tcp.port 5555
Tried few times, the results are consistent.
Made me think, are there different drivers for "slightly" different NST hardware?
Am I mistaken?
 
Renate NST
Old
#6  
Renate NST's Avatar
Recognized Contributor / Recognized Developer - OP
Thanks Meter 781
Posts: 1,947
Join Date: Feb 2012
Location: Boston
The partitioning on an NST actively uses 1,941,962,752 bytes.
Any capacity over that is unused by the stock partitioning.
The exact capacity of the "2 GB" is varied.
I wrote a note somewhere of 3 different sizes that I have seen.

adbd, the ADB daemon uses either USB or TCP (on the Nook, that's WiFi).
Whether service.adb.tcp.port is defined determines this.

 
ApokrifX
Old
#7  
Senior Member
Thanks Meter 46
Posts: 410
Join Date: May 2011
Renate,
Quote:
Originally Posted by Renate NST View Post
The partitioning on an NST actively uses 1,941,962,752 bytes.

I wrote a note somewhere of 3 different sizes that I have seen.
The Q is: Does all 3 use exact same windows driver?
Could you compare your NST Android Composite ADB Interface driver with mine, please:
Google, Inc. | 8/11/2009 | 2.0.10.2
Hardware Ids
USB\Vid_2080&Pid_0003&Rev_0216&MI_01
USB\Vid_2080&Pid_0003&MI_01
 
Renate NST
Old
#8  
Renate NST's Avatar
Recognized Contributor / Recognized Developer - OP
Thanks Meter 781
Posts: 1,947
Join Date: Feb 2012
Location: Boston
The excess size of the internal NAND does not make a difference in anything.

The "ADB driver" is basically a way to tell Windows:
Quote:
Hey, dude, you don't really know this device but pretend that you do.
It just has a bulk in endpoint and a bulk out endpoint.
Don't worry your little head over what the data is.
Just use the generic driver file C:\Windows\System32\drivers\winusb.sys
And if I feel like using it I'll interface through C:\Windows\System32\winusb.dll
And Windows sighs and just does it.

(Well, actually, it's a bit more complicated than that because it creates the Android Device install class.)

Anyway, what was your question?


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes