How I rooted my Incredible, and installed busybox.

Discussion in 'Droid Incredible Hacks' started by adrynalyne, Jun 11, 2010.

  1. adrynalyne
    Offline

    adrynalyne Premium Member Premium Member Developer

    Joined:
    Dec 21, 2009
    Messages:
    2,896
    Likes Received:
    4
    Trophy Points:
    0
    I take no credit for this, but I would like to share what I've done so far with DI root. This is not for the faint of heart, and I have had to reflash my phone with an RUU recently due to breaking stuff until I got it right (for me). I've heard of many messed up DI's lately, so do at your own risk.

    First, as we have all seen, you must root with the unrevoked method:

    public:adb_in_recovery [RootWiki]


    To run adb shell in a loop, I did this, using Windows Powershell:

    Code:
    while ($true) { adb shell }
    
    Once I had root access, which is ONLY good for that boot session, I made it permanent via these instructions from xda-dev and to install a working superuser whitelist app:

    Superuser 2.1 - Fun for all! [2010-05-16] - xda-developers
    Get the last one, and extract the contents so you can copy su and Superuser.apk to your sdcard.
    From http://forum.xda-developers.com/showthread.php?t=699088&page=45:
    Code:
    adb shell
    su
    /system/bin/cat /system/bin/sh > /system/bin/su
    /system/bin/chmod 4777 /system/bin/su
    export PATH=$PATH:/system/bin
    cd /system/app
    cat /sdcard/Superuser.apk > Superuser.apk
    cd /system/bin
    cat /sdcard/su > su
    ln -s /system/bin/su /system/xbin/su
    chmod 06755 su
    
    Then I installed my own compiled busybox for the TC roms that I put on the sdcard:

    Code:
    cd /system/bin
    cat /sdcard/busybox > busybox
    chmod 06755 busybox
    

    Then I installed my own custom system read only and read write mount scripts, also from the sd card:

    Code:
    cat /sdcard/sysro > sysro
    cat /sdcard/sysrw > sysrw
    chmod 06755 sysro
    chmod 06755 sysrw
    
    Then I made my own symlink for cp for busybox (once again from the sd card):
    Code:
    cat /sdcard/cp > cp
    chmod 06755 cp
    
    Then I removed city id:
    Code:
    rm /system/app/CityID.apk
    pm uninstall com.cequint.cityid
    

    Note this all must be done before reboot, you will not be able to do these things after reboot, as the system is locked down still for reasons beyond my understanding. However, these changes will persist. I did these changes, in this order.


    I take no credit for this aside from the busybox, cp, sysro, and sysrw stuff. Also, pm uninstall com.cequint.cityid fin ishes the uninstall of CityID, which other instructions do not note. Simply nuking the apk is not the entire procedure.

    I've attached my files if anyone is interested.
  2. justin82
    Offline

    justin82 DF Super Moderator Staff Member Premium Member

    Joined:
    Dec 11, 2009
    Messages:
    3,610
    Likes Received:
    159
    Trophy Points:
    63
    WOW.. that is def not for the faint of heart.. good job.. thinking this thread will be 30 pages with i just bricked my incredible..
    Last edited by a moderator: Jun 11, 2010
  3. adrynalyne
    Offline

    adrynalyne Premium Member Premium Member Developer

    Joined:
    Dec 21, 2009
    Messages:
    2,896
    Likes Received:
    4
    Trophy Points:
    0
    I have heard of bricks, and I think this phone is probably more easy to brick than the Moto Droid, which is dang near brick proof.

    So yes, PLEASE BE CAREFUL!
  4. CaptainTaco
    Offline

    CaptainTaco New Member

    Joined:
    Apr 22, 2010
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    EDIT: As adrynalyne pointed out, busybox is self contained, read the next post. The instructions in the post would create links to busybox for each individual command allowing you to not have to type "busybox" before each command. It is not necessary.

    Interesting, just a few observations / questions.

    For BusyBox, is this all you ran?

    cd /system/bin
    cat /sdcard/busybox > busybox
    chmod 06755 busybox

    I ask because that wouldn't install BusyBox, it would just place the file in your system/bin

    As far as I know, installation would require running from recovery
    I believe the proper code would be as follows (I have not run it yet, worked on getting Superuser.apk working first) I'll try it in a bit.... I digress, I believe it should be;

    adb push busybox /sdcard/busybox
    adb shell
    Code:
    $ su
    #export PATH=$PATH:/system/bin
    #cd /system/xbin
    # cat /sdcard/busybox > busybox
    # chmod 06755 busybox
    # ./busybox --install -s /system/xbin
    # rm /sdcard/busybox
    # exit
    $ exit
    this would all need to be done during the rooting process (aka in Recovery)
    This is because the system partition does not properly mount when not in recovery, this is still being worked on.

    Which brings me to my second question, the scripts for mounting and remounting, though correct for any other rooted phone, won't work correctly for the Incredible. (I checked your script code). Just curious if you left out some steps you might have done yourself that arn't listed, and perhaps found a way around the issues I described?

    I'm not trying to down your work or anything, just trying to help, and of course trying to discover if you figured something out we haven't, (perhaps omitted from the steps in your post)
    Last edited: Sep 28, 2010
  5. adrynalyne
    Offline

    adrynalyne Premium Member Premium Member Developer

    Joined:
    Dec 21, 2009
    Messages:
    2,896
    Likes Received:
    4
    Trophy Points:
    0
    Nope. Buysbox is a self contained file.

    Also, I used my scripts. They do work.

    Edit: not saying you can't do that, but without expanding 15 million commands, you can simply type:

    busybox <command> without the <>.
    Last edited: Jun 11, 2010
  6. adrynalyne
    Offline

    adrynalyne Premium Member Premium Member Developer

    Joined:
    Dec 21, 2009
    Messages:
    2,896
    Likes Received:
    4
    Trophy Points:
    0
    What makes you think the mounting scripts don't work?
  7. adrynalyne
    Offline

    adrynalyne Premium Member Premium Member Developer

    Joined:
    Dec 21, 2009
    Messages:
    2,896
    Likes Received:
    4
    Trophy Points:
    0
    Default state:

    Code:
    # mount
    mount
    rootfs / rootfs ro 0 0
    tmpfs /dev tmpfs rw,mode=755 0 0
    devpts /dev/pts devpts rw,mode=600 0 0
    proc /proc proc rw 0 0
    sysfs /sys sysfs rw 0 0
    tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
    none /dev/cpuctl cgroup rw,cpu 0 0
    [B]/dev/block/mtdblock3 /system yaffs2 ro 0 0[/B]
    /dev/block/mmcblk0p1 /data ext3 rw,nosuid,noatime,nodiratime,errors=continue,data=ordered 0 0
    /dev/block/mtdblock6 /data/data yaffs2 rw,nosuid,nodev 0 0
    /dev/block/mmcblk0p2 /cache ext3 rw,nosuid,nodev,noatime,nodiratime,errors=continue,data=ordered 0 0
    /dev/block//vold/179:3 /emmc vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=002
    0,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
    /dev/block//vold/179:9 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0
    020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
    #
    


    After running my script sysrw:

    Code:
    # sysrw
    sysrw
    **System mounted as Read-Write**
    # mount
    mount
    rootfs / rootfs ro 0 0
    tmpfs /dev tmpfs rw,mode=755 0 0
    devpts /dev/pts devpts rw,mode=600 0 0
    proc /proc proc rw 0 0
    sysfs /sys sysfs rw 0 0
    tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
    none /dev/cpuctl cgroup rw,cpu 0 0
    [B]/dev/block/mtdblock3 /system yaffs2 rw 0 0[/B]
    /dev/block/mmcblk0p1 /data ext3 rw,nosuid,noatime,nodiratime,errors=continue,data=ordered 0 0
    /dev/block/mtdblock6 /data/data yaffs2 rw,nosuid,nodev 0 0
    /dev/block/mmcblk0p2 /cache ext3 rw,nosuid,nodev,noatime,nodiratime,errors=continue,data=ordered 0 0
    /dev/block//vold/179:3 /emmc vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=002
    0,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
    /dev/block//vold/179:9 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0
    020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
    #
    
    After running my script sysro:

    Code:
    # sysro
    sysro
    **System mounted as Read-Only**
    **Synced.**
    # mount
    mount
    rootfs / rootfs ro 0 0
    tmpfs /dev tmpfs rw,mode=755 0 0
    devpts /dev/pts devpts rw,mode=600 0 0
    proc /proc proc rw 0 0
    sysfs /sys sysfs rw 0 0
    tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
    none /dev/cpuctl cgroup rw,cpu 0 0
    [B]/dev/block/mtdblock3 /system yaffs2 ro 0 0[/B]
    /dev/block/mmcblk0p1 /data ext3 rw,nosuid,noatime,nodiratime,errors=continue,data=ordered 0 0
    /dev/block/mtdblock6 /data/data yaffs2 rw,nosuid,nodev 0 0
    /dev/block/mmcblk0p2 /cache ext3 rw,nosuid,nodev,noatime,nodiratime,errors=continue,data=ordered 0 0
    /dev/block//vold/179:3 /emmc vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=002
    0,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
    /dev/block//vold/179:9 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0
    020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
    #
    


    What am I missing? I am not claiming that you can make magic happen with the locked down filesystem, but it does allow renaming, deleting, and permissions changes.
    Last edited: Jun 11, 2010
  8. CaptainTaco
    Offline

    CaptainTaco New Member

    Joined:
    Apr 22, 2010
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    that is what I was trying to explain, the filesystem is locked. It was not made clear in your original post, so should someone go through the steps and then try adding an app, such as Superuser.apk to the /system/app directory, they're going to be confused as to why even after they mounted the file system, it still does not let them.

    I am not claiming you are incorrect, just clarifying. And yes, I already stated the coding was correct for the rw script, just that even after rooting it does not work properly on the incredible. Not a fault of yours or mine, but a fault of the limitations we still have regarding the Incredible.


    EDIT: Sorry I just read the end of my original post, Sometimes I think ahead, and end up forgeting to write something I orginally intended. I did NOT state that your scripts were correct... but I meant to... after "(I checked your script code)" .... I just meant to clarify the limitations of mounting the file system currently. Sorry for the confusion.
    Last edited: Jun 11, 2010
  9. adrynalyne
    Offline

    adrynalyne Premium Member Premium Member Developer

    Joined:
    Dec 21, 2009
    Messages:
    2,896
    Likes Received:
    4
    Trophy Points:
    0
    Busybox output example:


    Code:
    # busybox tar
    busybox tar
    BusyBox v1.16.1 (2010-04-18 12:50:01 MST) multi-call binary.
    
    Usage: tar -[cxtzjaZmvO] [-X FILE] [-f TARFILE] [-C DIR] [FILE]...
    
    Create, extract, or list files from a tar file
    
    Options:
            c       Create
            x       Extract
            t       List
    Archive format selection:
            z       Filter the archive through gzip
            j       Filter the archive through bzip2
            a       Filter the archive through lzma
            Z       Filter the archive through compress
            m       Do not restore mtime
    File selection:
            f       Name of TARFILE or "-" for stdin
            O       Extract to stdout
            exclude File to exclude
            X       File with names to exclude
            C       Change to DIR before operation
            v       Verbose
    
    #
  10. adrynalyne
    Offline

    adrynalyne Premium Member Premium Member Developer

    Joined:
    Dec 21, 2009
    Messages:
    2,896
    Likes Received:
    4
    Trophy Points:
    0
    from my first post:


    Note this all must be done before reboot, you will not be able to do these things after reboot, as the system is locked down still for reasons beyond my understanding. However, these changes will persist. I did these changes, in this order.
  11. adrynalyne
    Offline

    adrynalyne Premium Member Premium Member Developer

    Joined:
    Dec 21, 2009
    Messages:
    2,896
    Likes Received:
    4
    Trophy Points:
    0
    So, let me clarify. Things that can be done with this damn locked down filesystem:

    Deletions.
    Permissions changes.
    Viewing of files.
    Renaming.


    What cannot be done:
    Adding to /system.
  12. CaptainTaco
    Offline

    CaptainTaco New Member

    Joined:
    Apr 22, 2010
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    Thank you for the clarification, I missed that statement in your first post, it's clear I have offended you in some manor, I truly did not mean to in any way, as I stated just looking to clarify. Apologies if I have.
  13. adrynalyne
    Offline

    adrynalyne Premium Member Premium Member Developer

    Joined:
    Dec 21, 2009
    Messages:
    2,896
    Likes Received:
    4
    Trophy Points:
    0
    No, you didn't offend me. I am just not a people person and come off that way :D Its all good :)
  14. CaptainTaco
    Offline

    CaptainTaco New Member

    Joined:
    Apr 22, 2010
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    Thank You as well for the clarification of busybox, in my previous phones I've always used the full install method (the one I listed), however I did just use your suggestion, and placed it in /system/bin as a standalone binary file (I use /system/xbin as force of habit). Verified it does work through using Titanium Backup. Learn something new every day. :)

    I guess it's just a matter of the App Makers requiring busybox installed better have both methods programed into their apps.


    and yea... I lack social skills as well, generally why I tend to offend people... I just assume I'm going to ahead of time, and deal with the ramifications as they come.
  15. adrynalyne
    Offline

    adrynalyne Premium Member Premium Member Developer

    Joined:
    Dec 21, 2009
    Messages:
    2,896
    Likes Received:
    4
    Trophy Points:
    0
    Yeah--thats why I symlinked cp, is because app devs don't take that into account.

    I am still playing, but am so limited by the lockdowns in place that it is frustrating.
  16. R1Lover
    Offline

    R1Lover New Member

    Joined:
    Nov 6, 2009
    Messages:
    1,702
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Northern Ca
    I have superuser installed and running just fine.... :)

    Thanks to XC from XDA for this as well.

    [​IMG]
  17. CaptainTaco
    Offline

    CaptainTaco New Member

    Joined:
    Apr 22, 2010
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    Correct, that feet has been overcome. Their method is listed in the first post on this forum as well. We now have Root, Superuser.apk, BusyBox, and a temporary recovery flash available. We're discusing the still limited lockdowns, such as the filesystem when not in recovery, the reflashing of any modified recovery ((Such as a Cryo recovery)) upon reboot, aka it won't last more than one boot. Etc, Etc.

    But yea, have Root and Superuser, and loving every second of it. Now the next step is to see if we can plop a modified kernel on there, and have it actually STAY on there. :)
    Last edited: Jun 11, 2010
  18. adrynalyne
    Offline

    adrynalyne Premium Member Premium Member Developer

    Joined:
    Dec 21, 2009
    Messages:
    2,896
    Likes Received:
    4
    Trophy Points:
    0
    Hell, I'd like it to just boot. I completely hosed my phone with a compiled kernel a few minutes ago :D


    Luckily I have an RUU to work with.
  19. R1Lover
    Offline

    R1Lover New Member

    Joined:
    Nov 6, 2009
    Messages:
    1,702
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Northern Ca
    Can we accomplish what is needed by just symlinking like the su.apk was done?

    I just want to be able to play with themes and also have wifi tether working... but I think that can be done as is... it just needs some tweeks to the wifi.apk
  20. adrynalyne
    Offline

    adrynalyne Premium Member Premium Member Developer

    Joined:
    Dec 21, 2009
    Messages:
    2,896
    Likes Received:
    4
    Trophy Points:
    0
    Sure, although there is a symlink file in the zip file I gave ya,.

    I have a feeling MM is going fall flat on its face though.
Search tags for this page
android razr maxx busybox wont install
,
busybox apk v1.16.1
,

busybox htc incredible

,
busybox v1.16.1 apk
,
buysbox for android htc desire c 43
,
can't cd to /system/xbin
,
droid incredible hacks
,
how to root htc incredible read only file
,
install busybox
,
install superuser on droid incredible
,
su not locating busybox
,
what busybox version for htc incredible