[Script] Turn off Apps2SD on CM 4.2+ - G1 Android Development

The script does a one time copy of the apps from /system/sd to /data for mytouch phones (since we don't need a2sd!). After that, a2sd is just disabled
Attachment: Update zip (takes about 20sec lol)
Pastebin: http://pastebin.com/d108b98f8
Rough info:
Cyanogen & Twisted A2SD modded for Hero (by Maxisma)
Remodified for CM 4.2+ by Wes Garner
This finds out if it is running on Magic or G1 and decides if A2SD is used or not
Mounts EXT for Magic and G1

Or you could just delete your ext2 partition...

but then no userinit

Didn't work for me. I have CM 4.2.5, downloaded mt3g-noa2sd-signed.zip and flashed it in recovery. Then when I rebooted I got to the CM bootscreen, after a few seconds the screen went black. I let it load for 45-60 minutes (watching tv) but nothing happened. Tried to flash again and the same thing.
ls -l in /data showed app and app-private was still linked to sd. I removed the links, made the directories and copied over the data from sd. Then it worked.

Kaptur said:
Didn't work for me. I have CM 4.2.5, downloaded mt3g-noa2sd-signed.zip and flashed it in recovery. Then when I rebooted I got to the CM bootscreen, after a few seconds the screen went black. I let it load for 45-60 minutes (watching tv) but nothing happened. Tried to flash again and the same thing.
ls -l in /data showed app and app-private was still linked to sd. I removed the links, made the directories and copied over the data from sd. Then it worked.
Click to expand...
Click to collapse
I'm having the same issue here, after flashing, I get Cyanogen boot screen and then it moves to black and sits there - since there's no way it's taking that long to copy the data, I'm guessing this script is broken as of 4.2.5.

From CyanogenMod Wiki http://wiki.cyanogenmod.com/index.php/Removing_Apps2SD
Removing Apps2SD
From CyanogenMod Wiki
Jump to: navigation, search
You'll probably have to re-install any paid apps (app-private) but normal apps should run fine after this.
For Terminal Emulator
Code:
su
mount -o rw,remount /system
Then proceed to the ADB instructions from after 'adb shell'
ADB Instructions
Code:
adb remount
adb shell
Code:
rm /data/app
mkdir /data/app
cp /system/sd/app/* /data/app/
rm /data/app-private
mkdir /data/app-private
cp -r /system/sd/app-private/* /data/app-private
rm /data/dalvik-cache
mkdir /data/dalvik-cache
reboot recovery
In Recovery Mode console, you will have to delete the ext partition:
Code:
parted /dev/block/mmcblk0
rm 2
quit
Note: If you had a 3rd partition for swap it will now be partition 2. Adjust your userinit.sh accordingly.
After rebooting, you can confirm that it worked by running:
ls -l /system
From Terminal Emulator (no need to remount/su) and you should see 'app' and 'app-private' as directories (and not app -> /system/sd/app).
Click to expand...
Click to collapse

yea oops, forgot to delete old symlinks on it

It doesn´t work for me...
I´m trying to disable A2sd because of my partition layout (Swap+Fat32) on my HTC Magic 32B but nothing happens after applying the update. My phone it just keeps in the bootloop forever....

Related

Apps on SD & Themes

I currently have RC33 w/ apps on SD card. If I installed a theme or converted to the RC33 Lite version, will that corrupt my phone?
creid2352 said:
I currently have RC33 w/ apps on SD card. If I installed a theme or converted to the RC33 Lite version, will that corrupt my phone?
Click to expand...
Click to collapse
RC33 Lite i believe will delete your link to the SD .. to accomplish the Lite version simply delete the media files on from the phone .. as for the themes .. you're on your own .. there are plenty of themes people have used that cause no problems .. but you may come across one that doesn't work properly
*Note: lite versions are only required if you're going to use a theme, on JF RC33 V1.41 and up
JFvMOD by LucidREM
-Seems to be the most popular version right now.
-Same as JF RC33 V1.42 except for a few added files to make APPS to SD really easy for everyone.
-Themes will not work on this unless you manually make it a "lite" version following the steps below
JF RC33 V1.42
-This version really only introduced a bug fix so Android Debug Bridge (adb) would work in recovery mode.
*A wipe shouldn't be necessary when updating to this version.*
* JF RC33 V1.42 (lite)
Same as the JF RC33 v1.41 (lite) version but has the bug fix of rc1.42
you can manually make your own lite version of the firmware by typing these commands
in the terminal emulator.
Code:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cp -rf /system/media /sdcard
rm -rf /system/media
shouldn't it be
Code:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cp -a /system/media /sdcard
rm -rf /system/media
ln -s /sdcard/media /system/media
Nitro212 said:
shouldn't it be
Code:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cp -a /system/media /sdcard
rm -rf /system/media
ln -s /sdcard/media /system/media
Click to expand...
Click to collapse
no need for the "ln -s" because the phone recognizes media on the /sdcard .. also the "cp -a" is not needed as the FAT32 does not recognize any permission settings from the files .. so you only need your method if you were to do something like moving it to EXT2:
#ln -s /system/sd/media /system/media
would then be necessary since the system does not automatically recognize the EXT2 partition
I have a question, i am going thru themes for competition and ran into one that is a full rc33 update. Is there any way to flash this without screwing up apps to sd? Can i put apps back to memory, flash, then reflash when im done and run copy.sh app script again, anyone?
Rinja said:
JFvMOD by LucidREM
-Seems to be the most popular version right now.
-Same as JF RC33 V1.42 except for a few added files to make APPS to SD really easy for everyone.
-Themes will not work on this unless you manually make it a "lite" version following the steps below
Click to expand...
Click to collapse
Im currently running Lucid's JFvMod and a comp theme on dxtop. Works flawlessly and have all the stock notifications .... Thanks Lucid!

Help me recover from flashing android screen

In the process of trying to move apps to the SD card, I've mucked something up.
I did:
cp -rp /data/data /system/sd/data
Then, just for safekeeping, I moved the /data/data directory to /data/data.test just in case.
I then did a symlink as follows:
ln -s /system/sd/data /data/data
Upon reboot, I get the flashing android screen. I do not have a nandroid backup (yeah, I know....I really should do that one of these days), but I think all my data should still be there. I just need to remove the symlink and move /data/data.test back to /data/data and all should be well.
How can I do this? Wish there was a sticky thread on how to recover from stuff like this. Digging through all these threads is time consuming and difficult.
well.. from y own experiencie while the phone is stuck on the android flashing screen i am able o access it from my pc using adb so try that
adb shell rm -rf /data/data
than rename data.test to data
adb shell mv /data/data.test /data/data
should work
Ah...didn't realize I could connect via adb at that stage....guess I should have tried it.
That did indeed work. Thanks!

Apps-to-SD in Recovery Terminal Tutorial(includes cache and dalvik-cache)

Alright, I've been posting this all over trying to help people figure out how to do this and figured it's time to make a dedicated thread. If at any point you get an error DON'T PROCEED. See if I referenced the error you're getting and, if so, do what I suggested. If not, post your error here and I'll try to get back to you ASAP.
NOTE: This can now also be done through my appstoSD app posted on this forum!!!! It will do everything for you.
This tutorial assumes you have:
A: A micro-sd card with 2 partitions, the first must be FAT32 and the second must be ext2.
B: Your phone must have one of the apps-to-sd ROM's installed.
C: Busybox installed into the /system/xbin directory. For steps on this please reference Darkrift's thread.
Before we start, let's make sure your phone is set up to handle this. Open up the terminal emulator app(available in the market) and type:
Code:
su
busybox df -h
If /system/sd doesn't appear, something is wrong. Either your sd card isn't partitioned correctly or your phone has a ROM that doesn't have apps to sd enabled. If /system/sd does show up then you're set and can start the tutorial
NOTE: Moving the cache is highly unstable and works for some people but not for most. I don't recommend trying unless you have a good idea of how to get your phone back to a usable state if it starts boot looping.
Now, for the first step you need to copy all the apps over to the sd card. To do this type(still in the terminal emulator)(The third and fourth lines are for cache to sd only):
Code:
busybox cp -a /data/app /system/sd/
busybox cp -a /data/app-private /system/sd/
busybox cp -a /data/dalvik-cache /system/sd/
busybox cp -a /data/data /system/sd/
exit
exit
Once the terminal emulator app closes, power off your phone. Then, turn it on in recovery mode by holding down the home button and then pressing the power button. Continue holding the home button until the "T-Mobile G1" icon goes away and a menu comes up. Then press Alt-x to go to recovery terminal. Press enter and a prompt should come up with a "#". Now type(If you only want your apps on your sd card and not the caches, skip steps 6-9)
Code:
mount data
rm -rf /data/app
ln -s /system/sd/app /data/app
rm -rf /data/app-private
ln -s /system/sd/app-private /data/app-private
rm -rf /data/data
ln -s /system/sd/data /data/data
rm -rf /data/dalvik-cache
ln -s /system/sd/dalvik-cache /data/dalvik-cache
reboot
And... you're all set! Your phone might take a while at the android screen since it has to populate the apps tray. If it lasts >5-10 minutes then something likely went wrong. Make sure you did all the steps correctly and if you did try the steps in the recovery terminal section of this tutorial again. If it still doesn't work, post here and we'll try to get it sorted out. That aside, enjoy having your apps on SD card and the permanent 72-73MB available!
EDIT: forgot the app-private directory. Thanks, LucidREM!!!
Maximus is the man.
[email protected] said:
Now, for the first step you need to copy all the apps over to the sd card. To do this type(still in the terminal emulator)(The second and third lines are for cache to sd only):
Code:
busybox cp -a /data/app /system/sd/
busybox cp -a /data/dalvik-cache /system/sd/
busybox cp -a /data/data /system/sd/
exit
exit
Once the terminal emulator app closes, power off your phone. Then, turn it on in recovery mode by holding down the home button and then pressing the power button. Continue holding the home button until the "T-Mobile G1" icon goes away and a menu comes up. Then press Alt-x to go to recovery terminal. Press enter and a prompt should come up with a "#". Now type(If you only want your apps on your sd card and not the caches, skip steps 4-7)
Code:
mount data
rm -rf /data/app
ln -s /system/sd/app /data/app
rm -rf /data/data
ln -s /system/sd/data /data/data
rm -rf /data/dalvik-cache
ln -s /system/sd/dalvik-cache /data/dalvik-cache
reboot
Click to expand...
Click to collapse
i see a missing step here .. what about /data/app-private
LucidREM said:
i see a missing step here .. what about /data/app-private
Click to expand...
Click to collapse
RIGHT! I keep forgetting that one cause that folder pisses me off and I move all the apps there to the normal app folder lol. Will fix in 5, 4, 3...
EDIT: 2,1,0
cp: cannot stat '/data/davlik-cache': no such file or directory
whats up?
NEVERMIND. i need to go back to spelling class.
I'm sure its been asked and answered but I'll ask again! I understand it can take quite a few minutes to boot but is this every time you reboot or just the first time?
Thanks
DynaMight said:
I'm sure its been asked and answered but I'll ask again! I understand it can take quite a few minutes to boot but is this every time you reboot or just the first time?
Thanks
Click to expand...
Click to collapse
just the first time. its moving all the apps and cache from phone to sd card during that first reboot.
won't that slow down the phone even more?
the first time takes much longer. Subsequent reboots are of normal duration, comparable to the standard build.
Smokuevo said:
won't that slow down the phone even more?
Click to expand...
Click to collapse
if you use a class six sdcard, the apps will load faster. i believe that class 6 flash media is faster than the phones flash.
stogchris81 said:
if you use a class six sdcard, the apps will load faster. i believe that class 6 flash media is faster than the phones flash.
Click to expand...
Click to collapse
Pushing (writing) a 2MB file through adp push seems a bit faster to the SDCARD compared to the internal memory.
-> rough average for SDCARD : 1200 KB/s
-> rough average for system storage : 1000 KB/s
Regarding pulling (reading), internal seems faster :
-> rough average for SDCARD : 1247 KB/s
-> rough average for system storage : 1250 KB/s
These tests are everything but serious.. This is using the famous SanDisk 8GB Mobile Ultra (class 6).
To conclude I'd say that speed is almost the same, sometimes a bit faster for SDCARD.
i have one question
i tried to read through the thread but it was waay to large and long
if u do install apps to the sd card
when u install a newer rom on it does that mean the apps are automatically installed once again? i would like to do this because haykuro's roms are released once a week and i dont like reinstalling apps over and over again...
bigballa said:
i have one question
i tried to read through the thread but it was waay to large and long
if u do install apps to the sd card
when u install a newer rom on it does that mean the apps are automatically installed once again? i would like to do this because haykuro's roms are released once a week and i dont like reinstalling apps over and over again...
Click to expand...
Click to collapse
Unfortunately the answer is "sorta". The apps will still be on your sd card in the same places you put them. BUT all the symlinks will be gone so it'll look like they all dissapeared. You'll have to repeat the recovery terminal part of the tutorial, but all the stuff before it will be unnecessary.
i keep getting /system/sd/app is not a directory but when i run mkdir /system/sd/app it says that the file already exists.
the one time i got adb to work i did the steps through it to get apps to sd but the i had to wipe my phone. do i have to do the steps in the first post or recreate the symlinks?
wizern23 said:
i keep getting /system/sd/app is not a directory but when i run mkdir /system/sd/app it says that the file already exists.
the one time i got adb to work i did the steps through it to get apps to sd but the i had to wipe my phone. do i have to do the steps in the first post or recreate the symlinks?
Click to expand...
Click to collapse
In terminal emulator do this:
Code:
su
cd /system/sd
ls -l[CODE]
And put what it says on the line with "app" in it here. If it says "app ->" and has something after the arrow(my guess would be /data/app) then you put the symlink the wrong way. Make sure you do ln -s /system/sd/app /data/app, not the other way around. Let me know what your results are
[email protected] said:
In terminal emulator do this:
Code:
su
cd /system/sd
ls -l[CODE]
And put what it says on the line with "app" in it here. If it says "app ->" and has something after the arrow(my guess would be /data/app) then you put the symlink the wrong way. Make sure you do ln -s /system/sd/app /data/app, not the other way around. Let me know what your results are[/QUOTE]
huh? can you repeat that because i didnt understand what you were saying
im at the first step anyway. and thats when it says /system/sd/app is not a directory. my other question is is do i have to use
rm -rf /data/app
rm -rf /data/dalvik-cache
rm -rf /data/app-private
to re-establish the symlinks or did the steps through adb i used get erased when i wiped it.
Click to expand...
Click to collapse
[email protected] said:
In terminal emulator do this:
Code:
su
cd /system/sd
ls -l[CODE]
And put what it says on the line with "app" in it here. If it says "app ->" and has something after the arrow(my guess would be /data/app) then you put the symlink the wrong way. Make sure you do ln -s /system/sd/app /data/app, not the other way around. Let me know what your results are[/QUOTE]
i had the same problem. it said /system/sd/app is not a directory even though it already existed. when i used your code above this was my result:
drwx----- root root 2009-04-12 20:11 lost+found
-rw-r--r-- system system 29303 2009-04-11 11:56 app
Click to expand...
Click to collapse
wizern23 said:
huh? can you repeat that because i didnt understand what you were saying
im at the first step anyway. and thats when it says /system/sd/app is not a directory. my other question is is do i have to use
rm -rf /data/app
rm -rf /data/dalvik-cache
rm -rf /data/app-private
to re-establish the symlinks or did the steps through adb i used get erased when i wiped it.
Click to expand...
Click to collapse
Umm I wouldn't proceed cause if /system/sd/app isn't a directory then you're gonna have lots of problems. I need to know what it says after you type
Code:
su
cd /system/sd/
ln -s
Specifically, there'll be a line of output that has the word "app" towards/at the end. I need to know what's in that line. If the line doesn't start with a 'd' then app isn't a directory and something happened and you need to remove /system/sd/app by typing this in the terminal emulator:
Code:
su
busybox rm -rf /system/sd/app
and then restart the process from the beginning.
it says that /system/sd/app is not a directory but when i do mkdir /system/sd/app it says the file already exists.
the line with app in it says
-rw-r--r-- system system 29303 2009-04-14 17:27 app.
okay removing that made it work.
[edit] Thank you so much. it finally worked. i now have 73mb free on the phone.
glad I could help. On a side note Apps to SD app is now live

I wiped and have the modded apps to sd 1.5 rom by Lucid, how do I restore my apps.

My apps are still on my sd card, how do I link them back to my phone, I had Jf's 1.5 I wiped after a bad theme install, now I moved to Lucids mod, and is there a way to recall my apps from my sd card again.
they should show up after symlinks are created again and a reboot........all of mine showed back up
just do the system links again and they should all come back, if it hangs try this:
Code:
adb remount
adb shell
cd /system/sd
mv app app1
mv app-private app-private1
do the sys link again busybox cp; rm -r ln -s, yada yada then restart ur phone
then do this
Code:
adb remount
adb shell
cd /system/sd/app1
install *.apk /data/app
wait for a while depending on how many apps u have then
Code:
cd /system/sd/app-private1
install *.apk /data/app-private
reboot
Will this method also add all your apps to the "My Downloads" section?
dasoccerbomb said:
Will this method also add all your apps to the "My Downloads" section?
Click to expand...
Click to collapse
No it will not. In order to have my downloalds back in the market you first have to backup the my downloads. Someone gave the instructions for this here
http://forum.xda-developers.com/showpost.php?p=3655174&postcount=44

[KERNELFIX] damageless/Fresh 2.0b2 kernel w/ Apps2sd REV 3

I have tested the following with the frest 2.1 2.0b2 build and it does enable Apps2SD.
Ver 3 now should work on fresh fine, and damageless (sometimes I found enabling apps2sd on damageless causes lockups at boot, these can be fixed by doing WIPE for DATA for now) :/
MAKE NANDROID BACKUP
This has been tested on: Fresh 2.0b2
ADDED INSTRUCTIONS TO ENABLE ON DAMAGELESS
Also this has been edited so the first few pages refer to the old style before I had signed zips working. xD
Flash the Update Zip Attached VIA recovery menu. That means copy it to the root of your sdcard (aka /sdcard/).
I tested this after a fresh wipe with a blank ext2 partition and one vfat (normal). I did not even boot it first run but you should be able to flash this on an existing rom. Others can test on other roms but I am using this for now on fresh 2.1 2.0b2.
Afterwards run the following after booting
FOR VER 3 SIGNED
Code:
[B]
adb remount
adb shell
cd /system/bin
ln -s /system/xbin/busybox /system/bin/sed
ls -l /system/bin/sed # make sure it exists
cd /
apps2sd on
# should say apps2sd enabled
reboot[/B]
FOR VER 1 SIGNED
Code:
[B]
adb remount
adb shell
cd /system/bin
busybox --install /system/bin
ls -l sed # make sure it exists
cd /
chmod 755 /system/bin/apps2sd
chmod 755 /system/xbin/apps2sd
apps2sd on
# should say apps2sd enabled
reboot[/B]
FOR VER 3 SIGNED for DAMAGELES
Code:
[B]
adb remount
adb shell
cd /
apps2sd on
# should say apps2sd enabled
# below fixes up the scripts generated by the 'apps2sd on' line.. who ever wrote that had it put DOS CR/LF on the ends and thats whats breaking APPS2SD on damageless!
cd /system/etc/init.d
dos2unix 04apps2sd
dos2unix 05userinit
reboot[/B]
Enjoy
Will this work on the other 2.1 ROMs?
I have only tested on fresh 2.1 2.0B . I would think that logically this should work on the other fresh 2.1 2.0 and perhaps Damageless's. As for darchstar's try it I havent run that rom in a few days.
kkruse said:
I have only tested on fresh 2.1 2.0B . I would think that logically this should work on the other fresh 2.1 2.0 and perhaps Damageless's. As for darchstar's try it I havent run that rom in a few days.
Click to expand...
Click to collapse
If someone could test this out and let me know if it works on my ROM then I would love to just use the same method to get it going with the author's permission (credit will be given).
i keep no space left on device when i do this command
cat /dev/zero > /dev/mtd/mtd2
networx2002 said:
i keep no space left on device when i do this command
cat /dev/zero > /dev/mtd/mtd2
Click to expand...
Click to collapse
same for me
cat: write error: No space left of device
If I remember right it is a different file than what he posted...
I will have to check.
Maybe you can help me w/ this... When I adb shell in recovery I get "/#" instead of "#" & I can't "mount -a"...
networx2002 said:
i keep no space left on device when i do this command
cat /dev/zero > /dev/mtd/mtd2
Click to expand...
Click to collapse
Another one with this issue.
Running Fresh 2.1 2.0b2 on a clean install.
Already have a partitioned SD card with apps installed (from fresh 1.1 rom)
Has anyone besides OP gotten this to work?
mrcharlesiv said:
Maybe you can help me w/ this... When I adb shell in recovery I get "/#" instead of "#" & I can't "mount -a"...
Click to expand...
Click to collapse
/# would mean you are adb into recovery......I think
Aye, / # means you are in recovery mode on the phone is all.
Not sure why you aren't able to mount -a. I'm curious if anyone has gotten this method to work yet..?
So I went ahead and did every step despite the errors it gave just to see what happens... It's booting....
EDIT: Seems like it worked. My internal memory dropped by a/b 20 megs and I'm reinstalling everything. Idk.
mrcharlesiv said:
So I went ahead and did every step despite the errors it gave just to see what happens... It's booting....
EDIT: Seems like it worked. My internal memory dropped by a/b 20 megs and I'm reinstalling everything. Idk.
Click to expand...
Click to collapse
K, I attempted to reboot and it hangs at the HTC screen, so I'm going to boot back into recovery and try to continue from the out of space error.
Last night I tried adding a2sd, e2fsck to /system/bin of Fresh and made a directory SD in /system
Then I added to the init.rc
on property:cm.filesystem.ready=1
class_start default
start a2sd
and
service a2sd /system/bin/logwrapper /system/bin/sh /system/bin/a2sd
disabled
oneshot
then mkbootimg and placed that boot.img into fresh's zip and resigned it.
It flashed ok. But still didn't take. I'm still learning, the stuff I did to iniit.rc I was just basically copying and pasting from other roms with a2sd init.rc's I was going to start a thread until I saw this one.
I was able to boot back into recovery and complete the setup past the out of space error (I still get it though) and reboot. It booted up, but apps are still installing to the internal memory, so it did not work.
mrcharlesiv said:
So I went ahead and did every step despite the errors it gave just to see what happens... It's booting....
EDIT: Seems like it worked. My internal memory dropped by a/b 20 megs and I'm reinstalling everything. Idk.
Click to expand...
Click to collapse
Try this from CMD Prompt
Adb remount
Adb shell
# cd /data/app
#pwd
let us know what you get
if data/app it didnt work.
So I've reinstalled about 15 apps and my internal memory is staying at 73...
I'm still kinda worried about those errors I got.
mrcharlesiv said:
Maybe you can help me w/ this... When I adb shell in recovery I get "/#" instead of "#" & I can't "mount -a"...
Click to expand...
Click to collapse
same here... anyone know where to go from here?
mrcharlesiv said:
So I've reinstalled about 15 apps and my internal memory is staying at 73...
I'm still kinda worried about those errors I got.
Click to expand...
Click to collapse
did you try doing what swaze said?
swaze said:
Try this from CMD Prompt
Adb remount
Adb shell
# cd /data/app
#pwd
let us know what you get
if data/app it didnt work.
Click to expand...
Click to collapse
kashb91 said:
did you try doing what swaze said?
Click to expand...
Click to collapse
Way to rain on my parade! Yeah it didn't work. Idk why my memory dropped and stayed lower then?

Categories

Resources