[DEV] Using -mm option works temporarily - SuperSU

I'm using the -mm (master-mount) option (or trying to) to be able to link folders from internal to external SD. Unfortunately it doesn't seem to work in a 'permanent' way. Any new app started after the mount does not receive the mounted folders, only apps already running will receive it!?
Furthermore, I tried various ways of using the -mm command, but only one seem to work:
su -mm -c 'mount command here' < /dev/null
Running su -mm and piping the commands fails, eg does not mount anything, but no failure message!?
Running su -mm -c <script_path> < /dev/null fails., eg does not mount anything, but no failure message!?
I also tried to run within different context, but it changes nothing. App started after the mount won't see it.
@Chainfire, can you help me make it work? Maybe detail a little more the How-to on this subject, because I fail to find a working method and I don't see how to make it work.
The only way to make it work seems to disable mount namespace separations.
Thanks.

@Chainfire, I understood you're likely not here for the rest of the summer, so you'll hopefully get this when you're back. Happy holiday until then.
I've made further investigations, on a stock-rooted LG G4, latest Lollipop 5.1.1.
For info, the mount commands are like this: 'mount -o bind,shared <source> <target>'... I run them using this syntax: su -mm -c 'mount... '.
EDIT:
All mounted folders are then accessible by any root shell started before or after they have been mounted. However other shells (be it started by the same app or another) do not see them if they are started after the folders have been mounted. If those standard shell are already running when the folders are mounted, they are all visible! Same behavior on a 4.4.2 device.
Then I tried disabling mount separation, but the result is exactly the same except for a very annoying side effect though, root shells actually loose access to /storage/emulated/0 !
EDIT2:
Found out that it only affects the emulated path (/storage/emulated/... and possibly /storage/extSdCard), if using /data/media and /mnt/media_rw paths, the mounts stick across processes, at least when the fuse filesystem is used.
Nevertheless is this a bug, is there something that can be done to make it work for emulated path (be it on fuse or sdcard filesystems) ? Or am I misunderstanding how all this works, or misusing the options? I'll appreciate any help you can provide on this. Let me know if you need any further information, I'll be happy to provide anything you need.
Thanks.

Related

I can push media files using ADB with Cyanogen but not Hero ROM's?

I have done extensive searching in general, Q&A, and development of this forum, as well as Sapphire and have not been able to find an answer to my problem. I have learned that your media files have a delay if you store them on your sd card and that this can be rectified by pushing the media files into your system memory. The /system/media/audio is a read only file and it won't let you push files. This is a simple fix by enabling the read/write of the phone using:
mount -w /system -o remount
From there you can push the files and no lag between calls and hearing the ringtone. Tada. This works perfectly on Cyanogen...The same cannot be said about Hero ROM's.
I have tried several Hero ROM's and I cannot get the read/write to be enabled on the phone when I type in the command. I noticed the first time that the media was located on the /data of the phone. So I changed the ADB command accordingly, and it did not work either. So I thought that it might be because of the location, so I flashed another Hero ROM where I knew the media was located on the /system of the phone. The same thing happened. Where I cannot get it to enable the write capability. I have tried this on several Hero ROM's and cannot figure out why I cannot get this to work.
Any insight is always appreciated, and an answer to this is always more than welcome. Thanks guys.
try
$su
#sh /system/bin/rwsystem
Click to expand...
Click to collapse
if that doesnt work
mount -o remount,rw /dev/mtd/mtdblock3 /system
Click to expand...
Click to collapse
make sure you have enough space on the partitions (type df into console)

remove stock apps

