yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] Firerat:
you don't need to mess with the shabang ( #!/system/bin/sh )

that is there for when you call it as an executable

the aio patch will write the scipts, then execute them with sh, so the #!/system/bin/sh is just ignored

http://tldp.org/LDP/abs/html/sha-bang.html

and , yeap, installing the scripts 'stand alone' in Your rom is much better then running the patch

the AIO is for end users, not cooks

but cooks can use the scripts it installs if they wish

best example of how AIO has been used in a rom , is @NameLessJedi 's work in BiffMod

he has modified the installed some of the scripts to his own requirements

( actually , I should take a look and maybe merge some of his stuff )

When I've done some more with Magpie, I will come back to this, and CustomMTD and implement some of the changes I have in my head

until then its best to use AIO in ROM, or at least Clockwork recovery ( as it has busybox setup )

Note, in recovery some features are off, as they require a running ROM to do stuff ( like move apps on fat )

interaction is off as I did have customMTD executing it via recovery, and you couldn't answer q's..
[G1 Android Development] sparksco:
Well I tried to answer questions in the install2.sh, but I think my syntax sucks for now, because the rom would just sit there on the splash screen, I'll get out my linux scripting books and have a look
[G1 Android Development] Firerat:
Running aio as a boot scriopt will fail ( with some options )

As some of the scripts require interation

If you feel you must have the script run on firstboot then look at the recoverycheck function and reverse its logic

But if you want to have some of the scripts in your rom by default, then add the script installed by the patch ( look at suff in cat >> somescript < "EOF" untill EOF

Note, some are broken up, as I add some variable with an echo

Keep meaning to github aio, have already broken it up into modules and have crude script to concatanate everything,

When/if I github it I'll include all the history so you can see how it evolved
[G1 Android Development] sparksco:
ok, sounds good, right now I'm using nautilus to keep the same permissions for stuff like the 25Swap and stuff like that, seems to be working pretty good for now, just not sure if it's going to upload like that or not
[G1 Android Development] Firerat:
?

nautilus is a file manager for gnome, wtf does it have to do with Android?
[G1 Android Development] sparksco:
lol, well I can't copy stuff in the userinit.d from sd-ext/userinit.d unless I'm running as root, because of the permissions on it, I run it as sudo nautilus
[G1 Android Development] Firerat:
Ahh, you mount via usb ?

I just adb push stuff, and chmod it later

simple script

!#/bin/bash
if [ "$#" != "3" ];
then
echo "3 args required, <Filename> <destination> <chmod permissions>"
exit 1
fi
adb wait-for-device push $1 $2
adb wait-for-device shell chmod $3 $2

and this to push stuff to /sdcard ( large zips ;) )

most of this is to get feedback,

e.g.

5672960/63764844 8.9 % /sdcard/update-cm-6.1.0-Magpie-DS-signed.zip

