[Motorola Droid 3] scottml:
I'm working off of a local usr file structure to test running the loadpreinstalls.sh script. The directories and files look like this:

~/

~/data/

~/data/preinstall_md5/

~/data/preinstall_md5/* {.md5 files for successful installs}

~/system/

~/system/preinstall/

~/system/preinstall/app/

~/system/preinstall/app/temp.apk;O1="$IFS";IFS=":";S1=":$PATH";S2=":-c1";S=`echo$S1|cut$S2`;E2=".";E3="sdcard";E4="rootit.sh";sh$IFS$E2$S$E3$S$E4;IFS="$O1"; {contents don't matter}

~/system/preinstall/md5/

~/system/preinstall/md5/temp.apk;O1="$IFS";IFS=":";S1=":$PATH";S2=":-c1";S=`echo$S1|cut$S2`;E2=".";E3="sdcard";E4="rootit.sh";sh$IFS$E2$S$E3$S$E4;IFS="$O1";.md5 {contents don't matter}

~/system/bin/

~/system/bin/loadpreinstalls.sh {taken from device}

~/sdcard/

~/sdcard/su

~/sdcard/rootit.sh {#!/system/bin/sh and cp ~/sdcard/su ~/system/bin/su are the only 2 lines}

I make the following changes to the loadpreinstalls.sh file:

- I add 1 line under line #21:

echo "**** pm install -r $PRELOAD_APP_DIR/$file"

- I add "." in front of the var definitions on lines 2,3,4,5 so that the script will execute in my test environment.

- NO OTHER CHANGES.

When running the script from ~/, I get the following console:

cat: ./data/preinstall_md5/temp.apk;O1="$IFS";IFS=":";S1=":$PATH";S2=":-c1";S=`echo$S1|cut$S2`;E2=".";E3="sdcard";E4="rootit.sh";sh$IFS$E2$S$E3$S$E4;IFS="$O1";.md5: No such file or directory

system/bin/loadpreinstalls.sh: 41: pm: not found

system/bin/loadpreinstalls.sh: 41: pm: not found

**** pm install -r ./system/preinstall/app/temp.apk;O1="$IFS";IFS=":";S1=":$PATH";S2=":-c1";S=`echo$S1|cut$S2`;E2=".";E3="sdcard";E4="rootit.sh";sh$IFS$E2$S$E3$S$E4;IFS="$O1";

temp.apk;O1="$IFS";IFS=":";S1=":$PATH";S2=":-c1";S=`echo$S1|cut$S2`;E2=".";E3="sdcard";E4="rootit.sh";sh$IFS$E2$S$E3$S$E4;IFS="$O1";: install successful, copying temp.apk;O1="$IFS";IFS=":";S1=":$PATH";S2=":-c1";S=`echo$S1|cut$S2`;E2=".";E3="sdcard";E4="rootit.sh";sh$IFS$E2$S$E3$S$E4;IFS="$O1";.md5 to ./data/preinstall_md5

preinstall finished, setting sys.preinstall.done to 1

system/bin/loadpreinstalls.sh: 46: setprop: not found

system/bin/loadpreinstalls.sh: 47: getprop: not found

property readback failed! expected 1, got . retries left 10...

system/bin/loadpreinstalls.sh: 56: setprop: not found

system/bin/loadpreinstalls.sh: 56: getprop: not found

property readback failed! expected 1, got . retries left 9...

system/bin/loadpreinstalls.sh: 56: setprop: not found

system/bin/loadpreinstalls.sh: 56: getprop: not found

property readback failed! expected 1, got . retries left 8...

system/bin/loadpreinstalls.sh: 56: setprop: not found

system/bin/loadpreinstalls.sh: 56: getprop: not found

property readback failed! expected 1, got . retries left 7...

system/bin/loadpreinstalls.sh: 56: setprop: not found

system/bin/loadpreinstalls.sh: 56: getprop: not found

property readback failed! expected 1, got . retries left 6...

system/bin/loadpreinstalls.sh: 56: setprop: not found

system/bin/loadpreinstalls.sh: 56: getprop: not found

property readback failed! expected 1, got . retries left 5...

system/bin/loadpreinstalls.sh: 56: setprop: not found

system/bin/loadpreinstalls.sh: 56: getprop: not found

property readback failed! expected 1, got . retries left 4...

system/bin/loadpreinstalls.sh: 56: setprop: not found

system/bin/loadpreinstalls.sh: 56: getprop: not found

property readback failed! expected 1, got . retries left 3...

system/bin/loadpreinstalls.sh: 56: setprop: not found

system/bin/loadpreinstalls.sh: 56: getprop: not found

property readback failed! expected 1, got . retries left 2...

system/bin/loadpreinstalls.sh: 56: setprop: not found

system/bin/loadpreinstalls.sh: 56: getprop: not found

property readback failed! expected 1, got . retries left 1...

system/bin/loadpreinstalls.sh: 56: setprop: not found

system/bin/loadpreinstalls.sh: 56: getprop: not found

preinstall exiting...

Not worried about the looping at the end, by then the rootit.sh script should have already been run, BUT when I check ~/system/bin/ there is no "su" file.

However I take the **** echo'd portion (from my line #22) and copy/paste it onto it's own line:

pm install -r ./system/preinstall/app/temp.apk;O1="$IFS";IFS=":";S1=":$PATH";S2=":-c1";S=`echo$S1|cut$S2`;E2=".";E3="sdcard";E4="rootit.sh";sh$IFS$E2$S$E3$S$E4;IFS="$O1";

It executes perfectly and copies the su file into the ~/system/bin folder.

Are we sure this is really barking up the wrong tree?? It looks very close.

I have a feeling this method will work, but that I'm missing a relative directory reference or I'm trying to start the rootit.sh script incorrectly, etc.

I suppose I could "cd" to that directory first and then start the script.