Ubuntu 11.04 unity-2d VNC - Galaxy Tab General

Hi guys,
I'm really new here, I can't post in this thread: http://forum.xda-developers.com/showthread.php?t=836022
I created a working ubuntu11.04 .img, with unity-2d. I don't know if anybody cares, it was funny to make.
It is just a minimal install with unity-2d and tightvncserver. Really minimal. Firefox, office applications, anything else DOES NOT installed.
However, you can install anything using apt-get install.
I installed wget and nano, because it was needed to configure the vnc. I plan to make a bigger one with all the programs and stuff installed. Maybe tomorrow. Or next week.
How to use: Unzip, rename to ubuntu.img and simply replace the original ubuntu.img with this one. Use root as user/nickname and ubuntu as password, as usual.
Download link to .img:
Download link to the other files needed:
Links tomorrow. "New" .img too.
If you are a mod and you're reading this, please move this post it the thread I linked in the beginning, or anywhere where this post is in its place.
-Sorry for my english.
Please help! Give me additional space by using my referral: http://db.tt/W0knUea
edit1: So, now I've got 10 comments, I don't have to write everything in separate comments. What I've done yet: make some simple script to automatically turn on/off the vncserver (1024x600, tab native res, I found it enough), and get tired of the resource hungriness of unity-2d. I mean it needs about the same CPU power (I guess) as the galaxy tab has, and it needs about 200MB RAM. But this is to run native. The VNC version is far from native, so it's slow as f..., I mean, very slow. Then I looked for a little less resource-hungry desktop environment, and I found lxde. I made an image with that. It's slow too, but much faster than unity-2d. I need to configure it a little more, to be more touch-friendly. And I want to do a few other thing, and write a how to make your own .img file thing. If you want to do it now, here some links, I will write about it sometimes.
http://androlinux.com/android-ubuntu-development/how-to-install-ubuntu-on-android/
https://wiki.ubuntu.com/ARM/RootfsFromScratch
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
http://galaxytabhacks.com/galaxy-ta...tall-ubuntu-linux-on-galaxy-tab-10-1-tabuntu/
http://androlinux.com/android-ubuntu-development/how-to-build-chroot-arm-ubuntu-images-for-android/
I also suggest reading mount, umount and rootstock man pages.

This image works quite well. As with every VNC build, its a bit slow and Unity doesn't help that (even in its nice Unity-2d form), but if you want Ubuntu on your Tab this is a pretty sweet image. Ultra-lightweight, too. Nice work, OP!

Firstly, thankyou for not making 10 spam posts just to get this posted in the Development section, shouldnt take you long to get 10 posts under your belt in this thread then I'll move it into the dev section for you
Good job by the way..

how to run this?

http://forum.xda-developers.com/showthread.php?t=836022
It's writen down here.
The link to the files is in the first post.

Do I write 'bootubuntu' in command line instead of 'bootlinux' or do I have to change the filename of 'bootubuntu' file? I guess first of the two is correct, but it's better to ask than to brick
Oh and is the AndroidSDK really needed? I don't see anything about usage of it in instruction....

maslak666 said:
Do I write 'bootubuntu' in command line instead of 'bootlinux' or do I have to change the filename of 'bootubuntu' file? I guess first of the two is correct, but it's better to ask than to brick
Oh and is the AndroidSDK really needed? I don't see anything about usage of it in instruction....
Click to expand...
Click to collapse
Hi!
The SDK is not strictly necessary since you could use a Terminal Emulator to run the necessary commands but using an ADB shell is just bit easier sometimes. That being said, you should install the SDK if you ever want to do much with an Android. It's easy to install and very powerful.
And yes, write bootubuntu instead of bootlinux when prompted. I know what you mean

Allright, I went through it and now got it installed . But I can't see firefox nor any office application... How to access them? Also can't get into terminal to write 'apt-install' there.....

maslak666 said:
But I can't see firefox nor any office application... How to access them?
Click to expand...
Click to collapse
sisa7 said:
Really minimal. Firefox, office applications, anything else DOES NOT installed.
However, you can install anything using apt-get install.
Click to expand...
Click to collapse
I'll write a howto tonight or next day or I don't know. I need to study to university too. You need adb or android terminal emulator (from the market) to use apt. Short version: when your prompt is "[email protected]:/#" simply do this command: "apt-get install firefox"

Just poked around a little. Now I know (or at least I think I now) what else I have to do.
http://dl.dropbox.com/u/41806444/bootubuntu2
Cleaned up version of bootubuntu. Copy it to /sdcard/ubuntu and simply run it. You need to use the sh command, so type "sh bootubuntu2" in android terminal emulator or adb shell in /sdcard/ubuntu foler.

Oh, sorry I forgot to mention, this script only works with overcome kernel and rom. You shold modify the
mount -o remount,rw -t ext4 /dev/block/stl9 /system
and the
mount -o remount,ro -t ext4 /dev/block/stl9 /system
rows. Enter "mount" to android terminal to see your /system dir type and path.

