yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] Firerat:
@G1ForFun

this is the script it installs

the blue is new, to get round this 'glitch' some are seeing with cm6

if the block device files are not there on boot, it makes them

as for swap, it simply tries each partition until it finds a swap one

for the moment swappiness is set at 60, but it doesn't seem to work all that well with cm6, so I'm probably going to make that optional and also have a script so you can change it

#!/system/bin/sh
# Autoswap - Firerat 2010-05-05
# thought about doing the partition check as per cm5 05mountsd
# but then I remembered that I couldn't do that with other busyboxes
# which is why I used a 'suck and see' in the past
FindSwap ()
{
LS_CMD=ls
SWAPON_CMD=swapon
SED_CMD=sed
SWAPPINESS=60
[COLOR="Blue"]MMC=/dev/block/mmcblk0
if [ ! -b "$MMC" ];
then
mknod ${MMC} b 179 0
chmod 600 ${MMC}
for i in 1 2 3;do
mknod ${MMC}p${i} b 179 $i
chmod 600 ${MMC}p${i}
done
fi[/COLOR]
if [ "`$SED_CMD -n '$=' /proc/swaps`" -gt "1" ];
then
echo "Swap appears to be already setup, skipping checks"
return
else
for isitswap in ` $LS_CMD /dev/block/mmcblk0p*` ; do
$SWAPON_CMD $isitswap 2>/dev/null
if [ "$?" = "0" ];
then
echo "$isitswap is swap"
echo $SWAPPINESS > /proc/sys/vm/swappiness
break
else
echo "$isitswap is not swap"
fi
done
fi
return
}
FindSwap
[G1 Android Development] G1ForFun:
Cool man, thanks for the quick response.
[G1 Android Development] fanbogo:
thx for great job !
[G1 Android Development] tommeke4:
i put the script on my sd, renamed it to script.txt

disconnected the usb, started terminal emulator, typed:

su

sh /sdcard/patch.txt all

the response im getting is: sh: can't open /sdcard/patch.txt

and yes, its really there. what am i missing...?
[G1 Android Development] Houka420:
Why would you rename it script.txt & then run the command sh /sdcard/patch.txt? Should be sh /sdcard/script.txt all since you renamed it script. You could have just left it the way it was & put sh /sdcard/fr-patch134.txt all & you would have been good.
[G1 Android Development] tommeke4:
looks like ive made some typo's. all working now ;) thanks
[G1 Android Development] Firerat:
no comment
[G1 Android Development] tman7510:
Swap 32MB when partition is 96

Hey Firerat something strange is going on because everyone is getting a 32mb swap after running your script. I used RAs recovery 1.7 to format my 96mb swap. Has anyone partitioned their sdcard using a diff tool. Is RA's recovery partition function not working properly????
[G1 Android Development] Firerat:
well 'everyone' must be using compcache and not swap
[G1 Android Development] tman7510:
We used to have the ability to run compcache and swap at the same time. Is that no longer possible with eclair? I want to run both...
[G1 Android Development] Firerat:
bakingswap was removed by the compcache authors

I never used compcache anyway, so I'm in no rush on turning it back on

but

http://forum.cyanogenmod.com/topic/2725-backing-swap-support-in-compcache-gone/

I hint at how in that thread

if there is a 'demand' and no-one else takes it up, I will look at providing at least one kernel and a 'single' diff patch
[G1 Android Development] 20_Eyes:
You are the best. What you bring to this community is monumental. I thank you.
[G1 Android Development] Pedraso XDA:
Patch for CM6

Hey Firerat, do u have a patch (or working on one) for CM6???? Some of us are having problems w the Market and LWP
[G1 Android Development] RebelScum75:
Hey, if I flash a new ROM, does all this get erased? Would I have to re-run this to re-enable everything?

