[DEV] BACKTRACK 5 on SGS2 (chroot) [UPDATED: 12/July/2011]

Search This thread

kapollo

Senior Member
Jun 5, 2008
88
3
Szczecin
inside bt.img there is a file named as ui

in terminal emulator if you follow steps till you type bt and get a root@localhost prompt

at this point you cna go to

cd /root/bin

and here you will see there is a file named ui

inside ui file you can see the text somthing like

vncserver -- geometry abcXdef
here abc=854 and def=480 for X10i simmilarly what ever is your screen resolution you just need to place that in correct place all done

@Doom please provide update script with correct resolution, as i am not sure about exact size of screen.
directly updating ui file once bt command has been fired and img is mounted should do the trick

What a HDTV with an MHL cable would the resolution change to say 720p actually work that way with a TV?
 

DavidMc0

Senior Member
Oct 5, 2007
342
8
Glasgow
I'd like to try this, but so far can't find the 'ui' file, or figure out how to open it.

Can you please give a full step by step guide on opening this file, so that I can edit and save it to see if I can get the resolution higher than 800x480 for output through HDMI?

Sorry if this is dumb - I know next to nothing about linux!


Edit: I figured it out (used text editor in BT to edit file), and putting the resolution up beyond 800x480 simply increases the size of the desktop and you need to scroll around to view it, so using this method, it does not achieve higher resolution through the MHL HDMI output.
 
Last edited:

anantshri

Senior Member
Feb 22, 2011
687
320
Bangalore
anantshri.info
I'd like to try this, but so far can't find the 'ui' file, or figure out how to open it.

Can you please give a full step by step guide on opening this file, so that I can edit and save it to see if I can get the resolution higher than 800x480 for output through HDMI?

Sorry if this is dumb - I know next to nothing about linux!

Code:
startbt
bt
after you reach the root@localhost prompt

then you can navigate to /root/bin/
there you will find ui script
you just need to edit it and change the resolution.
or if you are not able to find it.
type
Code:
which ui
this should give you the location
 
  • Like
Reactions: DavidMc0

gangster429

Senior Member
May 5, 2007
106
12
@gangster429

try this:

bt5_sgs2_shell_scripts_EXTSD_V1.zip

i am not sure if external sd is mounted during recovery... in any case try this...

also u need to place bt.img in /sdcard/external_sd/bt/

It's working with partition micro sd :):):):):)
without using the script
I will post the tutorial later have to find the correct steps first :)

ps don't give attation to time on the phone too lazy to change at moment will probably do wipe anyway to clean ever tying up and start over :)

I'm happy now :))))
 

Attachments

  • 14082011.jpg
    14082011.jpg
    80.8 KB · Views: 464
Last edited:

gangster429

Senior Member
May 5, 2007
106
12
used:
connectbot to run the command line it can be downloaded from market
rooted SGS2
bt.img from first post
some other files


made easy if you connect with putty to you andriod for typing in the commands.
http://xdaforums.com/showthread.php?t=1274635


Here is the way to run backtrack from micro sd
http://www.backtrack-linux.org/forum...captivate.html


I first partition my spare 8gb micro sd following with mini tool partition wizard
info: http://xdaforums.com/showthread.php?t=764491
additional info: http://www.omappedia.org/wiki/Android_SD_Configuration





6gb ext2 for backtrack
1gb fat32 So I can use the micro sd as external storage for my SGS2 ....
480mb linux swap (experimental)



I inserted my micro sd in the phone and typed:
Code:
cd /dev/block/vold/
ls

what you see her is the partitions that I made
179:19
179:18
179:17
179:16
179:11



Done the same without the micro sd inserted
I got only
179:11
So I know witch one was my micro sdcard.



I typyed

Code:
mount



here you see that 179:19 is already mounted thats my fat32 partition.

ext2 partition cant be seen in windows and not in android untill you mount it.
that's the linux way...