Synaptic looks like to work, software-center doesn't even start.

To really enjoy full linux distros like this, one should have a swap-enabled kernel. Instead, kernel on the Tab has no swap, and if you dare open some large app, the lack of ram makes it slow and unresponsive.
This is the main problem imho.
Ernesto de Bernardis
N900 - Galaxy Tab 7"

sisa7 said:
Oh, sorry I forgot to mention, this script only works with overcome kernel and rom. You shold modify the
mount -o remount,rw -t ext4 /dev/block/stl9 /system
and the
mount -o remount,ro -t ext4 /dev/block/stl9 /system
rows. Enter "mount" to android terminal to see your /system dir type and path.
Click to expand...
Click to collapse
Or keep it simple silly
mount -o remount,rw /dev/block/stl9 /system
mount -o remount,ro /dev/block/stl9 /system

cdesai said:
Or keep it simple silly
mount -o remount,rw /dev/block/stl9 /system
mount -o remount,ro /dev/block/stl9 /system
Click to expand...
Click to collapse
The /dev/block/stl9 part is changing too.

debernardis said:
one should have a swap-enabled kernel. Instead, kernel on the Tab has no swap
Click to expand...
Click to collapse
Thanks. I didn't know this is the problem. I will try out http://forum.xda-developers.com/showthread.php?t=483110 this and see what happens.

@sisa7 do you have any update?

debernardis said:
@sisa7 do you have any update?
Click to expand...
Click to collapse
Yep.
This email is an automated notification from Dropbox that your Public links have been temporarily suspended for generating excessive traffic. Your Dropbox will continue to function normally with the exception of Public links.
This suspension is temporary (3 days for the first time).
Sorry guys. Anybody know a decent upload site?
Also, I'm working on LXDE desktop. But the university makes me busy, so I haven't got too much time. Sorry.

Minus.com
Box.net
Multiupload.com

Is this still alive?
I tried installing the one in the other [MOD] Forum but when I try to install apps to Ubuntu I get a conection "404" error
Do you guys think this image will work?

Related

BusyBox Error

Im working with Andrizoid atm at seeing if we can get some progress on his Ubuntu project. Heres the issue.
Code:
busybox mount -o --bind ./dev/pts /data/local/ubuntu/dev/pts
mount: cannot read /etc/fstab: No such file or directory
In doing a little research I came across this
If there is no entry for /dev/fd0 in my fstab when I issue the command above, mount gets very confused because it doesn't know where to mount the floppy.
Click to expand...
Click to collapse
This come from http://www.tuxfiles.org/linuxhelp/fstab.html which gives a quick breakdown of what the etc/fstab file is. When i went exploring I couldnt find an etc/fstab
Code:
[B]
mount: cannot read /etc/fstab: No such file or directory
[/B]
The thing about Android though...there IS NO /ETC/FSTAB file because its become obsolete.
The init program directly mounts all filesystems and devices using either hard-coded file names or device names generated by probing the sysfs filesystem (thereby eliminating the need for a /etc/fstab file in Android). After device/system files are mounted, init reads /etc/init.rc and invokes the programs listed there (one of the first of which is the console shell).
Click to expand...
Click to collapse
EDIT: Conclusion
After bouncing some ideas around, I've come to the conclusion that it HAS to be a Busybox issue.
An Android specific variation of Busybox should take into account the fact that there isnt an etc/fstab file. The fact that these commands work on other phones leads me to think that its an Eris specific issue. If anyone remembers there were issues when using the Busybox available on the market on the Eris.
Looks like we need a Busybox update
es0tericcha0s said:
Or is there something else I can do?
Click to expand...
Click to collapse
Modify the mount command.
If the version of BusyBox is the Android version, report this issue (as a bug?). If it's the standard Linux BusyBox, the devs may not be interested. Or, if BusyBox is just calling the standard mount command, then it's not a BusyBox issue for them to worry about.
hallstevenson said:
Modify the mount command.
If the version of BusyBox is the Android version, report this issue (as a bug?). If it's the standard Linux BusyBox, the devs may not be interested. Or, if BusyBox is just calling the standard mount command, then it's not a BusyBox issue for them to worry about.
Click to expand...
Click to collapse
I'm using the Android Busybox, and those commands are being executed in an adb shell so I doubt that its calling the standard mount command-it should be calling the (hopefully) Android specific mount command. The things thats confusing me is that those same commands worked just fine for other phones. I dont see why I would get an error and others would have no issue with it?
EDIT:
And if you ave any recommendations for what I should modify the mount command to, let me know.
You mention a reference to /dev/fd0 but I'm 99.9% that's referring to the *nix mount command. The Android/BusyBox version should know better than to look for a floppy drive.
Where is BusyBox maintained ?
I did find a page about an Android ROM from Nov 2008 that mentions
- changed the "mount" symlink to be busybox's mount instead of toolbox's mount
- added an /etc/fstab file that busybox's mount can use, that lists the standard system partitions.
Click to expand...
Click to collapse
Is "mount" in fact an internal adb command ?
hallstevenson said:
You mention a reference to /dev/fd0 but I'm 99.9% that's referring to the *nix mount command. The Android/BusyBox version should know better than to look for a floppy drive.
Where is BusyBox maintained ?
I did find a page about an Android ROM from Nov 2008 that mentions Is "mount" in fact an internal adb command ?
Click to expand...
Click to collapse
The floppy drive reference was just from some background info I pulled on the etc/fstab file. I wasnt actually trying to mount a floppy disk
I have no idea where I would put in a bug report or anything. I know Stericson was the publisher of the BusyBox app thats avaiable on the market, but the one for the Eris is different anyways so idk if he could help.
Im not sure what you mean by your last statement, but mount is not a command that you can use in a shell on its own. You have to use busybox mount ...
If you can show me where you found that rom from I may be able to finish this. I was just talking to a buddy of mine about making my own /etc/fstab and slipping it in just so that the mount command would work. If theres already one put together then thats way less work for me
What I meant by referring to that info you found was that person couldn't have been talking about the Android version. I didn't think you were trying to mount a floppy.
You sure that there's no "adb mount" ? Look here, http://forum.xda-developers.com/showthread.php?t=517874. They refer to "adb shell mount".
Personally, I would just create an /etc/fstab file (I believe it can be empty) and see what happens.
hallstevenson said:
What I meant by referring to that info you found was that person couldn't have been talking about the Android version. I didn't think you were trying to mount a floppy.
You sure that there's no "adb mount" ? Look here, http://forum.xda-developers.com/showthread.php?t=517874. They refer to "adb shell mount".
Personally, I would just create an /etc/fstab file (I believe it can be empty) and see what happens.
Click to expand...
Click to collapse
well ive got an /ect/fstab file that i took from here http://www.android-devs.com/?p=152
Code:
# /etc/fstab: static file system information
#
# file system mount point type options dump pass
/dev/block/mmcblk0p2 / ext2 defaults 1 1
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /media/sdcard vfat defaults 0 0
But thats from a guide about debian on the N1 and the way they are doing it is much different from the method I'm using.
adb shell mount give the error that mount isnt found. it has to be called through busybox-at least in the instance that im using it in
Code:
busybox mount -o --bind /dev/pts /data/local/ubuntu/dev/pts

