Jump to content

Dangerous problem with app2sd (SOLVED , bug is repaired)


Guest joestone

Recommended Posts

Guest joestone

app2sdgt540_2_1.en_.zipHi Guys !

Use the autoapp2sd from arekl1988r . The bug is repaired in this version.

http://android.modaco.com/index.php?s=&amp...t&p=1431781

Or if you want to use the gscript version download the zip and use the script from the extracted zip.

I have found a problem with the app2sd . Both version has the same bug.

The normal 2.1 mounted volumes.

rootfs / rootfs ro 0 0

tmpfs /dev tmpfs rw,mode=755 0 0

devpts /dev/pts devpts rw,mode=600 0 0

proc /proc proc rw 0 0

sysfs /sys sysfs rw 0 0

/dev/block/mtdblock6 /data yaffs2 rw 0 0

/dev/block/mtdblock1 /cache yaffs2 rw,nosuid,nodev 0 0

tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0

/dev/block/mtdblock4 /system yaffs2 ro 0 0

/dev/block/mtdblock5 /lgdrm yaffs2 rw,nosuid,nodev 0 0

The normal 1.6 mounted volumes .

rootfs / rootfs ro 0 0

tmpfs /dev tmpfs rw,mode=755 0 0

devpts /dev/pts devpts rw,mode=600 0 0

proc /proc proc rw 0 0

sysfs /sys sysfs rw 0 0

/dev/block/mtdblock8 /data yaffs2 rw,nosuid,nodev 0 0

/dev/block/mtdblock3 /cache yaffs2 rw,nosuid,nodev 0 0

tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0

/dev/block/mtdblock6 /system yaffs2 ro 0 0

/dev/block/mtdblock7 /lgdrm yaffs2 rw,nosuid,nodev 0 0

/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=

1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,s

hortname=mixed,utf8 0 0

The a2sd script posted by me :

mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system

cat /sdcard/app2sd/busybox > /system/bin/busybox && chmod 700 /system/bin/busybox ;

umount /system/sdcard ;

mkdir /system/sdcard ;

mount -t ext2 /dev/block//vold/179:2 /system/sdcard

if busybox [ $? = "0" ] ;

then

echo "partycja ext2 zamontowana , kopiuje aplikacje" ;

mv /system/bin/vold /system/bin/vold2 ;

cat /sdcard/app2sd/vold > /system/bin/vold && chmod 777 /system/bin/vold ;

cat /sdcard/app2sd/vold.sh > /system/etc/vold.sh && chmod 777 /system/etc/vold.sh ;

sync ;

busybox cp -r -p /data/app /system/sdcard ;

busybox cp -r -p /data/dalvik-cache /system/sdcard ;

echo "gotowe , mozna zrestartowac" ;

sync ;

else

echo "nie moge zamontowac partycji ext2 powracam do stanu pierwotnego" ;

rm -r /system/sdcard ;

rm /system/bin/busybox ;

fi

The app2sd script posted by RAT-BoyZ

#!/system/bin/sh

echo APPS2SD by Arekl1988r

mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system

cat /sdcard/app2sd/cp > /system/bin/cp && chmod 700 /system/bin/cp

cd /sdcard/app2sd

cat vold.sh > /system/etc/vold.sh && chmod 777 /system/etc/vold.sh

mkdir /system/sd

chown system.system /system/sd

mount -t ext2 /dev/block//vold/179:2 /system/sd

mkdir /system/sd/app

chown system.system /system/sd/app

mkdir /system/sd/dalvik-cache

chown system.system /system/sd/dalvik-cache

mkdir /system/sd/cache

chown system.system /system/sd/cache

cd /data/dalvik-cache

cp * /system/sd/dalvik-cache

rm *

cd /data/app

cp * /system/sd/app

rm *

cd /data

mount -o bind /system/sd/app /data/app

mount -o bind /system/sd/dalvik-cache /data/dalvik-cache

mount -o bind /system/sd/cache /cache