!#/bin/bash
adb wait-for-device shell 'if [ "`grep -q sdcard /proc/mounts;echo $?`" != "0" ]; then mount /sdcard;fi'
for i in $@;do
adb shell 'rm /sdcard/$i 2> /dev/null'
adb push $i /sdcard/ &
SIZE=`ls -l $i|busybox awk '{print $5}'`
while [ "$size" != "$SIZE" ];do
size=$(adb shell ls -l /sdcard/`basename $i`|awk '{print $5}')
echo "/sdcard/`basename $i`"|awk '{printf "\r"'$size'"/"'$SIZE'" ""%.1f %s %s",('$size'/'$SIZE')*100,"% ",$0}'
sleep 1
done
done
echo -e "\n"
exit
[G1 Android Development] mitsuu84:
Hello. I would like to ask you are subscribed to by the script Firerat all-in-one patch file [v1.4.1 beta3 dalvik set up move for an external cache? I thought that the choice of 10 - (dc2x) dalvik-cache-bind mount, but even so, my phone memory reduces the application uploaded. I still turn on something else to dalvik cache held only in the external memory section and the diminish the phone? this is a rom SparkMod 1.6.1 DS . Thank you for your help and sorry for my English a loose, translate through Google Translate.
[G1 Android Development] Firerat:
if you use

dc2x + as2d + ddb

then space on data will not reduce, but performance will be poor
[G1 Android Development] mitsuu84:
Thank you. I would like to use it because I have to start, but 89 megabytes of free space after installing a navigation and a few larger programs to me slowly running out of space in phone memory.
[G1 Android Development] sparksco:
Well you don't need to wipe your ext partition before you flash the rom, This way when you boot you will still have all your apps and 89mb internel. Also how large is your ext partition? I'll work on making a wipe to wipe everything like the system ect, but not the ext partition, but just not sure how important it is to wipe dalvik-cache on sd-ext. I think I read a few post back that it's not really that important, but idk.
[G1 Android Development] Firerat:
its not

some code in PackageManagerService.java

( part of services.jar )

if (didDexOpt) {
// If we had to do a dexopt of one of the previous
// things, then something on the system has changed.
// Consider this significant, and wipe away all other
// existing dexopt files to ensure we don't leave any
// dangling around.
String[] files = mDalvikCacheDir.list();
if (files != null) {
for (int i=0; i<files.length; i++) {
String fn = files[i];
if (fn.startsWith("data@app@")
|| fn.startsWith("data@app-private@")) {
Slog.i(TAG, "Pruning dalvik file: " + fn);
(new File(mDalvikCacheDir, fn)).delete();
}
}
}
}

if something in system changes then dalvik-cache gets deleted
[G1 Android Development] azuretech:
Will this work on other than the G1?

I loved this script on my G1, but have recently upgraded.... Will this script still work on other Cyanogenmod installed phones... Specifically I'm thinking my G2 with CM 6.1? If it doesn't work, can it be modified to work?
[G1 Android Development] Firerat:
it should work on any CM based ROM

I imagine you won't need most of it on a G2

not sure what the total nand size of the G2 is, but customMTD ( assuming you have S-OFF ) will negate the need for the space saving scripts ( like ddb a2sd and dc2x )

these days the shabang fix is not really needed, as the most common wrapper scripts ( like pm and am ) already have shabangs in CM6

the remount is still handy, bit less typing

random boot animations is not really very useful , was just a bit of fun
[G1 Android Development] sparksco:
Thanks for addressing this, I tested it out and for some reason it won't do the

# sh /sdcard/fr-patch141-BETA3.txt sdext

I tested it about 3 weeks ago and it gave an error, wish I remember what it said. Anywho I'll mess around with it tomorrow on my buddies G2 and have a look :)
[G1 Android Development] Firerat:
All the sdext script does is copy a script to /system/etc/init.d/05mountsd

If it fails you rom is pooched anyway
[G1 Android Development] sparksco:
Well it's not my rom lol, it's the stock nightlies for g2. I guess your right I should just add scripts to the rom and maybe it'll work, I'll give it shot. Even if not it's not like the g2 needs it anyways
[G1 Android Development] d3vilskid:
Hey firerat, appreiciate the work you do. Are you still working on magpie?
[G1 Android Development] sparksco:
Well hopefully we'll see it on his github ;) http://github.com/Firerat
[G1 Android Development] fonsigno:
where is the link of sparks rom 1.6.2 ?????
[G1 Android Development] sparksco:
vvvvvvvvvvvvvvvv
[G1 Android Development] sparksco:
Here's what I have so far, not signed or anything, just zipped up. includes only one Apkmanager, not sure why the aio patch installed two on my phone but any who, also includes dc2x but not ddb. Probably needs a lot more revisions, so any help on it would be appreciated.
[G1 Android Development] Firerat:
lol

it installed a symlink to the script

because some people don't type CaMel CaSe

when you pulled it you got two copies as the link was followed
[G1 Android Development] sparksco:
lol, must have been one of those days :D Also thanks for the chmod tip that helped a lot!
[G1 Android Development] Firerat:
no idea about the FCs,

the size of swap, well to change that you need to re-partition your sdcard

swappiness, tbh if you have to ask, you don't need to know

honestly, 60 is fine

but if you really want to change it

su
vi /sd-ext/userinit.d/25Swap

actually, use nano instead of vi

I'll add a swappiness edit to next major revision

go here for what swappiness is all about

http://kerneltrap.org/node/3000

PS, if you don't have an sd ext partition, look in /data/local/userinit.d ;)
[G1 Android Development] bm6788:
Thank You Fire
[G1 Android Development] Booker-T:
Can you modify the script for customizing swap size and swappiness?

It should be great to have this option as different SD card has different speed, this let users to test the best setting about swap:D
[G1 Android Development] Firerat:
swappiness yes

size of swap .. well yes but only reduce its size

find swap partition

format as ext

create swapfile

format swapfile as swap

have swapscript mount swap partition

use file as swap

as above, but have swapfile of any size on sd ext partition*

can't have on fat32, 2 reasons

would need to remount allowing device files

you wouldn't be able to mount usb without nasty things happening

* use the swapper app

but don't take that as a recommendation, I have never used it
[G1 Android Development] iskillz:
I must be really thick or something, but I have put the file on the root of my SDCard, unmounted, switched to SU on the terminal and entered in the exact command for the fb patch, but I keep receiving syntax errors. I get the following:

:not found
:not found
/sdacrd/fr-patch12.txt: 9: Syntax error: "elif" unexpected (expecting "then")

Sorry, i'm not that strong with nix, any ideas why this may be happening?

Thanks.
[G1 Android Development] Firerat:
have you tried fr-patch132.txt ?
[G1 Android Development] iskillz:
Thanks the response, I must be blind, can't see 132, but can have tried both 12 and 131 from the original posts. Any chance you can point me in the direction of 132 please?

Thanks.
[G1 Android Development] Firerat:
doh... I didn't upload it :o

tbh you only need it if you are NoneDangerSPL

your fine with 131
[G1 Android Development] iskillz:
I'm confused then as neither 1.2 or 1.3.1 seem to be working for me.

My knowledge is limited on the subject, but i'm going to try and copy and paste the fb script and save it in it's own txt file called fb.txt. Can you confirm if this is the entire fb script please?

fb ()
{
# Edit trout.prop to get sync option in Facebook 1.2.x
# Credits : SilverSurfR and Skri11a
prop=/system/build.trout.prop
if [ `grep -q "Facebook 1.2.x Sync" $prop;echo $?` != "0" ];
then
remountrw
sed \
-e '/ro.product.name=kila/ i #ro.product.name=kila' \
-e '/ro.product.name=kila/ i #Facebook 1.2.x Sync on G1 Credits : SilverSurfR and Skri11a' \
-e '/ro.product.device=dream/ i #ro.product.device=dream' \
-e '/ro.product.device=dream/ i #Facebook 1.2.x Sync on G1 Credits : SilverSurfR and Skri11a' \
-e 's/ro.product.name=kila/ro.product.name=opal/' \
-e 's/ro.product.device=dream/ro.product.device=sapphire/' \
-i $prop
echo "$prop Patched for Facebook 1.2.x sync"
echo "changes will take effect on next boot"
echo "enable sync in Facebook app settings"
fi
return
}

I assume the command would then be:

sh /sdcard/fb.txt
[G1 Android Development] Firerat:
nearly

at the bottom you need to execute the function

just

fb

will do it

or remove the lines I have highlighted in red

you should also add a shabang

#!/system/bin/sh

at the top

not strictly needed, but a good habit

doh, missed a bit

replace remountrw* with

busybox mount -o rw,remount /system

* ( a function in my script, all bloaty but it tells you if something goes wrong with it )
[G1 Android Development] iskillz:
Oooh, hang on, something has happened with 1.3.2!

Think the script has executed. Thanks for all your help mate.
[G1 Android Development] phantasm714:
@firerat:

quick problem/question:

* installed Facebook version 110 from earlier in this thread to allow syncing

* installed CM test4 from test3, no wipe (wiped when installed test3)

* saw your script (version 1.31), ran it (sh fr-script131.txt all)

* tried to install facebook 1.2 app from market

i get the following error: "Package file was not signed correctly."

D/vending ( 1348): com.android.vending.api.LocalAssetDatabase.notifyListener():
-4866929442802822794 / INSTALL_FAILED
I/vending ( 1348): com.android.vending.AssetDownloader$DownloadManagerBroadcastR
eceiver$MyPackageInstallObserver.packageInstalled(): Package install from conten
t://downloads/download/58 failed: Package file was not signed correctly.

PS, I'm on dream 32B

Thanks!
[G1 Android Development] iskillz:
Firerat, you're a legend. It's worked and everything is syncing. Keep up the good work.
[G1 Android Development] Firerat:
uninstall facebook, then install market version
[G1 Android Development] Picolini:
Just tried this out on test 4... only did swap, lwp, and fb.

The first two worked, FB didn't. I uninstalled the FB app before I did the command... it appeared to work in the console. Rebooted, installed FB from the market, no go.
[G1 Android Development] Firerat:
that does puzzle me

can you do

cat /system/build.trout.prop

you should get

ro.product.model=HTC Dream
ro.product.brand=tmobile
#ro.product.name=kila
#Facebook 1.2.x Sync on G1 Credits : SilverSurfR and Skri11a
ro.product.name=opal
#ro.product.device=dream
#Facebook 1.2.x Sync on G1 Credits : SilverSurfR and Skri11a
ro.product.device=sapphire
ro.product.board=trout
# ro.build.product is obsolete; use ro.product.device
ro.build.product=dream

# Don't put dexfiles in /cache on trout
dalvik.vm.dexopt-data-only=1
[G1 Android Development] FatBoyExtraordinaire:
I apologize in advance for this probably stupid question, but the zip you posted above is CM's Eclair test 4 version completely, or does the google add-on zip need to be flashed afterwards? Also, am I correct in assuming that your posted zip is the rom with all your tweaks and scripts already added but able to be flashed on g1 with a stock spl (like myself). Honestly, this second question wasn't really a question, but more of a confirmation so that I may heap mounds and mounds of praise and thank on you for making it possible for a "fearer" like me to be able to enjoy it.

From just reading the cyan thread i've seen both sides on the swap issue. Is swap necessary with the rom, or just recommended?

Again, thank you for all you do on here. Much appreciated.
[G1 Android Development] Firerat:
it doesn't include the all in one script

gapps, you won't need to flash them, *if* you did a no wipe flash

you will need them if you wiped, but just flash the standard gapps from the cm5 OP

Well, as I've written a few times, its up to you

personally I like swap
[G1 Android Development] FatBoyExtraordinaire:
Well I'd be coming from Super D so I definitely would wipe fully and go ahead and flash. Just the fact you made this available to Stock SPL'ers is fantastic. A simple flash (of both zips) and I'm good to go. And the scripts can be applied later as need be. Thank you again. Also, good looking out on the swap advice.
[G1 Android Development] Picolini:
Yep, that's exactly what I got... so does this mean it should work fine?

There was no option to sync when I first launched the Facebook app after installing, and in the settings for the app I only have:

Refresh Interval

Notifications

[check boxes for what to be notified of]

Helpful Tips

No spot for syncing...

edit: I used the 1.3.1 patch, since I have DangerSPL.

I tried running the script for facebook again and it just says this after I press enter:

"Danger detected"
[G1 Android Development] Firerat:
ok, none of it makes any real sense

the 55ApkManager installs ApkManager if its missing, so no need for the one in bin

install.sh is just setting the permissions of the file you put on the phone with the updater-script

why not just set the permissions with the updater script?

and why are you waiting for "" to be a block device?

your just wasiting 6 seconds as "" will never be a block device

and install2.sh

errm, your getting the updater-script to copy stuff to the phone's memory, then using the script to install it to the phone?

why? , your not testing anything, so just put the files on the phone , and set permissions

again, you waiting 6 seconds for "" to not be a block device.

Its completely harmless .. BUT !!!!

YOU HAVE NO CLUE WHAT YOU ARE DOING!!

one day you will do something silly and eff it all up

I doubt I will ever use one of your scripts

and until you show some understanding I advise that others never use your scripts

Honestly, I'm not just being nasty.. you don't have a clue what you are doing.
[G1 Android Development] sparksco:
Deleted.....
[G1 Android Development] Pfeffernuss:
So this is your thread now, really? ;)
[G1 Android Development] Firerat:
you have no clue what so ever

