Custom scripts for Archangel root for firmware 2.0.71, 2.1.02, 2.1.03, 2.1.04, 2.1.08 - Gen8 Android Development

Finally we have a method to obtain root that does not involve installing the SDE and that works on at least three different firmware versions. 2.0.71, 2.1.02, 2.1.03, 2.1.08. For all the details see http://forum.xda-developers.com/showthread.php?t=928767
This program has the possibility to execute a script after root is acquired. See the readme.txt of Archangel v2.
You can create a script in /sdcard/sdcard/extraroot.sh and this will be executed as root
whenever you reboot, so you can use this to do any additional root functions you want.
If you make an error with this script which causes you a problem then you can eject your
sd card and reboot and it then will not execute.
Click to expand...
Click to collapse
NOTE: For windows users. Please use Notepad++ to edit the extraroot.sh and convert the file to unix format. In the menu choose "Format" -> "Convert to UNIX Format". This option is available with version v5.1.4 of Notepad++ it has been reported that it's not available in other versions.
Please post the firmware version, your script and a little description here.
Firmware 2.1.02, 2.1.03, 2.1.04,2.1.08 - Disable Swap
Swap is automatically enabled in these firmware versions.
Code:
swapoff /dev/block/mmcblk0p3
To verify that swap is turned off go to the Terminal Emulator and type free
Code:
/ $ free
total used free shared buffers
Mem: 243824 230972 12852 0 4332
Swap: 0 0 0
Total: 243824 230972 12852
Another way to turn off swap permanently without using the a script is to disable the swap service. This can be done from within the Terminal Emulator with the following commands
Code:
$su
#setprop persist.sys.archos.swapctl.en 0
Then reboot the device.
This only needs to be done once.
Firmware 2.0.71, 2.1.02, 2.1.03, 2.1.04, 2.1.08 - Disable ads
Disable ads. This was posted by archaism1 here http://forum.xda-developers.com/showthread.php?p=10941853#post10941853
Code:
cat <<EOF >/tmp/hosts
127.0.0.1 localhost
127.0.0.1 pagead2.googlesyndication.com pagead.l.google.com googleads.g.doubleclick.net
127.0.0.1 api.admob.com mm.admob.com r.admob.com mob.adwhirl.com cus.adwhirl.com met.adwhirl.com
EOF
mount --bind /tmp/hosts /etc/hosts
I have not tested this myself because I think the devs of applications need the ads to make some money.
Firmware 2.1.02, 2.1.03, 2.1.04, 2.1.08 - Swap on sd-card
Disable swap on internal storage and create a swap file on sd-card. The swap is 256Mb big to change the size just adjust the 256 value in the script.
ATTENTION: it can take a few minutes the first time the script is executed.
Code:
swapoff /dev/block/mmcblk0p3
if [ ! -f /sdcard/sdcard/myswap ]
then
echo "Creating swap file"
dd if=/dev/zero of=/sdcard/sdcard/myswap bs=1M count=256
mkswap /sdcard/sdcard/myswap
fi
swapon /sdcard/sdcard/myswap
And here the result of free
Code:
# free
total used free shared buffers
Mem: 243824 241432 2392 0 6232
Swap: 262136 320 261816
Total: 505960 241752 264208
WARNING: if you use a swapfile, which is described here, you can't use a usb connection to copy files without disabling the swap with the following command.
Code:
$su
#swapoff /sdcard/sdcard/myswap
Credit for this goes to http://forum.archosfans.com/viewtopic.php?f=74&t=42718
Hondaracer posted some scripts I'll include them as attachments

Advanced stuff.
Loading kernel modules.
There was a post in another thread about CifsManager here
chulri was so kind as to build the module. You can download it here.
Unzip the downloaded file and place it in a directory under /sdcard I suggest /sdcard/modules/
Add the following code to the extraroot.sh
Code:
insmod /sdcard/modules/cifs.ko
and reboot.
Now you can install CifsManager and start mapping drives.

Disable swap without using scripts
In Terminal Emulator execute following commands
Code:
$su
#setprop persist.sys.archos.swapctl.en 0

I have to create a file named extraroot.sh and and put it in /sdcard/sdcard ?
Do I need to make it executable ? (chmod +x)
Does it work only with permanent root ?
Thanks

ben.daccache said:
I have to create a file named extraroot.sh and and put it in /sdcard/sdcard ?
Do I need to make it executable ? (chmod +x)
Does it work only with permanent root ?
Thanks
Click to expand...
Click to collapse
You don't need to make it executable it's executed with sh /sdcard/sdcard/extraroot.sh
And you don't need the permanent root option either. It is also executed when you push the button.

Have tried your "Disable ads" script and it works perfect
No ads.
Why disable swap? Is there any reason?
cu
pOpY
PS: is there any way to increase the app storage size without using urkdroid?

popy2006 said:
Have tried your "Disable ads" script and it works perfect
No ads.
Click to expand...
Click to collapse
Good to know.
popy2006 said:
Why disable swap? Is there any reason?
Click to expand...
Click to collapse
There is some concern that swap on internal flash may reduce the lifetime of the flash. i just posted a way to enable swap on the sd-card . This is safer as the sdcard can be replaced the internal flash can not be replaced.
popy2006 said:
Is there any way to increase the app storage size without using urkdroid?
Click to expand...
Click to collapse
I'll look into it but i doubt it.