Also, is there a reason just doing this once with the "all" option wouldn't just work? There is a post by Vermithrax at CM forums (in the "Enabling Swap" thread - sorry, it won't let me post outside URLs yet) where he mentions he did it in chunks ("sdext reboot; swap reboot; dc2x reboot; lwp fb remount shabang reboot"), and I was wondering if there was a reason.

Also also, is it ok to mount my SD card via USB while swap and sdext are running? Does it only unmount the fat32 partition, or does it eject everything and screw me up?

Thanks a lot!
[G1 Android Development] Firerat:
if you install a new rom, you will have to redo this

ask Vermithrax

and xda's http:// filters are very weak, just drop the http:// bit
[G1 Android Development] RebelScum75:
Thanks.

I did ask Vermithrax, and he hasn't responded. But, as long as you can't think of any reason, that's good enough for me.

Is it ok to mount my SD card via USB while swap and sdext are running? Does it only unmount the fat32 partition, or does it eject everything and screw me up?
[G1 Android Development] juangil:
easy... if you are running swap on your linux swap partition you are safe to mount/unmount your sd because this partition remain mounted

now if you are running swap on sdcard/swapfile.swp (fat32 partition) its NOT safe to mount/unmount sd with swap active unless you are running swapper and check the "safe Unmount" box
[G1 Android Development] RebelScum75:
Thank you very much for the helpful replies, everyone.
[G1 Android Development] fsr678:
Would installing the lwp patch for cm6 rc2 help with things like the 3d gallery? I read the post a few pages back about it helping with lwp on the eris cm6 install but don't quite understand enough to know whether it would also help with gallery as far as speed or stability?

Am currently running cm6 rc2 with mtd partition 90/2.

Thank you!
[G1 Android Development] Firerat:
nope, it will do nothing for gallery3d

for live wall papers it basically turns off full 3d support, as live wall papers with full 3d do not run well on g1/mt3g
[G1 Android Development] frankencat:
Is there any reason to run this if I already have the 'Custom MTD Partitions' patches?

Sorry if this is a noob question. I am trying to catch up on this. Thanks :)
[G1 Android Development] G1ForFun:
Pardon my noob-ness

but does anyone know how to edit the swappiness value when using (sh /fr-patch134.txt swap) ?

Thanks in advance.
[G1 Android Development] Foo_Blyat:
he has patch136 on CM forums that allows you to edit the swappiness value. im sure itll be on here shortly
[G1 Android Development] G1ForFun:
Cool I'll wait till it makes its way over here
[G1 Android Development] frankencat:
Can I get a witness?
[G1 Android Development] raven_raven:
Of course there is a reason. MTD patch and firerats "all in one" patch do different things. First is to resise your system partitions to get more space for apps or system, second to turn on things like swap or facebook sync (see OP to full list of features).
[G1 Android Development] pk2:
Really f...nig noob question… sorry. Does this Firerat patch/script do much for the casual, curious, recreational rom flasher?

I hope this is to the benefit of alot of timid rom junkies.

Regards, PK
[G1 Android Development] G1ForFun:
sdext sdext mount for cm6 (new) *

lwp	LWP fix *

lsd	create legacy sd mount point

swap	Auto setup swap *

shabang	Patch Android scripts to work with ash

remount	install remount scripts

fb	Patch for Facebook 1.2.x sync on G1

fixp	Patch fix_permissions with new sd mount point

dc2x	DangerSPL : dalvik-cache will be bound with sd-ext *

NoneDangerSPL : dalvik-cache will be bound with cache *

MT3G : does nothing

I personally use the swap option myself....there are plenty of options for the casual user. In fact, I bet you this script was designed this way for a reason. It is very simple and easy to use.
[G1 Android Development] cal3thousand:
1.3.6 available

1.3.6 is available here:

it just includes option in swap after activating it to change swappiness

FR-PATCH136.TXT

taken from here:
[G1 Android Development] G1ForFun:
Meh he said he will post it here when he is ready...but if you wish.;D