I discovered that my ext2 partiton is 179:17 so I mounted that

first have to make the map

Code:
su mkdir
mkdir /data/local/sdcard
mkdir /data/local/mnt

then mount the partition (basic mount command ....)
Code:
mount -t ext2 /dev/block/vold/179:17 /data/local/sdcard

you can check again with mount command to see if it mounted.
this mean you ext2 partition is accessibly from /data/local/sdcard
Now you can work in the ext2 partition

now make BT5 folder in /data/local/sdcard
use the command
Code:
mkdir /data/local/sdcard/BT5
or jest make on with root explorer (be car full linux is case sensitive)


oke now you have to put the bt5.img to the mounted partition.
extract the zip so you get bt.img
Rename it to bt5.img
copy the bt5.img form first post to you internal sdcard or you fat32 partition
best way is to make a folder there and copy
download the following link and copy those file IN there to
http://www.filesonic.com/file/1674589764

now I used root explorer to copy everthing from my sdcard witch I copied bt5.img and files from the links to the mounted ext2 directory /data/local/sdcard/BT5
it should look like this
(copying can be also be done with command)


now open connectbot again
type in
Code:
cd /data/local/sdcard/BT5
sh bootbt
what this will do is mount the bt5.img to
/date/local/mnt
(you running now mounted ext2 in there bt5.img mounted in /date/local/mnt
It has to be like this cus it is img ((cdrom) witch has to be mounted (outomount exits to...)
if you get file already exist jest ignore

we are almost there

type
Code:
startvnc

open you vnc client
connect
server: 127.0.0.1 or localhost
port: 5901
username: bt
passwd: 123456789



you have to run thise commaned evertime you reboot you phone.
mount: mount -t ext2 /dev/block/vold/179:17 /data/local/sdcard
got to pad: cd /data/local/sdcard/BT5
start backtrack: sh bootbt
start vnc: startvnc
connect with vncclient

witch is no problem it can be put in to little script
feel free to make one I will make one when I have time.






(if you get in any of those command file not found or permission denied inform me I will edit this post)
It's about time to buy 32gb micro sd
I had my 16gb for a week or so :(
 

Attachments

  • BT5-GNOME-ARM.zip
    610.6 KB · Views: 118
  • SC20110813-195607.jpg
    SC20110813-195607.jpg
    8.3 KB · Views: 216
  • SC20110813-200221.jpg
    SC20110813-200221.jpg
    7.6 KB · Views: 204
  • SC20110813-214527(bew).jpg
    SC20110813-214527(bew).jpg
    44.4 KB · Views: 210
  • SC20110815-001228.jpg
    SC20110815-001228.jpg
    42.8 KB · Views: 202
  • 14082011.jpg
    14082011.jpg
    80.8 KB · Views: 204
Last edited:
  • Like
Reactions: siniy

Paladin13

Member
May 21, 2007
28
0
I also tried using MHL cable to achieve higher res by editing ui. It just increases desktop size not the res. Doesnt make sense though if u play a HD video the res is fullhd! Then it switches back to normal I guess.
 

anantshri

Senior Member
Feb 22, 2011
687
320
Bangalore
anantshri.info
I also tried using MHL cable to achieve higher res by editing ui. It just increases desktop size not the res. Doesnt make sense though if u play a HD video the res is fullhd! Then it switches back to normal I guess.


ohk do check one thing.... in android vnc viewer there are setttings which defines color level generally its set to 256 colors change it to higher. (if that is what you needed)

also can you put some screenshots or camera shots so that we can understand what exactly you meant.
 

DavidMc0

Senior Member
Oct 5, 2007
342
8
Glasgow
I also tried using MHL cable to achieve higher res by editing ui. It just increases desktop size not the res. Doesnt make sense though if u play a HD video the res is fullhd! Then it switches back to normal I guess.

When you play an HD movie, it treats the MHL output as another display with a higher resolution.

However, when running backtrack the MHL is in mirroring mode, which simply displays the output to the phone screen through the MHL cable to whatever HDMI device is plugged in, so it's always WVGA.

If we could figure out how to change the output mode so that backtrack / other linux is not sent to the phone display, but instead to a higher resolution display via the MHL adaptor like with movies, it would be great.
 

noobsgs2

Senior Member
Jul 2, 2011
378
32
I get Error: (Status 0) during the installation of the V2 in CWM

Edit1:

Tried to manually copy the files with root permission but terminal gives me permission denied while setting up busybox

Edit2:

Get it works perfectly giving execute permission to busybox..
I noticed some errors about /system/bin/startbt and stopbt displayed in the terminal console..

Edit3:

Had to reinstall my ROM since random reboots..

Anyway we cant do much without wifi drivers
 
Last edited:

Phk

Senior Member
I get Error: (Status 0) during the installation of the V2 in CWM

Edit1:

Tried to manually copy the files with root permission but terminal gives me permission denied while setting up busybox

Edit2:

Get it works perfectly giving execute permission to busybox..
I noticed some errors about /system/bin/startbt and stopbt displayed in the terminal console..

Anyway we cant do much without wifi drivers

You can always nmap or metasploit.......... :D
 
  • Like
Reactions: anantshri

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Can someone try on ninph 2.1.3 + LR6.0 as i did and report similar issues back?

if flashing thru CWM is not working try the manual way:
  • download the bt5_sgs2_shell_scripts_v2.zip and place it on SDCARD
  • using root explorer to extract contents of the zip file to some location... now copy the extracted files (from) to [new location]:
    • copy <extractedpath>\data\local\tmp\bt\busybox to /data/local/tmp/bt/busybox
    • copy <extractedpath>\sdcard\bt\bt to /sdcard/bt/bt
    • copy <extractedpath>\sdcard\bt\installbt.sh to /sdcard/bt/installbt.sh
    • copy <extractedpath>\sdcard\bt\startbt to /sdcard/bt/startbt
    • copy <extractedpath>\sdcard\bt\stopbt to /sdcard/bt/stopbt
  • now use terminal emulator and execute the following commands
    Code:
    su
    busybox chown root.root /data/local/tmp/bt/busybox
    busybox chmod 0777 /data/local/tmp/bt/busybox

thats it...

also make sure that u have extracted the archive (big one) and that the bt.img file is in /sdcard/bt/ folder
 

noobsgs2

Senior Member
Jul 2, 2011
378
32
Well i actually gave to busybox all the permissions but the problem was later... i had killui exit and stopped all.. even rebooted as u said but some randoms crashes started up so i decided to reinstall all... what could be the prob?

I tryed your codes too but after

busybox chown root.root /data/local/tmp/bt/busybox

i had "chown: unknown user/group root:root

I issued the second command without the first

busybox chmod 0777 /data/local/tmp/bt/busybox

And now it seems to work good without crashes or reboots.. was the first necessary?
 
Last edited:

curioct

Senior Member
Jan 12, 2011
280
41
Man I am absolutely astounded, I haven't messed with BT since V3 when I helped Daoid out with some stuff i the airoscript which eventually made it into the BT build and still carry BT3 on a USB stick.

but running it on the phone what an awesome piece of work, not sure I have the bottle to install it on my pride and joy new phone yet but I have downloaded it for when my bottle catches up. concerns about rom count and warranty I have already rooted the phone and that set my rom count to 1 :(

What a great piece of work

[update]
just bought a jig :)
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 64
    \\----[ Announcement ]----//

    [12/July/2011] Updated with new package (bt5_sgs2_shell_scripts_v2.zip) containing shell scripts & busybox

    //----[ Announcement ]----\\



    hi guys DooMLoRD & anantshri present to u:

    BACKTRACK 5 on SGS2


    all the work was done by anantshri, i mostly assisted by testing it on my SGS2 and modding it slightly so that it will work properly for SGS2... dont forget to thank him!

    i will try n keep it short and simple...

    for more details u can read the original thread at X10 sub-forums...

    [DEV] BACKTRACK 5 on Xperia X10 chroot


    [ Screenshots ]


    on startup (shell):

    shell.png



    in GUI:

    gui.jpeg


    phone + BT5 GUI:

    phone.jpg




    [ Requirements ]



    [ How To : File Setup ]

    u need to do this only once
    1. download the files from the links provided in this thread
    2. extract the files using 7zip to a temporary folder (needs 3.3GB free on that drive)
    3. connect ur SGS2 to PC and mount USB storage
    4. create a folder named 'bt' (without quotes) in the root of ur sdcard and copy the bt.img in that folder
    5. also place the file bt5_sgs2_shell_scripts_v2.zip in root of sdcard, this file has to be flashed via recovery
    6. once u verify that the above is correct then un-mount usb storage
    7. reboot into recovery and flash the file bt5_sgs2_shell_scripts_v2.zip stored in root of sdcard (or if u are using CWM app then just select the file for flashing and the app will do the rest ;))
    8. once ur phone reboots into OS just check the /sdcard/bt folder
    9. final directory structure should look like this:
      • /sdcard/bt/bt
      • /sdcard/bt/bt.img
      • /sdcard/bt/installbt.sh
      • /sdcard/bt/startbt
      • /sdcard/bt/stopbt
    10. once u verify that the above is correct then u can proceed


    [ How To : Launch BT ]

    1. start Terminal Emulator app on ur SGS2 and enter the following commands step by step (accept/allow any SuperUser request/popup that u may receive)
      • su
      • cd /sdcard/bt
      • sh installbt.sh
      • startbt
      • bt
    2. now u are in BackTrack5 shell

    3. to launch GUI (vncserver) enter the following command
      • ui
      uilaunch.jpeg

      now note the number N shown localhost:N
      e.g. as u can see from the above image that "New 'X' desktop is localhost:1", so N=1
      the vncserver is running at (5900 + N, N=1 ; so server port is 5901)

    4. now launch androidVNC app on phone and fill in the detials as follows
      • Nick : bt
      • Address : 127.0.0.1
      • Port : 5901
      • Password : 12345678
      • Username : <leave it blank>
      • Color Format : 24-bit color (4 bpp)
      vnc.jpeg

      inside vnc window select input mode (i personally recommend the following)
      • TouchPad (here your screen works like a big touchpad use it to navigate mouse.)
    5. and then press connect... now u are in BackTrack GUI!

    6. if u want to exit/close BT5 then u need to follow these steps:
      • close the androidVNC app (Menu -> Disconnect)
      • go back into Terminal Emulator app and enter the following commands
        u should be at this shell root@localhost:~#
        • killui
        • exit
      • now u will get back to this shell> #
      • now enter the following commands to stop bt and exit
        • stopbt
        • exit
        • exit
      • u can now exit the Terminal Emulator app
      • i would also recommend that u reboot ur phone


    [ Important Info ]

    root password is 12345678



    [ Download Links ]

    1. update.zip package containing shell scripts, busybox (which gets installed to temporary location) [to be flashed via recovery]
      this will not disturb/conflict with busybox of ur ROM/CF-Root kernel

      bt5_sgs2_shell_scripts_v2.zip (~800KB)

    2. main bt.img
      these links are 7zip archives split into 50mb files, u will need to download the following:
      total size: 486MB

      also uploading to mediafire for mirroring...
      Mediafire Folder: http://www.mediafire.com/?f9gk3p3t9wip5

      md5 hashes:

      Code:
       bt.7z.001 f19e769bf42b44867c8bb1d9bb9c5d44
       bt.7z.002 a4dd26a98d2c6925d871fb108fb5fadb
       bt.7z.003 ecca5a5d72c449117b1d3dbc23aeb1a2
       bt.7z.004 8ad487a01e4d149f0247ad9288201f32
       bt.7z.005 adab9cb3778cd8ac89ccc0e21997c3d7
       bt.7z.006 ba6a28de70a1115dc316f45cea508215
       bt.7z.007 f59757e891631607e1a35abadb231b3b
       bt.7z.008 cdb8c28a1fbd03657bb42e8d69f0600b
       bt.7z.009 426d892f872679e3d53d0ebb0376e138
       bt.7z.010 c7d2957bc65340d967b9dd3646d7cb39

    icon8.gif



    ENJOY!
    8
    [ Tips n Tricks! ]

    1. if u have ur device (SGS2) connected over wifi u can connect to the BT5 vncserver running on ur phone!! u will just need to connect to
      <ip_address_of_phone>:<portno>

      pcbasedvnc.png


    2. most of the startup/launching commands can be executed even through adb shell
    5
    ==== Reserved ===

    few pointers as this has been asked many times

    1) Monitor Mode will not work till someone tried to compile a custom wifi drivers with monitor mode enables, in that case also firmware should allow it.

    2) Those using android-vnc-viewer and facing difficulty in navigation check various input modes.
    These 3 works the best for me.

    1. Touch Mouse; D-Pad Pan
    2. Mouse pointer control mode
    3. TouchPad (here your screen works like a big touchpad use it to navigate mouse.)
    3
    [MOD/FIX]scripts will now mount storage on boot and path is fixed

    First the [FIX] bit

    The attached scripts change the PATH environment variable settings to include /usr/local/bin as needed this is added into the 'bt' script

    not sure if this was in all versions of doom's scripts but it's fixed in these ones where it was missing.

    *I have not gone through all programs to identify if other directories should be in path or not


    Second the [MOD]
    I have modified the 'startbt' and 'stopbt' scripts to automatically mount and unmount the sdcard, external_sd and the usb flash drives (otg cable required)

    Once Back|track 5 is loaded these are mounted in the /root/storage directory creating three directories called 'sdcard', 'external_sd' and 'usbflash'

    Since I was only really doing this as a POC, for myself and the poster above, I have not done extensive testing but so far the sdcard and external_sd are working just fine.

    Using a USB flash via this methof the flash drive must be mounted via the OTG cable and fully enumerated prior to booting or files will not display.

    one word of caution my startbt script is configred to boot BT5 from the external sdcard (edit line 5 remove '/external_sd' for default configuration)

    Full scripts with mods highlighted and underlined (simple bold didn't seem to show up much):-

    startbt :-

    Code:
    echo "BackTrack Loader by Anant based on ubuntu loader"
    echo " "
    echo "[ STEP 2 ]"
    echo ">> Setting variables"
    export kit=/sdcard/[B][U]external_sd/[/U][/B]bt
    export bin=/system/bin
    export mnt=/data/local/bt
    [B][U]export stor=$mnt/root/storage
    export sdcard=$stor/sdcard
    export extsd=$stor/external_sd
    export usbflash=$stor/usbflash[/U][/B]
    export PATH=$bin:/usr/bin[B][U]:/usr/local/bin[/U][/B]:/usr/sbin:/bin:$PATH
    export TERM=linux
    export HOME=/root
    export bboxpath=/data/local/tmp/bt/busybox
    # Mounting Image to the farthest loop point
    # FIXME : check if mount sucessfull otherwise abort whole process.
    echo ">> Creating nodes"
    $bboxpath mknod /dev/block/loop254 b 7 254
    echo ">> Mounting image"
    $bboxpath losetup /dev/block/loop254 $kit/bt.img
    echo ">> Setting other mount points"
    $bboxpath mount -t ext2 /dev/block/loop254 $mnt
    $bboxpath mount -t devpts devpts $mnt/dev/pts
    $bboxpath mount -t proc proc $mnt/proc
    $bboxpath mount -t sysfs sysfs $mnt/sys
    [B][U]$bboxpath mkdir -p $sdcard
    $bboxpath mkdir -p $extsd
    $bboxpath mkdir -p $usbflash
    $bboxpath mount --bind /mnt/sdcard $sdcard
    $bboxpath mount --bind /mnt/sdcard/external_sd $extsd
    $bboxpath mount --bind /mnt/sdcard/usbStorage/sda $usbflash[/U][/B]
    echo ">> Seting environment"
    sysctl -w net.ipv4.ip_forward=1
    echo ">> Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4"
    echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
    echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
    echo "127.0.0.1 localhost" > $mnt/etc/hosts
    echo "[ STEP 2 COMPLETE ]"
    echo " "
    echo "BackTrack is ready just type 'bt' (without the quotes)"



    bt script with mods in bold:-

    Code:
    echo "[ STEP 3 ]"
    echo ">> Setting variables"
    export kit=/sdcard/bt
    export bin=/system/bin
    export mnt=/data/local/bt
    export PATH=$bin:/usr/bin:/usr/sbin[B][U]:/usr/local/bin[/U][/B]:/bin:$PATH
    export TERM=linux
    export HOME=/root
    export bboxpath=/data/local/tmp/bt/busybox
    echo ">> Correcting resolution issues"
    $bboxpath sed -i 's/850/800/g' /data/local/bt/root/bin/ui
    echo "[ STEP 3 COMPLETE ]"
    echo "Customized script for BackTrack by Anant shrivastava http://anantshri.info"
    echo "modded for SGS2 by DooMLoRD"
    echo "Enjoy BackTrack 5 }:)"
    echo " "
    echo "BackTrack shell will now be lauched"
    echo "to start GUI (vncserver) type 'ui' (without the quotes)"
    $bboxpath chroot $mnt /bin/bash

    stopbt script with mods in bold:-

    Code:
    echo "Cleaning the leftover and returning back the memory to Android."
    echo "by Anant Shrivastava http://anantshri.info "
    echo " "
    echo "[ Cleanup ]"
    #After exit command is executed clear it all up
    echo ">> Setting variables"
    export kit=/sdcard/bt
    export bin=/system/bin
    export mnt=/data/local/bt
    export PATH=$bin:/usr/bin:/usr/sbin[B][U]:/usr/local/bin[/U][/B]:/bin:$PATH
    export TERM=linux
    export HOME=/root
    export bboxpath=/data/local/tmp/bt/busybox
    sync
    echo ">> Unmounting temporary mount points"
    [B][U]$bboxpath umount -l /data/local/bt/root/storage/external_sd
    $bboxpath umount -l /data/local/bt/root/storage/usbflash
    $bboxpath umount -l /data/local/bt/root/storage/sdcard[/U][/B]
    $bboxpath umount -l $mnt/dev/pts
    $bboxpath umount -l $mnt/proc 
    $bboxpath umount -l $mnt/sys 
    $bboxpath umount -l $mnt
    echo ">> Unmounting image"
    $bboxpath losetup -d /dev/block/loop254
    echo ">> Remounting system as RO"
    $bboxpath mount -o remount,ro /system
    echo "[ Cleanup Completed ]"
    echo " "
    echo "Please reboot to properly unmount BackTrack"

    I've just noticed I have used full path's in unmounting in this last script, so if you modified the paths to mount things you need to modify these too.

    additionally I used root explorer to manually copy these to '/system/bin' there is no reason that I can think of that these should not work with the standard install.sh script but this has not been tested by me.

    Disclaimer: as mentioned above this was a simple quick and dirty POC for me this messes with files in sensitve areas of your phone, I take no responsibilty for any damage you might do to your own phone.
    3
    files uploaded to personal direct download server!

    links updated

    also uploading to mediafire for mirroring...
    http://www.mediafire.com/?f9gk3p3t9wip5

    will post these links in few hours!

    ENJOY BT5 on ur SGS2