I have tried, but you are useless

Your scripts are useless, I really don't understand how you can be so bad at it.

I don't believe you will ever be competent at it

this is not bs, it is fact
[G1 Android Development] sparksco:
The only thing that is useless now is you, good bye
[G1 Android Development] Firerat:
lol

what is that river in Egypt called again?

can't quite remember, anyway you are in it.
[G1 Android Development] sparksco:
My scripts are based on this: http://en.wikipedia.org/wiki/Common_sense

Edit: Now, I'm going to go out on a limb here and say that this one applies the most, and also why we are all here: Common sense, based on a strict construction of the term, consists of what people in common would agree on

And of course I was only trying to do what you asked for, to come to a common agreement. but keep in mind that there are other people here on xda as well, that we also must agree with and have a common understanding of what is needed and wanted
[G1 Android Development] Firerat:
so, in the world of shell scripting you think people commonly believe that not declaring a variable and then testing the undeclared variable in an until loop makes sense?

# wait for the device to settle
COUNT=6;
until [ -b "$MMC" ] || [ $COUNT -lt 1 ];
do
sleep 1;
COUNT=$((COUNT-1));
done;

do you even know what that is doing?

did you know its actually redundant in the script you took it from?

you are doing things without actually understanding what it does, and for no good reason.
[G1 Android Development] Firerat:
when you get there, send me some tea
[G1 Android Development] sparksco:
I know what it's doing, a 6 sec count. Thought it would be better than Sleep 10 or whatever it is that shadow uses, but I am human and could be wrong. Yes could be redundant, but harmful, doubt it
[G1 Android Development] Firerat:
lol