This helped me tremendously (changing swappiness to 20)....swappiness of 60 was a kang value....dunno why that was ever the default.
[G1 Android Development] morvaeldd:
Assuming I will bind dalvik-cache to sd-ext, how will I be able to wipe it, in case I want to? I have DangerSPL and AmonRa 1.7.0 recovery. I usually do this when flashing a new nightly.
[G1 Android Development] Firerat:
just wipe dalvik-cache

remember, this is nothing new, dalvik-cache has been on sd ext for a long time before cm6

even if recovery didn't clear it, its a trivial matter of deleting the files in /sd-ext/dalvik-cache/
[G1 Android Development] morvaeldd:
My guess is that I could use console in AmonRa, mount sd-ext and then delete files?

Anyway, I have moved back to dalvik-cache in main memory. I had visible lag introduced when turning that option on alongside swap. This may be why for some swap helps in CM6, while for some not. Probably too much IO going on with SD card (even class 6).

My G1 was very slow without swap (constant reloading, 10-15 secs each, of home screen after opening single app), while after creating swap it become very manageable. I wanted to get more space so I tried using dc2x, but the phone became slow again (not that slow as first, but slower).

Will have to live with little apps (I left only the most important ones), until I will buy a new phone. But the speed now is very satisfying (32M swap, swapiness 10).
[G1 Android Development] danghieu07:
i use lwp and dc2x in firerat134 but i dont like , so i remove it by : rev lwp and rev dc2x but it dont normal :( . my battery had 90% and after 10hour , it had 0% and auto turn off :( , what is error ????

sorry , english bad
[G1 Android Development] keesvantilburg:
I would like to flash it as a zip file. Is it possible to create one?
[G1 Android Development] AndDiSa:
For what reason? Put it on /sdcard and run it from shell. No reason to flash it.
[G1 Android Development] Firerat:
its not really practical

in some cases it does different things depending on your SPL ( NoneDanger, Danger and MT3G )

and depending on what you wanted you would need to d/l several zips
[G1 Android Development] Firerat:
I doubt those options would effect battery life.

maybe the lwp option would, as running live wallpapers can use a lot of CPU.

your best bet with battery is to let it fully discharge, and then fully charge ( overnight ) with the phone off.

Then boot to recovery and wipe battery stats.

A G1's battery life is very poor,

with the stock battery I was getting around 10hrs with the original rooted cupcake, I bought an extended battery (with larger case ) and got ~18hrs

these days I'm getting around 30hrs with CM6
[G1 Android Development] SG_Shadow:
Option: sdext inquiry...

What is the correct way to utilize this? Do I have a fresh install and then activate this prior to installing any applications? Also, is it required on each update. For example, if and when RC3 comes out, can I flash RC3 and just forget about using this script as long as I did it on the prior versions?

Update: Yeah, I don't think I'm doing something right. I've just flash CM6 RC2 from scratch and before I installed any apps, I did the sd script. I also went into CM settings and checked the box to allow install on external storage. I performed a reboot and started to install apps. Still on internal, any suggestions?
[G1 Android Development] Abhi_UK:
These dont work on nightly builds do they. (swap)
[G1 Android Development] Firerat:
No and you will brick if you try

Look, if you have to ask that question you should not be using a nightly
[G1 Android Development] mashryock:
What will cause it to brick on the nightlies, the all-in-one script? SOrry, I am not following the conversation.
[G1 Android Development] Firerat:
The script will see that its a nightly and install several of Saturn's moons on your phone, and we all know they are just way too big for any phone.

Honestly, I just fail to understand

why people would think it wouldn't work on a nightly

why people would have to ask
[G1 Android Development] Houka420:
Hate to waste thread space but, Classic!!! ;)
[G1 Android Development] Foo_Blyat:
hey boss,

in this patch im wondering if sdext is the same as froyo-apps2sd patch?

tho im currently installing all my apps to internal memory, i was entertaining the thought of getting my apps onto an ext3 partition but im not a member of Cyanogenmod forums and couldnt download your fr-apps2sd-ext-v0-6-1.sh.txt file.

thanks!
[G1 Android Development] Firerat:
New version, includes app2sdext as seem on CM Forums

Latest fr-patch138.txt

Current options

Firerat script installer Version 1.3.8
Options:
a2sd	apps2sdext ( for FroYo ) [B]#NEW#[/B]
sdext	sdext mount for cm6
lwp	LWP fix *
lsd	create legacy sd mount point
swap	Auto setup swap *
shabang	Patch Android scripts to work with ash
remount	install remount scripts
fb	Patch for Facebook 1.2.x sync on G1
fixp	Patch fix_permissions with new sd mount point
dc2x	DangerSPL : dalvik-cache will be bound with sd-ext *
NoneDangerSPL : dalvik-cache will be bound with cache *
MT3G : does nothing

all	All of the above
* run-parts required ( autodetected )
--------------------------------------
rev <option> reverse the option (swap dc2x lwp )
--------------------------------------
example
[B]sh /sdcard/fr-patch138.txt[/B] swap lwp fixp
will setup swap, patch fix_permissions to see apps on sd
and setup the gpu permissions to enable lwp + 3d apps

This 'patch' file is simply for delivery, it is not required once you have installed the patches you want.

Update:2010-08-04

the 1.3.x version of Facebook no longer requires the 'fb fix' :)