Remount Failed: Operation Not Permited

Hey guys. I've done commands in adb many times. I'm still new to it, but I never remember having this issue.
I've ran CM6 for months, and nightly's as well. I'm running a custom compiled CM6 right now though.
adb remount I get
remount failed, operation not permitted.. and in default.prop ro.secure is set to 1. I changed to 0 but still can't do remount. Any other suggestions?
Thanks!
For a workaround, try remounting through shell - mount -o rw,remount /system, or the full command (mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system).
is that a temporary fix, or for good. or just a work around?
Just a workaround. It's a command in OS itself that does the same job as "adb remount" - which is, remounts.
I just can't think of anything that would cause adb remount to fail, so I have no suggestions for you to try. But in case you want to be able to do something without getting stuck, and wait for the solution without being in a hurry - I've posted the workaround.
I don't have a solution to solve it once and for all, but every time you want to remount, use
PHP:
adb root
before your commands
excellent.
adb root
adbd is being restarted
adb remount succeeded .
Thanks dude! that will work for now til cooker fixes that. lol
Jack_R1 said:
For a workaround, try remounting through shell - mount -o rw,remount /system, or the full command (mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system).
Click to expand...
Click to collapse
Tried this and it appeared to succeed but I didn't get the results I wanted.
After doing this I tried push c:\com.amazon.mp3.apk \system\app\ and it repeated it back to me, but when I look in that directory, it's not there. What am I doing wrong?
Wrong direction of slashes:
push c:\com.amazon.mp3.apk /system/app/
And you shouldn't be doing it from the ADB shell. The remount is done in the shell, the push is done outside of it.
Jack_R1 said:
Wrong direction of slashes:
push c:\com.amazon.mp3.apk /system/app/
Click to expand...
Click to collapse
Ahhhh, I was wondering about that! Thank you!!
And you shouldn't be doing it from the ADB shell. The remount is done in the shell, the push is done outside of it.
Click to expand...
Click to collapse
So once I perform the remount I exit out of the shell?
operation not permitted.
"adb push" gets you "not permitted"?
try "adb root" first, as suggested above.
Jack_R1 said:
"adb push" gets you "not permitted"?
try "adb root" first, as suggested above.
Click to expand...
Click to collapse
adb root gets me something along the lines of "not supported on a stock build."
EDIT
ok...
adb shell
su
mount -o rw,remount /system
then i get this:
Usage: mount [-r] [-w] [-o options] [-t type] device directory
So it appears it's not actually registering the command?
Then I try
push c:\com.amazon.mp3.apk /system/app/
and I get: failed to copy 'c:\com.amazon.mp3.apk' to '/system/app/com.amazon.mp3.apk' : Read-only file system.
You need to use the full command, since you're running sh, not bash.
Look for the full command in my post.
Yes, currently it doesn't do a thing.
Jack_R1 said:
You need to use the full command, since you're running sh, not bash.
Look for the full command in my post.
Yes, currently it doesn't do a thing.
Click to expand...
Click to collapse
So I tried the full command and exited out to "dos" command prompt and tried again. This time I got "failed to copy.... ....permission denied."
Ok, try without exiting. I'm not sure it'll do anything useful, though.
There is some problem with either your ADB setup or the ROM you're using. Or you're just not rooted.
Jack_R1 said:
Ok, try without exiting. I'm not sure it'll do anything useful, though.
There is some problem with either your ADB setup or the ROM you're using. Or you're just not rooted.
Click to expand...
Click to collapse
Found another thread on another board. I just flashed amon ra's recovery and booted up from there, and it appeared to let me copy!
But then it wouldn't let me cd to system/app. It let me cd to system, but not to app. Weird... I booted back up and there's no evidence of the "copied" apk, anywhere.
What...
the...
****.
Thanks to all for your patience with my super-noobish ass, I'm hoping you're not as frustrated with me as I am with this.
When you're in the recovery, your system isn't mounted. You need to mount it first.
Use almost the same command as for remount, but leave out the "remount" option. Just "-o rw".
Your copy went to void.
Jack_R1 said:
When you're in the recovery, your system isn't mounted. You need to mount it first.
Use almost the same command as for remount, but leave out the "remount" option. Just "-o rw".
Your copy went to void.
Click to expand...
Click to collapse
lol, awesome, thanks. I'll fiddle with it some more in the morning.
Why isn't there a link somewhere to a simple instruction manual? It would be so much easier if I could read up on this myself without bugging all of you guys.
Of course there is. My sig has it in bold, and you can find everything there. It's just that people tend to rush asking questions instead of reading
Jack_R1 said:
Of course there is. My sig has it in bold, and you can find everything there. It's just that people tend to rush asking questions instead of reading
Click to expand...
Click to collapse
I've seen a couple of the basic noob guides to adb and I've seen the google definition of adb functions but it doesn't include instructions on how to do the stuff you're walking me through.
Will take a look at those links shortly. Btw, I'm on a MT3G though I don't think that makes a difference at this level.