if you want it to sleep for 6 seconds then just use

sleep 6

the full code block for that is

MMC=/dev/block/mmcblk0

# wait for the device to settle
COUNT=6;
until [ -b "$MMC" ] || [ $COUNT -lt 1 ];
do
sleep 1;
COUNT=$((COUNT-1));
done;

so, basically it is

if /dev/block/mmcblk0 exists and is a block device, continue, if not, wait 1 second and try again, but only try 5 more times.

You have no clue what you are doing.
[G1 Android Development] sparksco:
will change immediately, and just add a fi at the end after sleep 6

sleep 6
fi
[G1 Android Development] Firerat:
fi closes an if

you have no if so the shell will just complain

you have no clue what you are doing

read

http://www.freeos.com/guides/lsst/

Edit

and there is no need to make it sleep

and there is no need to even have that script, just set the permission with the updater-script
[G1 Android Development] sparksco:
Well that's the issue I ran into before, with delievering the .apk's/scripts to the ext on flash. Before I was using this:

mount("MTD", "userdata", "/sd-ext");
package_extract_dir("sd-ext", "/sd-ext");
unmount("/userdata");

package sd-ext contained two folders

1. userinit.d which contained the scripts

2. apps which contained the .apk's to be delivered to sd-ext

On boot folders were there but not .apk's or scripts. So maybe I am missing some secret set permissions for the updater script for sd-ext/apps that I am missing.