cd /system/bin

mv vold vold2

cd /sdcard/app2sd

cat vold > /system/bin/vold && chmod 777 /system/bin/vold

df

echo Aplikacje Dalvik-cache oraz Cache zostały przeniesione na kartę pamięci

echo telefon zresetuje się za 20 sekund

sleep 20

reboot

The problematic parts are bold. The original app2sd was made to 1.6 . and works as expected. Remounts the /system in rw mode . In the new OS the script tries to remount the already mounted /data volume to the /system volume. The phone is overriding the problem and mounts the root volume as rw. This has a problem , the phone stores its factory defaults in ro but because the / is rw it has the possibilty to rewrite it and of course will rewrite it . Normally this cause only 1 thing app2sd remains after factory defaults. In case of some trouble with your phone even if you not noticed yet will also be stored as factory default.After upgrade to your localized 2.1 I suggest to do a restore factory defaults and then run app2sd with the following modification :

mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system

Please correct me if my findings are not correct .

Sorry fo the inconvenience , but I was working on the root problem .

Edited by joestone
Link to comment
Share on other sites

Guest saeba_ryo

I believe you are correct, the phone's filesystem is slightly different in 2.1 than in 1.6, so the script needs adjusting. I applied app2sd only today, but I have still 1.6, I will wait for official 2.1 for my country, so I do not have that problem.

Link to comment
Share on other sites

Guest new123

So after using the old original version you uploaded, even after doing a factory reset apps2sd still remains on the phone??

I re flashed my phone with the Baltic 2.1 ROM, then did a factory reset, does this mean that parts of app2sd are still on my phone? I havent installed app2sd again, i currently just have the apps running off the internal memory.

And does the original, incorrect version actually cause any problems with running the app2sd being as it was remounting the wrong folder?

Edited by new123
Link to comment
Share on other sites

Guest joestone
So after using the old original version you uploaded, even after doing a factory reset apps2sd still remains on the phone??

I re flashed my phone with the Baltic 2.1 ROM, then did a factory reset, does this mean that parts of app2sd are still on my phone? I havent installed app2sd again, i currently just have the apps running off the internal memory.

And does the original, incorrect version actually cause any problems with running the app2sd being as it was remounting the wrong folder?

Yes .

No after flash it will gone. But aftera simple factory reset parts of app2sd can remain on the phone using the old version.

It does not cause any problems. Only the system/app will contains the applications installed there , /system/bin will contains copied files .

Link to comment
Share on other sites

Guest joestone
This is not an issue because the system is mounted on the r / w just to create directories sd app and dalvik-cache

Yes if app2sd was run just after flash it is not an issue , but files and directories the script copies will remain after restore factory defaults and also all other modified files . While if only the /system is mounted in rw /system/etc/vold.sh will be removed and /system/bin/vold will be the original version after restore factory defaults.

Edited by joestone
Link to comment
Share on other sites

Guest kaball76
Yes if app2sd was run just after flash it is not an issue , but files and directories the script copies will remain after restore factory defaults and also all other modified files . While if only the /system is mounted in rw /system/etc/vold.sh will be removed and /system/bin/vold will be the original version after restore factory defaults.

so what happend if i do a factiry reset??? app2sd still making trouble on my phone....???

what i need to do for remove app2sd??

only a hard reset??

or do i need to reflash??

thks

Link to comment
Share on other sites

Guest joestone
so what happend if i do a factiry reset??? app2sd still making trouble on my phone....???

what i need to do for remove app2sd??

only a hard reset??

or do i need to reflash??

thks

app2sd remains after a factory reset with the original script .

It can cause troubles only if something was changed on the phone (some system files was modified before app2sd) and this changes do not work as expected restore factory defaults will not solve the problem because modified files remains on the phone .

If the original script was used the removal is possible. Restore the original vold (if you run the script only once you can find it in /system/bin as vold2) remove /etc/vold.sh . Restart the phone and if /data/app not mounted in /system/sd/app then remove /system/sd folder.