oh, thats a good reason to disable swap on the internal flash.
But i dont have an sdcard yet
Why then archos enables the swap default?
cu
pOpY

popy2006 said:
oh, thats a good reason to disable swap on the internal flash.
But i dont have an sdcard yet
Why then archos enables the swap default?
Click to expand...
Click to collapse
I have no idea why this was enabled by default. You have to ask Archos.

Swap
Will Swapper for Root or Swapper 2 (for root user) do the same thing for us noob's?

Mod57 said:
Will Swapper for Root or Swapper 2 (for root user) do the same thing for us noob's?
Click to expand...
Click to collapse
From what I can see all the commands to manage swap are present on the archos so both will probably work.
I'll get back to you.

Mod57 said:
Will Swapper for Root or Swapper 2 (for root user) do the same thing for us noob's?
Click to expand...
Click to collapse
Swapper for root is no solution as the swap file is created on the internal flash.
Swapper 2 on the other hand is working fine. But remember to place the swap on the external sd-card /sdcard/sdcard/swapfile.swp
I still placed
Code:
swapoff /dev/block/mmcblk0p3
in the extraroot.sh to be sure the internal swap was off.

Swap
Thank you.

wdl1908 said:
Originally Posted by popy2006
oh, thats a good reason to disable swap on the internal flash.
But i dont have an sdcard yet
Why then archos enables the swap default?
Click to expand...
Click to collapse
I have no idea why this was enabled by default. You have to ask Archos.
Click to expand...
Click to collapse
Probably the realization that they screwed up with only 256MB of RAM.
ARCHOS PRESIDENT: We get lots of complaints about the small RAM... what could we do?
ARCHOS ENGINEER: We can always use some of the internal flash for a swap.
ARCHOS PRESIDENT: Won't that decrease the life of the flash memory?
ARCHOS ENGINEER: Yes, but by then we'll have Gen9 out.
ARCHOS PRESIDENT: Great... go with it...

argie said:
Probably the realization that they screwed up with only 256MB of RAM.
ARCHOS PRESIDENT: We get lots of complaints about the small RAM... what could we do?
ARCHOS ENGINEER: We can always use some of the internal flash for a swap.
ARCHOS PRESIDENT: Won't that decrease the life of the flash memory?
ARCHOS ENGINEER: Yes, but by then we'll have Gen9 out.
ARCHOS PRESIDENT: Great... go with it...
Click to expand...
Click to collapse
LOL Good one.
I'v been doing some testing with swap and i'v seen not a lot of improvement.
Some tests I did.
Disable swap
install the flash plugin.
Go to the site of archosfans with the stock browser
Play the first flash video on the site.
The result is that after the video has started all apps in the background are killed off by the android memory manager and even ADW launcher is killed.
So second test
Enable swap
Go to the site of archosfans with the stock browser
Play the first flash video on the site.
Check with the command free via adb
The result is exactly the same as above and only 10Mb swap is used.
So for me swap is useless under android.
I suspect the android memory manager kicks in before the linux kernel has time to swap out the programs to free memory.
I also suspect that non of the real android apps are swapped out to those 10Mb but only the real linux programs are swapped out. I can't verify it at the moment as the top command thats installed does not show if a program is in swap or not.

Confirmation that it works on 2.1.04 from ShadowZephyr

I'm kinda lost when it comes to the extraroot.sh file. I created a sdcard folder in the sdcard, copy and pasted the script into a .txt file and renamed it to .sh. I'm guessing its wrong since nothing is happening. Could any kind soul shine a light on this?

Do these scripts work with the overclock zimage? Can i just point to the extraboot.sh in the init.rc?

smile_gerard said:
I'm kinda lost when it comes to the extraroot.sh file. I created a sdcard folder in the sdcard, copy and pasted the script into a .txt file and renamed it to .sh. I'm guessing its wrong since nothing is happening. Could any kind soul shine a light on this?
Click to expand...
Click to collapse
What do you mean when you say nothing is happening? What do you expect to happen? You won't see anything on the screen. And the script will only be run when the Archangel script tries to root the device.

liutszho said:
Do these scripts work with the overclock zimage? Can i just point to the extraboot.sh in the init.rc?
Click to expand...
Click to collapse
Why would you want these scripts to run on a fully rooted device. You can do anything you want on your device if it's fully rooted.
These scripts only make sense when used together with the Archangel root app.

Related

app 2 sd and partition size + more questions