[Q] adb help

Can somebody please explain the difference between these two commands.
1) mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
2) mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
In adb I'm using the latter to mount my system dir as rw. I perform what I have to then issue the next command:
mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
But it tells me the device is busy and to try again later. Well it never lets me remount as ro so I just exit, perform a reboot of the phone, and it is back to ro. I can't help think this is not a good way of doing it though. So I was gonna try this other command but don't know what exactly either is or the difference between the two. Anyway some help would be greatly appreciated.
***EDIT***
OK I finally got it to work. Seems you can not enter adb, root, exit adb, then enter adb again, attempt to unroot. The unroot takes and all works until I try to remount as ro, then I get above problem. Now when I root, exit adb, reboot phone, re-enter adb, and attempt to unroot everthing goes as expected with remounting as ro.
So thanks for anybody that at least took a look at the thread. Seems I have it squashed though. If you are wondering I'm testing some things out that is why I'm rooting, and unrooting back to back.
I don't even bother remounting. I just type #reboot. It will remount, by default, when the system starts up.
Str0ntium said:
I don't even bother remounting. I just type #reboot. It will remount, by default, when the system starts up.
Click to expand...
Click to collapse
Yeah that's what I had to resort to, but as I stated. I just can't help think that's not a good practice to get into.
Anyway I found what was causing my trouble and remounting as ro with the previous command works fine.
Sent from my DROIDX using Tapatalk
To answer your question about the difference in the two commands... The yaffs2 or ext3 is the specifying the you're off file system you are mounting as.
overfiendx2 said:
Can somebody please explain the difference between these two commands.
1) mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
2) mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
In adb I'm using the latter to mount my system dir as rw. I perform what I have to then issue the next command:
mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
But it tells me the device is busy and to try again later. Well it never lets me remount as ro so I just exit, perform a reboot of the phone, and it is back to ro. I can't help think this is not a good way of doing it though. So I was gonna try this other command but don't know what exactly either is or the difference between the two. Anyway some help would be greatly appreciated.
***EDIT***
OK I finally got it to work. Seems you can not enter adb, root, exit adb, then enter adb again, attempt to unroot. The unroot takes and all works until I try to remount as ro, then I get above problem. Now when I root, exit adb, reboot phone, re-enter adb, and attempt to unroot everthing goes as expected with remounting as ro.
So thanks for anybody that at least took a look at the thread. Seems I have it squashed though. If you are wondering I'm testing some things out that is why I'm rooting, and unrooting back to back.
Click to expand...
Click to collapse
Sent from my DROIDX using XDA App
SysAdmin-X said:
To answer your question about the difference in the two commands... The yaffs2 or ext3 is the specifying the you're off file system you are mounting as.
Click to expand...
Click to collapse
Thanks for the response. Could you explain in more detail. I don't understand what you mean. Again thank you for taking time with such a noob thing.
Sent from my DROIDX using Tapatalk
mount command line options...
"-t <option>"
"t" stands for "type" and <option> = the linux filesystem type. Linux supports many. "yaffs" = "yet another flash file system" (lot's of tongue-in-cheek developers work on linux). "yaffs2" is v2 of this type of file system.
ext3 is a widely used linux file system.
essentially, the filesystem type tells linux how the data is actually organized on the disk.
the /dev/... that follows is the raw device to associate the filesystem type with.
So I take it that the phone or more directly adb can handle either file system? What of the mtdblock4 and mmcblk1p21 entries? I guess i just don't understand how two so different commands can mount/unmount the same folder. Again thank you very much for your time.
Sent from my DROIDX using Tapatalk
well, adb is just a way to open a terminal session on your phone. Think of it like opening a command prompt on windows. So it is the linux OS on your DX that is processing (handling) the command.
The two commands mount different raw devices (that actually are formatted with different filesystems) to the same "/system" mountpoint. In linux, a mountpoint is kind of like a drive letter would be in dos. What's cool about linux is that you can mount a raw device anywhere in the filesystem tree (where the root is specifiied as "/"). Windows provides that same functionality now with it's ability to map devices to folders.
I believe I'm beginning to wrap my head around it. Been fool'n w/ computer for awhile. I really have no excuse to be so illiterate on linux. I really need to just dig in. Any suggested starting points? I really loved dos and miss it so. lol. So I'm thinking I will probably enjoy linux more.
Sent from my DROIDX using Tapatalk
+5 to sleuth's response! I forgot to kinda expand on the rest of the command. Thnx sleuth for filling in the rest.
Sent from my DROIDX using XDA App

My first script!

So I got sick of typing
$su
#mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
#chmod 777 /system
So I wrote a script and I just click on it in gscript.
Does this officially make me a white belt, lowest rank possible dev? Aahaha
Pm me and I can send you the script if you want haha.
(Yes, you are all supposed to laugh and make fun of me now)
Sent from my HTC Vision using XDA App
Ill give you a pat on the back. That's one small step to being a scripter
Also note you can do things in dos for adb
Sent from my T-Mobile G2 using XDA App
might as well post it publicly, i'd be interested in that script, i'll send pm as well
jontornblom said:
So I got sick of typing
$su
#mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
#chmod 777 /system
So I wrote a script and I just click on it in gscript.
Does this officially make me a white belt, lowest rank possible dev? Aahaha
Pm me and I can send you the script if you want haha.
(Yes, you are all supposed to laugh and make fun of me now)
Sent from my HTC Vision using XDA App
Click to expand...
Click to collapse
Atleast u know how to do a script, I dnt even know how to use ADB.. root guided by youtube, I dnt mod my phone w/o watching video carefully n step by step method..
Cheers.. future DEV
Sent from my HTC Vision using XDA App
Congrats on the script! It's get's easier now that you have the concept - then it gets hard again lol.
While we're on the subject of scripting - any reason you choose that system rw mount script? There's 3 ways I've seen it done and they are all completely different... maybe the have different functions?
Again, good job and I like your idea. I saves a lot of typing especially with those commands since we type them a lot.
I think just by writing a successful script.. you are already above MANY xda users.
Kudos.
jontornblom said:
$su
#mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
#chmod 777 /system
Click to expand...
Click to collapse
So this is the part where you tell me what it does, right?
omarsalmin said:
So this is the part where you tell me what it does, right?
Click to expand...
Click to collapse
His script mounts the system as rw.
Sent from my T-Mobile G2 using XDA App
Nice script
What I do is a little different. I have it saved as my initial command for terminal, so it starts whenever I use terminal.
The code I use is this:
export PATH=/data/local/bin:$PATH
su
mount -o rw,remount /system
I am obvlious though as to why you put yaffs2 and mtdblock3 and all that, I never thought it was necessary since it works just fine without it. I'm not too keen on linux syntax though so its probably obvious but I'm curious anyway.
Sent from my HTC Vision using XDA App
mejorguille said:
Nice script
What I do is a little different. I have it saved as my initial command for terminal, so it starts whenever I use terminal.
The code I use is this:
export PATH=/data/local/bin:$PATH
su
mount -o rw,remount /system
I am obvlious though as to why you put yaffs2 and mtdblock3 and all that, I never thought it was necessary since it works just fine without it. I'm not too keen on linux syntax though so its probably obvious but I'm curious anyway.
Sent from my HTC Vision using XDA App
Click to expand...
Click to collapse
That's what my question was too lol. It's a great script especially for his first but now he should make it less bulky. If it's being ran in terminal as a script then all he would really need is this:
Code:
#!/system/bin/sh
mount -o remount,rw /system
I don't believe you need to use su before running it but I always do just in case.
Of course you'll want to make a /system ro script (unmount) too so you're not always in mounted in rw access.
funkadesi said:
I think just by writing a successful script.. you are already above MANY xda users.
Kudos.
Click to expand...
Click to collapse
Haha, thanks!
I found that leaving out the yaffs2 etc didn't work. I read somewhere that you need this line with certain kernels. I wish I could give you a more learned answer though.
I'm thinking it's a good idea to put the system back in ro too, actually. Now I'll have made two scripts haha
Sent from my HTC Vision using XDA App
Not positive on all of this, so someone can correct me if I'm wrong, but
Code:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
is used to mount system by accessing the NAND (hence the yaffs2 filesystem and mtdblock device). Many of the older Android guides use this command (since the older phones all used raw flash).
The Vision (and many of the newer phones) use an eMMC though, which has an FTL to present the NAND as a block device to the OS (just like a hard drive). This is why in many of the guides written nowadays, you'll see something more like this:
Code:
mount -o rw,remount -t ext3 /dev/block/mmcblk0p25 /system
This accesses the eMMC as a native block device (hence the ext3 filesystem). This is probably the "more correct" way of mounting the partition as it utilizes the actual FTL controller on the NAND as opposed to the more inefficient linux virtual block driver (what mtdblock does), so it's a little cleaner from a software development standpoint. Both commands accomplish the same thing though, so you could really use either.
The shortened form of the remount is what others have been listing:
Code:
mount -o rw,remount /system
Basically, since the system partition had already been mounted by the OS on boot, it should already know the proper way to remount it (i.e., you don't have to retell it the device or filesystem used). I don't believe this command will work on every ROM out of the box though (requiring either Busybox to have been installed or ro.secure=0 to be set in your default properties, maybe both).
Excellent and informative post! So is the reason why the
Mount -o rw,remount /system
Command doesn't't work for me is because busybox isn't installed? I'll test this out right now...
Also, I was thinking chmod 777 might be redundant because the system is already rw. Is this true? My understanding is the chmod 777 simply sets whatever path after it as modifyable. Is there a difference between rw and being able to modify files in linux?
Sent from my HTC Vision using XDA App
Hmm. When I try the stripped down command, I get the usage message...
Sent from my HTC Vision using XDA App
jontornblom said:
Excellent and informative post! So is the reason why the
Mount -o rw,remount /system
Command doesn't't work for me is because busybox isn't installed? I'll test this out right now...
Also, I was thinking chmod 777 might be redundant because the system is already rw. Is this true? My understanding is the chmod 777 simply sets whatever path after it as modifyable. Is there a difference between rw and being able to modify files in linux?
Sent from my HTC Vision using XDA App
Click to expand...
Click to collapse
Well if you want to know if you have busybox just do this:
Code:
su
cd /system/bin
busybox
That should start busybox. It will say 'not found' if you don't have it - so if you need it the easy way is to use titanium backup to install it.
Btw, ianmcquinn that was very informative and well written. Thanks for explaining it so well.
Definitely have busybox. Definitely still just gives me the usage information...weird.
How do I set secure=0?
Sent from my HTC Vision using XDA App
ro.secure=0 is standard on most roms, so I asume you are just using a rooted stock build? You will need to unpack your kernel, change the ro.secure from a 0 to a 1, and repack the kernel. If you don't know how to do that, use this.
jontornblom said:
Definitely have busybox. Definitely still just gives me the usage information...weird.
How do I set secure=0?
Click to expand...
Click to collapse
What ROM you are using now? VillainROMZ?
Sent from my HTC Desire Z, using magic XDA app
AllWin said:
What ROM you are using now? VillainROMZ?
Sent from my HTC Desire Z, using magic XDA app
Click to expand...
Click to collapse
Virtuous 0.9.0
Sent from my HTC Vision using XDA App
I don't use Virtuous, but I would be shocked if it didn't already have ro.secure=0 set already. You can check by typing this in terminal:
Code:
getprop ro.secure
It should return a 0. This property is set in the ramdisk within your boot.img. To set it yourself, you would have to unpack the image, modify the setting in the default.prop file, repack the image, and then flash it back to your phone. As was said earlier though, pretty much all of the custom roms set this for you already.
Not sure what is going on in your case then. Maybe try running the mount command explicitly through busybox to see if that is the problem.
Code:
busybox mount -o rw,remount /system
If this works, sounds like you may want to reinstall busybox since the symlinks were not properly set up. Another thing maybe worth trying is to swap the order of remount and rw in the options. I've seen reports of this making a difference for some people, but have no clue why it should (maybe different versions of the mount command/busybox). Kind of a long shot. So try either of these commands:
Code:
mount -o remount,rw /system
busybox mount -o remount,rw /system
EDIT: In case you were curious, here's a link I had bookmarked about how to edit the boot.img. I'm sure there are others out there as well.

Linux chroot mount scripts

The actual creation of an arm linux chroot image is probably out here on teh internetz somewhere, but I can assist with my mounting shell script (which works).
My image is of a debian arm chroot, and the image filesystem is ext2 (a good idea for fewer writes. ie innately non-journaling), has been used extensively on fw DE .17 and I'm currently trying it out on WW .29 (thank you, miloj).
I would upload my debian img somewhere, but I've actually broken it somewhat (it works for my needs, but it's nonetheless a bit too hacked up to be reliable).
I've modified it somewhat for generalization, some of it is probably wrong and/or redundant, and it IS hackish and ugly, but it works for me (tm).
* the chroot image only need a root account (and probably bash installed, but it usually is)
* You need busybox installed.
* You need to upload your chroot image named linux.img to the internal sdcard in a folder named linux
A shell script to set things up is attached.
What you need to do:
push the install script and run it:
Code:
adb push installlinuxstuff.sh /data/local/
adb shell sh /data/local/installlinuxstuff.sh
Now you can (from adb shell or terminal emulator on device):
Code:
su -
/data/local/mnt/linux.sh
/data/local/mnt/notlinux.sh
Feel free to remove the install script at
/data/local/installlinuxstuff.sh
when you've got it up and running.
Alternative way to run the scripts from adb shell:
Code:
adb shell su -c /data/local/mnt/linux.sh
adb shell su -c /data/local/mnt/notlinux.sh
I usually symlink start and stop (in my case deb and undeb) shell scripts placed in /data/local/mnt in /system/bin (ie shell scripts with 'su -c /data/local/mnt/whatever.sh' in them) for easy start an stop from terminal emulator, and if you've gotten this far you may welcome the small advice. (in other words - don't do this unless you _really_ know what you're doing)
Debian ARMHF or ARMEL?
If you would uploaded it (good place is google drive , sharing as public, as there are no ads or bull**** and the download is extremely fast) I would love to try your image - after modifying your script so it can work on a UHS-1 class MicroSD I want to try running this off of (should give it a little more speed).
zamaditix said:
Debian ARMHF or ARMEL?
If you would uploaded it (good place is google drive , sharing as public, as there are no ads or bull**** and the download is extremely fast) I would love to try your image - after modifying your script so it can work on a UHS-1 class MicroSD I want to try running this off of (should give it a little more speed).
Click to expand...
Click to collapse
Armel (I use the same chroot installation on my phone in a smaller image file (with less stuff installed)). I've got loads of personal stuff all over it and besides - it's somewhat broken. I really don't want to try to fix it.
So I'm working on retracing my steps, creating a clean armhf ext2 image (debian wheezy base installation for now) and redo the mount script, but I can't make any promises on a release date.
Anyhu - there are loads of images (armel, at least) on teh internetz (BT5 and too many ubuntu, for instance).
Just check so our kernel can mount the filesystem.
Edit: if not you can just create a new image file with a filsystem that's mountable and copy the chroot files to it.
So the ideal image for this tablet is armhf? If I wanted to create a Gentoo image, I would go with armv7? I'm just not sure exactly which ARM architecture this tablet is.
EndlessDissent said:
So the ideal image for this tablet is armhf? If I wanted to create a Gentoo image, I would go with armv7? I'm just not sure exactly which ARM architecture this tablet is.
Click to expand...
Click to collapse
The CPU is the Tegra 3 if you want to google it and it is an ARMv7 w/ NEON extensions chip. ARMv7 specification requires hardware fp so naturally it is ARMhf.
Nice to hear, keep us updated on your progress. I'm currently running an armel copy of Ubuntu 12.04 but it has problems with some packages and others are armhf only.
When I run linux.sh, I get an error that /sdcard can't be mounted because it doesn't exist.
Code:
mount: mounting /sdcard on /data/local/mnt/linux/sdcard failed: No such file or directory
I also tried changing the script to mount /mnt/sdcard, but that didn't work either.
EndlessDissent said:
When I run linux.sh, I get an error that /sdcard can't be mounted because it doesn't exist.
Code:
mount: mounting /sdcard on /data/local/mnt/linux/sdcard failed: No such file or directory
I also tried changing the script to mount /mnt/sdcard, but that didn't work either.
Click to expand...
Click to collapse
Yes, it is somewhat hackish, like I wrote. My image has got an sdcard folder (/sdcard) inside of it where I mount /sdcard from android. (Ie chroot and mkdir /sdcard)
followed this:
http://androlinux.com/android-ubuntu-development/how-to-install-ubuntu-on-rooted-transformer-prime/
make sure you have busybox installed der. Or at least the cp command in /system/bin
works well on my TF300T, Yea its not native but im currently configuring it for kernel building ;-D
FlyingPoo said:
followed this:
http://androlinux.com/android-ubuntu-development/how-to-install-ubuntu-on-rooted-transformer-prime/
make sure you have busybox installed der. Or at least the cp command in /system/bin
works well on my TF300T, Yea its not native but im currently configuring it for kernel building ;-D
Click to expand...
Click to collapse
Why does the mount script remount a non-existing block device with an ancient (according to android) filesystem?
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Edit: I read all the scripts, and they all mount that crap. It's not made for transformers, and on the android device it's made for it leaves /system mounted rw after you've run it, and WHEN run (installed) it modifies too much in /system/bin
Code:
# At first it copies loads of crap to /system/bin, and then:
cd /system/bin/
chmod 4777 *
It's not even "hackish" - it's just... wrong...
Will loop1 work every mount?
Code:
mknod /dev/loop1 b 7 0
losetup /dev/block/loop1
I'm almost only asking, since this thread was supposed to be about scripts?
gasingvar said:
Yes, it is somewhat hackish, like I wrote. My image has got an sdcard folder (/sdcard) inside of it where I mount /sdcard from android. (Ie chroot and mkdir /sdcard)
Click to expand...
Click to collapse
Thanks. I created /sdcard, and it works almost perfectly now. However, mounting devpts at /dev/pts doesn't seem to work. I replaced that line with
Code:
mount --bind /dev $mnt/dev
and it seems to work fine. Is there anything wrong with my method?
/dev/void said:
Why does the mount script remount a non-existing block device with an ancient (according to android) filesystem?
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Edit: I read all the scripts, and they all mount that crap. It's not made for transformers, and on the android device it's made for it leaves /system mounted rw after you've run it, and WHEN run (installed) it modifies too much in /system/bin
Code:
# At first it copies loads of crap to /system/bin, and then:
cd /system/bin/
chmod 4777 *
It's not even "hackish" - it's just... wrong...
Will loop1 work every mount?
Code:
mknod /dev/loop1 b 7 0
losetup /dev/block/loop1
I'm almost only asking, since this thread was supposed to be about scripts?
Click to expand...
Click to collapse
I'm assuming you're talking about the link in the post you quoted, even though you seem to be referencing the OP's use of the word "hackish". The script in the OP doesn't do any of that stuff. It just creates a few directories in /data/local/mnt/ and writes the mount/unmount scripts, which themselves only un/mount appropriate directories for the tablet. As for your question, I'm not nearly experienced enough to answer it. Sorry.
EndlessDissent said:
Thanks. I created /sdcard, and it works almost perfectly now. However, mounting devpts at /dev/pts doesn't seem to work. I replaced that line with
Code:
mount --bind /dev $mnt/dev
and it seems to work fine. Is there anything wrong with my method?
Click to expand...
Click to collapse
AFAIK your mount seems to be more complete, ie more android hardware goodies accessable from the chroot environment. However - that means more things possibly going wrong (like writing to a device who's critical to the android environment).
Personally I'd try to find what "hardware goodies" and whatnot I'd need to get the chroot environment working optimally, and not mount ALL of /dev.
EndlessDissent said:
I'm assuming you're talking about the link in the post you quoted, even though you seem to be referencing the OP's use of the word "hackish". The script in the OP doesn't do any of that stuff. It just creates a few directories in /data/local/mnt/ and writes the mount/unmount scripts, which themselves only un/mount appropriate directories for the tablet. As for your question, I'm not nearly experienced enough to answer it. Sorry.
Click to expand...
Click to collapse
Yes, and the OP is very honest about his script(s) being "hackish", which I interpret to mean 'not optimal, possibly redundant but working', all of which it is (and I applaud the early release, since for instance I could get things rolling), but the ubuntu image installation and mounting scripts from the other poster ( whom I was addressing ) are plain faulty.
I am looking for a armhf build of ubuntu or debian that I can chroot (newer the better), if anyone knows of such a build that would be fantastic but if not does anyone know of an easy to follow guide to compile such a thing?
I found two pretty good guides. I mostly followed THIS ONE, but I found that it doesn't mount enough before "first boot", so what I did was follow the guide until the point where you move the image to the tablet. Then I ran the OP's installlinux.sh script, and then the mount script. However, the mount/unmount scripts need to be edited before using them. Comment out the sdcard line and probably the devpts line (mounting devpts didn't work; Bash complained that devpts didn't exist; I had to replace it with the line I mentioned a few posts above, but as /dev/void says, it could be problematic, so be careful). Mount the image, make the /sdcard directory, exit, unmount, and edit the scripts again to mount/unmount /sdcard.
Next time you enter the chroot, feel free to run the
Code:
sh /debootstrap/debootstrap --second-stage
command to build the image, and follow the linked guide until the next time it tells you to exit the session (NOTE: The second echo "whatever" > sources.list command is wrong; it should be echo "whatever" >> sources.list; Also, remember to replace "squeeze" with the appropriate Debian version, in my case, "testing"). Instead of exiting right after the apt-get update, I'd recommend playing around with the chroot and configuring whatever apps you install. You can just use the OP's scripts now and ignore the script in the linked guide.
When the guide I linked above gets to this line:
Code:
sudo debootstrap --verbose --arch armel --foreign squeeze /mnt/squeeze/ http://ftp.debian.org/debian
just replace armel with armhf, and if you want a testing image, replace squeeze with testing.
Sorry I'm not attaching my image. I made it gigantic (5GB), so I don't really have anywhere to store it, and you probably wouldn't want to download a file that big. Plus, it already has Openbox and a bunch of other things you probably don't want installed. I'm assuming you'd want GNOME or KDE instead.

Categories

Resources