You can see on the first post what should be changed in app2sd script to be able to remove with the factory reset. Mount.../6 was the original and mount.../4 should be . AFter flash run the script with this modification . With the modification I suggested app2sd will be removed by a factory reset.

Link to comment
Share on other sites

Guest RAT-BoyZ

hi joestone,

i already try factory reset, and after factory reset. app2sd still running in my phone. but free space in "setting>sdcard & phone storage" is increase.

when i check in root explorer, /system/app > can't mount to sdcard. but when i check in /system/sd/ have 3 sub folder, app,dalvik-cache and cache.

totally, i dont feel the change after reset to factory.

Please give me advice for this case. what a problem if we still running in "mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system"

thank you

Link to comment
Share on other sites

Guest joestone
hi joestone,

i already try factory reset, and after factory reset. app2sd still running in my phone. but free space in "setting>sdcard & phone storage" is increase.

when i check in root explorer, /system/app > can't mount to sdcard. but when i check in /system/sd/ have 3 sub folder, app,dalvik-cache and cache.

totally, i dont feel the change after reset to factory.

Please give me advice for this case. what a problem if we still running in "mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system"

thank you

It' s not a problem if you want app2sd be permanent and you run it just after flashing new ROM to the phone. But running the script in the old way will cause app2sd and root will be the part of the factory defaults and must be removed manually . That is what I wrotte on my first post. What happens in the case of sd failure . Hard reset will not solve the problem because app2sd is a part of factory defaults and your folders are redirected which is also the part of the defaults . The phone itself will work (I think so) because vold according to vold.sh will mount them to /system/sd dir , but do you think is that normal for example if /data/dalvik-cache is working from /system/sd/dalvik-cache .

App2sd will copy /data/app not /system/app.

As many people want to unroot the phone I think this should also be reversable process via a factory reset . Just check if you run app2sd with "mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system" that is there a superuser app in the /system/app folder after factory reset without rooting the phone again meaning your factory default was overwriten. As Superuser app remains on the phone after factory reset , other unwanted settings can remain on the phone . You will see the 3 folders even if you run the script with "mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system"

but app2sd will not work after factory reset , superuser apk will be removed from /system/app .Of corse the 3 folder will be on the sdcard because it is not touched by flash and factory reset .

It is only my fault if I think overwritting factory defaults can be dangerous and sorry to bother you and other people .

My opinion is factory reset should put the phone as it was in the shop , without permanent root and app2sd.

Link to comment
Share on other sites

Guest joestone
so, how we solve this problem?

Can you explain in simply steps?

Use the autoapp2sd from arekl1988r . The bug is repaired in this version.

http://android.modaco.com/index.php?s=&amp...t&p=1431781

If you want it to do manually :

Simply edit the original script (app2sd.sh) and replace "mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system" line with "mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system"

and use the edited script with the original method.

If you already run the orginal script (with "mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system"

line) restoring factory defaults to its original state is possible only with reflashing the phone.

After reflash use the edited script to app2sd.

Edited by joestone
Link to comment
Share on other sites

Guest RAT-BoyZ
Use the autoapp2sd from arekl1988r . The bug is repaired in this version.

http://android.modaco.com/index.php?s=&amp...t&p=1431781

If you want it to do manually :

Simply edit the original script (app2sd.sh) and replace "mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system" line with "mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system"

and use the edited script with the original method.

If you already run the orginal script (with "mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system"

line) restoring factory defaults to its original state is possible only with reflashing the phone.

After reflash use the edited script to app2sd.

if i need repair my app2sd on my phone ,what can i do?

must be re-flash or only download app2sd from arekl1988r and running now?

Link to comment
Share on other sites

Guest kaball76

i used to have the app2sd installed but with the problem i flashed my phone ...now what to do??

install new app2sd with the fix??

or what to do??

Link to comment
Share on other sites

