[MOD] v0.3.1 Working Full Ubuntu for 1.5.7 and 1.8.3 based on Sogarth's script

Status
Not open for further replies.
Search This thread

the2dcour

Senior Member
Mar 17, 2011
464
587
Boston
Sogarth's webtop2sd will be released soon, you really should wait and install that instead of this! Thanks -The Management
No longer breaks on 1.83, thanks to Romracer :D
Update: This script worked on my phone. Mind you I was installing it from a fresh SBF flash, but it should work on your phone too. Absolutely no guarantees as usual.
Update 11th April 2011, 06:59 PM: Won't be getting CWM package because it'd be huuuuuuuuuge.
Update 28th April 2011. 16:38 PM: Removing BETA tag since there have been no issues with the script for quite some time.

First off I would like to thank Sogarth for making this script in the first place as well as Romracer for fixing it for 1.83. Since he is busy doing more important work I decided to do this little hack for those of us that updated to 1.5.7 and dont feel like flashing back to earlier versions to get full Ubuntu working.

Again, this is only necessary if you're already running 1.5.7 or 1.8.3.

Secondly, I am still working on this script so it may not work for you. If you have a problem you may post in the thread or PM me showing exactly the error message, word for word, that you receive.

Updates will be included in the OP from time to time as I fix errors.

Instructions:
1) install.bat (from your computer)
2) adb shell (get a shell on your phone)
3) su (get root on your phone in that shell)
4) . /data/local/tmp/install.sh (run the install script *on your phone* don't forget the "." and the space after the dot, or you will have to chmod 755 the shell script manually)
5) ?????
6) profit\

Noob instructions, written by Viamonte (I take no credit or responsibility):
Thanks again for all your help. Now the noob instructions:

"1-Download "Terminal Emulator" from the market, on your phone (or any other terminal), and the file anexed in this thread to your computer.

2-Connect the Atrix to the computer via USB, configuring the connection mode to "None" and enabling USB Debugging mode (Settings>Applications>Development>USB debugging)

3-Unzip the file you downloaded on your pc, and run Install.bat. This will push the script to your phone.

4-Go back to your phone and open the emulator you downloaded. Then type "su" (without quotes) and press enter. Then type ". /data/local/tmp/install.sh" (without quotes) and press enter again.

The script should begin running now. It will stop in two moments where you'll be instructed to get a cup of coffee, and may take several minutes to continue form this point. When finished, the Atrix will reboot.

To check if this worked, use the Webtop either on your multimidia dock or your lapdock and verify if new itens appeared on your task bar and on the right upper side of the screen"

0.3.1 release
0.2 release
0.1 first release

Changelog
0.3.1 fix to gconf file's mdate so it does what its supposed to do =)
0.3 Small typo fixes and cpp package install fix by romracer, now works on 1.83 =)
0.2 Fixed some typos in uninstall.sh and make sure the %gconf file wound up in the right spot.
0.1 - first version. NOT CWM install but ready to be packaged for that more or less
 
Last edited:

flybob

Member
Jun 17, 2009
21
0
Gothenburg
My phone is working perfectly, so why not ruin it?

I'm giving this a try right now!

1.4.57 - Rooted and gingerblurred with HDMI Mirroring and Webtop hack.

I'll update as progress goes along:

Edit 1:
Initial try gave me this

Checking device state...
Obtaining temporary root access...pushing shell scripts
A filesystem file already exists. Reset it? [n] y
Mounting the filesystem...
07.sh
--------------------------------------------
EXECUTION FAILED
Unable to mount the filesystem file. ERR 07
--------------------------------------------
Press any key to continue . . .

Edit 2:
Ok, it doesnt work with resetting it. How about removing?

Checking device state...
Obtaining temporary root access...pushing shell scripts
A filesystem file already exists. Reset it? [n] n
A filesystem file already exists. Delete it? [n] y
Deleting the filesystem file...
--------------------------------------
EXECUTION FAILED
Unable to delete the filesystem file.
--------------------------------------
Press any key to continue . . .

Edit 3:
Ok, only one option left then.

Checking device state...
Obtaining temporary root access...pushing shell scripts
A filesystem file already exists. Reset it? [n] n
A filesystem file already exists. Delete it? [n] n
--------------------------------------------------------------------------
EXECUTION FAILED
The filesystem file already exists, but no operations have been selected.
--------------------------------------------------------------------------
Press any key to continue . . .

=====================================================================

Edit 4:

Since execution is failing I'm trying to find the problem. Using ADB Shell i tried to manually run the shell scripts and stumbled here:

(I tried chmod 777 @ 02.sh to see if that was the problem, no change is results)

