Related
Hi All,
The Ash shell provides a few advantages over the Android default sh shell such as command history and cursor handling at the prompt. There are other benefits, but these are the first that come in most handy (to me).
The following tutorial will get you ash as the login shell with as yet no ill effects:
Note: that in my case, I'm using my android2sd construct and thus this modification is being done to my active overlay profile setup, thus to undo it I can simply boot into "safe\\normal" mode and undo the changes without possibly locking me out of the console should it have failed (which it didn't) But you can edit the Android /system/bin/sh file in this manner directly.
Ash as Login Shell:
OK, make the /system fs read-write:
mount -o remount,rw /system
Click to expand...
Click to collapse
Note: that the fs type is not needed, and in my case is not yaffs but ext3, Android will figure it out proper.
Next,
cp -a /system/bin/sh /system/bin/sh0
Click to expand...
Click to collapse
(this is for backup purposes and allows us to undo the change if so desired, or delete it if no longer needed).
Note: I'm using JF1.51 roms, so busybox ash is available as /system/xbin/bb/ash, so that is what I am using here; use ash however you are able to access it.
echo "#!/system/xbin/bb/ash">/system/bin/sh
echo "/system/xbin/bb/ash \[email protected]">>/system/bin/sh
Click to expand...
Click to collapse
Please note the use of (redirect\\overwrite)> and (redirect\\append)>>.
This will overwrite sh with a script to load the desired shell, executing any command-line arguments passed, and preserve the permissions of the original sh file. You can manually set the permissions the same as they are for our sh0 backup if the permissions (root.shell)(0755) don't seem to keep.
Finally reset the read-only state of /system:
mount -o remount,ro /system
Click to expand...
Click to collapse
Now if you shell-in\\telnet-in you should get the ash prompt which unlike the Android sh default prompt, includes the present working directory(pwd) ie: '/#' instead of just '#'.
Note: A reboot should not cause the loss of the modification, but if does, copy the new sh script to your /data/local/bin location or something and copy it back via boot script or something.
Shell Scripts:
If you're like me, you discovered that Android didn't need the interpreter declaration comment in scripts, and thus may not have used them...Well, you will need to update your scripts to include them by adding something similar to the following as the first line of your scripts:
#!/system/xbin/bb/ash
Click to expand...
Click to collapse
Again, please note that I am using JF1.51 roms and the location of the busybox ash shell is what I'm listing; put the full location to the shell you intend to use as this location.
Without the interpreter declaration, ash simply complains 'not found' at the first command, as ash doesn't know how to interpret the script, and doesn't seem to default to the login shell.
Hope someone finds this helpful!
sweet. This is going to be very useful
BAM. thats sexy. i just did this on CM3.6.7.1. works like a charm.
scratches head. i'm lost. what does this do and how does this make my g1 better?
temporizer said:
scratches head. i'm lost. what does this do and how does this make my g1 better?
Click to expand...
Click to collapse
im not sure about the other features, but the one i installed it for is to have your working directory in front of ur prompt. ex:
Code:
/# cd /sdcard
/sdcard # cd /system/sd
/system/sd #
etc...
EDIT: Also, if you use ConnectBot, you'll notice with the regular sh, if u scroll up with tracball, you get BS characters on the prompt. with THIS one, when you scroll up, you get last command entered. VERY handy for when you mistype one character on a long-ass command.
I love you
Couldn't you do this?
Code:
mv /system/bin/sh /system/bin/sh0
ln -s /system/xbin/bb/ash /system/bin/sh
great job, i'm going to get ash working on my G1 (CM-3.6.7.1)
Thanks.
kanstin said:
Couldn't you do this?
Code:
mv /system/bin/sh /system/bin/sh0
ln -s /system/xbin/bb/ash /system/bin/sh
Click to expand...
Click to collapse
I tried this and it worked even after a reboot...
Sweet, I love the scroll back with trackball in the terminal!!! Me thinks this should get absorbed into the next Cyan release.
kanstin said:
Couldn't you do this?
Code:
mv /system/bin/sh /system/bin/sh0
ln -s /system/xbin/bb/ash /system/bin/sh
Click to expand...
Click to collapse
Yes, I reckon you could. Though I had done a few experiments where the symlink failed, but I'm fairly sure it was do to the link: /system/xbin/bb/ash -->../busybox and /system/bin/../busybox not existing...so I did it via script. Many ways to skin a cat they say.
Thank you all... this is fricken awesome!!
temporizer said:
scratches head. i'm lost. what does this do and how does this make my g1 better?
Click to expand...
Click to collapse
It gives a more advanced shell for when you use the command line interface or telnet into your G1. If you don't use the command line a lot, it won't help you.
As for specific benefits to the advanced version, it was listed in the first post.
Hi,
imho this is rather a hack that exposes you to the risk at least on CM to loose your
shell during boot as xbin.sqf the compressed squashfs filesystem containing
busybox is mounted rather late in the boot process. A cleaner solution would be to
move busybox to system/bin and link it to sh. That way you ensure that sh will
always be accessible during boot and also later on, thus not interfering with
further developments. A alternative could be to compile a standalone version
of busybox containing only ash (for size reasons, as size in /system/bin is precious)
copy that to /system/bin and link sh to it.
Seems to work fine on Dude's. Not really sure how it should open, but I type "ash" at the prompt and I get the /$ and /# if superuser. I also get the command history by rolling the trackball, which is a very nice feature.
Can i install this without using my PC?
temporizer said:
Can i install this without using my PC?
Click to expand...
Click to collapse
Should work using terminal.
Tried it on JACHero 2.7.1
I tried the hard link one and I get a read only fs error on the first move command. What should I chmod to get past that?
mugafuga said:
I tried the hard link one and I get a read only fs error on the first move command. What should I chmod to get past that?
Click to expand...
Click to collapse
Do this first before the mv and the symlink.
mount -o remount,rw /system
farmatito said:
Hi,
imho this is rather a hack that exposes you to the risk at least on CM to loose your
shell during boot as xbin.sqf the compressed squashfs filesystem containing
busybox is mounted rather late in the boot process. A cleaner solution would be to
move busybox to system/bin and link it to sh. That way you ensure that sh will
always be accessible during boot and also later on, thus not interfering with
further developments. A alternative could be to compile a standalone version
of busybox containing only ash (for size reasons, as size in /system/bin is precious)
copy that to /system/bin and link sh to it.
Click to expand...
Click to collapse
Is this in any way accurate? I dedicate my g1 to cyan's roms and wouldn't want anything to hinder any of the goodness that is cyanogenMod. Advice?
Load ash when terminal is started?
temporizer said:
Is this in any way accurate? I dedicate my g1 to cyan's roms and wouldn't want anything to hinder any of the goodness that is cyanogenMod. Advice?
Click to expand...
Click to collapse
Safest method will be to change to ash shell once terminal app is started (same as typing "ash" to switch shell from sh to ash). I don't know how to do it in android (in linux you could add it to your login script).
So if someone knows how to execute a command when we login using the terminal app, then switching to ash shell would work without fear of breaking any other functionality.
Hi, this is my first time posting on this site and I apologizes if this is in the wrong place. I just recently rooted my evo and was wondering when I want to apply a customization such as a new notification bar how do I know to use either flashing the file from the sd card or to run a command in adb? Is there an important difference, or can either be used? Thanks in advance for the help.
rafroehlich2 said:
Hi, this is my first time posting on this site and I apologizes if this is in the wrong place. I just recently rooted my evo and was wondering when I want to apply a customization such as a new notification bar how do I know to use either flashing the file from the sd card or to run a command in adb? Is there an important difference, or can either be used? Thanks in advance for the help.
Click to expand...
Click to collapse
Most files can be flashed, if they are in a .zip form, you should be okay. However for things like the bootscreens, the recommended method is to use ADB and push the bootanimation.zip file to the specified folder on the phone. However, this has been extremely simplified by user-made tools here on the EVO forums, not many people like using ADB (don't know why)... so there are tools to make it easier for people.
Usually the person that is distributing the file should say whether you need to flash or use ADB commands, just read the OP's post.
Thanks so much for your help.
rafroehlich2 said:
Thanks so much for your help.
Click to expand...
Click to collapse
Sure, no problem!
pseudoremora said:
Most files can be flashed, if they are in a .zip form, you should be okay. However for things like the bootscreens, the recommended method is to use ADB and push the bootanimation.zip file to the specified folder on the phone. However, this has been extremely simplified by user-made tools here on the EVO forums, not many people like using ADB (don't know why)... so there are tools to make it easier for people.
Usually the person that is distributing the file should say whether you need to flash or use ADB commands, just read the OP's post.
Click to expand...
Click to collapse
If I use the flashing method will the files be moved to the correct system folder or will it just deposit it in the ROM? When you use adb you specify the target, if I'm not mistaken. I just don't want my system to get cluttered with random files. Sorry if this isn't worded well.
rafroehlich2 said:
If I use the flashing method will the files be moved to the correct system folder or will it just deposit it in the ROM? When you use adb you specify the target, if I'm not mistaken. I just don't want my system to get cluttered with random files. Sorry if this isn't worded well.
Click to expand...
Click to collapse
When using ADB, the system won't get "cluttered"... mainly because when you're are using the adb push (copy) command, you will be overwriting the file that is currently residing on your phone.
For example, if I wanted to replace my bootanimation -- I would type:
Code:
adb push bootanimation.zip /system/customize/resource
This would copy the new bootanimation.zip over to the directory being specified (/system/customize/resource -- where the bootanimation resides), upon copying, it explicitly overwrites any file/folder with the name "bootanimation" -- unless you set a parameter when typing the command to ask you if it should overwrite. You don't need to worry about this though, almost always you'll overwrite the files.
As long as you push (copy) any and all files to its correct directory, nothing should ever get cluttered and if it does, then you can always remove it just as easily.
pseudoremora said:
When using ADB, the system won't get "cluttered"... mainly because when you're are using the adb push (copy) command, you will be overwriting the file that is currently residing on your phone.
For example, if I wanted to replace my bootanimation -- I would type:
Code:
adb push bootanimation.zip /system/customize/resource
This would copy the new bootanimation.zip over to the directory being specified (/system/customize/resource -- where the bootanimation resides), upon copying, it explicitly overwrites any file/folder with the name "bootanimation" -- unless you set a parameter when typing the command to ask you if it should overwrite. You don't need to worry about this though, almost always you'll overwrite the files.
As long as you push (copy) any and all files to its correct directory, nothing should ever get cluttered and if it does, then you can always remove it just as easily.
Click to expand...
Click to collapse
Thanks for taking the time to answer. I'm new to this and any time I see command line I get hesitant. Thanks again for the thorough answer.
rafroehlich2 said:
Thanks for taking the time to answer. I'm new to this and any time I see command line I get hesitant. Thanks again for the thorough answer.
Click to expand...
Click to collapse
Yup, no problem. I try to usually give a detailed answer, as I'm sure not everyone will understand vague answers.
pseudoremora said:
Yup, no problem. I try to usually give a detailed answer, as I'm sure not everyone will understand vague answers.
Click to expand...
Click to collapse
Since you seem to be knowledgeable what is the difference between flashing a rom by its name.zip as opposed to renaming it update.zip? Does the former start new and the latter maintain all apps/settings?
Sent from my PC36100
rafroehlich2 said:
Since you seem to be knowledgeable what is the difference between flashing a rom by its name.zip as opposed to renaming it update.zip? Does the former start new and the latter maintain all apps/settings?
Sent from my PC36100
Click to expand...
Click to collapse
No difference.
The naming conventions don't mean anything really. There used to be a time when all packages had to be called "update.zip", but the Devs that built the recoveries made it so you could name the .zip files whatever you wanted.
You'll see ROM's/theme's/etc with fancy names -- that's just so its easier for the end user to identify what he/she is actually going to flash.
When I say "update.zip", I just mean that the file can be flashed via recovery and won't require command line/terminal/ADB.
However, there are certain files that will always have a static name (bootanimation.zip) -- that can't change because the phone is programmed to look for that specified file. So whenever someone uploads a bootanimation and calls it: "Nexus-bootanimation.zip" --- this should be renamed to bootanimation before adb pushing or flashing to its specified directory.
Now I understand the idea behind flashing a radio, however I don't understand flashing a kernel. How do I know when to do this and do the risks of radio apply to the kernel? Also, are there any other major components that I'll eventually have to flash? Thanks for answering my many questions.
Sent from my PC36100
rafroehlich2 said:
Now I understand the idea behind flashing a radio, however I don't understand flashing a kernel. How do I know when to do this and do the risks of radio apply to the kernel? Also, are there any other major components that I'll eventually have to flash? Thanks for answering my many questions.
Sent from my PC36100
Click to expand...
Click to collapse
There are risks with both.
Flashing a kernel or radio has the potential to brick your phone. The radio is used for controlling all the "wireless" functions (3G, 4G, x1 connections (texting/calling)) -- pretty much anytime the phone connects to the Sprint towers, the radio is playing its part. So if you flash it incorrectly; the consequences are obvious.
The kernel is the heart of the Android. The kernel itself is actually Linux. Android is built upon Linux, so pretty much Google took the already existing Linux kernel and built Android on top of it (the UI, the apps, etc) and made Android into a Mobile OS, which can run on virtually any platform or device.
How do you know? You don't -- it's a matter of wanting to be curious enough to test. Some devs will put out kernels that overclock your device, others will add different features (screen fixes, loopback interface, underclocking, etc). The kernel controls all the hardware on the phone and how everything functions -- so when devs mess with source code, they are essentially making the hardware function differently for your device.
Some of the major components? -- The biggest ones so far are the wireless driver and 4G driver. When the EVO came out -- the battery life wasn't great; but after the new update (1.47 and the accompanying radio's); battery life on the device have improved significantly and people have experience better WiFi reception and such.
Hope that helps.
pseudoremora said:
There are risks with both.
Flashing a kernel or radio has the potential to brick your phone. The radio is used for controlling all the "wireless" functions (3G, 4G, x1 connections (texting/calling)) -- pretty much anytime the phone connects to the Sprint towers, the radio is playing its part. So if you flash it incorrectly; the consequences are obvious.
The kernel is the heart of the Android. The kernel itself is actually Linux. Android is built upon Linux, so pretty much Google took the already existing Linux kernel and built Android on top of it (the UI, the apps, etc) and made Android into a Mobile OS, which can run on virtually any platform or device.
How do you know? You don't -- it's a matter of wanting to be curious enough to test. Some devs will put out kernels that overclock your device, others will add different features (screen fixes, loopback interface, underclocking, etc). The kernel controls all the hardware on the phone and how everything functions -- so when devs mess with source code, they are essentially making the hardware function differently for your device.
Some of the major components? -- The biggest ones so far are the wireless driver and 4G driver. When the EVO came out -- the battery life wasn't great; but after the new update (1.47 and the accompanying radio's); battery life on the device have improved significantly and people have experience better WiFi reception and such.
Hope that helps.
Click to expand...
Click to collapse
That does help. This is my first time with android and my first time attempting to actually mess with it.
rafroehlich2 said:
That does help. This is my first time with android and my first time attempting to actually mess with it.
Click to expand...
Click to collapse
There will be a lot more "firsts", believe me. Some things will be harder than others; but if you stick with it and actually take the time to learn, you'll realize that working Android can be a helluva lot of fun and unbelievably addictive!
pseudoremora said:
There will be a lot more "firsts", believe me. Some things will be harder than others; but if you stick with it and actually take the time to learn, you'll realize that working Android can be a helluva lot of fun and unbelievably addictive!
Click to expand...
Click to collapse
The bug has already bit me. I appreciate the help. It's nice to know there is a community to get good answers from when needed.
Sent from my PC36100
pseudoremora said:
There will be a lot more "firsts", believe me. Some things will be harder than others; but if you stick with it and actually take the time to learn, you'll realize that working Android can be a helluva lot of fun and unbelievably addictive!
Click to expand...
Click to collapse
Instead of posting a new thread perhaps you can help me on this. When I attempt to use adb to remove a bundled app.
adb shell
cd /system/app
ls
rm app.apk
I get Disk space read only. I have full root and NAND I assume. I used the OTA method and am able to flash custom ROMs. I am using the rooted stock 1.47.651.1
rafroehlich2 said:
Instead of posting a new thread perhaps you can help me on this. When I attempt to use adb to remove a bundled app.
adb shell
cd /system/app
ls
rm app.apk
I get Disk space read only. I have full root and NAND I assume. I used the OTA method and am able to flash custom ROMs. I am using the rooted stock 1.47.651.1
Click to expand...
Click to collapse
When a "read-only" message is returned, it usually means that you don't have RW (read-write access), to circumvent this, run this command:
Code:
adb remount -- Should always be run if you plan on changing something that requires RW access
Then:
adb shell
cd /system/app
ls
rm app.apk
If for some reason you get a error message with adb remount (most likely due to permissions), then you'll need to use the full "remount" command, for that, run:
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
Hope that helps.
pseudoremora said:
When a "read-only" message is returned, it usually means that you don't have RW (read-write access), to circumvent this, run this command:
Code:
adb remount -- Should always be run if you plan on changing something that requires RW access
Then:
adb shell
cd /system/app
ls
rm app.apk
If for some reason you get a error message with adb remount (most likely due to permissions), then you'll need to use the full "remount" command, for that, run:
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
Hope that helps.
Click to expand...
Click to collapse
I tried your method, but I get another error. It looks like:
Code:
mac-mini:~ rafroehlich2$ adb remount
remount failed: Operation not permitted
mac-mini:~ rafroehlich2$ mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
mount: exec /usr/sbin/mount_yaffs2 for /System: No such file or directory
Is there a preventable reason
Code:
adb remount
fails? Thanks for the help.
rafroehlich2 said:
I tried your method, but I get another error. It looks like:
Code:
mac-mini:~ rafroehlich2$ adb remount
remount failed: Operation not permitted
mac-mini:~ rafroehlich2$ mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
mount: exec /usr/sbin/mount_yaffs2 for /System: No such file or directory
Is there a preventable reason
Code:
adb remount
fails? Thanks for the help.
Click to expand...
Click to collapse
I figured you might have trouble with the ADB remount -- again, this is usually due to permissions. For testing purposes, try booting into recovery and then issuing the adb remount command.
In regards to the full remount command -- I'm wondering if you have busybox (it contains all the Linux command line tools) so that you can run the above commands.
Can you issue and then paste the output back here?:
Code:
cat /proc/mounts
Also, run this:
Code:
adb shell
cd /system/xbin
ls
If you can see a huge list of files -- then that means you do in fact have Busybox installed.
Also, what ROM are you running?
pseudoremora said:
I figured you might have trouble with the ADB remount -- again, this is usually due to permissions. For testing purposes, try booting into recovery and then issuing the adb remount command.
In regards to the full remount command -- I'm wondering if you have busybox (it contains all the Linux command line tools) so that you can run the above commands.
Can you issue and then paste the output back here?:
Code:
cat /proc/mounts
Also, run this:
Code:
adb shell
cd /system/xbin
ls
If you can see a huge list of files -- then that means you do in fact have Busybox installed.
Also, what ROM are you running?
Click to expand...
Click to collapse
After
Code:
cat /proc/mounts
Code:
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
/dev/block/mtdblock4 /system yaffs2 ro 0 0
/dev/block/mtdblock6 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock5 /cache yaffs2 rw,nosuid,nodev 0 0
tmpfs /app-cache tmpfs rw,size=8192k 0 0
/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
Code:
mac-mini:~ rafroehlich2$ adb shell
$ cd /system/xbin
$ ls
wireless_modem
dnsmasq
su
I download the BusyBox app to keep it up to date and also installed it through the "problems" section on titanium backup. However, that's all I got.
The ROM I am using is the fully rooted stock RUU. I'd post a link, but am not sure if I'm allowed to yet. It is the one posted by whitslack.
here is an init.d script to optimize your ext4 partitions
thanks to crackpot for the original script, all i did was change the values to optimize performance
this has been tested and does improve performance
go inside tar and extract s99 file put into init.d folder /system/etc/init.d
dsexton702 said:
because im not professional with kernels raver or drhonk will have to install this on the kernel, but for those who have ext4 on all partitions on GB this mod is definitely for you
"Barriers allow usage of delayed allocations without risk. Delayed allocations are the key to performance for modern filesystems," supercurio.
THIS IS FOR EXPERIENCED PEOPLE WITH ADB
plug the phone in
make sure debug is on
and type the following into your command prompt
adb shell
mount -o remount,barrier=0 /system /system
mount -o remount,barrier=0 /cache /cache
for some reason the kernel only has /data with barriers when all 3 should have them
you will notice your quad go up about 2-300 more
and your performance will be much better
Click to expand...
Click to collapse
the barriers were prob removed to the fact of such little actuall memory on the system and cache partition or they may be looking at shortning the sgs4g cache partition size and when they keis the gingerbread forgot to add the barrier back in. Also note when you barrier the cache you also run the risk of locking downloads to a set size hince why some had issues on frayo with download sizes larger then 30 mb in size also why u dont see that in gb or if you adb shell in frayo
/unmount cache
rmdir cache
mdir cache
then ln the 2 caache files back which removes the limit
Must we ADB this, or can we do this via terminal as well?
Part Four said:
Must we ADB this, or can we do this via terminal as well?
Click to expand...
Click to collapse
i believe terminal is fine as well
Wow! Finally broke 3000!
Sent from my SGH-T959V using Tapatalk
Do we need to do this every (re)boot, or just once?
Thanks, amazing as always dsexton!
It will, but you will have to input out each time you reboot. Also...if you do use terminal to do it, you may need to put the commands in a note pad and copy /paste it. (holds down on the screen to get the paste function) it kept changing barriers to barrIers which is not valid .
Sent from my GS4G using XDA app.
there's an app called script manager, its free. just create new script, place code, save, set to root and to run at boot.
shotchacokov said:
It will, but you will have to input out each time you reboot. Also...if you do use terminal to do it, you may need to put the commands in a note pad and copy /paste it. (holds down on the screen to get the paste function) it kept changing barriers to barrIers which is not valid .
Sent from my GS4G using XDA app.
Click to expand...
Click to collapse
ADB it is then!
Somairotevoli said:
Wow! Finally broke 3000!
Sent from my SGH-T959V using Tapatalk
Click to expand...
Click to collapse
were you OC'd or stock? also, did you cook that battery mod? and are you on the kg4 or kg6 rom?
shotchacokov said:
were you OC'd or stock? also, did you cook that battery mod? and are you on the kg4 or kg6 rom?
Click to expand...
Click to collapse
I'm only managing to get 1200 on Quadrant, with a 1.2ghz OC. I'd love to know what I'm doing wrong...
Would this in any way benefit froyo, specifically audiophile-frayo?
Sent from my SGH-T959V using XDA Premium App
Could you elaborate if you don't mind? I've never used script manager
Somairotevoli said:
there's an app called script manager, its free. just create new script, place code, save, set to root and to run at boot.
Click to expand...
Click to collapse
sent from my Real Gs move in silence like lasagna
I am using KG6 w/ cwm/voodoo/KG4 kernel with lag fix enabled. I'm [email protected] 1.44ghz.
the battery is from
A UOT theme I am working on.
As for script manager, install from market.
Open app and create new script from menu.
Call it what ever you want. Hit ok.
Menu will open asking what to open file with, choose text editor.
Paste this code
Code:
mount -o remount,barrier=1 /system /system
mount -o remount,barrier=1 /cache /cache
Hit menu > close > yes to save
Using the programs built in file browser, locate the script, select it.
Check run as root and run at boot. Hit save.
Either run the script after that or reboot.
Run mount command in terminal and check your mounts.
should see barrier=1 on system, cache, and data.
Sent from my SGH-T959V using Tapatalk
Thank you sir very helpful
sent from my Real Gs move in silence like lasagna
Just a note. You have to decide yourself what you want to achieve in the end: better performance or better data integrity. Enabling barriers (setting barrier=1) reorders journaling in a way so that all data blocks are guaranteed to be written before committing, but it degrades the performance because the system have to wait until writes are done in certain sequence. Data integrity is better as there is less change for the transaction to complete improperly in case the system crashes (like when journal data is written but actual data is not.) On phones the chance of screwing up transactions is quite low, just don't ever remove the battery without shutting down the phone properly.
Quote from mount docs: "...Write barriers enforce proper on-disk ordering of journal commits, making volatile disk write caches safe to use, at some performance penalty. If your disks are battery-backed in one way or another, disabling barriers may safely improve performance. ..."
Some more readings here for example: lwn.net/Articles/283161/
The way to remount ext4 partitions for best performance should be this:
mount -o remount,noatime,delalloc,noauto_da_alloc,barrier=0
If you want more data safety then enable barriers.
AntonX said:
Just a note. You have to decide yourself what you want to achieve in the end: better performance or better data integrity. Enabling barriers (setting barrier=1) reorders journaling in a way so that all data blocks are guaranteed to be written before committing, but it degrades the performance because the system have to wait until writes are done in certain sequence. Data integrity is better as there is less change for the transaction to complete improperly in case the system crashes (like when journal data is written but actual data is not.) On phones the chance of screwing up transactions is quite low, just don't ever remove the battery without shutting down the phone properly.
Quote from mount docs: "...Write barriers enforce proper on-disk ordering of journal commits, making volatile disk write caches safe to use, at some performance penalty. If your disks are battery-backed in one way or another, disabling barriers may safely improve performance. ..."
Some more readings here for example: lwn.net/Articles/283161/
The way to remount ext4 partitions for best performance should be this:
mount -o remount,noatime,delalloc,noauto_da_alloc,barrier=0
If you want more data safety then enable barriers.
Click to expand...
Click to collapse
I've modified my init.d script to use these settings, for comparative purposes. Anyone is welcome to try it, assuming your ROM has init.d.
crackpot said:
I've modified my init.d script to use these settings, for comparative purposes. Anyone is welcome to try it, assuming your ROM has init.d.
Click to expand...
Click to collapse
wont work on gb right now because the kernel still doesnt support init.d at the moment
That's odd, it seems to load the mount settings.
Here's output from "mount" via ADB's shell.
Code:
/dev/block/stl9 /system ext4 rw,noatime,barrier=0,data=writeback,noauto_da_alloc
0 0
/dev/block/stl11 /cache ext4 rw,noatime,barrier=0,data=writeback,noauto_da_alloc
0 0
/dev/block/stl10 /data ext4 rw,noatime,barrier=0,data=ordered,noauto_da_alloc 0
0
crackpot said:
That's odd, it seems to load the mount settings.
Here's output from "mount" via ADB's shell.
Code:
/dev/block/stl9 /system ext4 rw,noatime,barrier=0,data=writeback,noauto_da_alloc
0 0
/dev/block/stl11 /cache ext4 rw,noatime,barrier=0,data=writeback,noauto_da_alloc
0 0
/dev/block/stl10 /data ext4 rw,noatime,barrier=0,data=ordered,noauto_da_alloc 0
0
Click to expand...
Click to collapse
it did nothing for me, my mount settings were exactly the same upon every reboot :/
Hi, I cannot figure out what I need to write in terminal emulator to gain root access to install cwm. I was hoping someone could post the exact command needed, I would appreciate it alot. I have tried searching but the generic commands i found on a different site didnt work. Thanks!
Can you gain root from terminal emulator? First I have heard this. Why not just Odin one of the modded kernels?
Sent from my HTC Sensation Z710e using xda premium
andale927 said:
Hi, I cannot figure out what I need to write in terminal emulator to gain root access to install cwm. I was hoping someone could post the exact command needed, I would appreciate it alot. I have tried searching but the generic commands i found on a different site didnt work. Thanks!
Click to expand...
Click to collapse
If you're just looking for the command to mount /system as read/write, you'll have to figure out what "device" is used for the mount. From the terminal, type:
mount
That will show you a list of things that are currently mounted. You'll see something like (not exactly):
/dev/block/stl9 /system rfs rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime, uid=1000,gid=1015,fmask=0002,dm
ask=0002,allow_utime=0020,codepage=cp437,iocharset =iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
The part you're interested in is the part before "/system" and that is the block device used to mount your system partition. To mount it read/write, you type (based on this example's block device & based on the rfs vs. ext4 file system):
mount -o rw,remount -t rfs /dev/block/stl9 /system
The -o part tells mount "here come the options" which are read/write & remount. The -t tells it the filesystem type (rfs or ext4, depends on if you have voodoo enabled). The next argument tells it the block device, then what mount point to use.
As for root, what Exodian said. You'll either have to flash a root enabled kernel or use SuperOneClick v2.2.
alt link: http://forums.androidcentral.com/sa...-guide-stock-2-3-6-replenish.html#post1651482
REVISED TUTORIAL IN ROOTING 2.3.6 SAMSUNG REPLENISH
warning for experienced adb users!: this was made with noobs in mind. you may learn something (from me! a noob! XD) but anyways, enjoy!
this does not affect anything on the phone except for adding the ability to access root permissions. CWM is not permanent, it disappears after you use it, and nothing on the phone is affected, as far as i know, but i had just factory reset the phone, so use at your own risk...
you may need to know:
root of a drive- drives are designated C:\ or D:\ or whatever letter in windows. Just go to "computer" and double click the first item. That location is the "root" of a drive.
Note: make sure you have at least 400 mb of memory (i know, thats alot, but just in case) on your sd card so you can back up your entire phone! i reccomend doing every optional step!!! It'll save you hassle if you have problems. If you can't make room for some reason, and you still wanna try, you should skip step 8. I don't suggest it though.
1. download "odin.zip" and "su" here: https://www.box.com/shared/620b03e95cc0814fefc8 and unzip to your desktop. if you dont have the android sdk, simply copy the "adb.exe" file from "odin.zip" to the root of your primary drive for later. Just go to "computer" and double click the top icon/item. It should say something about C:/. If you're on Mac, sorry. Idk much about it. As for Linux, I have no clue how you'd even try to do this. I love Linux but, sadly, can't experiment with this in it. WINE has its limits....... And I don't think adb or Odin would work.
2. download the "su" file and put into into "platform-tools" where you installed the android sdk, if you have it, or put onto the root of your primary drive if you havent.
3. start phone while holding "spacebar" and "p". "downloading..." should appear on the screen in yellow text
4. plug into the computer and run "Odin_Multi_Downloader_v4.42.exe"
5. select SPHM580.ops for "OPS" and Replenish-CWM5.tar for "One Package" (they should be the only options) DO NOT CHANGE ANYTHING ELSE!!!!!
6. hit "Start" and DO NOT REMOVE PHONE FROM USB.
7. as the phone reboots, hold "u" until CWM opens and set the phone down. you should close Odin now.
8. use the volume keys to navigate to the backup and restore option and use enter to select backup. wait for it to finish completely and take you back to the the CWM main UI. backing up here creates a pure recovery, untouched by anything. CWM is NOT installed into this recovery. continue with the guide.
9. open the command prompt (type cmd.exe in search or run in the start menu, depending on your version of windows) or use some form of terminal emulator on your operating system of choice. command prompt is preferred due to the fact i know it can get the job done, but do what you will.
10. navigate to the drive your sdk is on and into "platform-tools" or to the folder you put the adb.exe and su files on. the default should be [name of drive]:\Users\[username]\. use the "cd.." command til youre at the root of the drive, and if you installed the sdk, type "cd android-sdk-windows/platform-tools" or just go to the root of the drive and go to the next step if you havent. just be sure adb.exe and su are there.
11. type this in line for line, with enters in between. the blue "~#" in the later lines is the prompt you should have. do not type this. it will be in blue. (clockworkmod should still be open on your phone at this point)
adb shell
~#mount -o remount,rw -t rfs /dev/block/stl12 /system
~#exit
adb push su /system/bin/
adb shell
~#chmod 777 /system/bin/su
~#reboot
DO NOT CLOSE THE COMMAND PROMPT YET FOR THE SAKE OF CONVENIENCE
If you have problems with that, try using CWM to mount "/system". Some friendly people over at androidcentral pointed that out. I personally didn't have that problem, but I'm glad it's fixed.
12. when your phone has rebooted, go back to the open command prompt, which should be where it was before you typed "adb shell"
13. type "adb shell". you will see a prompt of "$." type "su." if you have a prompt of "#" rejoice! you have permanent root! now you can go on the Play Store and find "Superuser" and "Busybox" (they should be free. if you cant find it, get ahold of me and ill try to supply the newest updates) if not, and you have a backup from optional step 2, you should go through til you hit CWM and restore the backup. if not, make one now and reattempt everything aside from downloads and the moving the files around on your computer. Also, someone said something about "chmod 06755 /system/bin/su", so if you might try using that instead of "chmod 777 /system/bin/su". 777 worked for me, but maybe this works better for you.
OPTIONAL FINISH STEP: I dont know how you install CWM permanently, but you should do this so you can make backups of your rom and store them somewhere like on a box.com or mediafire.com account if you decide to mess with something on your phone. (use hjsplit to break it into pieces for uploading and reassemble after download for flashing if its too big). to use a recovery, enter CWM (either the way i have here or if you have permanently installed, just reboot and hold "u") and navigate to "backup and restore," "restore," and select the recovery you wish to use on your sd card (make sure when you take out a backup for storage, you zip up the entire folder with the name that contains the date and time of your backup.) it will overwrite everything on your phone to be exactly like it was when you backed it up.
good luck! have fun!
Note: if you rename the CWM backup file, make sure it DOESN'T HAVE A SPACE or it'll give you something about md5 or something not matching. If it says this, remove any spaces in the name and try again. I had it happen on my xperia play and freaked, thinking it was soft-bricked permanently one time, til I found out about cwm's glitch with that.
Also, I uploaded pretty much everything needed for rooting the phone, with comments pertaining to each file. This includes current (as of July 31, 2012) copies of Superuser.apk, a busybox installer, and the busybox and su binaries, as well the Odin package containing the tools to temp flash CWM.
the odin.zip file and the process of achieving CWM temp-flashing was found at http://forums.androidcentral.com/sa...method-samsung-replenish-android-2-3-6-a.html and credit for that part is given to joshua.worth, although I took it a different path than he did.
Update to above info: to simplify things, I uploaded all relevant files to box so people can get them easier. The su file went missing from xda, most importantly, so I fixed that, and added an updated binary in case someone has trouble with the other one.
contact me at [email protected] if you cant pm me.
Sorry if it takes a while to respond. Life's been kinda crazy for me lately, and I am using my new phone (no service) to do this over wifi.
ahh... well, turns out unrooting cannot be done with a CWM backup... you probably have to find a nandroid or a clean version of kernel with rom. the su file dissapears, although root is still there. ill keep playing with it, i have an idea why root stays although su disappears from the system files. anyways, i will still supply a backup thats pre-rooted for anyone who is willing to have a fresh start on their replenish. it will have superuser.apk preinstalled along with busybox, and everything else will be wiped. this will be a sprint backup, so if anyone has the boost version and is willing to back up with CWM and factory reset, then follow my guide, install busybox and superuser.apk, then back it up again, id be eternally grateful to have a copy
by the way, if anyone has problems with restoring a backup due to "md5" tags or whatever it is, make sure the name of the backup has no spaces. i was freaking out til i found that tip on an obscure forum (well, to me. i dont have a Motorola. lol. just a Sony Ericsson and 2 Samsungs)
update: sorry i havent uploaded the backup. i realized it would give whoever used it the number on this phone and i have to fix that. havent had time to anyways, plus it would only work on a sprint phone. it would convert any boost mobile to sprint, so thats a no-go. sorry...
does this work for the boost mobile replenish that is 2.3.6 if so how long does it take to odin
It should work. And Odin just flashes cwm (really fast) for the duration of the next boot cycle, which it automatically initiates, so hold the recovery button (I think it's u) as it goes into it and you'll have temp root. Make sure it's in download mode before you start. Remember, it cannot be unrooted, so if you value your warranty, plz think twice before doing it. I'm just here to supply the how-to if you decide to, not to say you have to. If you do, enjoy root access!
isavegas said:
It should work. And Odin just flashes cwm (really fast) for the duration of the next boot cycle, which it automatically initiates, so hold up (I think it's u) as it goes into it and you'll have temp root. Make sure it's in download mode before you start. Remember, it cannot be unrooted, so if you value your warranty, plz think twice before doing it. I'm just here to supply the how-to if you decide to, not to say you have to. If you do, enjoy root access!
Click to expand...
Click to collapse
Thanks. I did not know if there is a fail safe if something went wrong. so I was second guessing. Very simple to do thank you assuming with odin I made a back up. if I where to mess my system up I can use odin and restore my backup and I be back up and running again no need to sbf
i keep getting : ~ # mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
mount: mounting /dev/block/mtdblock3 on /system failed: Invalid argument
bscabl said:
i keep getting : ~ # mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
mount: mounting /dev/block/mtdblock3 on /system failed: Invalid argument
Click to expand...
Click to collapse
hmm... i am familiar with the error (ive gotten it with 3 different phones in my attempt to root it, but i have succeeded each time regardless) but are you sure you actually have clockworkmod OPEN on your phone when the error shows up? i cant actually do anything from my end, because i no longer have a computer i can use to test anything, or the replenish i rooted with the method... but i opened the cwm several times before thinking to test the adb and seeing the "~#". i actually restarted the phone and did it again before actually rooting it, seeing if i had rooted it or what, and tho i got the same prompt every time it was booted in cwm, it wouldnt show up if i allowed the phone to boot normally after using odin, i HAD to ACTUALLY boot into the cwm menu, which is completely seperate from the OS itself, although it has access to the system files.
by the way, copy and paste this directly into the command prompt when you get to the step to avoid human error. mount -t rfs -o remount,rw /dev/block/stl9 /system
or, if it wont work, try this mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
sorry bout the babbling XD. anyways, cwm should be circumnavigating the root permissions. hmm.... if you still have problems after that, try skipping to the adb push for the "su" file.
sorry i havent been on top of the thread. ill set up an email notification.
and by the way, something i found very useful on my xperia play when it went into infinite reboot, you can always just restore the system files in the advanced restore option, allowing you to keep all of your app data if, later down the line, your phone needs to be restored. hope this helps. it helped me XD thought id lose all of my messages, but nope. i decided to explore the advanced restore and yay! i got to keep them XD
UPDATE
I don't know if it matters to you anymore, but apparently, some people have trouble with this and fix it by going to the mount menu in CWM and mounting /system
Couple of corrections:
chmod 777 /system/bin/su
should be chmod 06755 /system/bin/su
and then following that command should be
ln -s /system/bin/su /system/xbin/su
and I saw someone say this is unrootable. Thats not correct. Simply running the unroot script would unroot. Doomlord made a nice one.
To use it do the following:
Code:
adb push unroot /data/local/
adb shell chmod 777 /data/local/unroot
adb shell su -c "/data/local/unroot"
adb reboot
[code]
The above will unroot almost any android device.
halfcab123 said:
Couple of corrections:
chmod 777 /system/bin/su
should be chmod 06755 /system/bin/su
and then following that command should be
ln -s /system/bin/su /system/xbin/su
and I saw someone say this is unrootable. Thats not correct. Simply running the unroot script would unroot. Doomlord made a nice one.
To use it do the following:
Code:
adb push unroot /data/local/
adb shell chmod 777 /data/local/unroot
adb shell su -c "/data/local/unroot"
adb reboot
[code]
The above will unroot almost any android device.[/QUOTE]
Unfortunately, Doomlord's method didn't work on it. I tried all manner of one clicks and manual versions and only this got even temporary root. It's a workaround based on forcing the phone to boot into a custom recovery. (I call it custom bc its not an "official" recovery.) And I chose the chmod by looking through many manual ways to root, and that one was popular, and it works. I had full root access afterwards. I tried to unroot afterwards, however, so I could take screenshots and stuff, but the su file would reappear, even after manual deletion or restoring to an unrooted backup. Anyways, point is, this is the only method I could get to work at all, and it does work.
But the "chmod" night help other people, so ill make note of it in the post just in case. Thanks for the info.
Sent from my rooted R800at using xda app-developers app
Click to expand...
Click to collapse
Important fix----
If step 11 doesn't work, go to the "mount" menu in cwm and mount /system. Some people on androidcentral were kind enough to mention that this fixed their problem with mounting /system as rewritable
Sent from my R800at using xda app-developers app
isavegas said:
Important fix----
If step 11 doesn't work, go to the "mount" menu in cwm and mount /system. Some people on androidcentral were kind enough to mention that this fixed their problem with mounting /system as rewritable
Sent from my R800at using xda app-developers app
Click to expand...
Click to collapse
thats because your command is wrong
shabbypenguin said:
thats because your command is wrong
Click to expand...
Click to collapse
How? Throughout my own rooting of one of the phones, I had this working perfectly. Every time I hit a snag, I found a way around it and documented it. A few other people had errors show up because the phone itself hadn't mounted the system, but the problem was resolved, and only a couple people had any other problems, and they were unrelated to that. I assure you, every command works properly, as far as I know.
exactly my point. your command to mount system is wrong.
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
lets break it down shall we?
mount - this is teh command
-o remount,rw - this is where you tell it what option you want, in this case remounting as rw.
-t yaffs2 - here you are telling mount that it should expect a yaffs2 formatted device, which is not what the samsung replenish is. the replenish uses RFS (robust file system), the best way i can describe it is like telling your windows computer that your hard drive is fat32 when its actually ntfs.
/dev/block/mtdblock3 - this is where you tell mount what you are looking to mount, the issue here is that the replenish doesnt use MTD blocks, it uses STL's and BML's.
/system here is where you are trying to mount the said device to..
out of 5 parts you did get 3 correct tho. you might wish to modify your guide to reflect the actual mount command, for your device it is the following:
mount -o remount,rw -t rfs /dev/block/stl12 /system
and that will kick out system as r/w
shabbypenguin said:
exactly my point. your command to mount system is wrong.
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
lets break it down shall we?
mount - this is teh command
-o remount,rw - this is where you tell it what option you want, in this case remounting as rw.
-t yaffs2 - here you are telling mount that it should expect a yaffs2 formatted device, which is not what the samsung replenish is. the replenish uses RFS (robust file system), the best way i can describe it is like telling your windows computer that your hard drive is fat32 when its actually ntfs.
/dev/block/mtdblock3 - this is where you tell mount what you are looking to mount, the issue here is that the replenish doesnt use MTD blocks, it uses STL's and BML's.
/system here is where you are trying to mount the said device to..
out of 5 parts you did get 3 correct tho. you might wish to modify your guide to reflect the actual mount command, for your device it is the following:
mount -o remount,rw -t rfs /dev/block/stl12 /system
and that will kick out system as r/w
Click to expand...
Click to collapse
Hmmmm.... Odd..... *shrugs* I had no problem with the command, but I guess other ppl had pickier computers or phones. Hell, Vista's buginess might have worked in my favor that time XD. Thanks for the pointer. I didn't really understand the exact way the replenish was built. I just found a lil guide for making it boot into cwm and found it allowed for me to use that as an exploit to root the device. In fact, I've done the same kind of stuff to root the samsung Intercept, except I made their own software flash a pre-rooted kernel. anyways, I'll update the guide on xda and androidcentral. Thanks!
isavegas said:
Hmmmm.... Odd..... *shrugs* I had no problem with the command, but I guess other ppl had pickier computers or phones. Hell, Vista's buginess might have worked in my favor that time XD. Thanks for the pointer. I didn't really understand the exact way the replenish was built. I just found a lil guide for making it boot into cwm and found it allowed for me to use that as an exploit to root the device. In fact, I've done the same kind of stuff to root the samsung Intercept, except I made their own software flash a pre-rooted kernel. anyways, I'll update the guide on xda and androidcentral. Thanks!
Click to expand...
Click to collapse
chances are you had system mounted in cwm without knowing it.
for future knowledge always check the devices fstab for where to mount and filesystem type
https://github.com/Shabbypenguin/android_device_replenish/blob/master/recovery/recovery.fstab
as you can see the proper mounts from the files i used to make CWM for the replenish
shabbypenguin said:
chances are you had system mounted in cwm without knowing it.
for future knowledge always check the devices fstab for where to mount and filesystem type
https://github.com/Shabbypenguin/android_device_replenish/blob/master/recovery/recovery.fstab
as you can see from the files i used to make CWM for the replenish the proper mounts
Click to expand...
Click to collapse
Eh, maybe. For all I know the first thing I did was mount everything with cwm. I DID do this several months ago. I don't even have the phone anymore. The owner of the phone was gonna give it to me after upgrading, but she sold it, so I kept her 500gb laptop hard drive instead. Popped it out of the external hdd casing and stuck it in a laptop. XD. It now has Linux on it.
Anyways, I've updated the guide to have the right command and note that if it doesn't work to use cwm to mount /system. And how do you find the fstab? Just Google it? Or is it somewhere on the device?
Btw, do you know anything about cwm? It refuses to properly back up my xperia play anymore. The .android_secure folder keeps giving it errors.
isavegas said:
Eh, maybe. For all I know the first thing I did was mount everything with cwm. I DID do this several months ago. I don't even have the phone anymore. The owner of the phone was gonna give it to me after upgrading, but she sold it, so I kept her 500gb laptop hard drive instead. Popped it out of the external hdd casing and stuck it in a laptop. XD. It now has Linux on it.
Anyways, I've updated the guide to have the right command and note that if it doesn't work to use cwm to mount /system. And how do you find the fstab? Just Google it? Or is it somewhere on the device?
Btw, do you know anything about cwm? It refuses to properly back up my xperia play anymore. The .android_secure folder keeps giving it errors.
Click to expand...
Click to collapse
its where the recovery is on the device. each device has their own fstab. as for your error sounds like a conflict, either with cwm itself or that folder
shabbypenguin said:
its where the recovery is on the device. each device has their own fstab. as for your error sounds like a conflict, either with cwm itself or that folder
Click to expand...
Click to collapse
It HAS to he cwm, because the folder is regarded as super hidden by the device. The folder itself can be seen, but the contents can ONLY be edited by the rom or a pc, and I haven't touched it with a pc before. It's where your apps go when you move them to the sd card. I've been trying to back my phone up with cwm because I wanted to test the jelly bean alpha release for it. its the xperia play 4g. Stupid backup crashes every time I try and it ends up eating up what room is left in my sdcard.
i followed your guide and have root in shell. however i cant get root permission on any apps, the window doesnt pop up asking me for permission. i also get a toast notification saying superuser access denied for whatever app im trying to open. any ideas?
arodey said:
i followed your guide and have root in shell. however i cant get root permission on any apps, the window doesnt pop up asking me for permission. i also get a toast notification saying superuser access denied for whatever app im trying to open. any ideas?
Click to expand...
Click to collapse
What does your Superuser log show?
Sent from my PC36100