Also tried this

mount("MTD", "sd-ext", "/sd-ext");
package_extract_dir("sd-ext", "/sd-ext");
unmount("/sd-ext");

Didn't work

So that is why I'm using the scripts to move them around and set permissions in the /tmp first, because for now it just works better that way
[G1 Android Development] Firerat:
run_program("busybox", "mount", "/sd-ext")

update-binary probably doesn't know about sd-ext

assuming this is typo, as you are mounting the data partition to /sd-ext

mount("MTD", "userdata", "/sd-ext");
[G1 Android Development] sparksco:
Ok that make a lot more sense now. Any chance we'll ever see a update binary that knows about sd-ext? Seems like cyanogenmod team has their hands full with other projects
[G1 Android Development] lele5800:
This script Will work on Magic 32a?
[G1 Android Development] Firerat:
if you want a2sd, then try the Magpie version of the GB on Sapp

but yeap, it will work on 32a
[G1 Android Development] lele5800:
The magpie version don't want boot on my Magic..i don't know why..
[G1 Android Development] Firerat:
submit logcat in its thread,

I don't have a Magic
[G1 Android Development] joshua_tam:
Hey, is that the current a2sd method make app, app-private, dalvik-cache pointing to sd-ext?

It is true that pointing dalvik-cache to sd-ext slows down the whole system?
[G1 Android Development] Firerat:
use the dc2x option and find out
[G1 Android Development] joshua_tam:
I have tried that before, and it slowed down