# ls -l
...
...
-rwsr-sr-x shell shell 87 2011-04-06 12:13 03.sh
-rwxrwxrwx shell shell 82 2011-04-06 12:11 02.sh
-rwsr-sr-x shell shell 251 2011-04-06 12:04 01.sh

# pwd
pwd
/data/tmp/shell

# /data/tmp/shell/02.sh
/data/tmp/shell/02.sh
/data/tmp/shell/02.sh: not found
 
Last edited:

nosit1

Senior Member
May 19, 2010
905
108
Arizona
I had the same issue as flybob when I tried to run the script. :(

Sent from my MB860 using XDA Premium App
 

Ririal

Retired Recognized Developer
Feb 21, 2011
785
393
Grayslake
www.rirnef.net
Good effort, but 1.57 changes how we have to run commands as root. On a normal linux box, I'm sure your methods would work fine, but we're not dealing with a normal su binary. You should look into doing this as CWM as opposed to .bat files. I had a hell of a time getting around the restrictions since the psneuter exploit was closed.
 

the2dcour

Senior Member
Mar 17, 2011
464
587
Boston
Ah, I did not think about that Ririal, thanks for the info. I am not familiar with CWM though.

Why is the /tmp directory in /data ? That would certainly cause every script to fail.
I'll look at this some more tonight.
 
Last edited:

molotof

Senior Member
Apr 26, 2007
51
10
Virginia
Good effort, but 1.57 changes how we have to run commands as root. On a normal linux box, I'm sure your methods would work fine, but we're not dealing with a normal su binary. You should look into doing this as CWM as opposed to .bat files. I had a hell of a time getting around the restrictions since the psneuter exploit was closed.

How about a shell script that we can run in terminal emulator ? and the output goes to screen and a log file for debug !
 

the2dcour

Senior Member
Mar 17, 2011
464
587
Boston
How about a shell script that we can run in terminal emulator ? and the output goes to screen and a log file for debug !

most of the script is now run by shell scripts, no reason you couldn't run them in the terminal emulator, just get the order right. There are also a few lines I didn't translate to shell so you'd have to enter them by hand.

In any case I'll keep working on this until Sogarth releases his version with union mounts =D
 

flybob

Member
Jun 17, 2009
21
0
Gothenburg
You might be interested to know this;

# cd /tmp
cd /tmp

# pwd
pwd
/data/tmp



# ls -l /tmp
lrwxrwxrwx root root 2011-04-09 14:47 tmp -> /data/tmp


I'll happily help with the script, i know tons of linux and got my Atrix ready to be bricked ;)
 

flybob

Member
Jun 17, 2009
21
0
Gothenburg
Yes, just replied to the previous question :)

Why is the /tmp directory in /data ? That would certainly cause every script to fail.
I'll look at this some more tonight.


However, why doesn't the scripts run as wanted...?

# cat /tmp/shell/02.sh
cat /tmp/shell/02.sh
#!/bin/sh
/system/bin/su
/bin/rm /data/ubuntu.disk > /dev/null 2>&1 && echo PASS#

# ls -l /tmp/shell/02.sh
ls -l /tmp/shell/02.sh
-rwxrwxrwx shell shell 82 2011-04-06 12:11 02.sh

# /tmp/shell/02.sh
/tmp/shell/02.sh
/tmp/shell/02.sh: not found
 

Ririal

Retired Recognized Developer
Feb 21, 2011
785
393
Grayslake
www.rirnef.net
Yes, just replied to the previous question :)




However, why doesn't the scripts run as wanted...?

# cat /tmp/shell/02.sh
cat /tmp/shell/02.sh
#!/bin/sh
/system/bin/su
/bin/rm /data/ubuntu.disk > /dev/null 2>&1 && echo PASS#

# ls -l /tmp/shell/02.sh
ls -l /tmp/shell/02.sh
-rwxrwxrwx shell shell 82 2011-04-06 12:11 02.sh

# /tmp/shell/02.sh
/tmp/shell/02.sh
/tmp/shell/02.sh: not found

Ah ok my mistake, you didn't quote anything I didn't realize that's what you were responding too :)

Likely noexec flag causing that issue.

Also, you can't invoke su from inside a shell script. It just doesn't work with this su binary.
 

the2dcour

Senior Member
Mar 17, 2011
464
587
Boston
yeah, I guess not. I hadn't realized that it wasn't a real 'su' before making this... too bad.

If anyone figures out how to get around that we'll be in business ;) Unfortunately that's way beyond my expertise.
 

the2dcour

Senior Member
Mar 17, 2011
464
587
Boston
Okay, after fiddling a little bit and talking to a friend I may have solved some of the problems, mainly with the scripts executing and su working.
I will have to rewrite a bunch of things but should report back tonight.
 

