[Motorola Droid X2] Moon Shadow - NM:
All right... I guess it's time to "ask the experts". My linux background has not been very much help here... ARGH!

Okay, I have two script that I have written that are supposed to mount /system as RO and RW respectively. Very simple:

To mount rw:

#!/system/bin/sh
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system

To mount ro:

#!/system/bin/sh
mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system

I manually ran the mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system command and adb pushed them to /system/xbin as mountro and mountrw and chmod both to 755.

In ADB I try to execute:

/system/xbin/mountrw

and get an error stating:

/system/xbin/mountrw: not found

I even try:

/system/bin/sh /system/xbin/mountrw

and I get this error:

mount: No such file or directory

Okay, so I figured out that it is having a problem trying to find the mount command, so I modify the script to:

#!/system/bin/sh
/system/bin/mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system

I then re-run this:

/system/bin/sh /system/xbin/mountrw

and I'm still getting this friggin' error message!

mount: No such file or directory

When I run it through Script Manager I get the same error:

mount: No such file or directory

This should just friggin' work damn it! (Sorry, very frustrated.)

Also, it would be nice NOT to have to type the path to the script. I can run ZepplinRox V6_SuperCharger script from the ADB command line just by typing from the directory I have it in:

sh V6_SuperCharger_for_Android-update9_RC3.2.sh

No absolute path, no ./ path... WTF? ARGH!

Okay, I KNOW this is friggin' possible just by the fact that I can run Zep's script in ADB...

So, any takers? Thanks in advanced...

Friggin' Ciao. :p

[EDIT]

Okay, I figured out a work around for this... I probably should not work on this after working at work all day... But, that is another story...

I have heavily modified the script files I have created. They are still called mountrw and mountro and the contents are as follows:

mountrw:

#!/system/bin/sh
# This mounts the /system file system as Read Write in order to modify or add
# files to the /system file system.
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null

mountro:

#!/system/bin/sh
# This mounts the /system file system as Read Only which is the default when
# Android is booted.
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null

So, after poking around in ZepplinRox's V6_SuperCharger script, I found those values repeated several times, so that helped point me in the right direction. The next problem I had was getting the scripts to "run from anywhere". I still haven't figured that one out yet, and the VERY MESSY solution to that is to put the two scripts in /. I know, I know, I know... that is the most dangerous place to put it.

So, when I first log into the ADB shell all I have to type is

sh mountrw

and when I'm done, type

sh mountro

So, As the work around, this works. I really don't recommend anyone else doing this because of the data security risks that you open your phone up to... Yes, I'm aware of them and that is why I am asking now for some help in having the ability to run a script globally, from anywhere in the android file structure. I don't mind typing the "sh" in front of the script since I sometimes must do that in linux. I have noticed that the $PATH of Android doesn't allow scripts to be executed unless you type the absolute path to the script, or are in the same directory as the script.

Okay, so again to ask: Is there any way to execute a script without having to type the absolute path to it? Thanks!

Ciao! (MUCH calmer now then when I first wrote this post...) :D

[/EDIT]