I am willing to pay someone if someone can figure out how to remove factory apps like
facebook
footprints
peep
quickoffice
stock
visual vm
stock massages
i never use them for some reason they run in the background
Just take a look at this thread from the android forums
http://androidforums.com/all-things-root-eris/53646-unwanted-apps.html
NOTE: you MUST have ROOT in order to remove those apps.
If the instructions in that thread about "adb" are too complicated for you, then go buy the Root Explorer app, navigate to the folders you were told to in the thread, click the "r/w" button at the top of the app, then long press on the files you are told to delete.
Deleting system apps is risky if you delete the wrong ones. As usual, you are responsible if anything happens.
As I see it, you must have root to modify system files on your ROM (anyone correct me if I'm wrong)
But I was able to use Titanium Back up (downloaded from the Android market, free) to see all installed programs and I successfully deleted Visual VM, Peep, and stock messages... I use the others...
now so far, my ROM that is installed [2.1 version .3] hasn't had any problems with the removal of these system programs, So I think it is a safe method.
I believe this is a good alternative to adb commands... since you know what you are deleting.
and of course, I am not responsible if you do happen to mess your phone up.
C:\Users\admin\Desktop>cd android-sdk-windows
C:\Users\admin\Desktop\android-sdk-windows>cd tools
C:\Users\admin\Desktop\android-sdk-windows\tools>adb shell
$ mount -0 rw,remoun /dev/block/mtdblock3 /system
mount -0 rw,remoun /dev/block/mtdblock3 /system
mount: invalid option -- '0'
BusyBox v1.15.0 (2009-08-25 15:17:43 BST) multi-call binary
Usage: mount [flags] DEVICE NODE [-o OPT,OPT]
Mount a filesystem. Filesystem autodetection requires /proc be mounted.
Options:
-a Mount all filesystems in fstab
-f Dry run
-r Read-only mount
-w Read-write mount (default)
-t FSTYPE Filesystem type
-O OPT Mount only filesystems with option OPT (-a only)
-o OPT:
loop Ignored (loop devices are autodetected)
[a]sync Writes are [a]synchronous
[no]atime Disable/enable updates to inode access times
[no]diratime Disable/enable atime updates to directories
[no]relatime Disable/enable atime updates relative to modification ti
me
[no]dev (Dis)allow use of special device files
[no]exec (Dis)allow use of executable files
[no]suid (Dis)allow set-user-id-root programs
[r]shared Convert [recursively] to a shared subtree
[r]slave Convert [recursively] to a slave subtree
[r]private Convert [recursively] to a private subtree
[un]bindable Make mount point [un]able to be bind mounted
bind Bind a directory to an additional location
move Relocate an existing mount point
remount Remount a mounted filesystem, changing its flags
ro/rw Read-only/read-write mount
There are EVEN MORE flags that are specific to each filesystem
You'll have to see the written documentation for those filesystems
$ cd /system/app
cd /system/app
$ 1s
1s
1s: permission denied
$
this is what i get am i doing something wrong here
Type adb shell than su and tell me what happens.
binny1007 said:
Type adb shell than su and tell me what happens.[/QUOTE
never mind i got it to work i used different method i bought the titanium backup. show all the installed apps easy to uninstall it works great now my phone is running much faster thanks for all the help
Click to expand...
Click to collapse
FYI, you were typing the commands wrong.
Right after you do "adb shell" you'll need to type "su" and the $ prompt should change to a # prompt. Check your phone as well after typing "su" as you should see a popup asking for permission.
$ mount -0 rw,remoun /dev/block/mtdblock3 /system
Click to expand...
Click to collapse
should be: mount -o rw,remoun /dev/block/mtdblock3 /system
The -o is the letter o, not a zero.
$ 1s
Click to expand...
Click to collapse
Should be: ls
That's the letter l (lowercase L), not a one.
grdlock, I believe there is a "t" missing in your post:
mount -o rw,remount /dev/block/mtdblock3 /system
Ahh, ya, you're right. I just copied/pasted what he wrote and didn't catch that.
ampinc said:
binny1007 said:
Type adb shell than su and tell me what happens.[/QUOTE
never mind i got it to work i used different method i bought the titanium backup. show all the installed apps easy to uninstall it works great now my phone is running much faster thanks for all the help
Click to expand...
Click to collapse
Glad to know it works for someone else as well
Click to expand...
Click to collapse
I just downloaded Titanium Backup and deleted the "worldclock.apk" and I have to say it's a nice app, (Titanium that is)
So far, from the VanillaDroid ROM, I've deleted the following with no ill effects:
Stocks
Weather ( I use WBug)
Visual Voicemail
Browser ( I use Dolphin)
Quickoffice
MMS
Talk
Mail
Deskclock
I would like to delete the following but am having some difficulty finding the correct "apk"
Camcorder (I think it's built into the camera?)
Call History
People Search
Settings (just the app in the drawer, another NAND before I do this I guess)
Voice Dialer
Voice Search
Voice Record
NaviPanel ***Anyone know if this will mess with Maps?***
FACEBOOK !!!! I deleted the "Facebook.apk" but the FB app is still in the drawer and it still works fine. If anyone could help me with deleting this one I would be forever greatful! Trying to delete it using Titanium, it says: "cannot find Facebook.apk" But it's still friggin there......argh!
Edit: Woohoo! Facebook is gone.
Titanium tells me it needs root acess and that's out of question. Then again, I'm on the lg ally and it might be different... idk. Any other suggestions?

Userinit and Apps2SD for Vibrant(legacy)

NOTE: This method has been somewhat superseded by JustAnotherCrowd's method in this thread:
http://forum.xda-developers.com/showthread.php?t=744655
It should still work, however, if you don't want to mess with Odin, but if you want to use ext4 and get the max speed AND stability, I recommend using JACs method.
There are two zip files attached. Consider them "Beginner" and "Advanced". You can only use one or the other, not both. No wipe is required for either, but you will want to clean and repair your ext partition if you plan on using one.
Beginner: If you have an SD card with an ext partition on it (no swap partition, just FAT/ext), ttabal has created a fantastic script to mount it on startup. This zip file runs that script at startup. Credit to ttabbal for the script.
IMPORTANT: You will need to install the latest version of busybox before installing this update or it will not work. You can find busybox on the market for free; download and install it and then open it and click "update busybox".
http://getyourboneon.com/vibranta2sd.zip
Advanced: Enables you to place a custom userinit.sh script in /data/local (make sure premissions are set to 755) and it will run on startup.
http://getyourboneon.com/enableuserinit.zip
An explanation of how this was done:
When looking through the init.rc, I realized that there was only one thing running as root that could safely be replaced; the boot logo player. So, all this does is replace the boot logo player with a script that calls userinit.sh from /data/local and then calls the (now renamed) bootlogo player for those of you who want that nifty startup screen
A super simple (and slightly dirty) hack but I figured it might come in handy for those of us who are impatient and would like to do our own tweaks.
Nice....
I'll be looking forward to this.
Edit:
Working great.
??
Can some one elaborate on what this does?:
BM1515 said:
Can some one elaborate on what this does?:
Click to expand...
Click to collapse
http://wiki.cyanogenmod.com/index.php?title=Userinit.sh
anomalous3 said:
I found a way to get a userinit.sh script working for the vibrant for those of us who would like to run anything at startup. Already got the proof of concept working, and am now busy packaging it into an easy script that will set everything up for you. Will update this post later tonight with the finalized script once it's done.
Click to expand...
Click to collapse
Nice work. What can you do on bootup on the vibrant? I havent looked at all the kernel settings.
oh, just stuff like mounting an ext partition or initializing the modules for the FM radio (assuming we can find them and the hardware's there).
anomalous3 said:
oh, just stuff like mounting an ext partition or initializing the modules for the FM radio (assuming we can find them and the hardware's there).
Click to expand...
Click to collapse
Yes the userinit can contain quite a few script functions and technically almost all of them that would be needed on a modifed rom.
E.G
Code:
insmod /system/lib/compcache/ramzswap.ko;
rzscontrol /dev/block/ramzswap0 -i -d 32768;
busybox swapon /dev/block/ramzswap0;
echo 528000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
echo 0 > /proc/sys/vm/page-cluster;
# Set "deadline" scheduler fifo batch to 1 for mtdblocks and mmc
for i in `ls -1 /sys/block/mtdblock*` /sys/block/mmcblk0
do
echo 1 > $i/queue/iosched/fifo_batch
done
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /system/sdcard/sd;
if [ "$?" = 0 ];
then
busybox chown 1000:1000 /system/sd;
busybox chmod 771 /system/sd;
# clean up any old symlinks, create data directories
for i in dalvik-cache data;
do
if [ -h /data/$i ];
then
rm /data/$i;
fi;
if [ ! -d /data/$i ];
then
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
Updated. And to mount an ext partition you'd want to mount /dev/block/mmcblk1p2.
Got my ext mounted but haven't yet figured out how to get app data over to the external sd card without tons of force closes (I'm probably setting the permissions wrong).
anomalous3 said:
Updated. And to mount an ext partition you'd want to mount /dev/block/mmcblk1p2.
Got my ext mounted but haven't yet figured out how to get app data over to the external sd card without tons of force closes (I'm probably setting the permissions wrong).
Click to expand...
Click to collapse
Those were some examples not specifically for the Vibrant.
justanothercrowd said:
Those were some examples not specifically for the Vibrant.
Click to expand...
Click to collapse
I know I could tell by the echo 528000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
I was just sayin' though in case anyone was interested in making this work....too tired to mess with it anymore tonight.
anomalous3 said:
Updated. And to mount an ext partition you'd want to mount /dev/block/mmcblk1p2.
Got my ext mounted but haven't yet figured out how to get app data over to the external sd card without tons of force closes (I'm probably setting the permissions wrong).
Click to expand...
Click to collapse
I've been trying to get the ext partition to mount, but I keep getting errors from mount. This is just with "adb shell". I did "su", and have root. What command are you using? Does it only work from the userinit?
# mount /dev/block/mmcblk1p2 /system/sd
Usage: mount [-r] [-w] [-o options] [-t type] device directory
# mount -t auto /dev/block/mmcblk1p2 /system/sd
mount: No such device
# ls /dev/block/mmcblk1p2
/dev/block/mmcblk1p2
The device and mount directory do exist, so I'm a bit lost. I'll give it a go with the userinit hack and see if that gets things running.
EDIT: Nevermind, I forgot to do "busybox mount". grrrrr.. that works now.
EDIT2: Ummm... it mounts as a j4fs with a bunch of crap I've never seen on there. WTF?!? I didn't even know that filesystem existed.
maybe try
Code:
busybox mount -t ext3 /dev/block/mmcblk1p1 /system/sd
? I got it to mount and recognize the ext partition, my trouble was getting the data over to it. maybe a symlink isn't the best way to do it and I could try a bind mount.....
OK. I got it working, had to use mkfs.ext2 to re-format the ext partition. I have no idea what put that other crap there, but it wasn't me and formatting doesn't seem to have bothered anything.
Here's a rough draft of my userinit.sh. I have booted with it, and it seems to work fine. No warranty, obviously. It bind mounts /data/data to a directory on the ext partition, copying files if needed. It might do with some more cleanup and safety checking, but seems to work OK for me.
Speed wise, it seems to work pretty good.
Oh, you need to create the /system/sd directory yourself. I didn't add that in the script. remount rw and "mkdir /system/sd". A root file manager should be able to handle that as well, or add it to the script.
I've never had lag on my Vibrant so the lag fixes have always confused me a bit. Screwing with the phone is what its all about though.
well I'll be damned. It works. I wonder if we'll see an improvement from moving the dalvik-cache over too, seeing as how those are the actual executables for the applications.
[edit] It seems to have killed my mobile data connection.[/edit]
anomalous3 said:
well I'll be damned. It works. I wonder if we'll see an improvement from moving the dalvik-cache over too, seeing as how those are the actual executables for the applications.
Click to expand...
Click to collapse
Possibly. I haven't tried that yet. Maybe I'll toss it on and see. I did another version that moves the mount to /sd-ext like CM5. I'll add that in here, it automated, no need to make the mount point yourself. It feels a little more "standard" to have it there.
OK. For grins, I moved dalvik-cache as well. Here's the update, same mechanism. It feels like it might be a little faster, I'm not sure. I'll let everyone have a try at it and see what you think.
it works and data works too! Also seems noticeably quicker!
With your permission, I'd like to package this into an update.zip along with the userinit enabler (once you feel it's ready) so we can have a reliable way to get apps2sd working.
so with this userinit.sh we can apply the mimocan fix, not that i have noticed a hell lot of stalling but there is somewhat stalling after a while. only to make a great phone even better.
anomalous3 said:
it works and data works too! Also seems noticeably quicker!
With your permission, I'd like to package this into an update.zip along with the userinit enabler (once you feel it's ready) so we can have a reliable way to get apps2sd working.
Click to expand...
Click to collapse
just one question... why would we need a2sd? i remember when i had my mt3g and whenever i ran any sense rom or regular rom that a2sd slows it down significantly but when i stored everything on the phone it was way smoother and its not like we dont have the space..

[Q] ADB "No space left on device"

Hey guys
So I am currently running 2.3.3 on my N1. I manually flashed the update from Here. I used the "Modified GRI40".
So after update, I noticed that my adfree wasn't working. Running the app, it tells me my host file is up to date. However, no ads are being blocked. Same after uninstalling and re-installing the app. So then I decided to try to copy the host file over manually using adb.
I run adb and get root prompt. Then I mount /system as rw using
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
It appears to work. So then I try copying the host file to /system/etc using
Code:
cp hosts /system/etc
Then I get the following error.
"write error: No space left on device"
But i do, over 30mb of free space.
So I don't know what the issue is. Im thinking that maybe /system isn't being mounted as RW so it is giving the error??
Any help would be much appreciated.
Thanks!
Did you check the /system free space, or /data?
Try doing a df -h from the terminal to verify that you do, indeed, have free space on /system as well as /data, as Jack_R1 mentioned.
codesplice said:
Try doing a df -h from the terminal to verify that you do, indeed, have free space on /system as well as /data, as Jack_R1 mentioned.
Click to expand...
Click to collapse
Well looks like somehow I don't have any space left. I went to go download a terminal application from the market but it errored saying no space left.
So now I can't even install new apps.
However, under settings->storage it says I have 28MB of free space left.
Any ideas?
Sent from my Nexus One using XDA App
Reboot, wipe Dalvik cache.
Go to Manage Applications, clear browser cache.
If it restores you some space - great, proceed with what codesplice suggested above.
If it doesn't - backup, wipe and reflash.
If no backup installed - you're out of luck.
Since you seem to have adb functioning, you can run adb shell df -h to get a readout of your available space on your different file systems. This could help troubleshoot the issue.
Additionally, rather than doing a long manual "mount" command, you could simply do an adb remount to automagically remount all file systems in read/write mode.
The indication under Settings --> Storage indicates free space on /data, I believe, and gives no indication of /system (where you're trying to copy the hosts file).
Another thought (sorry this isn't really coherent at this point...): What if you were to remove your default hosts file and then push the new one?
Code:
> adb remount
Remount succeeded
> adb shell rm /system/etc/hosts
> adb push hosts /system/etc/hosts
> adb shell chmod 644 /system/etc/hosts
codesplice said:
Another thought (sorry this isn't really coherent at this point...): What if you were to remove your default hosts file and then push the new one?
Code:
> adb remount
Remount succeeded
> adb shell rm /system/etc/hosts
> adb push hosts /system/etc/hosts
> adb shell chmod 644 /system/etc/hosts
Click to expand...
Click to collapse
Well that's thing, that is why I started this thread because I was trying to use ADB to push a new hosts file but got the no space error. So I already tried that.
Sent from my Nexus One using XDA App
I was asking if you had specifically tried removing the old one and replacing it rather than just overwriting.
Oh I see what you mean. But no I have not, let me give it a shot.
**Nope didn't work. I still got the same error, no space left on device.
Have you had the opportunity to do adb shell df -h yet?
codesplice said:
Since you seem to have adb functioning, you can run adb shell df -h to get a readout of your available space on your different file systems. This could help troubleshoot the issue.
Additionally, rather than doing a long manual "mount" command, you could simply do an adb remount to automagically remount all file systems in read/write mode.
The indication under Settings --> Storage indicates free space on /data, I believe, and gives no indication of /system (where you're trying to copy the hosts file).
Another thought (sorry this isn't really coherent at this point...): What if you were to remove your default hosts file and then push the new one?
Code:
> adb remount
Remount succeeded
> adb shell rm /system/etc/hosts
> adb push hosts /system/etc/hosts
> adb shell chmod 644 /system/etc/hosts
Click to expand...
Click to collapse
No to hijack this thread, but I just wanted to ask, does "adb remount" require root?
Brownbay said:
No to hijack this thread, but I just wanted to ask, does "adb remount" require root?
Click to expand...
Click to collapse
yes, without root access to the filesystem, adb remount will fail.
So when I try adb shell df -h, I get:
"-h: No such filesystem or directory"
You don't have busybox. Try running "adb shell df", maybe it'll still give some info.
Ok when I ran adb shell df I got a listing of filesystems. /system says size 145M and used 145M. So apparently it is full.
How could that be though?
It could be that you have some bad blocks on your /system partition (you can generally only check by doing a wipe operation in recovery and then viewing the log). These bad blocks could take up space that would otherwise store your system data, and could push you over capacity.
Or you could just have some extra bloat related to that ROM. You could drive to remove some of the applications on /system that you don't have use for (the Amazon MP3 thing, for instance). I'd suggest using Titanium Backup to do this, but you can also do it by manually using the adb shell.
Alternatively, a full wipe and clean reinstall may help make sure you don't have anything left over taking up space.
I'm thinking about just flashing a new ROM altogether as I am also having issues with the battery. Under usage, Android OS now shows somewhere around 35% of the usage. This only started happening after updating to 2.3.3.
I've always ran stock ROMs, so I haven't played with any of the custom ROMs out there. Are there any ROMs you recommend for a first timer?
*Sidenote* So a nandroid backup is a complete backup of the system state correct?
So after flashing a ROM, I can just restore the nandroid backup and my phone will be exactly as it was with the old ROM and user data?
decoyjoe said:
I'm thinking about just flashing a new ROM altogether as I am also having issues with the battery. Under usage, Android OS now shows somewhere around 35% of the usage. This only started happening after updating to 2.3.3.
I've always ran stock ROMs, so I haven't played with any of the custom ROMs out there. Are there any ROMs you recommend for a first timer?
*Sidenote* So a nandroid backup is a complete backup of the system state correct?
So after flashing a ROM, I can just restore the nandroid backup and my phone will be exactly as it was with the old ROM and user data?
Click to expand...
Click to collapse
I've been really impressed with the Kang-o-rama ROMs. Basically prettied-up versions of Cyanogen. The latest release is a beta based on CM7, so still has a few issues. The prior release (KOR 1.1Final) is still quite solid.
And yes, a nandroid backup creates a copy of your current disk image, which can then be restored at any time to revert back to a previously-working configuration (great for when you break stuff!).
decoyjoe said:
I'm thinking about just flashing a new ROM altogether as I am also having issues with the battery. Under usage, Android OS now shows somewhere around 35% of the usage. This only started happening after updating to 2.3.3.
I've always ran stock ROMs, so I haven't played with any of the custom ROMs out there. Are there any ROMs you recommend for a first timer?
*Sidenote* So a nandroid backup is a complete backup of the system state correct?
So after flashing a ROM, I can just restore the nandroid backup and my phone will be exactly as it was with the old ROM and user data?
Click to expand...
Click to collapse
Exactly Remember to wipe before restoring
Oh and that brings up another thought.
So if before I flash a new ROM, I do a Titanium Backup and then flash the ROM...
Would I then be able to restore that Titanium Backup made on the previous stock ROM to restore all my apps and user data?

[Q] busybox and nandroid issues

I have been experimenting with my new droid/milestone the past couple of days, odd problems which I am past now but still curious about.
Firstly after flashing the 2.1 sbf with rsd it will autoboot and screen slider will be there, then when I reboot, screen slider will be missing. This only happend when I flashed an sbf from the sbf site(2.1 uk version, not service), doing a factory reset didn't have any problem -could reboot as many times and slider would be there.... then suddenly after factory boot it would dissapear after first boot. Anyway solved this problem by installing screen mode widget after first boot after flash, solved problem, but still weird. Fixed this now but still curious about it.
Next, nandroid backup is missing from recovery menu, I have rooted and can execute root commands after typing "su" via Android Terminal emulator, so pretty sure is rooted. So why no nandroid? I thought I could do nandroid backup after rooting.
Next busybox won't install, tried the app, did the "searching system" for over an hour(not exagerrating), eventually gave up and uninstalled.
Trying to do a "manual busybox install" now, using this guide:
Busybox How-to? - Android Forums
Can't execute commands via usb/adb in recovery mode as the other guy suggested so been trying these commands both with terminal emulator on phone, and usb-debugging mode with windows shell. Using these I can go "su" and type "ls" to see files on my droid phone....but when I try to "mount /system" or /sdcard from windows I just get a print about mount options, when I try to "cat /sdcard/busybox > /system/xbin/busybox" I get a "file is read only" error.
I would like advice on how to install busybox, I would like to do it manually(because the app seems to not work for me, remember I waited over an hour while it "searched") and I want to learn to manually do stuff anyway. I tried to chmod /system/xbin too, but that didn't seem to change it from read only.
Also any thoughts on why nandroid backup is missing from my recovery menu even though my droid is rooted. I thought it was meant to appear.
I am still learning and researching, and appreciate any links or tips.
droidtech1 said:
Next, nandroid backup is missing from recovery menu, I have rooted and can execute root commands after typing "su" via Android Terminal emulator, so pretty sure is rooted. So why no nandroid? I thought I could do nandroid backup after rooting.
Click to expand...
Click to collapse
This is odd. Which OpenRecovery did you install? Androidiani? GOT? Or the "original" OpenRecovery? Are you aware, that you come into OpenRecovery by starting Recovery Mode and apply update.zip?
droidtech1 said:
Next busybox won't install, tried the app, did the "searching system" for over an hour(not exagerrating), eventually gave up and uninstalled.
Trying to do a "manual busybox install" now, using this guide:
Busybox How-to? - Android Forums
Click to expand...
Click to collapse
Using the app from the market worked like a charm for me. No idea, what might have gone wrong for you...
droidtech1 said:
Can't execute commands via usb/adb in recovery mode as the other guy suggested so been trying these commands both with terminal emulator on phone, and usb-debugging mode with windows shell. Using these I can go "su" and type "ls" to see files on my droid phone....but when I try to "mount /system" or /sdcard from windows I just get a print about mount options, when I try to "cat /sdcard/busybox > /system/xbin/busybox" I get a "file is read only" error.
Click to expand...
Click to collapse
For remounting, try "mount -o rw,remount /dev/block/mtdblock6 /system" and for undoing this, use "ro" instead of "rw".
droidtech1 said:
I would like advice on how to install busybox, I would like to do it manually(because the app seems to not work for me, remember I waited over an hour while it "searched") and I want to learn to manually do stuff anyway. I tried to chmod /system/xbin too, but that didn't seem to change it from read only.
Click to expand...
Click to collapse
You should download busybox and put the "busybox"-file in the directory /sdcard. After that do:
Code:
# su
# mount -o rw,remount /dev/block/mtdblock6 /system
# cp /sdcard/busybox /system/xbin
# cd /system/xbin
# chmod 755 busybox
# ./busybox --install
# mount -o ro,remount /dev/block/mtdblock6 /system
One thought at the end: How did you root?
I rooted by flashing "vunerable recovery" using RSD lite, copied milestone-root.zip to sd card, renamed it update.zip, rebooted into recovery mode, flashed update.zip from there.
I didn't realise I had to install something like open recovery, think because I remember not having to do that on my pulse? Anyway will try and install one of those now.
Thanks those commands at the end helped, actually managed to copy busybox to /system/xbin, however the 2nd last one "./busybox --install" gave me a load of errors -all being no such file or directory, for example "/usr/bin/wc: no such file"
about 30 of those path errors. Maybe the command path "./busybox" needs to be something else?
ah, okay. sorry, I thought you already installed an openrecovery. for many cool features you will need it (e.g. nandroid, for overclocking it's not a must but a nice-to-have). please don't use GOT, it's rather old already. androidiani is okay, I think.
I think your previous attempts to install busybox via the app etc. mixed up some internal links in the device. please reboot and try again (the above steps except the "cp ..."). seems like the app tried to install busybox to /usr/bin but failed... I hope this failed attempt will be fixed by a simple reboot. otherwise it would be great to have the output of:
Code:
# su
# ls /usr/bin
No I re-flashed my main sbf and also did a factory reset to do a clean start, only thing since that full wipe I have done is rooting in the method I described, installed the screenmode widget, textedit, and android terminal emulator.
I have no such file /usr, are you sure I should have this in droid/milestone?
Here is my full output of my root system using ls:
tmp
pds
cdrom
sqlite_stmt_journals
config
cache
sdcard
d
etc
system
sys
sbin
proc
init_prep_keypad.sh
init.rc
init.mapphone_umts.rc
init.mapphone_cdma.rc
init.goldfish.rc
init
default.prop
data
root
dev
perhaps "/usr" is a sub inside one of the above folders? I tried using "find" to find it but that command dosn't seem to work since it won't even find the ones I can see with ls
I found it, /usr is inside /system... so if busybox was moved to /system/xbin, I'm guessing the ./ means install it to the parent directory which was /system which /usr is also in.
The errors I got said no such file "/usr" so It seems like it is trying to install to the wrong directory.... perhaps the command should be "busybox --install" or "/busybox --install" I don't want to experiment and mess things up before your opinion on this.
*edit almost forgot, output of /system/usr is
keychars
bin
srec
keylayout
share
output of /system/usr/bin is
panic_daemon
gki_pd_notifier
nvm_daemon
clean_dex.sh
brcm_guci_drv
bplogd_daemon
This is really strange. Maybe your busybox-file is corrupt.
Where did you download the busybox-file?
Which sbf did you flash?
So for explanation-purposes: When you put an executable or script file in any directory, you can execute it by first making it executable ("chmod 755 /system/xbin/busybox"), changing to that directory ("cd /system/xbin") and then executing it by adding "./" in front of it. The dot slash always stands for the _current_ directory. The _parent_directory has two dots "../".
If you want, you may try:
# /system/xbin/busybox --install
instead of
# ./busybox --install
Or maybe try this one:
# /system/xbin/busybox --install -s /system/xbin
Last time, I installed busybox into the directory /data/busybox, which worked brilliantly, but this path turned out to be unpractical. So I wanted to reinstall it in a different directory. I removed everything from /data/busybox including the directory itself and tried to start the whole procedure with /system/xbin. But that time it protested, that there were no files in "/data/busybox/...". Conclusion: The last busybox-install affected the second one. When I remember correctly I rebooted after that and used the app from the market *g*
My main sbf I flashed was android 2.1(uk version).
I downloaded busybox 1.17.2(won't let me post url here), was from droidforums dot net.
I don't remember if I tried all of his commands, but the last one on that forum seems to have worked.. I think......... it was:
"busybox --install /system/xbin/"
After remounting with your commands and typing the above command, I didn't get any errors, I synced and rebooted and now when I "ls /system/xbin" it shows a bunch of files/names which look like busybox commands. When I type "busybox" it outputs a bunch of commands too... so I am guessing this means it has succesfully installed? I can't say I tried these before attempting install so I have no comparison but I assume I would have a different output if busybox wasn't installed.
So assuming it worked, why would
"busybox --install /system/xbin/" work, and
"/system/xbin/busybox --install" not?
I also managed to install open recovery and do a nandroid backup succesfully
I have another short question, not specific to android but happens in all terminals I use, windows and linux alike. Sometimes I cannot execute commands anymore and it just becomes text in the terminal(just re-echo'ing my text output, without executing any functions)... can't remember specifically when it happened on my windows or linux pc shells, but on my android it happens whenever I have to give "SU" permission to the terminal, I have to quickly close the terminal and reload it again to get su access. I'm sure there is a name for this "state" where you are locked out of using commands in the shell and just typing text but I can't find a way to get out of it(without closing and re-opening terminal), there must be some key combination to be able to execute commands again in the current terminal session. If you have any idea what I am talking about?
Thanks for all your help so far.
droidtech1 said:
My main sbf I flashed was android 2.1(uk version).
Click to expand...
Click to collapse
Don't want to try one of the 2.2?
droidtech1 said:
I downloaded busybox 1.17.2(won't let me post url here), was from droidforums dot net.
I don't remember if I tried all of his commands, but the last one on that forum seems to have worked.. I think......... it was:
"busybox --install /system/xbin/"
After remounting with your commands and typing the above command, I didn't get any errors, I synced and rebooted and now when I "ls /system/xbin" it shows a bunch of files/names which look like busybox commands. When I type "busybox" it outputs a bunch of commands too... so I am guessing this means it has succesfully installed? I can't say I tried these before attempting install so I have no comparison but I assume I would have a different output if busybox wasn't installed.
Click to expand...
Click to collapse
Yes, this sounds very much like installation was successful.
droidtech1 said:
So assuming it worked, why would
"busybox --install /system/xbin/" work, and
"/system/xbin/busybox --install" not?
Click to expand...
Click to collapse
typing "busybox" without the path in front of it worked, because busybox is in the directory /system/xbin, which is already in your $PATH-variable (try "echo $PATH"). So the command interpreter (shell) will automatically look up "busybox" in /system/xbin.
I had a look at the busybox syntax and it's actually
Code:
busybox --install [-s] [INSTALLDIR]
So you have to put the directory you want to install in at the end. That's what your last command makes use of
droidtech1 said:
I have another short question, not specific to android but happens in all terminals I use, windows and linux alike. Sometimes I cannot execute commands anymore and it just becomes text in the terminal(just re-echo'ing my text output, without executing any functions)... can't remember specifically when it happened on my windows or linux pc shells, but on my android it happens whenever I have to give "SU" permission to the terminal, I have to quickly close the terminal and reload it again to get su access. I'm sure there is a name for this "state" where you are locked out of using commands in the shell and just typing text but I can't find a way to get out of it(without closing and re-opening terminal), there must be some key combination to be able to execute commands again in the current terminal session. If you have any idea what I am talking about?
Click to expand...
Click to collapse
Sounds like this is just the state, when shell is busy, i.e. when the last process you started is still running and no prompt ($ or #) is displayed. You may kill the last process in linux using CTRL+C, which will hopefully bring back the shell prompt. No idea which shortcut replaces this on the milestone/droid. I never use any android terminals, but only the ADB-Shell: http://developer.android.com/guide/developing/tools/adb.html
I'm learning to build apps for android so I thought having 2.1 on my droid would be better for testing (instead of 2.2). I also have a Nexus-S with 2.3 and a tmobile-pulse with 1.5. So I want to keep the most native version on each phone since most consumers won't install custom roms, although some will get updates anyway.
I use my droid a lot when I am out and use the terminal a lot so having busybox too has given me more to play around with. I actually find my droid much better working on than the nexus s, love the keyboard and dpad.

Categories

Resources