dicksteele

Inactive Recognized Contributor
Sep 4, 2010
3,807
2,740
California
Running on GladAtrix2 v3

USB debugging on; USB set to none

Checking device state...
Obtaining temporary root access...pushing shell scripts
-------------------------
EXECUTION FAILED
Unable to chmod scripts.
-------------------------
Press any key to continue . . .


Changed /sdcard-ext to /sdcard in script. Got this error

Checking device state...
Obtaining temporary root access...pushing shell scripts
-------------------------
EXECUTION FAILED
Unable to chmod scripts.
-------------------------
* server not running *
Press any key to continue . . .

Running BETA_ubuntu-1.0.6.4.zip. File extracts to BETA_ubuntu-1.0.6.2 directory. Ran ubuntu-1.5.7.bat

Moved BETA_ubuntu-1.0.6.2 to C:\ Same error
 

the2dcour

Senior Member
Mar 17, 2011
464
587
Boston
The only easy workaround to that I can see at the moment is to
Code:
adb shell
su
chmod 777 /path-to-scripts/*
ls -l /path-to-scripts/*
make sure all the files are executable (should say rwxrwxrwx)
then remove the bit of code from 1.5.7.bat
Code:
set retval=
for /f "tokens=*" %%l in ('%~dps0adb.exe shell "/bin/chmod 6755 /mnt/sdcard-ext/shell/* > /dev/null 2>&1 && echo PASS"') do set retval=%%l
if "%retval%" neq "PASS" set message=Unable to chmod scripts. && goto abort

If anyone can help me fix this problem I should be able to automate the chmod process using ririal's suggestion of su -c. The problem is that there are too many nested quotation marks in this section of the batch file, and I can't for the life of me figure out how to escape quotes so they pass through to adb:
Code:
set retval=
for /f "tokens=*" %%l in ('%~dps0adb.exe shell "/system/bin/su -c [U]'/bin/chmod 6755 /mnt/sdcard-ext/shell/*'[/U] > /dev/null 2>&1 && echo PASS"') do set retval=%%l
if "%retval%" neq "PASS" set message=Unable to chmod scripts. && goto abort
The underlined bit is where I need to escape either single or double quotes.
 
Last edited:

Ririal

Retired Recognized Developer
Feb 21, 2011
785
393
Grayslake
www.rirnef.net
The only easy workaround to that I can see at the moment is to
Code:
adb shell
su
chmod 777 /path-to-scripts/*
ls -l /path-to-scripts/*
make sure all the files are executable (should say rwxrwxrwx)
then remove the bit of code from 1.5.7.bat
Code:
set retval=
for /f "tokens=*" %%l in ('%~dps0adb.exe shell "/bin/chmod 6755 /mnt/sdcard-ext/shell/* > /dev/null 2>&1 && echo PASS"') do set retval=%%l
if "%retval%" neq "PASS" set message=Unable to chmod scripts. && goto abort

If anyone can help me fix this problem I should be able to automate the chmod process using ririal's suggestion of su -c. The problem is that there are too many nested quotation marks in this section of the batch file, and I can't for the life of me figure out how to escape quotes so they pass through to adb:
Code:
set retval=
for /f "tokens=*" %%l in ('%~dps0adb.exe shell "/system/bin/su -c [U]'/bin/chmod 6755 /mnt/sdcard-ext/shell/*'[/U] > /dev/null 2>&1 && echo PASS"') do set retval=%%l
if "%retval%" neq "PASS" set message=Unable to chmod scripts. && goto abort
The underlined bit is where I need to escape either single or double quotes.

^ escapes batch, \ escapes shell. Hope this helps. If you zip up and send me the whole process in a single .sh file I can wrap it up in CWM for you.
 
  • Like
Reactions: the2dcour
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    Sogarth's webtop2sd will be released soon, you really should wait and install that instead of this! Thanks -The Management
    No longer breaks on 1.83, thanks to Romracer :D
    Update: This script worked on my phone. Mind you I was installing it from a fresh SBF flash, but it should work on your phone too. Absolutely no guarantees as usual.
    Update 11th April 2011, 06:59 PM: Won't be getting CWM package because it'd be huuuuuuuuuge.
    Update 28th April 2011. 16:38 PM: Removing BETA tag since there have been no issues with the script for quite some time.

    First off I would like to thank Sogarth for making this script in the first place as well as Romracer for fixing it for 1.83. Since he is busy doing more important work I decided to do this little hack for those of us that updated to 1.5.7 and dont feel like flashing back to earlier versions to get full Ubuntu working.

    Again, this is only necessary if you're already running 1.5.7 or 1.8.3.

    Secondly, I am still working on this script so it may not work for you. If you have a problem you may post in the thread or PM me showing exactly the error message, word for word, that you receive.

    Updates will be included in the OP from time to time as I fix errors.

    Instructions:
    1) install.bat (from your computer)
    2) adb shell (get a shell on your phone)
    3) su (get root on your phone in that shell)
    4) . /data/local/tmp/install.sh (run the install script *on your phone* don't forget the "." and the space after the dot, or you will have to chmod 755 the shell script manually)
    5) ?????
    6) profit\

    Noob instructions, written by Viamonte (I take no credit or responsibility):
    Thanks again for all your help. Now the noob instructions:

    "1-Download "Terminal Emulator" from the market, on your phone (or any other terminal), and the file anexed in this thread to your computer.

    2-Connect the Atrix to the computer via USB, configuring the connection mode to "None" and enabling USB Debugging mode (Settings>Applications>Development>USB debugging)

    3-Unzip the file you downloaded on your pc, and run Install.bat. This will push the script to your phone.

    4-Go back to your phone and open the emulator you downloaded. Then type "su" (without quotes) and press enter. Then type ". /data/local/tmp/install.sh" (without quotes) and press enter again.

    The script should begin running now. It will stop in two moments where you'll be instructed to get a cup of coffee, and may take several minutes to continue form this point. When finished, the Atrix will reboot.

    To check if this worked, use the Webtop either on your multimidia dock or your lapdock and verify if new itens appeared on your task bar and on the right upper side of the screen"

    0.3.1 release
    0.2 release
    0.1 first release

    Changelog
    0.3.1 fix to gconf file's mdate so it does what its supposed to do =)
    0.3 Small typo fixes and cpp package install fix by romracer, now works on 1.83 =)
    0.2 Fixed some typos in uninstall.sh and make sure the %gconf file wound up in the right spot.
    0.1 - first version. NOT CWM install but ready to be packaged for that more or less
    2
    Here's what I've dubbed Ubuntu 0.3. I've cleaned up the cpp error on aptitude_parse.pl as well as a few other typos I came across (udev package check, sudoers, a few others I don't remember). I've gone through the install a few times from scratch with no major issues, but I haven't had time to test the webtop. If it worked before, then I'd think it would work now but no guarantees until I'm able to test it.

    If nothing else, I don't expect this will brick your phone. But as always, buyer beware, seller accepts no responsibility, yadda yadda.

    I should also note that each attempt I made was starting from scratch first. I'd strongly recommend anyone else do the same. I can't extrapolate what will happen if you're halfway through some previous botched install.

    Edit: Initial testing on 1.8.3 seems to work fine. The only thing that didn't seem to take was the gconf.xml (menu bar changes). I'll take a look at that in the morning.
    1
    The only easy workaround to that I can see at the moment is to
    Code:
    adb shell
    su
    chmod 777 /path-to-scripts/*
    ls -l /path-to-scripts/*
    make sure all the files are executable (should say rwxrwxrwx)
    then remove the bit of code from 1.5.7.bat
    Code:
    set retval=
    for /f "tokens=*" %%l in ('%~dps0adb.exe shell "/bin/chmod 6755 /mnt/sdcard-ext/shell/* > /dev/null 2>&1 && echo PASS"') do set retval=%%l
    if "%retval%" neq "PASS" set message=Unable to chmod scripts. && goto abort

    If anyone can help me fix this problem I should be able to automate the chmod process using ririal's suggestion of su -c. The problem is that there are too many nested quotation marks in this section of the batch file, and I can't for the life of me figure out how to escape quotes so they pass through to adb:
    Code:
    set retval=
    for /f "tokens=*" %%l in ('%~dps0adb.exe shell "/system/bin/su -c [U]'/bin/chmod 6755 /mnt/sdcard-ext/shell/*'[/U] > /dev/null 2>&1 && echo PASS"') do set retval=%%l
    if "%retval%" neq "PASS" set message=Unable to chmod scripts. && goto abort
    The underlined bit is where I need to escape either single or double quotes.

    ^ escapes batch, \ escapes shell. Hope this helps. If you zip up and send me the whole process in a single .sh file I can wrap it up in CWM for you.
    1
    yeah you should have more than 1gb free in /data then. But after the install ~300mb free in data is to be expected. That partition is only like 2gb total and lots of other important things reside there too ;)
    1
    thank you for the input but shortly my script will become outdated. it doesnt work as-is for 1.8.3 I also get the cpp expected error. I won't be fixing this since it will be replaced by a more sophisticated version soon, wait for it with bated breath.