Jump to content

gscript lite eturning errors -testing a2sd


Guest theboxman

Recommended Posts

Guest theboxman

Hey all,

trying to test a2SD using gscript. I've tried both script versions posted - the simple non SU requiring one and the complicated one. Needless to say the desire is rooted with the most recent incarnation of the a2sd flashed as well.

From the complicated one I get this output:

stderr: sed: not found

APPS2SD is NOT working!

stderr: du: not found

stderr: sed: not found

stderr: du: not found

stderr: sed: not found

stderr du: not found

stderr: [: not found

stderr: arithmetic expression: syntax error: " + "
that's from the SU requiring script by PaulW21781I the code for which follows:
#!/system/bin/sh

  #Set all Paths to Check

  appsfld=/data/app

  appsprvfld=/data/app-private

  dalvikfld=/data/dalvik-cache

  #Get Sizes (even before checking)

  appsize=$(du -Lsh ${appsfld} | sed 's/\([0-9]*\)\(.*\)/\1/')

  appprivsize=$(du -Lsh ${appsprvfld} | sed 's/\([0-9]*\)\(.*\)/\1/')

  dcachesize=$(du -Lsh ${dalvikfld} | sed 's/\([0-9]*\)\(.*\)/\1/')

#Do the Magic!

if [ -h $appsfld ]; then

  echo -e "/data/app is a symlink.............OK ("$appsize"MB)"

  if [ -h $appsprvfld ]; then

	echo -e "/data/app-private is a symlink.....OK ("$appprivsize"MB)"

	if [ -h $dalvikfld ]; then

	  echo -e "/data/dalvik-cache is a symlink....OK ("$dcachesize"MB)"

	  echo -e "\nAPPS2SD is working with dalvik-cache!\n"

	  totalsize=$(( $appsize + $appprivsize ))

	  totalsize=$(( $totalsize + $dcachesize ))

	  echo -e "\nAPPS2SD is saving you "$totalsize"MB of Internal Mem"

	elif mount|grep dalvik-cache > /dev/null; then

	  echo -e "/data/dalvik-cache is a bind-mount.OK ("$dcachesize"MB)"

	  echo -e "\nAPPS2SD is working with dalvik-cache!\n"

	  totalsize=$(( $appsize + $appprivsize ))

	  totalsize=$(( $totalsize + $dcachesize ))

	  echo -e "\nAPPS2SD is saving you "$totalsize"MB of Internal Mem"

	else

	  echo -e "\nAPPS2SD is working without dalvik-cache!\n"

	  totalsize=$(( $appsize + $appprivsize ))

	  echo -e "\nAPPS2SD is saving you "$totalsize"MB of Internal Mem"

	  echo -e "\nYou could save a further "$dcachesize"MB by moving the"

	  echo -e "Dalvic-Cache across with the modified APPS2SD Script!"

	fi

  fi

else

echo APPS2SD is NOT working!

totalsize=$(( $appsize + $appprivsize ))

totalsize=$(( $totalsize + $dcachesize ))

echo -e "You could save "$totalsize"MB by using APPS2SD with"

echo -e "the Dalvik-Cache mod!"

fi

exit 0
The simpler script which doesn't require SU gives the output:
stderr: Syntax errror: "then" unexpected (expecting "f)i"
here is the code of the second script:
#!/system/bin/sh

if [ -h /data/app ]; then

  echo /data/app is a symlink...............OK

  if [ -h /data/app-private ]; then

	echo /data/app-private is a symlink.......OK

	if [ -h /data/dalvik-cache ]; then

	  echo /data/dalvik-cache is a symlink......OK

	  echo -e "\nAPPS2SD is working with dalvik-cache!\n"

	elif mount|grep dalvik-cache > /dev/null; then

	  echo /data/dalvik-cache is a bind-mount...OK

	  echo -e "\nAPPS2SD is working with dalvik-cache!\n"

	else

	  echo -e "\nAPPS2SD is working without dalvik-cache!\n"

	fi

  fi

else

echo APPS2SD is NOT working!

fi

exit 0

I suspect the problem is more likely related to gscript not functioning correctly than anything else?

Anyone any idea what's going on?

Edited by theboxman
Link to comment
Share on other sites

Guest theboxman

Help pretty please with a sugar on top?

Hey all,

trying to test a2SD using gscript. I've tried both script versions posted - the simple non SU requiring one and the complicated one. Needless to say the desire is rooted with the most recent incarnation of the a2sd flashed as well.

From the complicated one I get this output:

stderr: sed: not found

APPS2SD is NOT working!

stderr: du: not found

stderr: sed: not found

stderr: du: not found

stderr: sed: not found

stderr du: not found

stderr: [: not found

stderr: arithmetic expression: syntax error: " + "
that's from the SU requiring script by PaulW21781I the code for which follows:
#!/system/bin/sh

  #Set all Paths to Check

  appsfld=/data/app

  appsprvfld=/data/app-private

  dalvikfld=/data/dalvik-cache

  #Get Sizes (even before checking)

  appsize=$(du -Lsh ${appsfld} | sed 's/\([0-9]*\)\(.*\)/\1/')

  appprivsize=$(du -Lsh ${appsprvfld} | sed 's/\([0-9]*\)\(.*\)/\1/')

  dcachesize=$(du -Lsh ${dalvikfld} | sed 's/\([0-9]*\)\(.*\)/\1/')

#Do the Magic!

if [ -h $appsfld ]; then

  echo -e "/data/app is a symlink.............OK ("$appsize"MB)"

  if [ -h $appsprvfld ]; then

	echo -e "/data/app-private is a symlink.....OK ("$appprivsize"MB)"

	if [ -h $dalvikfld ]; then

	  echo -e "/data/dalvik-cache is a symlink....OK ("$dcachesize"MB)"

	  echo -e "\nAPPS2SD is working with dalvik-cache!\n"

	  totalsize=$(( $appsize + $appprivsize ))

	  totalsize=$(( $totalsize + $dcachesize ))

	  echo -e "\nAPPS2SD is saving you "$totalsize"MB of Internal Mem"

	elif mount|grep dalvik-cache > /dev/null; then

	  echo -e "/data/dalvik-cache is a bind-mount.OK ("$dcachesize"MB)"

	  echo -e "\nAPPS2SD is working with dalvik-cache!\n"

	  totalsize=$(( $appsize + $appprivsize ))

	  totalsize=$(( $totalsize + $dcachesize ))

	  echo -e "\nAPPS2SD is saving you "$totalsize"MB of Internal Mem"

	else

	  echo -e "\nAPPS2SD is working without dalvik-cache!\n"

	  totalsize=$(( $appsize + $appprivsize ))

	  echo -e "\nAPPS2SD is saving you "$totalsize"MB of Internal Mem"

	  echo -e "\nYou could save a further "$dcachesize"MB by moving the"

	  echo -e "Dalvic-Cache across with the modified APPS2SD Script!"

	fi

  fi

else

echo APPS2SD is NOT working!

totalsize=$(( $appsize + $appprivsize ))

totalsize=$(( $totalsize + $dcachesize ))

echo -e "You could save "$totalsize"MB by using APPS2SD with"

echo -e "the Dalvik-Cache mod!"

fi

exit 0
The simpler script which doesn't require SU gives the output:
stderr: Syntax errror: "then" unexpected (expecting "f)i"
here is the code of the second script:
#!/system/bin/sh

if [ -h /data/app ]; then

  echo /data/app is a symlink...............OK

  if [ -h /data/app-private ]; then

	echo /data/app-private is a symlink.......OK

	if [ -h /data/dalvik-cache ]; then

	  echo /data/dalvik-cache is a symlink......OK

	  echo -e "\nAPPS2SD is working with dalvik-cache!\n"

	elif mount|grep dalvik-cache > /dev/null; then

	  echo /data/dalvik-cache is a bind-mount...OK

	  echo -e "\nAPPS2SD is working with dalvik-cache!\n"

	else

	  echo -e "\nAPPS2SD is working without dalvik-cache!\n"

	fi

  fi

else

echo APPS2SD is NOT working!

fi

exit 0

I suspect the problem is more likely related to gscript not functioning correctly than anything else?

Anyone any idea what's going on?

Link to comment
Share on other sites

Guest theboxman
Help pretty please with a sugar on top?

Anyone with a bit of shell scripting proficiency spy the problem???

Link to comment
Share on other sites

Guest theboxman

114 views and no replies?

Some memebers have managed this so it's likely someone must have some idea how to get this working!

Or is there another way to test a2sd via adb connection to linux computer or something?

Edited by theboxman
Link to comment
Share on other sites

  • 2 weeks later...
Guest andycted

Did you find out a solution ? Same happens to me !

[EDIT] maybe I've found it, I've copied and pasted the script on a pc then moved the file to the sd

Edited by andycted
Link to comment
Share on other sites

Guest myth1001
Did you find out a solution ? Same happens to me !

[EDIT] maybe I've found it, I've copied and pasted the script on a pc then moved the file to the sd

I had the same error when I first tried to install app2sd on my rooted Desire.

It turned out that i used the wrong app2sd file, I used the upgrade version instead of the fresh one.

just to point out in case you did the same mistake as me.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.