Change log

1.3.8 ( 2010-08-12 )

added FroYo apps2sdext ( v1.2 )

includes ApkManager, to manage app location

added swapfile support ( create and resize swapfile with swappy in terminal/adb shell )

1.3.7 ( 2010-08-10 )

can be run in recovery

swappiness defaults to 20

new script /system/bin/swappy , change swappiness ( just type swappy in terminal )

remount rw/ro now works again ( I included the fix this time ;) )

lwp script 'recreates' hw3d.xml if it does not exist
[G1 Android Development] mat_pav:
Hi Firerat,

Can you tall me whats the difference between your script and the apps2sd created this way:

!/sbin/sh

mount -a

rm -rf /data/dalvik-cache

rm -rf /cache/dalvik-cache

mkdir /sd-ext/app

mkdir /sd-ext/dalvik-cache

ln -s /sd-ext/dalvik-cache /data/dalvik-cache

ln -s /sd-ext/dalvik-cache /cache/dalvik-cache

cp /data/app/* /sd-ext/app

rm -rf /data/app

ln -s /sd-ext/app /data/app

sync

Thank you
[G1 Android Development] Firerat:
oops

the syntax error in 138

is fixed now

for some odd reason I end up sticking in

an extra line

echo "
[G1 Android Development] mat_pav:
TNX. What are the advantages and disadvantages of moving the dalvik-cache to ext ( G1 ) ? Its there any tutorial for ApkManager?
[G1 Android Development] Firerat:
IMO , you get better performance with dalvik-cache on internal memory

in terminal type

ApkManager.sh

or

apkmanager.sh

you get shown a list

enter the numbers for the apks you want to 'toggle' ( separated by <space> )

done..
[G1 Android Development] Abhi_UK:
what does mount sd-ext do?

On cm_dream_sapphire-08112010-054414 I get an error for the a2sd script. /sdcard/fr-patch138.txt: Syntax Error: "(" unexpected (expecting "}")
[G1 Android Development] Firerat:
I don't know, what does mount sd-ext do?
[G1 Android Development] runderekrun:
Firerat,

Fantastic script, thank you very much for everything you have done!

Anyways I am trying to run the new swap script in 1.3.8 and this is the result.

# sh fr-patch138.txt swap
sh fr-patch138.txt swap
--------------------------------
Danger detected
--------------------------------
-------------------------
/sd-ext/userinit.d/25Swap installed
-------------------------
-----------------------------------------------------
swappy utility installed
just run swappy if you want to change your swappiness
-----------------------------------------------------
current swappiness=60
what swappiness would you like?
enter a number between 1 and 100
12
12
swappiness=60
current swap partition = 46.1M /dev/block/mmcblk0p3
would you like to install a swapfile instead? (y/n)
y
y
expr: syntax error
what size would you like?
max is M which is approx 70% of the space available on your sd-ext
but don't make it too big!!
32
32
expr: syntax error
please enter a number between 1 and

expr: syntax error
please enter a number between 1 and
32
32
expr: syntax error
please enter a number between 1 and

expr: syntax error
please enter a number between 1 and

It doesn't take my suggestion for swapiness or let me set a filesize. Any Ideas?

Thanks again.
[G1 Android Development] Firerat:
errm

not sure, you should have a number next to M

I'll have a look at it asap
[G1 Android Development] Firerat:
sorry, my bad

when you have no swapfile it ends up 'blank'

so now I test value and make 0 if its blank
[G1 Android Development] runderekrun:
Awesome! Where can I get the updated script?
[G1 Android Development] Firerat:
its in the OP

patch138b
[G1 Android Development] Abhi_UK:
On cm_dream_sapphire-08112010-054414 I get an error for the a2sd script. /sdcard/fr-patch138.txt: Syntax Error: "(" unexpected (expecting "}")
[G1 Android Development] Firerat:
yeah,

fr-patch138b.txt is the fixed one
[G1 Android Development] runderekrun:
DUH!

Sorry I was just checking your most recent post.
[G1 Android Development] sauudmir:
"a2sd	apps2sdext ( for FroYo ) #NEW#"

what is this ??
[G1 Android Development] Firerat:
apps 2 sd for FroYo

when you run the script in your ROM you have the option to move your apps from Fat partition to ext partition , much like the 'old school' script.

In addition the ApkManager ( shell script ) lets you move ( or toggle ) apps between Internal and sd-ext quickly and easily.

It will do until the Proper apps2sdext comes ( in the Android Framework )
[G1 Android Development] sauudmir:
Got it ... i thought its some new apps2sd fat32 thingy... thanks :)
[G1 Android Development] Noxxolous:
wurx on hero 2.1 w/sense?

Hey Firerat,

U r a tremendous resource to us all hats' off 2 u chap!!

Will "all" of these scripts work on a HERO ROM--let's say ZXTeam's latest build-- and if not which ones will and will not.

THX in advance
[G1 Android Development] arefin:
altough I have a 32MB swap partiton, the script says I dont have a swap partition or file and offers me if I want to create a swap file!

is this a bug? am using 138b btw.

thanks
[G1 Android Development] arefin:
did I get this correct that, this script will only work to relocate installed apps from /data/app to /sd-ext/app and that it will NOT tell the 'to-be-installed' apps to goo directly to /sd-ext/app/

right?
[G1 Android Development] Trek55:
have the same question, anyone?
[G1 Android Development] domex2k:
Well i first installed 14 apps and ran the a2sd and i checked it was all there, i then installed 13 more apps and then i mounted to my laptop with ubuntu to verify and it was all there aswell, not sure if that answers your question.
[G1 Android Development] bert269:
Thanks again for the effort

Fireat.

Thanks for the update to your scripts. I will try 1.5.3 soon.

I just have one question. When I look at the aio options (fr-patch-138b) is a2sd	& sdext mutually exclusive? It feels to me that a2sd is the older/first method introduced by CM donut/eclair days and sdext was introduced by Cm6. Am I right or missing the point? I meant to ask - one cannot use both options together, right?

Thanks!
[G1 Android Development] AustinAce:
I wiped data and cache installed the custom partitions and rom + gapps

Then wait for all my apps to be re downladed as soon as that finished I TRIED to apply the patch. Well when I rebooted my phone it went into a loop.

So I figured it was because I didn't have enough space on my phone because it obviously told me error:not enough space or something like that.

Then I redid everything except I pressed no instead of yes on the script and it sent me into a loop again. Any ideas?
[G1 Android Development] Abhi_UK:
What does the lwp do to cm6 as lwp already run, does it improve performance or what?
[G1 Android Development] Firerat:
sd-ext is required for a2sd, if you chose a2sd then sd-ext will be automatically included.

a2sd moves your apps to /sd-ext ( and you get the option to move some back to internal , use apkmanager.sh to 'toggle' location at anytime

if you just chose sd-ext, then sd-ext will be mounted on boot ( and any custom scripts you have in /sd-ext/userinit.d will be executed )
[G1 Android Development] Firerat:
when live wallpaper have full 3d access , they kind of 'fail' e.g. they will 'turn off' when the screen goes off.

the lwp hack basically turns off full3d access for the live wallpapers, so they run like they did in the eclair ROMS pre 3D
[G1 Android Development] Firerat:
get customMTD v 1.5.3

put fr-patch138b.txt on your sdcard

then do

cat > /sdcard/mtdpartmap.txt << "EOF"
mtd 90 2
aio remount a2sd
EOF

wipe, flash ROM, Flash Boot Patcher

optionally run

su
ApkManager.sh

in terminal

Oh, and if you really want me to figure out why you are looping post a logcat
[G1 Android Development] staunty:
I haven't been able to find an answer but for some reason the fixp portion of the script gives me the "SD_EXT_DIRECTORY environment variable not found...". I'm still using the 134 version. I just tried the 138b but for some reason it created issues and I had to do a restore. Any reason why fixp isn't working for me? MT3G with CM6r2.
[G1 Android Development] Firerat:
its a fail safe I added

the problem with fix_permissions is the script is 'hard coded' to use /system/sd as the location of sd-ext apps

in CM5 /system/sd was removed, and the fix_permissions script would error

so , I just 're hardcoded' to use sd-ext,

CM5 would give the sd-ext as a ENV

eg.

SD_EXT_DIRECTORY=/sd-ext

so it was 'easy' to check that and skip the patch ( becuase it would break fix_p.. on none CM5 )

What I might do is redo the patch to 'pickup' the correct sd-ext from /proc/mounts, thereby making it compatible with every ROM.

tbh, I should probably have a proper look at github and do a pull request on a fixed version of fix_permissions
[G1 Android Development] NLJ:
Another excessive 'fi' ?

Hi!

I think I've found excesive 'fi' in fr-patch138b.txt. It's harmless but still =o)

Patch is attached.
[G1 Android Development] AustinAce:
I run the code after I wipe and flash 1.5.3 rec/ROM/1.5.3 boot right??
[G1 Android Development] Firerat:
no, you need the /sdcard/mtdpartmap.txt before flashing ( else it won't know to use aio )
[G1 Android Development] AustinAce:
Thank you dude.

Btw I'll be running a log cat if this doesn't work again, I couldn't last time because I was flashing the patches from work. :)
[G1 Android Development] Firerat:
gawd knows where that came from :)

yeah, I missed that, as my vim does context highlight in a cat > file << "EOF" block.. hmm, maybe I can add it some how

I usually comment out the cat line, and then forget to undo them
[G1 Android Development] Firerat:
It doesn't matter , as long as the file is created

You can even make it in windoze notepad, the script will make it compatible

I can see I will have to make it easier,

Anyway, 01:07 am bst, no more beer, landlord has kicked me out, pah

Ok, tell you what, I shall make a new version which will create a default config

For now if you are a g1/magic and can already install a cm5/6 based rom don't worry about the config

I will do two things

A function in 'all in one' to create a config

A default config based on the phone model ( or maybe I can look at the most recent zip and assume that's what your going to install/ combo of both )

Got some 'data' from a cmda and a desire, so yeah stuff is looking good, but script getting bigger, lol

I already have a new version with a 'test run', ( well most of it, it to test compatibilty with phones I don't know about ;) )

Eta, don't ask ;)

But day or two is a good bet