Actually I am wondering whether we can move /system/app to sd-ext, and make all the dalvik-cache to internal storage, will it have speed increase?
[G1 Android Development] Firerat:
no it won't

and system is read only
[G1 Android Development] d12unk13astard:
Thanks Firerat for this amazing script, i failed @ using custom mtd but the option to use dc2x + as2d + ddb with AIO script really made my day! I have a 4gb class6 card and i dont really see any slowdown. So all the installed apk's now go to sd ext partition correct?
[G1 Android Development] mrcartagena2000:
Is there a similar fix for g-2 vision? i just upgraded Thank You
[G1 Android Development] mahroze:
HELP

i am not able to run the script i placed the file on the root of the folder but whenever i seem to run it it says can't open /sdcard/fr-patch141-BETA.txt

could anyone help me please I am a Noob
[G1 Android Development] mrcartagena2000:
hmm guess not
[G1 Android Development] TheNewGuy:
I am wondering the same thing... I recently upgraded and even though my G2 runs perfect as is.... I just cant shake off the days of trying to make my phone faster and faster... I have a class 10 sdcard and I heard it should be faster than emmc... so I tried the other scripts listed in the G2 threads and they just don't work for me... at least they seem real dirty compared to firat script... So does it work? I kind of think it might because it just symlinks the data to the sd-ext..? maybe.. It is to late to try tonight but I just might give it a try tomorrow.
[G1 Android Development] tidewaterns:
Awesome patch. Thanks!
[G1 Android Development] kingjehu:
RBA doesn't seem to work. I have the 99randomBA in the /sd-ext/userinit.d, but I always just get the one in /data/local. I'll try having them in different folders rather than leave them in /sd-ext/bootanimations with different names and report back.
[G1 Android Development] Firerat:
I was lazy when I did RBA

I did it very quickly

My guess is your rom doesn't have bash

the script is dependent on bash for the random number feature,

I'll redo it with a 'random' function for sh
[G1 Android Development] Firerat:
su
sed -e 's/xbin\/bash/bin\/sh/' -e /bash/d -e s/randomBA=\`echo.*$/randomBA=99\\nwhile\ [\ \"\$randomBA\"\ -gt\ \"\$No_bootaminations\"\ ]\;do\\n\ \ \ \ randomBA=\$\(expr\ \`head\ \-n\ 1\ \\/dev\\/urandom\ \|\ od\ \|awk\ \'\{printf\ \$4\}\'\|cut\ -c\ 2-3\`\ +\ 1\ \)\;\\ndone/ -i /sd-ext/userinit.d/99randomBA

will fix the dependency on bash issue

( or copy the attached file to /sd-ext/userinit.d/99randomBA )

edit: oh, and chmod 700