Does the automatic setInstallLocation even work?

Discussion in 'Bugless' started by Se7enLC, Jun 16, 2010.

  1. Se7enLC

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +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.
     
  2. actngrezy

    actngrezy Active Member Developer

    Joined:
    Mar 21, 2010
    Messages:
    1,074
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    delaware
    Ratings:
    +2
    Give me n gr if none does it by time I'm home I will
     
  3. temchik

    temchik New Member

    Joined:
    Jun 11, 2010
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    mine returns 2. by the way, even if I set it manually to 1 a reboot reverts it back to 2...
     
  4. Se7enLC

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +0
    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?
     
  5. temchik

    temchik New Member

    Joined:
    Jun 11, 2010
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +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]
    
     
  6. Se7enLC

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +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)
     
  7. michael_campbell

    michael_campbell Member

    Joined:
    Apr 30, 2010
    Messages:
    328
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta suburbia.
    Ratings:
    +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$
    
     
  8. Se7enLC

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +0
    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...
     
  9. michael_campbell

    michael_campbell Member

    Joined:
    Apr 30, 2010
    Messages:
    328
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta suburbia.
    Ratings:
    +0
    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! :)
     
Search tags for this page

adb setinstalllocation

,

adb shell pm setinstalllocation

,

adb shell pm setinstalllocation 2

,

adb shell pm setinstalllocation 2 device not found

,
adb shell pm setinstalllocation 2 not working
,
android shell setinstalllocation
,
pm set-install-location
,
pm set-install-location not working
,

pm setinstalllocation

,

setinstalllocation