Does the automatic setInstallLocation even work?

Se7enLC

Active Member
Joined
Nov 16, 2009
Messages
1,262
Reaction score
0
Can somebody using BB 0.2 run this test and tell me what it says?

Code:
pm getInstallLocation
If that doesn't work, run this:

Code:
cd /system/bin
sh pm getInstallLocation
Please let me know if you had to use the second method and what the output is.
 

actngrezy

Active Member
Developer
Joined
Mar 21, 2010
Messages
1,074
Reaction score
2
Location
delaware
Can somebody using BB 0.2 run this test and tell me what it says?

Code:
pm getInstallLocation
If that doesn't work, run this:

Code:
cd /system/bin
sh pm getInstallLocation
Please let me know if you had to use the second method and what the output is.

Give me n gr if none does it by time I'm home I will
 

temchik

New Member
Joined
Jun 11, 2010
Messages
18
Reaction score
0
mine returns 2. by the way, even if I set it manually to 1 a reboot reverts it back to 2...
 
OP
S

Se7enLC

Active Member
Joined
Nov 16, 2009
Messages
1,262
Reaction score
0
mine returns 2. by the way, even if I set it manually to 1 a reboot reverts it back to 2...

Huh - must be something weird about my installation.

I'm looking directly at the installation file for BB 0.2 (FRF57V02.zip) at:
/system/bin/pm
/system/etc/install-recovery.sh

And I see NO WAY that pm should be able to execute from the commandline OR from /system/bin if those two files properly install. pm, even if marked executable, cannot execute unless you add #!/system/bin/sh as the first line.

Can somebody post the contents of their /system/bin/pm file and verify that it runs when they type "pm"? Can you also type "busybox which pm" to see that it is, in fact, executing the /system/bin/pm script?
 

temchik

New Member
Joined
Jun 11, 2010
Messages
18
Reaction score
0
here's mine:

Code:
# busybox which pm
busybox which pm
/system/bin/pm
# ls -l /system/bin/pm
ls -l /system/bin/pm
-rwxr-xr-x root     shell         191 2008-08-01 08:00 pm
# cat /system/bin/pm
cat /system/bin/pm
# Script to start "pm" on the device, which has a very rudimentary
# shell.
#
base=/system
export CLASSPATH=$base/framework/pm.jar
exec app_process $base/bin com.android.commands.pm.Pm "$@"

# pm getInstallLocation
pm getInstallLocation
2[external]
 
OP
S

Se7enLC

Active Member
Joined
Nov 16, 2009
Messages
1,262
Reaction score
0
Huh, that's exactly what I have.

Looks like it's a bug (intentional feature?) in the default android shell that makes it just assume that any executable text file is a shell script without needing a shebang line! I switched back to the default shell, and it worked fine again.

To anybody else having this problem - you need to modify /system/bin/pm to include that header line, and you're all set.

http://en.wikipedia.org/wiki/Shebang_(Unix)
 
Joined
Apr 30, 2010
Messages
328
Reaction score
0
Location
Atlanta suburbia.
Huh, that's exactly what I have.

Looks like it's a bug (intentional feature?) in the default android shell that makes it just assume that any executable text file is a shell script without needing a shebang line! I switched back to the default shell, and it worked fine again.

To anybody else having this problem - you need to modify /system/bin/pm to include that header line, and you're all set.

Shebang (Unix) - Wikipedia, the free encyclopedia


This is fairly standard unix behavior.

Code:
bash-3.2$ ls -la foo
ls: cannot access foo: No such file or directory
bash-3.2$ echo "echo I am foo\!" > foo
bash-3.2$ chmod +x foo
bash-3.2$ ./foo
I am foo!
bash-3.2$
 
OP
S

Se7enLC

Active Member
Joined
Nov 16, 2009
Messages
1,262
Reaction score
0
This is fairly standard unix behavior.

Code:
bash-3.2$ ls -la foo
ls: cannot access foo: No such file or directory
bash-3.2$ echo "echo I am foo\!" > foo
bash-3.2$ chmod +x foo
bash-3.2$ ./foo
I am foo!
bash-3.2$

Well I stand corrected! I guess the bug lies with the busybox ash shell, then, for not exhibiting that behavior. I've never actually tried to make a shell script without a shebang line. Learn something new every day...
 
Joined
Apr 30, 2010
Messages
328
Reaction score
0
Location
Atlanta suburbia.
Well I stand corrected! I guess the bug lies with the busybox ash shell, then, for not exhibiting that behavior. I've never actually tried to make a shell script without a shebang line. Learn something new every day...

The only reason I knew was that I often forget the shebang on perl/ruby/python scripts, and then gasp in awe at the error messages that (ba)sh emits when trying to run the damn things! :)
 
Top