Hello.
Im trying to get app 2 sd to work.
But i think i miss somting.
This is an unbranded HTC Hero in Europe.
This is what i have done:
Downloaded: flashrec-1.1.3-20091107-2.apk and recovery-RA-hero-v1.6.2.img and flashed the recovery boot loader.
Updated the phone with 3.2-update-hero-modacocustomrom-core-signed.zip from the recoveryboot loader menu.
Updated the phone with update-hero-radio-63.18.55.06JU_6.35.09.26-signed.zip from the recoveryboot loader menu.
Now i booted my phone and used it a few minutes.
Then i partitioned the SD card from the bootloader.
Swap-size = 32 MB
Ext2-size = 512 MB
Fat32-Size = Remainder (8 gb transcend class 6 card)
Then i did a move apps+davl to SD
I think i also did a fix apk vid mismatches.
Is this all that's needed to be done?
Or did i somthing in the wrong order here?
How can i check that i'm using my SD card?
Are the default partition sizes OK?
I'm sorry, but i was not able to post images here, links are not allowed for new users, picture of the process... you need to copy paste if you want to look at the pictures...
img16.imageshack.us/img16/6891/img1084c.jpg
img205.imageshack.us/img205/484/img1085.jpg
img248.imageshack.us/img248/3620/img1086k.jpg
rvenes said:
[snip]
Then i did a move apps+davl to SD
I think i also did a fix apk vid mismatches.
Is this all that's needed to be done?
Or did i somthing in the wrong order here?
How can i check that i'm using my SD card?
Are the default partition sizes OK?
[snip]
Click to expand...
Click to collapse
No need to select "Move apps+dalvik to SD" as Apps2SD will automatically kick in if it detects an ext2/3/4 partition on your sdcard. Don't know if it makes a difference that you did though.
Default partition sizes are okay, 512 MB is plenty for tons of apps. Don't think you need any swap for Modaco, at least I always set swap to 0 MB. Oh and keep the ext2 partition ext2 (don't upgrade to ext3/4, it wears out your sdcard much quicker).
You can check if it worked by using adb (if you don't know how to use adb, use the search):
adb shell
ls -al /data
If the output includes something like this:
lrwxrwxrwx root root 2010-03-16 23:42 app-private -> /system/sd/app-private
lrwxrwxrwx root root 2010-03-16 23:42 app -> /system/sd/app
...then you're golden. The arrows mean they are symlinks pointing to your sdcard, as opposed to actual directories (in phone memory).
EDIT: or much simpler. Run AndroidCommander.
Hope that helps.
Thank you.
I've moved on, so now using HeroDroid 0.4, but that change change within the end of the day.
First time flashing it was scary, 2nd not so scary, and the 3rd one will be just a walk in the park.
I assume ADB is Android Debug Bridge...
I've also tried AndroidCommander, but didnt get it to work... must look into that...
rvenes said:
Thank you.
I've moved on, so now using HeroDroid 0.4, but that change change within the end of the day.
First time flashing it was scary, 2nd not so scary, and the 3rd one will be just a walk in the park.
I assume ADB is Android Debug Bridge...
I've also tried AndroidCommander, but didnt get it to work... must look into that...
Click to expand...
Click to collapse
You're welcome. You're right about the scariness, however always make sure to do a nandroid backup before flashing, or it will get scary again.
Yes, and ADB is included in the android SDK you can grab from google. Running the SDK setup also allows you to download the usb debug driver (it's listed in sdk setup's repository as "usb driver package") you need for ADB - and Android Commander in turn, as it relies on adb for everything. You need to manually replace the HTC sync driver with the one from the sdk.
Hmm...
maybe it works...
img696.imageshack.us/img696/9166/app2sd.jpg
In that image you see a arrow pointing to somwhere else...
but with the ADB command i get an error...
w:\android-sdk_r05-windows\android-sdk-windows\tools>adb shell
# ls -al /data
ls -al /data
-al: No such file or directory
I did not change the HTC driver that i have installed on my Win 7 64 bit, but i am "inside" the phone... i have installed a program with AndroidCommander, and when i try just "ls" i get a list...
# ls
ls
sqlite_stmt_journals
config
cache
emmc
sdcard
d
etc
sbin
init
system
init.rc
proc
init.hero.rc
init.rc~
init.goldfish.rc
default.prop
data
sys
logo.rle
root
dev
#
Looks like it works for you! The green arrow in AndroidCommander means it's a symlink pointing elsewhere. And in the statusbar it says you have 430 MB free space on your ext partition. Assuming you used the default 512MB, that means there's already some 82 MB of apps on there. If all apps are showing in your Applications list, then it's all good.

[REF] How to boot your SD build from magldr [quick guide]

This is a very short guide for all of you looking to dual boot android from the sd card now that you have windows phone 7 taking up the nand space. It's originally posted by letama and I added a bit to it.
It's actually quite simple. All you have to do is add nand_init to one line in the init.rc file. For most builds, you will need to use a linux distro and mount the rootfs.img file, then edit the init rc file, add nand_init to this line:
Code:
service ril-daemon /system/bin/rild -l /system/lib/libhtc_ril_wrapper.so -- -d /dev/smd0
so it looks like this
Code:
service ril-daemon /system/bin/rild -l /system/lib/libhtc_ril_wrapper.so -- -d /dev/smd0 nand_init
For builds that uses the cedesmith initrd method, you have to mount the system.ext2 file, everything else is the same.
Save your file. Make sure you haven't changed the permissions and unmount the image. Copy the build to your microsd, set magldr to boot from the directory you copied it to and boot ad sd, you should be good to go.
Problems: booting it this way does not read from your startup.txt, you have to wait for cotulla to add it in future magldr. I'm not sure if the old method of updating (dumping everything in a folder named root) still works.
Disclaimer: I've tried this with jdms, hd2one, superram, desire_hd2 and mdj rEVOlution 2.3 and they all work fine with my old data image, your mileage may vary. This is a very quick guide because that's all I know Anymore I'll have to search google, so you might as well do that yourself Anyone who have a better method of editing feel free to post it. I'll add it here if you post it in this thread.
Tip from aled99 to edit without linux.
Corias said:
I've managed to mount system.ext2 to Windows 7. Without VM and Linux at all.
What tools are needed:
1. Windows Ext2/Ext3 driver. You can get it from here.
2. Any software to mount image to virtual drive. I've used Gizmo Drive, but there are others also working.
Tip: Gizmo doesn't show ext2 as supportable image type, when you browse for image. So, manually type *.* filter.
Click to expand...
Click to collapse
Some files that are already edited:
CoreDroid HD 0.4 edited by ricola7
Desire_hd2 system.ext2 file
HD2ONE 0.3.5 system.ext2
JDMS 1.62
MDJ HD v4.6
MDJ rEVOlution 2.3 rootfs.img
NexusHD2-FRG83D v1.8 from nzxtneo
Superram 1.5 from letama
Builds that already work with magldr:
DL DesireZ v2.2 from dandiest
HD2 Gingerbread/CyanogenMod7 from copenhagen
Is this a method to boot a NAND Rom from SD Card without flashing?
blax123 said:
Is this a method to boot a NAND Rom from SD Card without flashing?
Click to expand...
Click to collapse
No it boots the sd builds from this subforum. Not the nand builds.
will this work if I have android in my nand, and want to run a different android off of sd card? Like if I wanna test drive gingerbread roms off the sd, while sticking with a froyo based rom in nand? I really want to do this.
izzy spun said:
will this work if I have android in my nand, and want to run a different android off of sd card? Like if I wanna test drive gingerbread roms off the sd, while sticking with a froyo based rom in nand? I really want to do this.
Click to expand...
Click to collapse
I haven't tried copenhagen's build but it should work the same way. Try it and let us know how it worked out
Edit: Actually I got curious and checked it out. Copenhagen's build does not require editing. You can boot it from sd using magldr as it is. Nice too. I think I'll play with that for a while
Sorry but I'm stuck on the first line. What is a linux distro? How do I edit the line? I'll be able to take care of the rest. This is the part that confuses me.
buzz killington said:
This is a very short guide for all of you looking to dual boot android from the sd card now that you have windows phone 7 taking up the nand space. It's originally posted by letama and I added a bit to it.
It's actually quite simple. All you have to do is add nand_init to one line in the init.rc file. For most builds, you will need to use a linux distro and mount the rootfs.img file, then edit the init rc file, add nand_init to this line:
Code:
service ril-daemon /system/bin/rild -l /system/lib/libhtc_ril_wrapper.so -- -d /dev/smd0
so it looks like this
Code:
service ril-daemon /system/bin/rild -l /system/lib/libhtc_ril_wrapper.so -- -d /dev/smd0 nand_init
For builds that uses the cedesmith initrd method, you have to mount the system.ext2 file, everything else is the same.
Save your file. Make sure you haven't changed the permissions and unmount the image. Copy the build to your microsd, set magldr to boot from the directory you copied it to and boot ad sd, you should be good to go.
Problems: booting it this way does not read from your startup.txt, you have to wait for cotulla to add it in future magldr. I'm not sure if the old method of updating (dumping everything in a folder named root) still works.
Disclaimer: I've tried this with jdms, hd2one, superram, desire_hd2 and mdj rEVOlution 2.3 and they all work fine with my old data image, your mileage may vary. This is a very quick guide because that's all I know Anymore I'll have to search google, so you might as well do that yourself Anyone who have a better method of editing feel free to post it. I'll add it here if you post it in this thread.
Click to expand...
Click to collapse
thanks.. so i must use linux? any tools available in win?
buzz killington said:
I haven't tried copenhagen's build but it should work the same way. Try it and let us know how it worked out
Edit: Actually I got curious and checked it out. Copenhagen's build does not require editing. You can boot it from sd using magldr as it is. Nice too. I think I'll play with that for a while
Click to expand...
Click to collapse
can you elaborate on this please.
can you give a step by step.
i am real interested in trying this.
thanks in advance.
Anthonayy said:
Sorry but I'm stuck on the first line. What is a linux distro? How do I edit the line? I'll be able to take care of the rest. This is the part that confuses me.
Click to expand...
Click to collapse
It's just short for Linux distribution, such as ubuntu or redhat. I used ubuntu. Once you have it mounted you can use any text editor available.
vista1984 said:
thanks.. so i must use linux? any tools available in win?
Click to expand...
Click to collapse
Sorry, I don't know if there are. Maybe others can chime in. Anything that'll let you mount an ext2 image and edit its contents will do. Unfortunately I'm not familiar with any windows tools.
Will this hack enable me to run Android from my SD card, with WP7 installed on the phone?
I just want to make sure, because I've been searching around, and several indidual sources have said that WP7 doesn't recognize any SD cards, including compatible SD cards.
I would really love to try WP7, but without losing my android.
Sent from my HTC HD2 using XDA App
WOOZ!E said:
Will this hack enable me to run Android from my SD card, with WP7 installed on the phone?
I just want to make sure, because I've been searching around, and several indidual sources have said that WP7 doesn't recognize any SD cards, including compatible SD cards.
I would really love to try WP7, but without losing my android.
Sent from my HTC HD2 using XDA App
Click to expand...
Click to collapse
Dude, it has nothing to do with WP7, You boot Android from MAGLDR not WP7. So you would either use a different SD card to boot into Android BEFORE booting windows or you would partition your SD card in a way that it allows you to use it for WP7 and Android at same time.
How can I mount the system.ext2 by using terminal?
Code:
[email protected]# mount -o loop system.ext2 /mnt
system.ext2: No such file or directory
asdfg2010 said:
How can I mount the system.ext2 by using terminal?
Code:
[email protected]# mount -o loop system.ext2 /mnt
system.ext2: No such file or directory
Click to expand...
Click to collapse
you have to specify where your file is and I believe you have to create a mount point, you can't just put it in /mnt. Somebody correct me if I'm wrong
Code:
cd /mnt
sudo mkdir sys
sudo mount -o loop -t ext2 /home/usr/Desktop/system.ext2 /mnt/sys
buzz killington said:
you have to specify where your file is and I believe you have to create a mount point, you can't just put it in /mnt. Somebody correct me if I'm wrong
Code:
cd /mnt
sudo mkdir sys
sudo mount -o loop -t ext2 /home/usr/Desktop/system.ext2 /mnt/sys
Click to expand...
Click to collapse
I try but not successful
windows ext2 editing
buzz killington said:
It's just short for Linux distribution, such as ubuntu or redhat. I used ubuntu. Once you have it mounted you can use any text editor available.
Sorry, I don't know if there are. Maybe others can chime in. Anything that'll let you mount an ext2 image and edit its contents will do. Unfortunately I'm not familiar with any windows tools.
Click to expand...
Click to collapse
I think you can edit an ext2 image with windows using the method in post #4 from this thread: http://forum.xda-developers.com/showthread.php?t=808169
Corias said:
I've managed to mount system.ext2 to Windows 7. Without VM and Linux at all.
What tools are needed:
1. Windows Ext2/Ext3 driver. You can get it from here.
2. Any software to mount image to virtual drive. I've used Gizmo Drive, but there are others also working.
Tip: Gizmo doesn't show ext2 as supportable image type, when you browse for image. So, manually type *.* filter.
Click to expand...
Click to collapse
I've tried editing the file and it seemed to save the changes, but I haven't tried booting android yet.
I am trying to do this method in super ram Rom but no success. I have successfully mount system.ext2 but there wasn't any init.rc file. After a lot Google search I have managed to discover that this file is in file initrd.gz and I made the change. But the build starts and hangs in first screen.any suggestion;
Sent from my HTC HD2 using Tapatalk
can anyone uploade the files? i dont have linux..
Cool, thanks! I seems to be working for me with MDJ FroYo HD v4.6. Has anyone had any success getting two Android ROMs running from their microSD card? I was doing this when booting from WM6.5 by putting them in different directories and modifying rel_path in the startup.txt for one of them, but obviously this method won't work until MAGLDR supports startup.txt...
clio94 said:
I am trying to do this method in super ram Rom but no success. I have successfully mount system.ext2 but there wasn't any init.rc file. After a lot Google search I have managed to discover that this file is in file initrd.gz and I made the change. But the build starts and hangs in first screen.any suggestion;
Sent from my HTC HD2 using Tapatalk
Click to expand...
Click to collapse
I didn't do the superram built myself, but letama posted a full version later in that magldr thread. Try to see if you can find it. If not I'm sure I still have it somewhere I can post it for you.
You can change Android folder on SD using MAGLDR
Enter Magldr
Select 9. Services
then 1. BootSettings
then 3. AD SD Dir

Guide: Partitioning SD-Card 4 apps2sd & swap partition, the easy way.

Ok. I do not mean any offence to junghyun01.
However this is another method & the one that I personally use.
This requires: stock kernel & dual mode recovery (ClockWorkMod).
Some version of ClockWorkMod that come with custom kernels do not include the necessary options to format your sd-card.
To return to stock kernel on gingerbread or froyo, follow this guide:
http://forum.xda-developers.com/showpost.php?p=21238366&postcount=2
This is the easiest way to create sd-ext/2nd partition+swap partition on sdcard with our phones:
1: Backup all data from sdcard to computer *Important*.
2: Boot into ClockWorkMod by tapping touch-screen while on Sony Ericsson screen
WARNING: We will now delete all data on sdcard, that is why you made a backup.
3: Advanced => Partition SD Card => 512M or 1024M (depending how many apps you want to install & the size of your sdcard) => 0mb for swap size (or if using a custom kernel you can set a swap size of 128m) => Yes to format.
4:Power Off phone.
5:Remove sdcard and put into computer, put the files that you backed up to the computer back on the sdcard.
6:Insert sdcard back into phone and power on. Click thanks.
How to enable swap? Warning: This can & will shorten your sd-cards life. Read post #2!
(Swap will only work on a custom kernel!)
After flashing the rom of your choice, flash the add-on "x8EnableSwapPartition2.zip" in ClockWorkMod to enable swap or download ResetSwap from the market.
Credits:
junghyun01 go on give him a thanks for giving me the motivation to create this thread.
[email protected](me): Flashable add-on zip, guide, time, information. Click thanks!
x8EnableSwapPartition2.zip=Swappiness set at 40%.
x8EnableSwapPartition.zip=Swappiness set at Android default 60% or whatever % your rom developer has set it at.
More Information: (You don't really need to read this but if you are interested...)
Stock Kernel?? Oh man...
I personally think it is worth it for all users to flash back to stock kernel & dual mode recovery. Why? Just so they can partition their sd-card like this, as sd-ext will be formatted in Ext4.
Ext4=Best speed/reliability overall. Why would you still be using ext2/3???
Why only 128mb swap size?
Because it is wasteful to create a larger swap partition. It never gets used. I have never seen 128mb's of swap used on our phone & that is even with heavy games/apps running in the background. You are just making your sd-card size smaller for no benefit.
Why not just use Swapper2 from the market with a swap(.swp) file?
Swapper2 is notorious for slowing down your phone as it likes to auto-start all the time also a swap file will not be as fast as a swap partition.
Will SWAP shorten SD-card lifespan???
Yes it undoubtedly will. Will you be able to notice this in any way? Most probably not.
Using swap will cause intensive reading/writing in one region of the sd-card. All flash memory devices (including our NAND internal memory) have limited write cycles. Excessive reading/writing causes bad blocks on your sd-card. Some sd-cards have extremely poor write cycles, so they can & will burn out when using swap.
Some people believe it would take a full year or even longer of using swap to actually cause any noticeable effect on your sd-card. Even if it does cause bad blocks on you sd-card, when formatting your sd-card with most modern-day file systems, these blocks will be marked as bad blocks and they wont be used. This equals to an extremely slow decrease in total capacity of your sd-card (which will be close to unnoticeable) .
Having said all of that there has been reported cases where SD-Cards have burned out and stopped working almost directly after enabling swap. Coincidence? Who knows but...What you do & flash to your phone is your own decision & no one else is in any way responsible for what happens except you.
And another method if you need it:
http://forum.xda-developers.com/showthread.php?t=1445543
Or guide with pictures:
You can create an ext partition on your sdcard in windows by downloading the newest Easeus Partition Manager Here or at their Homepage.
After installing the program use the guide found here:
http://forum.xda-developers.com/showthread.php?p=10654666
I have tried this method and it works with Ext2 and Ext3.
I use alf kernel + Gdx 21
I already partition my sd card using mini tool partition wizard as follow
1. primary Fat32
2. primary Ext4
3. primary LinuxSwap
already flash the addon , but still no swap active when i check on terminal.
i see on your zip that it make swap on /dev/block/mmcblk0p3
but in mine there's only /dev/block/vold -> which is empty also
I don't know if my swap partition is load .
still there's /sys/dev/blok/179:3 which refer to mmcblk0p3
and on sys/block/mmcblk0
I'm not familiar with linux , so please give me a guide what to do.
thanks
aries77 said:
I use alf kernel + Gdx 21
I already partition my sd card using mini tool partition wizard as follow
1. primary Fat32
2. primary Ext4
3. primary LinuxSwap
already flash the addon , but still no swap active when i check on terminal.
i see on your zip that it make swap on /dev/block/mmcblk0p3
but in mine there's only /dev/block/vold -> which is empty also
I don't know if my swap partition is load .
still there's /sys/dev/blok/179:3 which refer to mmcblk0p3
and on sys/block/mmcblk0
I'm not familiar with linux , so please give me a guide what to do.
thanks
Click to expand...
Click to collapse
How to u check if swap is running or not?? Type wat code on terminal..
Sent from my E15i using xda premium
kakho55 said:
How to u check if swap is running or not?? Type wat code on terminal..
Sent from my E15i using xda premium
Click to expand...
Click to collapse
on terminal type --> free
export PATH=/data/local/bin:$PATH
$ export PATH=/data/local/bin:$PATH
$free
total used free shared buffers
Mem: 186704 183584 3120 0 132
-/+ buffers: 183452 3252
Swap: 33596 25304 8292
$
So it work or not? ?
Sent from my E15i using xda premium
kakho55 said:
export PATH=/data/local/bin:$PATH
$ export PATH=/data/local/bin:$PATH
$free
total used free shared buffers
Mem: 186704 183584 3120 0 132
-/+ buffers: 183452 3252
Swap: 33596 25304 8292
$
So it work or not? ?
Sent from my E15i using xda premium
Click to expand...
Click to collapse
Swap: 33596 25304 8292
yes it work..
ok, it works now.
Re-download and flash.
(You can delete old script in etc/init.d)
8xfan said:
Swap: 33596 25304 8292
yes it work..
Click to expand...
Click to collapse
but i cant see any different .... ram still around 28mb ...><
Sent from my E15i using xda premium
lrakkarl said:
ok, it works now.
Re-download and flash.
(You can delete old script in etc/init.d)
Click to expand...
Click to collapse
thanks, it works now
works.. thx.. ..
btw, can someone please explain why did SWAP shorten SD card lifespan??
kakho55 said:
but i cant see any different .... ram still around 28mb ...><
Sent from my E15i using xda premium
Click to expand...
Click to collapse
LOL i dont know..maybe OP can answer it
Thankyou,thats worked!
Just forget to disable compcache,but there no problem at all!
I have updated both post #1 & #2 with the information requested. Please give it a read.
@kakho55
Swap allows you to run more apps/processes at any one time. The android operating system will still use all of your real ram too.
What about the swapping coefficient, in the script is not defined. This number is showed in procent and defines the ratio of swap partition being used by the system.
One question,i using Reset Swap and everytime i reboot i need to go to app and activate swap again,thats normal?And if i flash the EnableSwap.zip?
gdeliana said:
What about the swapping coefficient, in the script is not defined. This number is showed in procent and defines the ratio of swap partition being used by the system.
Click to expand...
Click to collapse
Uploaded new add-on & modified first post to answer your question.
(if no value specified then Android default setting is 60%)
RodrigoOgasawara said:
One question,i using Reset Swap and everytime i reboot i need to go to app and activate swap again,thats normal?And if i flash the EnableSwap.zip?
Click to expand...
Click to collapse
Yes that is normal if using ResetSwap. This is because it never auto-starts by itself.
If you flash the add-on zip then swap will be auto enabled every boot.
hi.. new addon.is for ??
lrakkarl said:
Uploaded new add-on & modified first post to answer your question.
(if no value specified then Android default setting is 60%)
Yes that is normal if using ResetSwap. This is because it never auto-starts by itself.
If you flash the add-on zip then swap will be auto enabled every boot.
Click to expand...
Click to collapse
Thanks mate

[Q] Swap not working "LT15i 4.1.B.0.431 "

HI,
It's my first post here and I'm glad to be a member on this fantastic website.
I have a problem with the swap partition on my device, Xperia arc.
I flashed my device to "LT15i 4.1.B.0.431 Generic Global World" follow by this post.
I found that lacking in memory so I tried to use swap partition and created 256 Linux swap partition on my SD card. But "free" commend still shows swap=0
However, I decided to use swapper 2. Still no effect and I couldn't get swap although swapper did its job without fail!
After few days search I found that the kernel doesn't support the swap, So, I tried to use "Kernel.sin unpacked and added CWM options" form here. It also didn't work, neither "init.d zram scripts from wedgess" from the same page.
However, I'm looking for help to use swap on my device or any suggestion that can help me to improve memory in my device.
P.s. I'm a newbie in Android and still don't understand it very well specially those names like rom and etc, but I have been using Linux (Fedora) for 6 years.
edanny101 said:
HI,
It's my first post here and I'm glad to be a member on this fantastic website.
I have a problem with the swap partition on my device, Xperia arc.
I flashed my device to "LT15i 4.1.B.0.431 Generic Global World" follow by this post.
I found that lacking in memory so I tried to use swap partition and created 256 Linux swap partition on my SD card. But "free" commend still shows swap=0
However, I decided to use swapper 2. Still no effect and I couldn't get swap although swapper did its job without fail!
After few days search I found that the kernel doesn't support the swap, So, I tried to use "Kernel.sin unpacked and added CWM options" form here. It also didn't work, neither "init.d zram scripts from wedgess" from the same page.
However, I'm looking for help to use swap on my device or any suggestion that can help me to improve memory in my device.
P.s. I'm a newbie in Android and still don't understand it very well specially those names like rom and etc, but I have been using Linux (Fedora) for 6 years.
Click to expand...
Click to collapse
Did you try manually turn on swap with "swapon"?
Also you can create swap in file.
Code:
cd <to your SD card>
dd if=/dev/zero of=swapfile bs=1024 count=65536
mkswap swapfile
swapon swapfile
Thanks a lot for your kind reply.
I flashed my device to cm10 and it works much better.
I tried to remove this post but I could not.
Thanks anyway for your time to read my post and reply.
Cheers.

[GUIDE][SWAP]Increase virtual ram easily in simple steps

Hello all, as some of you know that there is a way that lets you increase your device's ram capacity, and that is by swap, well am here to give you simple and easy steps to enable swap on your device.I only tested this on few devices so don't complain if it didn't work.
I'am not responsible for any damage could happen, you are doing it at your own risk.
Prerequisites
1-An android phone (duhh )
2-Must be rooted.
3-Busybox xbin. (Read below)
4-Kernel Must Support Swap
Tested devices
-Galaxy Ace S5830
-Galaxy Ace S5830i
-Galaxy Ace 2
-Galaxy S4 (don't ask why!)
-Galaxy S4 mini
-Galaxy Ace Plus
-Sony Xperia Sola
Tested android versions
-2.3.x
-4.0.x
-4.1.x
-4.2.2
-4.3.0
-4.4.2 (got some problems)
-4.4.4 (got some problems)
kitkat users may find a problem that swap has a limit of 50 MB or 150 MB ( Caused by the new 4.4.x kernel Just Try It)
Installing busybox xbin
{If you are not sure what is this then just go to how to swap
And if swap didn't work the come back here and apply the steps}
1-Download busybox from playstore or buy the pro version
2-Run busybox
3-Wait for the loading
4-Then normal install or smart install in case you are in pro.
5-When done installing restart your phone
How to swap
1-Install simple root swap
2-Run it and give it root permission
3-Specify the size of swap file (how much MB you want to add as virtual ram) (big size needs more time)
4-Create swap file
5-Check enable at boot
6-Click on
7-Check if the swap worked
8-Enjoy...
reserved
I did every thing and nothing happened ?
I have xperia u with Experimental v12...
Sent from my Xperia U using XDA Premium 4 mobile app
Heads up! using swap on SD card may decrease your SD card's lifetime.
Can we damage our systems any how?Can I try this on a auto navi system with Android 4.0.3?
Thx
Sent from my iPhone using Tapatalk
Csi02 said:
Can we damage our systems any how?Can I try this on a auto navi system with Android 4.0.3?
Thx
Sent from my iPhone using Tapatalk
Click to expand...
Click to collapse
Since the swap file in made on the SD Card, No, it will not damage your system but there is a high chance it can affect the SD Card. If you have an SD Card, then yes you can try this on Auto Navi System with Android 4.0.3. Make sure to have a class 8 or greater SD Card to get maximum speed. Hope I Helped
Thx for your answer! I will try it after I buy another SD class! I hope that will make my unit a little smoother!
Sent from my iPhone using Tapatalk
It does NOT work on Galaxy Ace S5830i with this ROM and this kernel...
MorgenTee said:
It does NOT work on Galaxy Ace S5830i with this ROM and this kernel...
Click to expand...
Click to collapse
Can you find the swap file on your SD Card? If not then can you tell us exactly what happens when you choose to create swap?
mahithm said:
Can you find the swap file on your SD Card? If not then can you tell us exactly what happens when you choose to create swap?
Click to expand...
Click to collapse
The file is there, it has the size that I choose in "Simple Root Swap". I tried 200 MB and 100 MB.
The "Info" tab of "Simple Root Swap" tells me however:
Status Swap:
Total Swap: 0MB
Used Swap: 0MB
Free Swap: 0MB
When I open a terminal emulator "free" tells me 0 swap, "swapon -a" tells me that /etc/fstab does not exist...
MorgenTee said:
The file is there, it has the size that I choose in "Simple Root Swap". I tried 200 MB and 100 MB.
The "Info" tab of "Simple Root Swap" tells me however:
Status Swap:
Total Swap: 0MB
Used Swap: 0MB
Free Swap: 0MB
When I open a terminal emulator "free" tells me 0 swap, "swapon -a" tells me that /etc/fstab does not exist...
Click to expand...
Click to collapse
Did you press the On button below Auto Start? Once you create the Swap file using the Re/ Create button, tick the Auto Start box and press the On button below that. That should activate swap on SD Card. Now check Info to see your swap details or use "free" on Terminal. Do post the result. Hope I Helped
mahithm said:
Did you press the On button below Auto Start? Once you create the Swap file using the Re/ Create button, tick the Auto Start box and press the On button below that. That should activate swap on SD Card. Now check Info to see your swap details or use "free" on Terminal. Do post the result. Hope I Helped
Click to expand...
Click to collapse
I have done that already. After the creation of the swap file, I checked "Auto Start" and clicked "on". I also tried restarting the phone, but it didn't change anything.
MorgenTee said:
I have done that already. After the creation of the swap file, I checked "Auto Start" and clicked "on". I also tried restarting the phone, but it didn't change anything.
Click to expand...
Click to collapse
Did you install BusyBox? Creating and running swap requires certain binaries which may not be present in the rom by default. Do post the result.
mahithm said:
Did you install BusyBox? Creating and running swap requires certain binaries which may not be present in the rom by default. Do post the result.
Click to expand...
Click to collapse
Yes, I followed the instructions (see below) in the first post exactly.
Installing busybox xbin
{If you are not sure what is this then just go to how to swap
And if swap didnt work the come back here and apply the steps}
1-downlpad busybox from play store or buy th pro version
2-run busybox
3-wait for the loading
4-then normal install or smart install incase you are in pro.
5-when done installing restart your phone
How to swap
1-install simple root swap
2-run it and give it root permission
3-specify the size of swap file (how much mb you want to add as virtual ram) (big size needs more time)
4-create swap file
5-check enable at boot
6-click on
7-check if the swap worked
8-enjoy...
Click to expand...
Click to collapse
Is it possible that the kernel I am using is lacking swap capabilities and therefore, the app cannot make swap work?
MorgenTee said:
Yes, I followed the instructions (see below) in the first post exactly.
Is it possible that the kernel I am using is lacking swap capabilities and therefore, the app cannot make swap work?
Click to expand...
Click to collapse
Since you have followed all the instructions perfectly, it must be the kernel. Rafael's kernel does have swap support though.
mahithm said:
Since you have followed all the instructions perfectly, it must be the kernel. Rafael's kernel does have swap support though.
Click to expand...
Click to collapse
Thanks! Too bad that it won't work for my setup. I will consider trying the other kernel once I do have some more time on my hands.
This worked very well for me. Thanks OP! :good:
MorgenTee said:
The file is there, it has the size that I choose in "Simple Root Swap". I tried 200 MB and 100 MB.
The "Info" tab of "Simple Root Swap" tells me however:
Status Swap:
Total Swap: 0MB
Used Swap: 0MB
Free Swap: 0MB
When I open a terminal emulator "free" tells me 0 swap, "swapon -a" tells me that /etc/fstab does not exist...
Click to expand...
Click to collapse
Your kernel might not support swap...
M2M_RockS said:
I did every thing and nothing happened ?
I have xperia u with Experimental v12...
Sent from my Xperia U using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Check your kernel swap support...
Sorry for flooding... I hv a que. Can I use swap in rom TWRD 1.0
Sent from my GT-S5830i using xda app-developers app

Categories

Resources