Related
Introducing...
Darktremor Apps2SD 2.7.5.3 Beta 04
Date of Release: January 29, 2011
Download Current Version
Instructions - Change Log - Commands - ROM List - Developer's Guide
Darktremor Apps2SD Fan Page ----
Darktremor Apps2SD Development Group
Are you installing Darktremor Apps2SD on your phone? Here are the instructions to help you: Facebook
Are you a developer wanting to include Darktremor Apps2SD in your latest ROM? Here is the Developer Guide: Facebook
Click to expand...
Click to collapse
Update on Beta 4
It seems I'm getting mixed results with these betas. I'm not sure why this is occurring, some people have been able to get this working right while others have had a hard time with it.
Currently, I'm rebuilding the entire program. This takes a while because I have to figure out how to pack all these options into the program but make it small enough to where it will run correctly.
I will say that some of the beta features are coming back out...one of them is the search for a partition code. I suspect that code may be leading me into issues with certain platforms, so I'm going back to the 2.7.5.2 method of mounting (mmcblk0p2 or mmcblk1p2).
Also, parts of the code will use Busybox Ash (the only code that won't will be starta2sd, which will still use Bash for the time being). The startup code will definitely use Busybox Ash.
Until then, here are the links to the the last two betas and the last official release:
Version 2.7.5.3 Beta 04 - http://www.darktremor.info/files/a2sd/dtapps2sd-2.7.5.3-beta04-signed.zip
Version 2.7.5.3 Beta 03 - http://www.darktremor.info/files/a2sd/dtapps2sd-2.7.5.3-beta03-signed.zip
Version 2.7.5.2-1 - http://www.darktremor.info/files/a2sd/dtapps2sd-2.7.5.2-1-signed.zip
And, if you want past versions, you can view the repository: ftp://dtuser:[email protected] (ignore the smiley face...that's XDA doing that.)
Click to expand...
Click to collapse
Beta 04 took longer than I expected to release. I have done major changes to the code:
1. New commands: convert-ext4 - This will convert your EXT3 partition into EXT4. Just a friendly reminder on this command: Not every rom supports EXT4, so it is possible to go into a boot loop if you switch roms. Use with caution.
2. Reworked convert-ext3 (convert-ext4 gets similar code)...now a flag file is set before the reboot (no conversion is done before the reboot). At load time, the conversion is performed. This takes longer in the reboot process and you may think your phone has locked up...wait about five minutes before doing anything with the phone.
3. Repair is rebuilt...now it uses existing commands to repair the setup (reinstall, remove, cachesd, cachepart, nocache, datasd, nodata). Definitely shrinks the code.
4. Added fix_permissions program to the package. This may help with Superuser issues when using the datasd feature. It is used in reinstall, remove, datasd and nodata.
5. a2sd install is back!!! Both a2sd install and a2sd reinstall do the exact same thing.
6. Dalvik heap code has been shrunk and now creates a file called dalvikheap. Actually, the code has been doing this all along (since about 2.7.5.2, I think), but I never put the code in to use the file.
7. Low Memory Killer code has also been shrunk and uses a file caled dtset_lowmem to set the low memory killer parameter.
8. Replaced Busybox PS function with Toolbox PS. The issue with Busybox PS is that it gives a false reading when I look for android.process.acore (which is the main program when the GUI starts up). If that is present, the program thinks you are trying to run Darktremor without any command line parameters. This was because Busybox would report the process was there when, in reality, it wasn't (validated this when my phone was boot looping.) Toolbox's PS reports the correct setting. This should fix the bootlooping issues some people are experiencing.
9. New commands: usedtbusybox and usedefaultbusybox - these commands may help in diagnosing issues that is may be related to the native Busybox on your rom. a2sd usedtbusybox will use the Busybox that is packaged with Darktremor. a2sd usedefaultbusybox will turn back on the scan behavior of the program introduced in Beta 03.
10. Support for Darktremor Apps2SD version 2.7 and earlier has been discontinued. To upgrade correctly from one of those versions, use version 2.7.5.3 Beta 03b or earlier.
11. Finally fixed stalled boot issues (or at least my tests with several roms says so.)
See the change log for additional details.
You will notice that if the program runs repair and finds a problem, it will correct the issue and reboot. You will see a second reboot when the dalvik-cache clears (this is to fix timing issues with CyanogenMod...I can't control that startup as well as I can other roms). This only happens if repair is ran or you flash a new rom (as repair will realign all data). If you are upgrading from a previous version of Darktremor, you should not see the reboots.
Click to expand...
Click to collapse
This is Darktremor Apps2SD, a multipurpose program that primarily allows a user to execute applications created for the Android OS on their Secure Digital card (with the proper setup...more on that later). But, Darktremor Apps2SD is all about stability. The goal is to be able for all users of the Android OS to be able to take advantage of a method to run their applications from a secure digital card.
But just because the Darktremor Apps2SD is all about stability, doesn't mean it isn't packed with features:
- Move applications (both free and paid) to the Secure Digital card.
- Move Dalvik Cache to run either from your Secure Digital card or from your cache partition and clears the cache on demand.
- Boot Loop Protection: prevents the phone from boot looping in the event the SD card could not be mounted.
- Dalvik JIT for faster performance on Roms which support it.
- User selectable sizes for the Dalvik heap sizes, allowing a user to freely optimize their system.
- Activate a swap partition on your SD card and sets how often the swap partition is utilized.
- Automatically fixes configuration issues.
- Users can check the free space on their SD card and check the installation to make sure all is setup correctly.
- Runs ZipAlign on demand...this makes your programs load faster.
- Built in help system for easy reference of commands.
- All features can also be reversed without repartitioning your Secure Digital card.
- New logging features assists in troubleshooting issues.
- Commands to set the Low Memory Killer feature at boot time. Great for those people who are the "set it and forget it" type.
- And more...
Darktremor Apps2SD is not the same as Froyo Apps2SD. Froyo Apps2SD creates a secure folder on the FAT32 section of your SD card (this is the section that you see when you mount your phone to your computer) and stores the programs there. This is nice as you don't have to do anything special with the phone, but it isn't backwards compatible with older versions of Android (Cupcake, Donut, Eclair) and, because of the way Froyo works, older programs not designed for Froyo will automatically stay on your internal storage (unless you install a program that forces the move to your SD card).
Darktremor Apps2SD takes a different approach. Based on the original CyanogenMod works, Darktremor Apps2SD uses symbolic linking to force Android into moving your applications to the SD card. Because Android will not allow anything to be ran from the FAT32 partition on your SD card (and, in Froyo, it will only allow you to run programs from a special folder), Darktremor utilizes filesystems called EXT2, EXT3 and EXT4. Each one of these filesystems is native to Linux (the operating system running Android), which allows you to run programs from them (same as, say, a computer running Ubuntu). This method is completely compatible with all versions of Android, including Froyo. In fact, you can run both the Darktremor Apps2SD and Froyo Apps2SD at the same time.
Check out the list of Roms that either have Darktremor Apps2SD installed or are compatible with Darktremor Apps2SD. Click on the link labeled ROM List at the top of this message.
Darktremor Apps2SD Installation Instructions
How to install:
NOTE: ROMS THAT ARE ORM (ORIGINAL ROM FROM MANUFACTURER...ALSO KNOWN AS STOCK ROMS) WILL NOT RUN ANY VERSION OF APPS2SD EXCEPT FROYO.
The code to launch Apps2SD is not present in the init.rc. The only way Apps2SD will work with a Stock ROM is if the init.rc has been modified with the commands to run Apps2SD.
Click to expand...
Click to collapse
Since you are flashing this version to your phone, do a nandroid backup of your phone before starting these instructions. Also, it is preferred you use RA 1.6.2 Recovery, Godspeed Recovery or ClockworksMod Recovery.
Click to expand...
Click to collapse
1. Download the program from the previous post.
2. Determine if you have setup your sd card with an ext partition
if you have setup your sd card already (existing users of a2sd...any version):
A. Copy the program to your sd card.
b. Reboot into recovery
Click to expand...
Click to collapse
if you have not setup your sd card (for those new to a2sd):
A. backup your sd card to your computer. can't stress this enough, as partitioning will wipe the entire card.
B. Reboot into recovery
c. In android system recovery, select partition sdcard
d. In the partition sdcard menu, select partition sd
e. Follow the instructions on the phone to partition your sd card. You can optionally set a swap file while you are partitioning your sd card.
F. In the partition sdcard menu, select sd:ext2 to ext3. Follow the instructions on the screen.
G. only perform this step if you want ext4 and your rom supports it: in the partition sdcard menu, select sd:ext3 to ext4. Follow the instructions on the sdcard.
h. Press the back button on the phone to go back to the main menu.
I. Put the a2sd file on the sd card (and all your other files you backed up earlier) by selecting usb-ms toggle and transfer the files to your computer.
Click to expand...
Click to collapse
3. In recovery, select flash zip from sdcard.
4. In flash zip from sdcard, select the a2sd package file you downloaded earlier. Press home to flash.
5. Reboot phone.
Click to expand...
Click to collapse
Note: Due to an issue with the Sprint Hero source code, ext4 partitions may only work intermittently. You may not want to use an ext4 partition unless the rom you are using is certified to have a working ext4 partition. If you have issues with ext4, repartition your sd card for ext3.
Click to expand...
Click to collapse
Note: If you apply Darktremor Apps2SD and still notice internal storage is decreasing, this is due to the dalvik-cache not being moved. By default, Darktremor Apps2SD will not move the dalvik-cache on boot.
If you want to move the dalvik-cache to the sd card, type:
a2sd cachesd (move dalvik to sd card)
a2sd cachesdreset (move dalvik to sd card and clears contents of dalvik-cache)
a2sd cachepart (move dalvik to cache partition)
a2sd cachepartreset (move dalvik to cache partition and clears contents of dalvik-cache)
Make sure your SD card is at least a class 4 before doing this, otherwise you may run into performance issues, unless you move the dalvik to the cache partition.
You still have other caches (i.e. Browser caches) and other data being stored and updated in internal storage, so the number of free space will continue to drop, but at a slower rate (unless you are engage in heavy web surfing, tweeting or facebook socializing.)
Click to expand...
Click to collapse
Darktremor Apps2SD Credits and Change Log
Special Thanks:
Thanks to the following people for helping me with Darktremor Apps2SD:
Toastcfh
- For assisting me in getting my test kernel setup to run ext4...that helped tremendously with development.
- For testing it (along with Flipzmode) on FreshToast 2.0 (CDMA Hero).
- For (along with Flipzmode) helping to identify the disappearing marketplace issue.
shahid.malik
- For testing on VillianROM 5.5 (HTC GSM Hero)
- For testing on VanillaEclair 2.0.1 (HTC GSM Hero)
Andrizoid
- For testing on Evil Eris 2.0 (HTC Eris)
- For including it in Smash Rom (HTC Eris)
Framework43
- For adding to Evil Eris 2.0.1 (HTC Eris)
DS36
- For testing on Eris Official 1.0 Alpha w/ Controllable Overclocking (HTC Eris)
4SidedDice (and others)
- For testing it on DamageControl's 2.08 and later (CDMA Hero)
Flipzmode
- For including it (along with Toastcfh) in FreshToast 2.0 (CDMA Hero)
- For including it in Fresh Hero (HTC CDMA Hero)
- For including it in Fresh Evo (HTC Evo)
- For (along with Toastcfh) helping to identify the disappearing marketplace issue.
Kurt666
- For testing on Pay's ROM for Desire v1.4 (HTC Desire)
Cordy
- For helping with general testing of Darktremor Apps2SD
zygame
- For including it on Daguu_Espresso_v1.2_By_FlZyGaMeUp-Pre-release-2 (HTC GSM Hero)
chuckhriczko
- For including it in SuperSonic v2.0 (HTC Evo)
zenulator
- For including it in ZenEXP 0.9.6.2 (HTC CDMA Hero)
crunchybutternut
- For including it in Buufed 1.7.2 (HTC CDMA Hero)
.mac
- For including it in ZenEXP Eris Expresso (HTC Eris)
Papa Smurf151
- For including it in Blue Echo (HTC CDMA Hero)
- For including it in Red Dawn (HTC CDMA Hero)
beezy420
- For including it in HoneyBun Rom (HTC CDMA Hero)
britoso
- For testing it on Froyo FRF50 and FRF83 (Nexus One)
djmcnz
- For including it in Kang-o-rama 0.9 Froyo (Nexus One)
THATTON
- For testing the installation process on ClockworksMod Recovery.
eViL D:
- For including it in eViL n-One-sh0t Noir 7 (Nexus One)
t2noob
- For including it in Plain Jane T2 2.1 (HTC Eris)
Jr33
- For including it in Froyo AOSP Beta3 (Nexus One)
- For including it in CliqMod (Motorola Cliq)
UltimoJedi
- For supplying the elusive base address to build a boot image on the HTC Legend.
MrDanger
- For including it in DangerRom (HTC CDMA Hero for Cellular South)
Kiljacken
- For including it in KiljackenROM (HTC Tattoo)
BesFen
- For including it in BesFen Apps2SD ROM (HTC Legend)
dsixda
- For including it in his Android Kitchen
freddyemmer
- For including it in Vodafone 845 MR Edition
attn1
- For including it in Liberated_Aria (HTC Aria)
capychimp
- For including it in RCMagic 4.2 for Rogers Cellular (HTC Magic)
nfinitefx45 (and others)
- For showing me the binding mount method for using dalvik-cache on the cache partition and using SenseUI (roboclk helped with this as well).
- For including it in NFX-Hero
Click to expand...
Click to collapse
If I forgot anyone...let me know.
Click to expand...
Click to collapse
Change Log
Darktremor Apps2SD Version 2.7.5.2
- Added additional code to allow /dev/block/mmcblk1p3 to be a swap partition. This complements the multiple location codes that were added in 2.7.5 Final that allows for EXT mounting from /dev/block/mmcblk0p2 or /dev/block/mmcblk1p2
- Fixed a few lines in the code that did not write to the log file correctly.
- Fixed the log file reference. It was pointed at "/data/dta2sd.log;"...the semicolon didn't need to be there.
- Adjusted the installer script to only remove files in /system/etc/init.d that have the following words in it: apps2sd, a2sd, cache, dalvik. It will also name the launcher file either 04apps2sd, 10apps2sd or 40apps2sd...depending on number availability (the number in the front of the file tells Busybox what sequence to run the file...you can't have two or more files start with the same number (i.e 04modules and 04apps2sd...one of these files will be skipped). This is to address concerns with other roms regarding the partition mounting as an ext2 when it was formatted as an ext4 (module launcher was overwritten by Darktremor).
Click to expand...
Click to collapse
Darktremor Apps2SD Version 2.7.5.1
- Added mounting functions to the cache partition. This mounts dalvik-cache directory on the cache partition (/cache/dc) to /data/dalvik-cache. The end result is SenseUI thinks it is storing dalvik-cache files on /data/dalvik-cache rather than the cache partition. No more force closes when using the cache to store dalvik-cache and using SenseUI.
- Added swappiness settings for swap partition. The command is a2sd swappyxx, where xx is the value you wish to set swappiness to (i.e. to set swappiness to 30%, type a2sd swappy30).
- Added a2sd partlist to list the available EXT partitions available on your rom. This should reduce the number of complaints about incorrectly mounting the ext partition.
- Rebuild a2sd repair to run from starta2sd. Fixa2sd is no longer available.
- Unmounts the EXT partition before it performs an automated reboot. This should reduce the time to mount the SD card (which it doesn't look like it did..oh well).
- Removed smallheap, largeheap and jumboheap command. Replaced with heapsizexx command, where xx is the number of megs you wish to set aside for dalvik cache.
Click to expand...
Click to collapse
Darktremor Apps2SD Version 2.7.5 Final
- New commands: cachepartreset, cachesdreset, nocachereset. These commands do the same as their counterparts (cachepart, cachesd, nocache), but it doesn't move the contents of the dalvik-cache. This allows users to perform both a move and a reset of the dalvik-cache.
- cmpatch command has been removed. The CyanogenMod patch that was related to that command automatically installs as part of startup.
- boota2sd has been removed. All functions have been transferred to launcha2sd. The "lite" version of Apps2SD no longer exists (replaced by the contents of boota2sd). This was done to speed up Apps2SD load time (this is part of the CyanogenMod 6 fixes).
- Mount commands now looks for both /dev/block/mmcblk1p2 and /dev/block/mmcblk0p2. This is to allow compatibility with phones that use mmcblk0p2 for other items (i.e. Froyo).
Click to expand...
Click to collapse
Darktremor Apps2SD Version 2.7.5 Release Candidate 3 (RC3)
- Four releases (three official, one unofficial): RC3, RC3A, RC3B (unofficial), RC3C...subsequent versions used to fix interactive issues between Darktremor Apps2SD and CyanogenMod Nightly Builds.
- Mount point has changed from /system/sd to /data/sd (RC3 only). This is mostly for stability with NAND protected phones. This was reversed back in RC3A. However, there is code in RC3C that detects whether the mount point /sd-ext (used in CyanogenMod and Froyo builds) exists...if so, it uses that mount point instead of /system/sd. - Include /system/bin/sysinit from CyanogenMod for developers who wish to use the CyanogenMod Froyo method outlined in the Rom Guide.
- a2sd swapspace now uses different data to show the swap sizes and free.
- Changed verbage in a2sd check to reflect the a2sd reinstall and a2sd reswap commands.
- New command: a2sd cmpatch - this command symlinks /cache/dalvik-cache to /data/dalvik-cache. Also creates a new Dalvik to Cache directory: /cache/dc.
- Now have a way to detect if the program is running during boot. Type a2sd by itself on a command prompt will display the help file.
Click to expand...
Click to collapse
Darktremor Apps2SD Version 2.7.5 Release Candidate 2 (RC2)
- a2sd install and a2sd swap have been renamed to a2sd reinstall and a2sd reswap. This is due to too many people thinking that a2sd install and a2sd swap is the commands used to install apps2sd and to turn on swap. These functions are automatic when apps2sd starts. Those commands are suppose to be used to a) reactivate apps2sd after running the a2sd remove command and b) reactivate swap after running a2sd noswap.
- Corrected lowmem-default command to work.
- Uses the installed Busybox on the phone or the included Busybox for Apps2SD. This may help with phones that are ext3 capable but only mount as ext2.
- Added more logging for Sysinfo
- Creates a separate dump file during Sysinfo that has numerous pieces of information about the phone. This will help in future troubleshooting and development of Apps2SD (it doesn't get sent anywhere).
- Detects Froyo build in a2sd check and a2sd repair. This will use the asterisks (old format) rather than the checkmarks (new format) in the report.
Click to expand...
Click to collapse
Darktremor Apps2SD Version 2.7.5 Release Candidate 1 (RC1)
- Added mknod command to create /dev/block/mmcblk0p2 (mostly for Froyo kernels)
- Added logging. Log is saved in /data/dta2sd.log
- Added Low Memory Killer commands (lowmem-moderate, lowmem-strict, lowmem-optimum, lowmem-aggressive, lowmem-extreme, lowmem-ultimate). Now the user can control the low memory killer settings and reapply them on boot. a2sd check reports Low Memory Killer settings - Moved launching of boota2sd from starta2sd to launcha2sd. This eliminates one level of bash shell, which should make the program use less memory.
- Now displays the help file when a2sd is called without command parameters from the command line.
- Added a new property: apps2sd.run. This is used for determining if a2sd is being called at first boot or the command line.
- Fixed an issue with moving /data/app and /data/app-private where the permissions were not being copied. This caused strange issues to occur in applications, especially the paid apps.
- a2sd check now reports "default setting" used when dalvik.vm.heapsize doesn't exists.
- Detection of No Apps2SD flag file has been installed in the Apps2SD Lite Version (apparently that was skipped all this time).
- Moved the code to activate swap to the front of launcha2sd. This is until I find a better way of detecting it.
- New format for a2sd check and a2sd repair. Now displays graphic symbols. Should make the report easier to read. Note: New graphics doesn't work so well in Froyo builds. A fix is coming soon.
- New commands: a2sd swapspace shows the amount of swap space (this may not work in all roms). a2sd sysinfo shows a complete profile of your phone.
Click to expand...
Click to collapse
Darktremor Apps2SD Version 2.7.5 Preview Fix 4a
- Removed 00a2sdremove script file. Removal of other apps2sd is done during the flash process.
- Fixed a coding error during the rebuild process where a2sd install and a2sd cachesd was not proceeding when the ext partition was mounted.
Click to expand...
Click to collapse
Darktremor Apps2SD version 2.7.5 Preview Fix 4
- Complete rebuild from Apps2SD 2.7 Update 3r1. This one is built a little different than Preview releases. Changes from Preview Fix 3 are included.
- Help system will now show the entire command list using Busybox More. - a2sd check will now display the ext type on the SD card.
- a2sd defaultheap will return the heap size to the device's default setting (removes all heap flag files)
Click to expand...
Click to collapse
Darktremor Apps2SD version 2.7.5 Preview Fix 3
- Removed reference to mounting /system (except in JIT installation/removal). This is to accommodate NAND protection in the Desire.
Click to expand...
Click to collapse
Darktremor Apps2SD version 2.7.5 Preview Fix 1 and Preview Fix 2
- Fixed JIT installation and removal error.
Click to expand...
Click to collapse
Darktremor Apps2SD version 2.7.5 Preview
- Added Boot Loop Protection...moves app, app-private and/or dalvik-cache back to internal storage if SD card could not be mounted. Sets No Apps2SD flag.
- Added Dalvik JIT. - Added user selectable Dalvik heap sizes (smallheap = 16mb, largeheap = 24mb, jumboheap = 32mb) - Renamed many programs with new .a2sd extentions.
- Corrected bugs from Darktremor A2SD 2.7 Update 3r1.
- Apps, Dalvik Cache and Swap Partition can be activated separately.
- Install and Davik Cache to SD will not work if the SD card can't mount. This prevents a user-inflicted boot loop.
Click to expand...
Click to collapse
Darktremor A2SD Version 2.7 Update 3r1
- Fixes a bug in fixa2sd that causes the dalvik-cache to automatically move to the SD card.
- Created a new program called launcha2sd that now does the launching functions of a2sd. The program a2sd now launches launcha2sd using bash. This fixes any /system/bin/sh issues with open brackets being interpreted at commands rather than conditions in an IF statement.
Click to expand...
Click to collapse
Darktremor A2SD Version 2.7 Update 3
- If a rom has the dalvik-cache on the cache partition, it will not attempt to move it to the internal cache.
- Users now have an option to move the dalvik-cache to the cache partition. The option to move dalvik-cache to the SD card is still retained.
- New commands introduced: cachepart moves dalvik-cache to cache partition, cachesd moves dalvik-cache to sd card (phased replacement to a2sd cache).
- Fixes some minor bugs.
Click to expand...
Click to collapse
Darktremor A2SD Version 2.7 Update 2
- The /system partition returns to read-only state when the program is finished. The /data partition is left untouched.
- ZipAlign does not automatically start on boot. You must type a2sd zipalign to activate the start on boot feature.
- Taken out visual references of CyanogenMod's cm.filesystem.ready and DamageControl's dc.filesystem.ready. It now refers to both visually as "File System Ready property"
- A2SD Check no longer mounts the ext partition. It will indicate when the ext partition is not already mounted. This should help in troubleshooting roms that do not automatically launch A2SD.
Click to expand...
Click to collapse
Darktremor A2SD Version 2.7 Update 1
- Reversed a decision on 2.7 final to set /system and /data to read-only when the program completes. This is causing major issues with some newer roms.
Click to expand...
Click to collapse
Darktremor A2SD Version 2.7
- Completely rebuild the entire program from ground up. Attempted to simplify the process and to better detect different environments.
- All programs use the included busybox.a2sd to avoid conflicts with the different busybox installations.
- Mounts /system and /data in read-write to prevent any conflicts. Remounts them in read-only when completed.
- Except for a2sd, all programs built as bash scripts.
- Separated the original program into the following programs:
a2sd - Simple script that detects whether the init.rc was fixed with the cm.filesystem.ready and sets it accordingly. Starts starta2sd if either a command is included or the cm.filesystem.ready patch is installed, otherwise runs A2SD that does not move dalvik-cache. Runs a smaller version of the boota2sd if the cm.filesystem.ready or dc.filesystem.ready are not present.
starta2sd - Processes all commands...it's the controller program. Adds the following commands: align, zipalign, nozipalign, resetcache, clearcache, fixmarket, diskspace. boota2sd - Used when the cm.filesystem.ready fix or the dc.filesystem.ready fix is present in init.rc. Resets dalvik-cache, app and app-private to internal storage upon the following conditions:
- Mount failure or missing ext partition, and
- Any or all key directories are symlinked to the SD card. This step prevents a bootloop or a stall from occuring during the boot process. Also incorporates better detection of mounted partition. If it detects the partition mounted in /proc/mounts, it will skip trying to mount. Automatically executes fixa2sd if the flags and symlinks to dalvik-cache, app and/or app-private do not match. Also moved the mounting of the swap partition to the end and reintegrated auto partition detection when mounting (similar to A2SD 2.6.1). Added ZipAlign functions.
chka2sd - Incorporates bug fixes that did not detect the dalvik-cache correctly. New report layout (should be simpler to read). Code was simplified. fixa2sd - Incorporates same bug fixes as chka2sd. Does a better detection of flag files and symlinks. Code was simplified.
setupa2sd - Used to execute setup commands from starta2sd (install, remove, cache, nocache, align, fixmarket). Also controls a2sd help.
aligna2sd - zip aligns all apk files in /data/app and /data/app-private.
010a2sdmodaco - Part of the Beta8 Modaco Desire testing, does the following:
- If 02cachedalvikcache exists, back the program up and overwrite the program, preventing the contents from executing.
- if 40a2sd exists, do the same thing.
Click to expand...
Click to collapse
Darktremor A2SD Version 2.6.1
- Mainly a bugfix. Corrects the dalvik-cache code where it would put the dalvik-cache back on the sd card even when the flag file was set.
- Put the flag files back on /system/sd. Fresh 2.0d was incompatible with the new setup (it doesn't mount the /sdcard until later in the boot process).
- Added code for Fresh 2.0d...the boot can be hung if the dalvik-cache is changed during boot. Program automatically determines if 04apps2sd exists in /system/etc/init.d (this is signature for any roms built from Fresh 2.0d) and automatically sets the NoCache flag if the dalvik-cache is in internal memory and the NoCache flag isn't set.
- Fixed swap code. It was not turning on swap when it should.
- (Release 1) - Fixed some minor issues.
- (Release 2) - Recreated a new flash package that is more compatible with different recovery system.
Click to expand...
Click to collapse
Darktremor A2SD Version 2.6
- Moves all flag files from /system/sd to /sdcard. The kernel mounts the FAT32 SD partition and that will be available before Apps2SD runs. Future flag file creation will be in /sdcard.
- Added a check feature (a2sd check). This will check your flag files and symlinks. A report on your screen will tell you what needs to be fixed, if any.
- Added a repair feature (a2sd repair). This will repair your a2sd installation.
- Flashing the A2SD checks Busybox installation and reinstalls it if necessary (it only checks for a missing Busybox installation...it won't replace the one you have installed).
- Automatically remounts /system and /data partitions for read-write access when started with any of the install/repair options (install, repair, cache, nocache, remove).
- Fixed mount command...now uses auto detect rather than the individual partitions. This allows A2SD to work on ext4.
- Separate nocache version available for slower SD cards.
Click to expand...
Click to collapse
Darktremor A2SD Version 2.5
- Added functionality to move dalvik-cache to the ext partition.
- Added option a2sd cache to manually move the dalvik-cache to the ext partition.
- Added option a2sd nocache to manually move the dalvik-cache back to the internal phone storage.
- Added option a2sd install to setup a2sd on a phone (all apps and dalvik-cache on ext partition)
- Added option a2sd remove to revert all a2sd changes back to normal mode (all apps and dalvik-cache in internal storage).
- Added option a2sd noswap to turn off swap partition.
- Added option a2sd swap to turn on swap partition.
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Installing Support for Apps2SD in your Rom
How to add Apps2SD support to your Rom
If you are a new rom developer, chances are you are building a rom based on either someone else's work or you are using the stock rom. If you base your rom on someone else's work, chances are the previous developer included support for Apps2SD in the boot image.
However, if you are starting from the stock image, or you have grabbed a rom that doesn't have Apps2SD support, you aren't stuck. Here's a guide that will help you disassemble a boot image, edit the necessary files to activate Apps2SD, and reassemble a boot image.
To begin, you'll need a Linux or a Mac system and basic knowledge on how to navigate through your Linux or Mac via a terminal program. The tools presented in this guide will only work with those systems.
1. Create a directory called workspace. This will be where you work on the ramdisk.
2. Inside workspace, create another directory called scripts. This is where you will place the tools and scripts you will need.
3. Download the following and uncompress the files into the scripts directory: http://www.darktremor.info/files/tools/ramdisk-scripts.zip
4. Open a terminal window, change the directory to the workspace directory, and type chmod 755 *
5. Put the boot.img from the rom you are working on in the workspace directory.
6. In the terminal window, change to the scripts directory and type ./getramdisk
7. Change to the ramdisk directory located in the workspace directory.
8. Open a text editor and load init.rc
9. Look for a line called class_start default.
10. Choose a method:
Direct Apps2SD method
This method allows you to call Apps2SD directly. Additional scripts will have to be added as other services in the init.rc.
Type the following right above the class_start default:
start a2sd
on property:cm.filesystem.ready=1
The lines should look like this:
Code:
start a2sd
on property:cm.filesystem.ready=1
class_start default
Next , go to the end of the file and type the following:
Code:
service a2sd /system/bin/logwrapper /system/bin/sh /system/bin/a2sd
disabled
oneshot
Click to expand...
Click to collapse
Busybox Run-Parts Method
This method allows you to call Apps2SD (and other scripts) simply by placing it in a directory.
Type the following right above the class_start default:
start sysinit
on property:cm.filesystem.ready=1
The lines should look like this:
Code:
start sysinit
on property:cm.filesystem.ready=1
class_start default
Next , go to the end of the file and type the following:
Code:
service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
disabled
oneshot
Click to expand...
Click to collapse
Modified CyanogenMod method
This method allows you to call Apps2SD (and other scripts) by running a script called sysinit
Type the following right above the class_start default:
exec /system/bin/sysinit
on property:cm.filesystem.ready=1
The lines should look like this:
Code:
exec /system/bin/sysinit
on property:cm.filesystem.ready=1
class_start default
Click to expand...
Click to collapse
11. Save the init.rc
12. Change to the scripts directory and type ./makeramdisk
13. Now it's time to create the boot image. In the scripts directory, you need to run the command makeboot, but you are going to need to enter some information on the command line:
a. You need the filename of the kernel code. This was created for you when you ran the getramdisk command. The file is called boot.img-kernel and it is located in the workspace directory.
b. You need the filename of the new ramdisk file you created. This was created for you when you ran the makeramdisk command. The file is called newramdisk.gz and it is located in the workspace directory.
c. You need to know what you are going to name your new boot image. You need to name it something other than boot.img (we'll fix that part later in the guide). Try newboot.img and save it to the workspace directory
d. You will need to know your kernel base address. Now I don't have all of the base addresses for all the phones, but I do have the four I normally work with when developers need me to check their boot image. This part is very important, as using the wrong base address will cause your phone not to boot (and you'll have to restore back from a recovery image). Use the following values for the base address and the kernel start commands:
Hero CDMA (heroc), Hero GSM (hero)
Base Address: 0x19200000
Command Line: "no_console_suspend=1 console=null"
Click to expand...
Click to collapse
Desire (bravo), Nexus One (passion)
Base Address: 0x20000000
Command Line: "no_console_suspend=1 msmsdcc_sdioirq=1 wire.search_count=5"
Click to expand...
Click to collapse
Evo 4G (supersonic), Incredible (inc)
Base Address: 0x20000000
Command Line: "no_console_suspend=1"
Click to expand...
Click to collapse
Wildfire (buzz)
Base Address: 0x02e00000
Command Line: "no_console_suspend=1 console=null"
Click to expand...
Click to collapse
Aria (liberty), Legend (legend), MyTouch3G Slide (expresso)
Base Address: 0x12c00000
Command Line: "no_console_suspend=1 console=null"
Click to expand...
Click to collapse
Geeksphone One
Base Address: 0x1a000000
Command Line: "[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] androidboot.hardware=qcom"
Click to expand...
Click to collapse
T-Mobile G1 (dream), MyTouch3G (sapphire), Magic (sapphire)
Base Address; 0x10000000
Command Line: "no_console_suspend=1 console=null"
Click to expand...
Click to collapse
If you have the base address for a phone not listed, please let me know and I'll include them in this guide.
Click to expand...
Click to collapse
From the scripts directory, type:
./mkbootimg --kernel <Path and filename to boot.img-kernel> --ramdisk <Path and filename to newramdisk.gz> --cmdline "<Command Line from above>" -o <Path and filename of new boot image> --base <Base Address from above>
Example: ./mkbootimg --kernel ../boot.img-kernel --ramdisk ../newramdisk.gz --cmdline "no_console_suspend=1 console=null" -o ../newboot.img --base 0x19200000
14. Move the newboot.img file into the directory that you are using to build your rom and rename it to boot.img (you will have to delete the old boot.img first).
Now, if all works well, you will have a boot image that actually boots and has Apps2SD support built in.
To use Apps2SD with the Apps2SD direct method, simply put a file with the Apps2SD code in /system/bin and name it a2sd
To use Apps2SD with the Busybox Run Parts method or the CyanogenMod Froyo method, simply put a file with the Apps2SD code in /system/etc/init.d and name it anything...just make sure it starts with a two-digit number (not sure if that's an actual requirement, but all the busybox run parts roms use it). Example of this is 04apps2sd.
Darktremor Apps2SD Commands
Since this guide was posted, I'm getting questions ask on how to use Darktremor Apps2SD.
Darktremor Apps2SD is a command line interface (CLI) program (a GUI is planned, but has not been built).
You will need either a terminal program from the Android Marketplace, or you will need ADB from the Android Software Development Kit (SDK).
If you are using a terminal program, simply start up the program. Type su to allow the terminal program to gain superuser access (if you are using Superuser.apk to manage your superuser permission, this will automatically trigger a popup on the very first run. Press Accept to allow the terminal program superuser access).
If you are using ADB, simply navigate to the directory you stored the Android SDK in. Then navigate to the Tools directory under the SDK folder. Type adb shell in a command line on your computer (ADB can be found in the SDK under the Tools folder).
Both of these methods should bring you to a prompt that displays a pound sign (#).
Once you have the superuser prompt, simply type /system/bin/a2sd followed by the command you wish to use (i.e. /system/bin/a2sd check)
The list of commands are below.
Syntax
Syntax: /system/bin/a2sd command
command is one of the following:
Standard Apps2SD Commands:
--------------------------------------------------
reinstall
Moves free and paid apps to the ext2/ext3/ext4 partition on your secure digital card. Removes the No A2SD flag file.
This is used if you have already executed an a2sd remove command. Otherwise, this part is automatically performed when Apps2SD is started.
File removed: /data/.noa2sd
remove
Moves free and paid apps to the internal phone storage. Creates the No A2SD flag file.
File created: /data/.noa2sd
Click to expand...
Click to collapse
Swap Partition Commands:
--------------------------------------------------
reswap
Removes the No Swap flag. Allows A2SD to activate the swap partition.
This is used if you have already executed an a2sd noswap command. Otherwise, this part is automatically performed when Apps2SD is started. Note: This command has no effect on roms where the swap space is not built into the kernel.
File removed: /data/.noswap
noswap
Creates the No Swap flag. Prevents A2SD from activating the swap partition. Note: This command has no effect on roms where the swap space is not built into the kernel.
File created: /data/.noswap
swappyxx
Sets the swappiness setting for the swap file. xx sets the swappiness percentage used. (i.e. to set swappiness to 30%, type a2sd swappy30.
Click to expand...
Click to collapse
Dalvik Cache Commands:
--------------------------------------------------
cachesd
Moves Dalvik cache files to the ext2/ext3/ext4 partition on your secure digital card. Creates Dalvik Cache to SD flag.
Caution: If your phone fails to mount the ext2/ext3/ext4 partition and your dalvik-cache is pointed to the SD card, you will likely end up in a boot loop. Execute a2sd nocache from adb shell to rectify the issue.
Click to expand...
Click to collapse
File created: /data/.dalvikcacahe
File removed: /data/.dcpartition
cachesdreset
Same as cachesd above, but erases the contents of the dalvik-cache after move. This performs both the a2sd cachesd and a2sd resetcache all in one command.
File removed: /data/.dcpartition
cachepart
Moves Dalvik cache files to the /cache partition in your phone. Creates Dalvik Cache to Cache Partition flag.
Caution: Some phones do not have enough space to put the dalvik-cache on the cache partition. Also, some roms that have SenseUI installed may not work well with the dalvik-cache on the cache partition (although this issue appears to be fixed starting with Darktremor 2.7.5.1). If you experience issues such as force closes, try moving the dalvik-cache to the SD card (a2sd cachesd) or internal storage (a2sd nocache) instead.
Click to expand...
Click to collapse
File created: /data/.dcpartition
File removed: /data/.dalvikcache
cachepartreset
Same as cachepart above, but erases the contents of the dalvik-cache after move. This performs both the a2sd cachepart and a2sd resetcache all in one command.
File removed: /data/.dalvikcache
nocache
Moves Dalvik cache files to the internal phone storage. Removes all Dalvik Cache flags.
File removed: /data/.dcpartition, /data/.dalvikcache
nocachereset
Same as nocache above, but erases the contents of the dalvik-cache after move. This performs both the a2sd nocache and a2sd resetcache all in one command.
File removed: /data/.dcpartition. /data/.dalvikcache
resetcache
Clears the dalvik cache and restarts phone.
Click to expand...
Click to collapse
Apps2SD Diagnostic Commands:
--------------------------------------------------
check
Performs a symlink and flag file check on your setup. Outputs a report that shows you if
there are issues with your Apps2SD setup.
repair
Performs a repair of all symlinks based on flag file activation.
diskspace
Shows disk space statistics for the ext partition.
sysinfo
Displays information about your phone, partitions, swap, and more.
Also writes a dump file that has an entire profile of your phone. This is for troubleshooting only.
File Created: /data/dtsysdump.txt
swapspace
Shows swap space statistics for all swap space active on the phone. Note: This command has no effect on roms where the swap space is not built into the kernel.
Click to expand...
Click to collapse
ZipAlign Commands:
--------------------------------------------------
align
Performs a one-time zipalign on all APK files in /data/app and /data/app-private.
zipalign
Allows ZipAlign to execute during the boot process. Creates the ZipAlign flag file.
File Created: /data/.zipalign
nozipalign
Prevents ZipAlign from executing during the boot process. Removes the ZipAlign flag file.
File Removed: /data/.zipalign
Click to expand...
Click to collapse
Dalvik Setting Commands:
--------------------------------------------------
jit
Installs DalvikVM JIT.
WARNING: Do not run this command if your phone has NAND protection active.
Click to expand...
Click to collapse
nojit
Removes DalvikVM JIT.
WARNING: Do not run this command if your phone has NAND protection active.
Click to expand...
Click to collapse
defaultheap
Resets the Dalvik heap size to the default heap size.
File Removed: /data/.smallheap, /data/.largeheap, /data/.jumboheap
heapsizexx
Sets the dalvik heap size to xx. For example, to set the dalvik cache to 24mb, type a2sd heapsize24. To reset back to default, type a2sd heapsize0 (that's a zero, not the letter "o")
Click to expand...
Click to collapse
Low Memory Killer Commands:
----------------------------------------------------
lowmem-moderate
Sets the internal memory killer to the following settings:
Code:
Foreground Apps: 1536 pages / 6 MB
Visible Apps: 3072 pages / 12 MB
Secondary Server: 4096 pages / 16 MB
Hidden Apps: 7680 pages / 30 MB
Content Provider: 8960 pages / 35 MB
Empty App: 10240 pages / 40 MB
Create File: /data/.lmmoderate
Remove File: /data/.lmoptimum, /data/.lmstrict, /data/.lmaggressive, /data/.lmultimate, /data/.lmextreme
lowmem-optimum
Sets the internal memory killer to the following settings:
Code:
Foreground Apps: 1536 pages / 6 MB
Visible Apps: 2048 pages / 8 MB
Secondary Server: 4096 pages / 16 MB
Hidden Apps: 10240 pages / 40 MB
Content Provider: 12800 pages / 50 MB
Empty App: 15360 pages / 60 MB
Create File: /data/.lmoptimum
Remove File: /data/.lmmoderate, /data/.lmstrict, /data/.lmaggressive, /data/.lmultimate, /data/.lmextreme
lowmem-strict
Sets the internal memory killer to the following settings:
Code:
Foreground Apps: 1536 pages / 6 MB
Visible Apps: 2048 pages / 8 MB
Secondary Server: 4096 pages / 16 MB
Hidden Apps: 15360 pages / 60 MB
Content Provider: 17920 pages / 70 MB
Empty App: 20480 pages / 80 MB
Create File: /data/.lmstrict
Remove File: /data/.lmmoderate, /data/.lmoptimum, /data/.lmaggressive, /data/.lmultimate, /data/.lmextreme
lowmem-aggressive
Sets the internal memory killer to the following settings:
Code:
Foreground Apps: 1536 pages / 6 MB
Visible Apps: 3072 pages / 12 MB
Secondary Server: 4096 pages / 16 MB
Hidden Apps: 21000 pages / 82 MB
Content Provider: 23000 pages / 90 MB
Empty App: 25000 pages / 98 MB
Create File: /data/.lmaggressive
Remove File: /data/.lmmoderate, /data/.lmoptimum, /data/.lmstrict, /data/.lmextreme, /data/.lmultimate
lowmem-extreme
Sets the internal memory killer to the following settings:
Code:
Foreground Apps: 1536 pages / 6 MB
Visible Apps: 3072 pages / 12 MB
Secondary Server: 4096 pages / 16 MB
Hidden Apps: 38400 pages / 150 MB
Content Provider: 40960 pages / 160 MB
Empty App: 43520 pages / 170 MB
Create File: /data/.lmextreme
Remove File: /data/.lmmoderate, /data/.lmoptimum, /data/.lmstrict, /data/.lmaggressive, /data/.lmultimate
lowmem-ultimate
Sets the internal memory killer to the following settings:
Code:
Foreground Apps: 1536 pages / 6 MB
Visible Apps: 3072 pages / 12 MB
Secondary Server: 4096 pages / 16 MB
Hidden Apps: 51200 pages / 200 MB
Content Provider: 57600 pages / 225 MB
Empty App: 64000 pages / 250 MB
Create File: /data/.lmultimate
Remove File: /data/.lmmoderate, /data/.lmoptimum, /data/.lmstrict, /data/.lmaggressive, /data/.lmextreme
lowmem-default
Sets the internal memory killer back to phone default settings.
Remove File: /data/.lmmoderate, /data/.lmoptimum, /data/.lmstrict, /data/.lmaggressive, /data/.lmextreme, /data/.lmultimate
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Wow
Great release. ZipAlign on demand does make programs load noticeably faster. No problems with the market either. Trying different heap sizes for performance.
I like the help command too. Great work thanks!
Running a GSM Hero using a stock 2.1 repack ROM.
I've not used A2SD before, but giving it a shot now. I had no problems setting it up, the instructions are very clear and concise, but I am having problems using it.
I setup a 750MB ext3 partition, and I was expecting AppMonster to report I had loads of freespace. It was reporting my freespace as pretty much what it was before. (100MB free)
I tried /system/bin/a2sd install and it appears I have lots of duplicated files from the rather verbose output.
What have I done wrong?
Thanks.
Code:
# /system/bin/a2sd install
/system/bin/a2sd install
[ ] Launching Darktremor A2SD
[*] Starting Darktremor Apps2SD version 2.7.5 preview
[ ] Mounting /system as read-write
[ ] Starting Apps2SD in install mode
[ ] Checking SD Card.
[ ] Searching for Mount Point...
[!] Mount point found..no further action required.
[ ] Checking for ext partition
[*] Ext partition found and already mounted.
[ ] Moving apps to SD card.
cp: '/data/app/YouTube.apk' and '/system/sd/app/YouTube.apk' are the same file
cp: '/data/app/br.com.fast4ward.sdcardspeedtester.zip' and '/system/sd/app/br.co
m.fast4ward.sdcardspeedtester.zip' are the same file
cp: '/data/app/btm.game.ui.apk' and '/system/sd/app/btm.game.ui.apk' are the sam
e file
cp: '/data/app/com.adobe.reader.apk' and '/system/sd/app/com.adobe.reader.apk' a
re the same file
cp: '/data/app/com.agilesoftresource.apk' and '/system/sd/app/com.agilesoftresou
rce.apk' are the same file
cp: '/data/app/com.alfray.timeriffic.apk' and '/system/sd/app/com.alfray.timerif
fic.apk' are the same file
cp: '/data/app/com.bigtincan.android.adfree.apk' and '/system/sd/app/com.bigtinc
an.android.adfree.apk' are the same file
cp: '/data/app/com.bonfiremedia.android_ebay.apk' and '/system/sd/app/com.bonfir
emedia.android_ebay.apk' are the same file
cp: '/data/app/com.dozingcatsoftware.WireGoggles.apk' and '/system/sd/app/com.do
zingcatsoftware.WireGoggles.apk' are the same file
cp: '/data/app/com.facebook.katana.apk' and '/system/sd/app/com.facebook.katana.
apk' are the same file
cp: '/data/app/com.google.android.apps.maps.apk' and '/system/sd/app/com.google.
android.apps.maps.apk' are the same file
cp: '/data/app/com.google.android.apps.shopper.apk' and '/system/sd/app/com.goog
le.android.apps.shopper.apk' are the same file
cp: '/data/app/com.google.android.apps.translate.apk' and '/system/sd/app/com.go
ogle.android.apps.translate.apk' are the same file
cp: '/data/app/com.google.android.apps.unveil.apk' and '/system/sd/app/com.googl
e.android.apps.unveil.apk' are the same file
cp: '/data/app/com.google.android.maps.mytracks.apk' and '/system/sd/app/com.goo
gle.android.maps.mytracks.apk' are the same file
cp: '/data/app/com.google.android.stardroid.apk' and '/system/sd/app/com.google.
android.stardroid.apk' are the same file
cp: '/data/app/com.google.zxing.client.android.apk' and '/system/sd/app/com.goog
le.zxing.client.android.apk' are the same file
cp: '/data/app/com.handcent.nextsms.apk' and '/system/sd/app/com.handcent.nextsm
s.apk' are the same file
cp: '/data/app/com.luke.uktvguide.apk' and '/system/sd/app/com.luke.uktvguide.ap
k' are the same file
cp: '/data/app/com.magicwach.rdefense_free.apk' and '/system/sd/app/com.magicwac
h.rdefense_free.apk' are the same file
cp: '/data/app/com.maplekeycompany.apps.shake.apk' and '/system/sd/app/com.maple
keycompany.apps.shake.apk' are the same file
cp: '/data/app/com.mathpad.mobile.android.wt.unit.apk' and '/system/sd/app/com.m
athpad.mobile.android.wt.unit.apk' are the same file
cp: '/data/app/com.mattwach.trap2.apk' and '/system/sd/app/com.mattwach.trap2.ap
k' are the same file
cp: '/data/app/com.mgillespie.AutosportsFREE.apk' and '/system/sd/app/com.mgille
spie.AutosportsFREE.apk' are the same file
cp: '/data/app/com.mgillespie.GamingNews.apk' and '/system/sd/app/com.mgillespie
.GamingNews.apk' are the same file
cp: '/data/app/com.mixzing.basic.apk' and '/system/sd/app/com.mixzing.basic.apk'
are the same file
cp: '/data/app/com.neoline.music.apk' and '/system/sd/app/com.neoline.music.apk'
are the same file
cp: '/data/app/com.newsrob.apk' and '/system/sd/app/com.newsrob.apk' are the sam
e file
cp: '/data/app/com.opera.mini.android.apk' and '/system/sd/app/com.opera.mini.an
droid.apk' are the same file
cp: '/data/app/com.pgmsoft.wifinder.apk' and '/system/sd/app/com.pgmsoft.wifinde
r.apk' are the same file
cp: '/data/app/com.rechild.advancedtaskkiller.apk' and '/system/sd/app/com.rechi
ld.advancedtaskkiller.apk' are the same file
cp: '/data/app/com.rerware.android.MyBackupPro.apk' and '/system/sd/app/com.rerw
are.android.MyBackupPro.apk' are the same file
cp: '/data/app/com.shazam.android.apk' and '/system/sd/app/com.shazam.android.ap
k' are the same file
cp: '/data/app/com.socialnmobile.dictapps.notepad.color.note.apk' and '/system/s
d/app/com.socialnmobile.dictapps.notepad.color.note.apk' are the same file
cp: '/data/app/com.xe.android.apk' and '/system/sd/app/com.xe.android.apk' are t
he same file
cp: '/data/app/de.android_telefonie.appmanager.apk' and '/system/sd/app/de.andro
id_telefonie.appmanager.apk' are the same file
cp: '/data/app/de.czesla.android.remote.apk' and '/system/sd/app/de.czesla.andro
id.remote.apk' are the same file
cp: '/data/app/net.flixster.android.apk' and '/system/sd/app/net.flixster.androi
d.apk' are the same file
cp: '/data/app/org.transdroid.apk' and '/system/sd/app/org.transdroid.apk' are t
he same file
cp: '/data/app/uk.co.johnsto.android.beebplayer.apk' and '/system/sd/app/uk.co.j
ohnsto.android.beebplayer.apk' are the same file
[ ] Linking /data/app to /system/sd/app.
[ ] Moving private apps to SD card.
cp: '/data/app-private/br.com.fast4ward.sdcardspeedtester.apk' and '/system/sd/a
pp-private/br.com.fast4ward.sdcardspeedtester.apk' are the same file
[ ] Linking /data/app-private to /system/sd/app-private.
[ ] Removing No A2SD flag file.
rm: cannot remove '/data/.noa2sd': No such file or directory
[ ] Setting File System Ready property to 1.
[ ] Remounting /system to read-only.
#
Can someone also explain how A2SD works in a simplified form? It may help in understanding things.
Thanks.
Your android phone is designed to store applications in the phone's internal storage under the directory /data/app and /data/app-private.
Apps2SD allows the applications to be stored on the SD card by telling Android to store the applications somewhere else.
It does this by creating directories on your SD card, then replaces /data/app and /data/app-private with a symbolic link file. A symbolic link file is a file that is a reference to another file or directory. This is similar to how shortcuts work in Windows.
For example, without Apps2SD installed, if you used a file manager on your phone and tapped the /data/app folder, you would see a bunch of files. Now, if you look at where you are at in the directory chain, you would be at /data/app, since that is a directory.
When Apps2SD is active, if you tap on the /data/app folder, you would still see files, but you will noticed that you are in a completely different directory (/system/sd/app). This is because /data/app is a file that points to /system/sd/app. When Android stores your program in /data/app, it thinks it is still storing it in /data/app (Internal storage). But, because of redirection, it is really storing the program in /system/sd/app.
When you type a2sd install, one of the processes it performs is moving all the data from /data/app to /system/sd/app. In your case, it looks like you tried to perform an install of Apps2SD after it was already installed. In other words, the files were trying to copy to themselves, which can't happen.
The a2sd install command is usually not necessary, as the program will automatically set itself up upon boot. The only time you really need to use a2sd install is if you used an a2sd remove command in the past or the Boot Loop Prevention code activated (your SD card failed to mount). Both scenarios activate the No Apps2SD flag file, which a2sd install removes.
To check your diskspace on your ext partition, you can use a2sd diskspace.
mgillespie said:
Running a GSM Hero using a stock 2.1 repack ROM.
I've not used A2SD before, but giving it a shot now. I had no problems setting it up, the instructions are very clear and concise, but I am having problems using it.
I setup a 750MB ext3 partition, and I was expecting AppMonster to report I had loads of freespace. It was reporting my freespace as pretty much what it was before. (100MB free)
I tried /system/bin/a2sd install and it appears I have lots of duplicated files from the rather verbose output.
What have I done wrong?
Thanks.
Code:
# /system/bin/a2sd install
/system/bin/a2sd install
[ ] Launching Darktremor A2SD
[*] Starting Darktremor Apps2SD version 2.7.5 preview
[ ] Mounting /system as read-write
[ ] Starting Apps2SD in install mode
[ ] Checking SD Card.
[ ] Searching for Mount Point...
[!] Mount point found..no further action required.
[ ] Checking for ext partition
[*] Ext partition found and already mounted.
[ ] Moving apps to SD card.
cp: '/data/app/YouTube.apk' and '/system/sd/app/YouTube.apk' are the same file
cp: '/data/app/br.com.fast4ward.sdcardspeedtester.zip' and '/system/sd/app/br.co
m.fast4ward.sdcardspeedtester.zip' are the same file
cp: '/data/app/btm.game.ui.apk' and '/system/sd/app/btm.game.ui.apk' are the sam
e file
cp: '/data/app/com.adobe.reader.apk' and '/system/sd/app/com.adobe.reader.apk' a
re the same file
cp: '/data/app/com.agilesoftresource.apk' and '/system/sd/app/com.agilesoftresou
rce.apk' are the same file
cp: '/data/app/com.alfray.timeriffic.apk' and '/system/sd/app/com.alfray.timerif
fic.apk' are the same file
cp: '/data/app/com.bigtincan.android.adfree.apk' and '/system/sd/app/com.bigtinc
an.android.adfree.apk' are the same file
cp: '/data/app/com.bonfiremedia.android_ebay.apk' and '/system/sd/app/com.bonfir
emedia.android_ebay.apk' are the same file
cp: '/data/app/com.dozingcatsoftware.WireGoggles.apk' and '/system/sd/app/com.do
zingcatsoftware.WireGoggles.apk' are the same file
cp: '/data/app/com.facebook.katana.apk' and '/system/sd/app/com.facebook.katana.
apk' are the same file
cp: '/data/app/com.google.android.apps.maps.apk' and '/system/sd/app/com.google.
android.apps.maps.apk' are the same file
cp: '/data/app/com.google.android.apps.shopper.apk' and '/system/sd/app/com.goog
le.android.apps.shopper.apk' are the same file
cp: '/data/app/com.google.android.apps.translate.apk' and '/system/sd/app/com.go
ogle.android.apps.translate.apk' are the same file
cp: '/data/app/com.google.android.apps.unveil.apk' and '/system/sd/app/com.googl
e.android.apps.unveil.apk' are the same file
cp: '/data/app/com.google.android.maps.mytracks.apk' and '/system/sd/app/com.goo
gle.android.maps.mytracks.apk' are the same file
cp: '/data/app/com.google.android.stardroid.apk' and '/system/sd/app/com.google.
android.stardroid.apk' are the same file
cp: '/data/app/com.google.zxing.client.android.apk' and '/system/sd/app/com.goog
le.zxing.client.android.apk' are the same file
cp: '/data/app/com.handcent.nextsms.apk' and '/system/sd/app/com.handcent.nextsm
s.apk' are the same file
cp: '/data/app/com.luke.uktvguide.apk' and '/system/sd/app/com.luke.uktvguide.ap
k' are the same file
cp: '/data/app/com.magicwach.rdefense_free.apk' and '/system/sd/app/com.magicwac
h.rdefense_free.apk' are the same file
cp: '/data/app/com.maplekeycompany.apps.shake.apk' and '/system/sd/app/com.maple
keycompany.apps.shake.apk' are the same file
cp: '/data/app/com.mathpad.mobile.android.wt.unit.apk' and '/system/sd/app/com.m
athpad.mobile.android.wt.unit.apk' are the same file
cp: '/data/app/com.mattwach.trap2.apk' and '/system/sd/app/com.mattwach.trap2.ap
k' are the same file
cp: '/data/app/com.mgillespie.AutosportsFREE.apk' and '/system/sd/app/com.mgille
spie.AutosportsFREE.apk' are the same file
cp: '/data/app/com.mgillespie.GamingNews.apk' and '/system/sd/app/com.mgillespie
.GamingNews.apk' are the same file
cp: '/data/app/com.mixzing.basic.apk' and '/system/sd/app/com.mixzing.basic.apk'
are the same file
cp: '/data/app/com.neoline.music.apk' and '/system/sd/app/com.neoline.music.apk'
are the same file
cp: '/data/app/com.newsrob.apk' and '/system/sd/app/com.newsrob.apk' are the sam
e file
cp: '/data/app/com.opera.mini.android.apk' and '/system/sd/app/com.opera.mini.an
droid.apk' are the same file
cp: '/data/app/com.pgmsoft.wifinder.apk' and '/system/sd/app/com.pgmsoft.wifinde
r.apk' are the same file
cp: '/data/app/com.rechild.advancedtaskkiller.apk' and '/system/sd/app/com.rechi
ld.advancedtaskkiller.apk' are the same file
cp: '/data/app/com.rerware.android.MyBackupPro.apk' and '/system/sd/app/com.rerw
are.android.MyBackupPro.apk' are the same file
cp: '/data/app/com.shazam.android.apk' and '/system/sd/app/com.shazam.android.ap
k' are the same file
cp: '/data/app/com.socialnmobile.dictapps.notepad.color.note.apk' and '/system/s
d/app/com.socialnmobile.dictapps.notepad.color.note.apk' are the same file
cp: '/data/app/com.xe.android.apk' and '/system/sd/app/com.xe.android.apk' are t
he same file
cp: '/data/app/de.android_telefonie.appmanager.apk' and '/system/sd/app/de.andro
id_telefonie.appmanager.apk' are the same file
cp: '/data/app/de.czesla.android.remote.apk' and '/system/sd/app/de.czesla.andro
id.remote.apk' are the same file
cp: '/data/app/net.flixster.android.apk' and '/system/sd/app/net.flixster.androi
d.apk' are the same file
cp: '/data/app/org.transdroid.apk' and '/system/sd/app/org.transdroid.apk' are t
he same file
cp: '/data/app/uk.co.johnsto.android.beebplayer.apk' and '/system/sd/app/uk.co.j
ohnsto.android.beebplayer.apk' are the same file
[ ] Linking /data/app to /system/sd/app.
[ ] Moving private apps to SD card.
cp: '/data/app-private/br.com.fast4ward.sdcardspeedtester.apk' and '/system/sd/a
pp-private/br.com.fast4ward.sdcardspeedtester.apk' are the same file
[ ] Linking /data/app-private to /system/sd/app-private.
[ ] Removing No A2SD flag file.
rm: cannot remove '/data/.noa2sd': No such file or directory
[ ] Setting File System Ready property to 1.
[ ] Remounting /system to read-only.
#
Can someone also explain how A2SD works in a simplified form? It may help in understanding things.
Thanks.
Click to expand...
Click to collapse
Many thanks for that. That helps understand what is happening.
Is it normal that regular (a2sd unaware) apps like AppMonster will not be able to correctly report free internal phone diskspace? As clearly the report of 100MB free is totally bogus.
If this is normal, and I can use the a2sd diskspace command instead, that fine too, perhaps I worry too much, or ask too many questions!!!
Well when I get home I'll run it through it paces on my Rom and post my findings.
tkirton said:
You can still visit the old thread: http://forum.xda-developers.com/showthread.php?t=670087
At this moment, I need software testers to do some routine tests. Feedback is appreciated.
Click to expand...
Click to collapse
Sent from my HERO200 using XDA App
many thanks for this update, so how exactly do we enable (check if already enabled) JIT?
Got it up and running on blue echo and it runs beautifully. I've got 131mb free on my phone and the rom is flashing and running smooth as silk. Thanks for the update.
Only suggestion that I could make is maybe having an app like dcConfig but for ur a2sd that way u can change setting very easily. But other than that I love it and will always run ur stuff on my roms
The 100MB free is internal storage space (the /data partition). Remember that your applications are being stored on the Secure Digital card and not the data partition, so 100MB sounds right for the internal storage if you didn't move dalvik-cache.
a2sd diskspace reports the free space on your ext partition, so it will show a large difference (you configured more space on your ext partition).
mgillespie said:
Many thanks for that. That helps understand what is happening.
Is it normal that regular (a2sd unaware) apps like AppMonster will not be able to correctly report free internal phone diskspace? As clearly the report of 100MB free is totally bogus.
If this is normal, and I can use the a2sd diskspace command instead, that fine too, perhaps I worry too much, or ask too many questions!!!
Click to expand...
Click to collapse
The one with the GUI configuration is slated for 2.8. I just have to learn Java to program it (or convince friends of mine to help).
Believe me, I really want the GUI configuration in there. I think it would resolve many of the configuration questions I continue to receive.
Papa Smurf151 said:
Got it up and running on blue echo and it runs beautifully. I've got 131mb free on my phone and the rom is flashing and running smooth as silk. Thanks for the update.
Only suggestion that I could make is maybe having an app like dcConfig but for ur a2sd that way u can change setting very easily. But other than that I love it and will always run ur stuff on my roms
Click to expand...
Click to collapse
I completely agree. I wish I knew how to build an app from scratch cause I'd Def do it for u. U have helped so many here and r great at what u do. This thing deserves the GUI
im getting an error when trying to enable/disable jit
Code:
# apps2sd jit
apps2sd jit
[ ] Launching Darktremor A2SD
[*] Starting Darktremor Apps2SD version 2.7.5 preview
[ ] Mounting /system as read-write
[ ] Starting Apps2SD in jit mode
[ ] Running A2SD JIT Install Program.
[ ] Running JIT Setup.
/system/bin/jit.a2sd: line 7: Case: command not found
/system/bin/jit.a2sd: line 8: syntax error near unexpected token `)'
/system/bin/jit.a2sd: line 8: ` "install")'
[ ] Setting File System Ready property to 1.
[ ] Remounting /system to read-only.
# apps2sd nojit
apps2sd nojit
[ ] Launching Darktremor A2SD
[*] Starting Darktremor Apps2SD version 2.7.5 preview
[ ] Mounting /system as read-write
[ ] Starting Apps2SD in nojit mode
[ ] Running A2SD JIT Removal Program.
[ ] Running JIT Setup.
/system/bin/jit.a2sd: line 7: Case: command not found
/system/bin/jit.a2sd: line 8: syntax error near unexpected token `)'
/system/bin/jit.a2sd: line 8: ` "install")'
[ ] Setting File System Ready property to 1.
[ ] Remounting /system to read-only.
#
Just an update, So far it is smooth as silk, havent had any issues on my rom as of yet. Thanks tkirton
I can't test JIT since the rom I'm using already has it. But thanks for the feedback...I'll fix that right away.
urushiol said:
im getting an error when trying to enable/disable jit
Code:
# apps2sd jit
apps2sd jit
[ ] Launching Darktremor A2SD
[*] Starting Darktremor Apps2SD version 2.7.5 preview
[ ] Mounting /system as read-write
[ ] Starting Apps2SD in jit mode
[ ] Running A2SD JIT Install Program.
[ ] Running JIT Setup.
/system/bin/jit.a2sd: line 7: Case: command not found
/system/bin/jit.a2sd: line 8: syntax error near unexpected token `)'
/system/bin/jit.a2sd: line 8: ` "install")'
[ ] Setting File System Ready property to 1.
[ ] Remounting /system to read-only.
# apps2sd nojit
apps2sd nojit
[ ] Launching Darktremor A2SD
[*] Starting Darktremor Apps2SD version 2.7.5 preview
[ ] Mounting /system as read-write
[ ] Starting Apps2SD in nojit mode
[ ] Running A2SD JIT Removal Program.
[ ] Running JIT Setup.
/system/bin/jit.a2sd: line 7: Case: command not found
/system/bin/jit.a2sd: line 8: syntax error near unexpected token `)'
/system/bin/jit.a2sd: line 8: ` "install")'
[ ] Setting File System Ready property to 1.
[ ] Remounting /system to read-only.
#
Click to expand...
Click to collapse
The link for fix 1 (2?) isn't working.
It is now...I uploaded the archive file instead of the signed file.
mtnchkn said:
The link for fix 1 (2?) isn't working.
Click to expand...
Click to collapse
Hello everyone, i was testing 'SD speed tweak' of CF-Root by skin1980 in KPM, and found out that it wasn't working properly, so i decided to fix it and share the results
This tweak aims to increase read speed of both internal and external sd-cards by increasing the buffer size. It should work in any firmware/rom with ROOT privileges, if the rom doesn't support loading scripts from init.d, check the bottom of the post.
Put this script in /etc/init.d with any name, for example 98Sdfix:
Code:
#!/system/bin/sh
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/179:16/read_ahead_kb;
Important! it needs execution permissions (rwxrwxrwx) it can be done in root explorer or on a terminal by doing chmod 777 /etc/init.d/98sdfix
Important! the second path 179:16 may vary according external SD size, check the path with a root explorer and adjust the script if needed.
Reboot or run the script in a terminal as root to see the effects
Info: the number 2048 is the new buffer size (original was 128), it can be anything like 256,512,1024,2048,3072,etc. you can use whichever you found best (i recommend Sd Tools to test)
Option 2 (if the above isn't working for you)
Code:
#!/system/bin/sh
echo "2048" > /sys/devices/platform/mmci-omap-hs.0/mmc_host/mmc1/mmc1:1234/block/mmcblk1/queue/read_ahead_kb;
echo "2048" > /sys/devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/queue/read_ahead_kb;
Please notice that in the path to the file there are folders named mmc0:0001 and mmc1:1234 this last 4 numbers could vary from different firmware versions/roms check the path with a root explorer and adjust the script if needed.
Note: if the rom doesn't support loading scripts from init.d, it could work anyways using Script manager or any app like it, be sure to check "Run as Root" and 'Run at boot'
Similar Post on http://forum.xda-developers.com/showthread.php?t=1010807
(it isn't exactly the same since i added external-sd and option 2 is device specific)
I hope it helps
Script attached: unzip and place it in /etc/init.d please check the second path with a root explorer and adjust the script if needed
You should put a disclaimer: With this fix there will be sync issue with voice and video in video recording
jaskiratsingh said:
You should put a disclaimer: With this fix there will be sync issue with voice and video in video recording
Click to expand...
Click to collapse
Sorry to hear that, but its not a problem of the fix (tested several times, i don't have that problem), maybe it's a slow card (Class 4 or greater is recommended for HD), or it can be some other modifications you made, try with a ramscript to see if the phone has the problem because it struggling with ram, i suggest v6supercharger with MegaRAM settings...
Can u upload ur script so that we directly test it...? That will be good for every one.
vishal24387 said:
Can u upload ur script so that we directly test it...? That will be good for every one.
Click to expand...
Click to collapse
these are already present in many roms
sakindia123 said:
these are already present in many roms
Click to expand...
Click to collapse
Not really, only internal sdcard is considered (179:0) wich is universal, external-sd (179:16) it's not and must be manually added
alfrix said:
Not really, only internal sdcard is considered (179:0) wich is universal, external-sd (179:16) it's not and must be manually added
Click to expand...
Click to collapse
great work buddy...
great work.
works well.
most of the script part went over my head so can someone pls tell how to install it in a simple way??pls
i can paste the script in /etc/init.d
but what does this mean?-
please check the second path with a root explorer and adjust the script if needed??
akashsgpgi said:
most of the script part went over my head so can someone pls tell how to install it in a simple way??pls
i can paste the script in /etc/init.d
but what does this mean?-
please check the second path with a root explorer and adjust the script if needed??
Click to expand...
Click to collapse
"Please notice that in the path to the file there are folders named mmc0:0001 and mmc1:1234 this last 4 numbers could vary from different firmware versions/roms check the path with a root explorer and adjust the script if needed."
after placing the script, using root explore, follow the system path as mentioned: "/sys/devices/platform/mmci-omap-hs.0/mmc_host/mmc1/mmc1:1234"
means "in the sys folder, open the devices folder, then open the platform folder, then open the mmi-omap-hs.0 folder, etc. etc." until you get where you need to go.
my address on mmc1 is e624
im going to use method 1
but in place of 2048 what should i put , i tried sd tools but i got speed in mb/s (writing 7mb/s and reading 16.7mb/s)
so what to put in place of 2048 in the script:
#!/system/bin/sh
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/179:16/read_ahead_kb;
Mine is 60MB/s read and 10 in write
akashsgpgi said:
im going to use method 1
but in place of 2048 what should i put , i tried sd tools but i got speed in mb/s (writing 7mb/s and reading 16.7mb/s)
so what to put in place of 2048 in the script:
#!/system/bin/sh
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/179:16/read_ahead_kb;
Click to expand...
Click to collapse
Sent from my GT-I9003 using XDA App
i have applied this script
so now do i have to disable sd speed tweak in the cf root tweak manager??
It simply worked , thanks :good:
i have 32GB class 10 SD Card before this script my Writing Speed was :28.3 MB/s and Read Speed: 34.2
but after the script my Writing Speed is:16.4 :crying: but My Read Speed: 64.8 what is this ????
Important!
For people that can't find the second path :: like Me
I think this is easiest way to know the second path the first part 179 is constant put the the second part (16) it depends on you Ext SD Card Size (i tried this tweak but without modification and it work on internal sd card only but when i modified it and make it 179:32 cuz i have 32GB micro SD card it works perfectly )
First-Boot Install System
I have searched Far and wide for something like this since i first put out SleeperROM in November and always come up empty.
So with the latest release, i decided it was finally time to do it myself.
All you have to do is, using the following package as a template either on its own or in your ROM, make sure your batch folder with the .apk's to install are in /data/.firstboot/
Why
Some apps like QuickPic, ConnectBot, TinyFlashlight, Flash, Google Goggles and others that rely on linked libs don't like to simply be copied to their install dir because many won't install their own libs unless the PackageManager does it and/or they won't add themselves to the packages list (like QuickPic). The old solution is to include the lib either in the /data/data/appdir/lib with the rom install OR in /system/lib but this is quite wasteful especially in the case of big apps like Flash where including the libs separately from the app effectively doubles the space taken up on the rom by that single app since the apk still contains the lib files within.
So the solution is to install on first boot by including the apps in a batch folder for the script to process.
How it works
What it does is run from the init scripts, as one of the last scripts to run, it waits until the Android core system is up (checks to be sure by waiting for the SystemUI process is running then waits for an additional 10 seconds)
Then runs /data/.firstboot.sh, which is where you should put your first boot routines. Included in this script is the batch app installer which looks for the apps in /data/.firstboot/ and stores temporary app backups in /cache/tmp -- so be mindful that on MTD roms, the cache partition is smaller so may have to modify the $tmp variable to wherever you want to store temporaries
After installing, it sleeps for a proportional number of seconds (5 seconds per app installed) to ensure there is no race condition between installs or the final permissions_fix, zipalign and tmp cleanup. The /data/.firstboot.sh script removes itself when everything is complete.
The remaining components are kept in there for additional use by the /etc/init.d/Y02firstboot script in the future, so then all that needs to be put on the phone is a new /data/.firstboot/ dir and replacement /data/.firstboot.sh to run a batch of updates.
The Apps MUST be named by their package name.
I.e. Titanium Backup MUST be named com.keramidas.TitaniumBackup.apk
the file name must correspond with the name of the data dir in /data/data/ the script is lazy in that way, i didn't feel like keeping a file manifest of installs, instead just like to drop in apps to install.
The installer
consists of the following components:
- /system/etc/init.d/Y02firstboot
- /system/xbin/rsync
- /system/xbin/fix_permissions
- /system/xbin/batch_zipalign
- /system/xbin/sleeperlog (echos, logcats, and writes a log of activity to /sdcard/sleeperlog.txt)
- /data/.firstboot.sh
- /data/.firstboot/ (batch app directory)
- NOT INCLUDED, there must be a busybox bin somewhere in $PATH - this is not a problem for most roms
See the package link for a ready to use first-boot installer [CWM] flashable. Just drop your apks into /fs/data/.firstboot/ for a batch app updater
Download the template/usable package
DOWNLOAD MOD_CWM-FirstBoot-20120112.zip
File size: 341.07 KB / MD5 23d88c349b8d2fa3cd2f9958ae99a1f6
THE MAIN COMPONENTS:
/system/etc/init.d/Y02firstboot
Code:
#!/system/bin/sh
# execute post-install script on First boot
# 01022012 SENSEISIMPLE
SLEEP=3
FBSCR="/data/.firstboot.sh"
BB="busybox"
pg () {
$BB ps | $BB grep "[email protected]" | $BB grep -v "$( echo $BB grep [email protected] )"
}
if [ -f "$FBSCR" ]; then
#install apps on first boot after system services have started
sleeperlog "Found $FBLOC"
sleeperlog "Waiting for system"
$BB chmod 0755 $FBSCR
while : ; do
if pg systemui; then
$BB sleep 10
sleeperlog "system loaded."
log -p i -t boot "Executing $FBSCR script"
sleeperlog "Running FirstBoot init"
$FBSCR
break
fi
sleeperlog "WAITING FOR SYSTEM SERVICE: sleeping for $SLEEP s..."
$BB sleep $SLEEP
done
fi
/data/.firstboot.sh
Code:
#!/system/bin/sh
#
# 20120107 - SENSEISIMPLE
#
log -p i -t init:firstboot "INIT.firstboot BEGIN: USER SCRIPT $FBLOC.sh"
sleeperlog "FirstBoot Script OK TO RUN"
FBLOC="/data/.firstboot"
tmp="/cache/tmp/firstboot"
bak="$tmp/bak/data/data/"
BB="busybox"
RM="$BB rm"
CP="$BB cp"
MV="$BB mv"
MKDIR="$BB mkdir"
LS="$BB ls"
CHMOD="$BB chmod"
SLEEP="$BB sleep"
GREP="$BB grep"
pg () {
$BB ps | $BB grep "[email protected]" | $BB grep -v "$( echo $BB grep [email protected] )"
}
$CHMOD 0777 /data
#install apps on first boot
if [ -d $FBLOC ]; then
sleeperlog "Found $FBLOC"
if [ "$($LS $FBLOC)" ]; then
cd $FBLOC
$MKDIR -p $bak
for pkg in *.apk; do
log -p i -t init:firstboot "INIT.firstboot INSTALLING: $pkg"
sleeperlog "PREPARING: $pkg"
pkgname=${pkg%.*}
sleeperlog "BACKING UP APP DATA - $pkgname"
#back up data, delete the original data dir to prevent install errors (pm isn't very good at what it does)
if [ -d /data/data/$pkgname ]; then
$CP -a /data/data/$pkgname $bak/$pkgname
$RM -rf /data/data/$pkgname
fi
#WAIT, then install, then WAIT SOME MORE
$SLEEP 2
sleeperlog "INSTALLING $pkgname"
pm install -r $FBLOC/$pkg &
$SLEEP 10
#REIntegrate application data
if [ -d "$bak/$pkgname" ]; then
sleeperlog "\nSYNCING APP DATA \n\n$(/system/xbin/rsync -auv --exclude=lib $bak/$pkgname/ /data/data/$pkgname/)\n"
fi
i=$((i+1))
#Move the install .apk to tmp
if $LS /data/app | $GREP "$pkgname"; then
sleeperlog "Package appears to have installed."
$MV "$pkg" $tmp/
fi
#If the firstboot batch dir is empty, delete it now
! [ "$($LS $FBLOC)" ] && $RM -rf $FBLOC
done
#WAIT for [#ofapps x 5 seconds each] to avoid a race condition
waitsecs=$(( i * 5 ))
sleeperlog "Waiting for ${waitsecs}s before Fixing Permissions"
$SLEEP $waitsecs
sleeperlog "Fixing Permissions $(/system/xbin/fix_permissions)"
sleeperlog "Running batch zipalign \n\n $(/system/xbin/zipalign)"
sleeperlog "Clearing tmp $tmp"
fi
fi
sleeperlog "FIRSTBOOT SCRIPT COMPLETE"
log -p i -t init:firstboot "INIT.firstboot SELF DESTRUCT FIRSTBOOTSCRIPT"
if ! [ "$($LS $FBLOC)" ]; then
$MV $0 $tmp/.firstboot
# COMMENT THIS OUT FOR DEBUGGING, TO NOT REMOVE THE TMP DIR
$RM -r $tmp
echo ""
fi
echo -e "#\n#COMPLETED ON $(date)\n#" >> $0
sleeperlog "FirstBoot Apoptosis"
log -p i -t init:firstboot "INIT.firstboot END: USER SCRIPT $FBLOC.sh"
THANKS
CyanogenMod team for the Fix_permissions script
DarkyROM for the Batch Zipalign script
Saving this seat . . .
does this work with a bml rom?
^^^^In theory, it would work with an NTFS rom, if one existed - different filesystems don't [usually] create any changes on the surface... if you try to copy a file from a partition of any file system to a partition of any other file system, you don't have to explicitly tell the system the fs types involved. I haven't looked through the entire script, but if there are any commands that must specify the partition type, it would be a simple matter of changing any occurances of EXT4 to YAFFS2, etc.
This could be a great way to make a clean reinstall with all of your apps intact (minus app data, do a separate backup with your backup app of choice) - first, backup your installed apps by copying them to the appropriate directory, then do a full wipe and install, with the script automatically reinstalling your apps on first boot...
EDIT: I just looked through the script more closely. First, it appears that data is backed up. Second, I can confirm that the standard, non-file system-specific linux commands are used for file operations (cp to copy, etc), so this script shouldn't need any adjustment to accomodate different file systems
Sent from my SPH-D700 using XDA App
Is it possible for someone to develop an application to backup your personal apps and then running a script in clockwork or on first boot that does the same thing as this, alllowing for personal apps to be in the rom directly after flashing. I understand that sometimes apps may not be compatible, but can randomroms rdu script be modified to choose to do this?
Sent From My Cyan4g
Good looking script SenseiSimple!!
Okay, I'm trying to use this script, but you said to put the apps in fs/data/firstboot/ but where is "fs"? I found the "firstboot.sh" file, but I'm sure I can't put the apk's in there...
In loving memory of my son "Jeffrey Ryan Giles" 11/17/1992 to 11/25/2011 :'(
sniperkill said:
Okay, I'm trying to use this script, but you said to put the apps in fs/data/firstboot/ but where is "fs"? I found the "firstboot.sh" file, but I'm sure I can't put the apk's in there...
In loving memory of my son "Jeffrey Ryan Giles" 11/17/1992 to 11/25/2011 :'(
Click to expand...
Click to collapse
If you look at the folder structure inside the SleeperROM zip, you'll see he uses an fs directory to hold his system and data folders for installation. If you're developing a ROM, you can adapt the script to point to wherever your data folder is (most other ROMs just have system and data in the root directory of the zip, so the path would just be data/firstboot/).
EDIT: no need to look in SleeperROM zip, the firstboot zip in the OP has the same folder structure. It just doesn't seem to have the firstboot directory inside data. You'll need to add that.
Sent from my SPH-D700 using XDA App
bbelos said:
If you look at the folder structure inside the SleeperROM zip, you'll see he uses an fs directory to hold his system and data folders for installation. If you're developing a ROM, you can adapt the script to point to wherever your data folder is (most other ROMs just have system and data in the root directory of the zip, so the path would just be data/firstboot/).
EDIT: no need to look in SleeperROM zip, the firstboot zip in the OP has the same folder structure. It just doesn't seem to have the firstboot directory inside data. You'll need to add that.
Sent from my SPH-D700 using XDA App
Click to expand...
Click to collapse
Thanks for the reply buddy, so what I THINK your saying is to create a folder called "first boot" in my data folder?
In loving memory of my son" Jeffrey Ryan Giles" 11/17/1992 to 11/25/2011 - RIP :'(
sniperkill said:
Thanks for the reply buddy, so what I THINK your saying is to create a folder called "first boot" in my data folder?
In loving memory of my son" Jeffrey Ryan Giles" 11/17/1992 to 11/25/2011 - RIP :'(
Click to expand...
Click to collapse
Are you trying to do this in a ROM or on the phone? Sorry if that's a dumb question, but I just want to be sure we're on the same page.
Sent from my SPH-D700 using XDA App
sniperkill said:
Thanks for the reply buddy, so what I THINK your saying is to create a folder called "first boot" in my data folder?
In loving memory of my son" Jeffrey Ryan Giles" 11/17/1992 to 11/25/2011 - RIP :'(
Click to expand...
Click to collapse
bbelos said:
Are you trying to do this in a ROM or on the phone? Sorry if that's a dumb question, but I just want to be sure we're on the same page.
Sent from my SPH-D700 using XDA App
Click to expand...
Click to collapse
i hadn't noticed my zip routine apparently skips empty .folders
in the zip, there SHOULD have been /fs/data/.firstboot into which you place whatever apk files named according to their actual package name i.e. com.keramidas.TitaniumBackup.apk for Titanium Backup, com.alensw.PicFolder.apk for QuickPic and so on...
you can find out this info in Titanium Backup by finding the app in the list and tapping its name to show the data store location.
it HAS to correspond to the actual package name in order to properly back up the data files because the package manager binary as run from a script won't overwrite the data dir so the old data has to be synced back into the new install (rsync)
I am currently refactoring the script to reduce the number of dependencies... the system will then consist of the init.d script, zipalign and rsync bins, and the /data/.firstboot.sh, /data/.firstboot dir all in one place rather than scattered throughout the system.
irule9000 said:
Is it possible for someone to develop an application to backup your personal apps and then running a script in clockwork or on first boot that does the same thing as this, alllowing for personal apps to be in the rom directly after flashing. I understand that sometimes apps may not be compatible, but can randomroms rdu script be modified to choose to do this?
Sent From My Cyan4g
Click to expand...
Click to collapse
it would be possible to create an app to do this, and i considered it because of the need to make sure the android system is fully loaded for package manager to work, but given the requirement for full root access to start running before the system is up without having to worry about android permissions or getting SuperUser approval it's easier/more effective to do it as part of the system init in a script.
as far as randomking's rdu script, they would be compatible, but they exist separately as in one shouldn't interfere with the other, because the firstboot script runs long after install once the system is up and running.
you could modify the rdu setup to include/exclude the /data/.firstboot dir and .firstboot.sh script based on the selected config, since the init script does nothing if it doesn't see the /data/.firstboot.sh file, and the .firstboot.sh script does nothing if it doesn't see the .firstboot dir
SenseiSimple said:
it would be possible to create an app to do this, and i considered it because of the need to make sure the android system is fully loaded for package manager to work, but given the requirement for full root access to start running before the system is up without having to worry about android permissions or getting SuperUser approval it's easier/more effective to do it as part of the system init in a script.
as far as randomking's rdu script, they would be compatible, but they exist separately as in one shouldn't interfere with the other, because the firstboot script runs long after install once the system is up and running.
you could modify the rdu setup to include/exclude the /data/.firstboot dir and .firstboot.sh script based on the selected config, since the init script does nothing if it doesn't see the /data/.firstboot.sh file, and the .firstboot.sh script does nothing if it doesn't see the .firstboot dir
Click to expand...
Click to collapse
Expanding on the rdu script idea, how about a prop variable in the config to specify a user apps directory on the sdcard (best if standardized)? The user can store the apks to be installed after a clean flash in this directory. The rdu script would be modified to copy those apks to the firstboot directory. Although how to handle data? Maybe another script to be run before flashing that checks the apks in the sdcard folder, and copies the current data folder to the sdcard. This data is then restored somehow with the firstboot script. This all can be in addition to the firstboot apps included with the rom.
Sent from my SPH-D700 using XDA App
app
I honestly have no developing experience. To clarify, I was I simply asking if the app could back up the users personal apps/data to the specified folders, to make this script fool proof. Then when a rom is flashed the randomromkings rdu script which currently decides on lite roms or full roms could be modified to either install apps or not install apps depending on the rom compatibility. Finally data is wiped, rom flashes, and your script runs on boot allowing the apps to all be there. Expanding on that if the ROM allows apps to be re installed via your script, through the modified rdu, your script could be moved from one directory to another allowing the process to happen and at the end moves itself back to the original directory. This means that the end user who has no clue how to do anything but flash roms (like myself, but I want to learn) has done nothing accept backing up their apps. I know this is all hypothetical, but would this be possible, and also I have another idea that is probably impossible. If a script could be written so that the apps are backed up when the rom flashes, then the rom automatically does a factory restore and wipes the various caches, meaning that less people are going to have force close issues or other avoidable bugs because they didnt wipe. thanks for all your hard work
Clear Me Here !!
You said that the script (.firstboot.sh) removes itself, but does it remove Y02firstboot script from init.d?? I don't think so, also, there are no disadvantages of this after first boot, as it won't find .firsboot.sh and skip the operation, but why shud it execute unneccesarily everytime??
@OP--Plz. tell me if i am right or wrong.......If right, plz. add a function to remove that script from init.d. However files in /xbin are OK though, so no need to remove them............
Everybody is writing and making this appear as complicated as possible! So let me clarify what I believe the idea is here. First of all, the 'RDU script' I assume you're referring to is simply a flash-able zip to set you phone for a lite or full installation. It sets a config file. I use it in my rom, and I also currently use that config file to set several other features upon installation, and changeable at anytime one of my themes is flashed.
RDU was simply meant to jump start the idea of developers making installations more uniform. Which has happened to various extents, for example, I've used this first-boot install to solve my quickpic(I love the app) and flash pre-install problems. It also fixes usb tether, vlingo, terminal, etc.
SO, what are we saying here? We'd like to be able to backup our apps to the sd card, as many apps can do for us. Then, we'd like to either:
A. Build a script into a rom to restore these apps prior to or upon installation.
or
B. Build a separate script which would be run AFTER a rom installation to restore these apps from CWM.
Yes?
P.S. I see this is very late to the game, didn't realize this thread was being revived...
Still. Neat idea, sorry I hadn't noticed it yet.
+1 Thanks
After integrating this into my custom ROM, my phone (Galaxy S 4G) would only install the first .apk file in the .firstboot directory. After I removed the code which tells it to backup/restore the /data/data directories, it worked fine. I won't need that code since the ROM does a full wipe of /data every time anyway, but I'm not sure why it doesnt work when it's there. I'm not well versed enough with Java's syntax yet to comprehend why.
Also, your first post says that it should record logs to \sdcard\sleeperlog.txt but the script tries to record it to \sdcard\sleeperromlog.txt and neither one of those files actually appear on the sd card.
Edit: I had to remove the check to make sure the .firstboot directory is empty before deleting it, but it works fine on my Galaxy S 4G ROM as long as there are no /data/data directories for the programs I am installing.
does anyone still have a template of this? The link is down.
Edit: nevermind I don't need it anymore.
QSTN1: Is it necessary to umount sdcard1 before running fsck_msdos?
By doing so seems to break and remove some HomeScreen icons on some OS's where certain Apps have been 'Moved to SDcard'.
QSTN2: Does newer versions of Android OS (ie 5.0.2+) natively and automatically run fsck and fsck_msdos at boot-time on your FAT formatted plugin micro-SD card, or is it an add-on specific from various OEMs?
Most of you are probably very familiar with Windows ChkDsk.exe C: /f to repair damaged/corrupted SDcards.
You may have found that by removing your SDcard from your Android device and running ChkDsk under Windows, that you solved a lag problem with your Android device. By running ChkDsk on your SDcard, maybe prompted for you to 'Convert lost chains to files', and by fixing that, fixed my lag problem.
You may also have found that sometimes that's not enough, and you need to copy your whole SDcard over to a Windows folder, reformat your SDcard as FAT (same as it was before) and copied your data back. That certainly has been the case on one of my older and slower Android 10" tablets that some Apps like 'Screenshot Ultimate Pro' by 'Ice Cold Apps', as great as it is, sometimes corrupts my SDcard when I'm tapping around too fast.
Instead of having to take the SDcard out of my tablet each time I detected this problem, I needed to run fsck_msdos on the tablet itself, so I went through the motions and finally created a HomeScreen icon, where one single click will repair the SDcard and I could then get on with business.
TIP1: I've successfully created a HomeScreen icon using SManager by devwom by placing the following script under a 'scripts' folder I created under the default Home directory of SManager.
I also made sure that the script file had the appropriate (FULL) rights and that under Advanced, I made my 'Scripts' folder, SManager's Home-base.
My preferred location to place shell (.sh) scripts for SManager (Script Manager) by devwom:
/data/data/os.tools.scriptmanager/Scripts/
I used SMWidgets by devwom to create the HomeScreen icon for the script.
#!/system/bin/sh
# scr_FsCk_MsDos_on_MoXT1068_sdcard1.sh
# umount /dev/block/vold/179:65
fsck_msdos -y /dev/block/vold/179:65
echo .........
echo : Done! :
echo .........
NOTE: You can see in the script above, that I've commented out the umount command which seems to work whether or not the SDcard has been dismounted or not.
This is my main question I need answering, as around the traps, I see conflicting reports about dismounting first and I'd rather not have to do that if all works by leaving the SDcard mounted during fsck_msdos.
Thanks.
Hi, If I do this per adb shell as su I get the following error:
Code:
1|herolte:/ # fsck_msdos -y /dev/block/vold/public:179,1
fsck_msdos -y /dev/block/vold/public:179,1
stlog : disable(No such file or directory)
begin(dev:/dev/block/vold/public:179,1)
** fsck_msdos for samsung-mod version 1.1.1
** /dev/block/vold/public:179,1
exFAT signature in boot block: unsuported
end(ret:2, stderr:0, dev:/dev/block/vold/public:179,1), stat(dirs:(0/0), files:0)
Any advice please!
HI guys
I just discovered a way to make init.d work on my rom and it should work on other roms as long as everything is followed down to the T
Basically there are 5 things you need to do
1: BootImageExtractor *links to follow* need to get it from my other laptop
2: Notepad++ *ask google*
3: Rashr *or any other apps that can flash kernels I just use this one*
4: Rooted Device
5: Rootexplorer *or any apps that let you dig deep into the root of THE android*
Ok lets start
First up is to unpack your boot.img and you should see your RAMDISK folder
now go ahead and look for init.rc and open it with notepad++ now add this code either at the very top or below the import scripts.
Code:
import /init.d.sh
You can use any name really as long as you have the same import script and name of the sh file
Now on to the next step which is to create a .sh file
Open up notepad++ and add this code in
Code:
#!/system/bin/sh
on property:sys.boot_completed=1
start sysinit
service sysinit /sbin/sysinit.sh
oneshot
class late_start
user root
group root
disabled
Now save as and use all types and name it init.d.sh and be sure its in the ramdisk folder
Having fun yet?
now last but not the least the sysinit.sh file!
same method as above but with a different code and is saved in the sbin folder
Code:
#!/system/bin/sh
mount -o remount,rw /;
mount -o rw,remount /system
# init.d support
if [ ! -e /system/etc/init.d ]; then
mkdir /system/etc/init.d
chown -R root.root /system/etc/init.d
chmod -R 755 /system/etc/init.d
fi
# start init.d
for FILE in /system/etc/init.d/*; do
sh $FILE >/dev/null
done;
And there you have it folks!
I would like to credit where I got the idea from but alas the guy who gave me the boot.img says he got it from another site and got it randomly.... so would like to thank my buddy Car *actually a human not a machine*
I already tried using the 00test script by Ryuinferno to see if it works and after two reboots I found the test log file in /data
I am new at this so please be gentle and I am still working on this because I want to integrate the scripts of Ryuinferno into the kernel *scripts being the 00test and the 00setperm* he will allow me to use them.
Again thanks XDA! my new home
Feedback please ^_^
Reserved
Where is the difference to the easy to use apps from other devs?
-CALIBAN666- said:
Where is the difference to the easy to use apps from other devs?
Click to expand...
Click to collapse
This is just an alternate method
and there are some phones who cant get init.d to work even with the universal init.d app * i know cause my device has that problem*
I am not saying those apps are not working, infact I use those when I help mates with their phones performance *its easier yes*
and this is something like kernel injection so just flashing a kernel will add init.d and would/could be useful for some devs or guys who just want to know how things tick *like me*
Ok,cool,thanx for answer bro.greeetz!
Working...
Thanks