Guest joestone
i used to have the app2sd installed but with the problem i flashed my phone ...now what to do??

install new app2sd with the fix??

or what to do??

Install new app2sd with the fix.

Link to comment
Share on other sites

Guest joestone
if i need repair my app2sd on my phone ,what can i do?

must be re-flash or only download app2sd from arekl1988r and running now?

You have to reflash. Then use the repaired script.

Link to comment
Share on other sites

Guest joestone
Is it necessary to format ext2 partition? I think old data is still there after reflashing.

Yes , your old data is still there.

It will not cause any problem if you not format it. Your old apps will be on the phone without format. Some of them may require to reinstall , some of them will work without reinstall.

Link to comment
Share on other sites

Guest droidpereira
Use the autoapp2sd from arekl1988r . The bug is repaired in this version.

http://android.modaco.com/index.php?s=&amp...t&p=1431781

If you want it to do manually :

Simply edit the original script (app2sd.sh) and replace "mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system" line with "mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system"

and use the edited script with the original method.

If you already run the orginal script (with "mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system"

line) restoring factory defaults to its original state is possible only with reflashing the phone.

After reflash use the edited script to app2sd.

I prefer to do it manually and it works thanks for your help.

By the way i think app2sd auto doesn't work because don't get su

...

Link to comment
Share on other sites

Guest joestone
Can I just reflash my phone again with 2.1 baltic rom, then reroot then edit the old app2sd script and install it?..

Yes , this is the correct way.

Link to comment
Share on other sites

Guest joestone
I prefer to do it manually and it works thanks for your help.

By the way i think app2sd auto doesn't work because don't get su

...

I wrote my suggestions to arekl1988r last night to get su .

Link to comment
Share on other sites

Guest bloodlust8

ok thanks.. will do it later.. hopefully everything will be done in one try..

done..

how can I tell if I've done it correctly?

Edited by bloodlust8
Link to comment
Share on other sites

Guest RAT-BoyZ

hi joestone,

i already try to re-flash my phone. and i re-format partition ext2.

after flashing i got a root level again. And i re-app2sd with new method.

like this..

-adb shell

-su

-sh /sdcard/app2sd/app2sd.sh

app2sd.sh fill is...

i change mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system to mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system

and i'm try install app from market and success the app install to /system/SD.

And then,

i'm try to factory reset. after factory reset, the app2sd and root still running.

but... all app is removed.

yesterday, with my method i did factory reset and app2sd,root, and all app still running.

i think there are no major differences.

CMIIW....

Link to comment
Share on other sites

Guest joestone
hi joestone,

i already try to re-flash my phone. and i re-format partition ext2.

after flashing i got a root level again. And i re-app2sd with new method.

like this..

-adb shell

-su

-sh /sdcard/app2sd/app2sd.sh

app2sd.sh fill is...

i change mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system to mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system

and i'm try install app from market and success the app install to /system/SD.

And then,

i'm try to factory reset. after factory reset, the app2sd and root still running.

but... all app is removed.

yesterday, with my method i did factory reset and app2sd,root, and all app still running.

i think there are no major differences.

CMIIW....

It is strange . When you did the factory reset and not rooted the phone df still shows /data/app is mounted ?

Did su working ? I got permission denied message .

"but... all app is removed." for me it says /data/app is not mounted (as with running app2sd). After app2sd you will get back your old applications .

I do it this way :

Flash the phone .

Restore factory defaults.

run 1 click root.

run app2sd with the new line (gscript method , but both method does the same just in different ways) .

restart the phone.

df shows /data/app is mounted (app2sd running).

restore factory defaults

adb shell

su ( i got permission denied )

df shows only the standard volumes (app2sd not running).

ls /system/app does not lists superuser.apk

while with the original line after su Superuser app requests access. and df showed /data/app mounted.

Of course the root and app2sd scripts will work if you run it , but with the repaired line they will be removed from the phone with restore factory defaults and will not be a part of it.

Edited by joestone
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.