yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] Firerat:
yes, its lame and doesn't save to sdcard, ( so doesn't have WES permission )

Options

uninstall lwp - easy

edit the 15GPU_perms script - relatively easy

find an Android permission which the game has, but live wallpapers don't, and add to /system/etc/permissions/hw3d.xml ( along with graphics linux grp )

use brutt_all's apktool and add wes string - easy(ish) but I removed my 32bit linux to make some room

changing the 15GPU_perms is probably the best option

su
sed s/com.qualcomm.qx.neocore/net.hexage.radiant.lite/ /sd-ext/userinit.d/15GPU_perms -
/sd-ext/userinit.d/15GPU_perms

nb, if you wanted to change again, the yu need to sub com.qualcomm.qx.neocore with the current

I guess I could add something to make it easier

btw, this is whats happeing

#!/system/bin/sh
# restrictive Perms for GPU - Firerat 2010-05-05
# NB, see also /system/etc/permissions/hw3d.xml
if [ -e /dev/msm_hw3dc ];
then
chmod 660 /dev/msm_hw3d*	#dumb down gpu permisions
chown root.graphics /dev/msm_hw3d*
fi
# Check for Neocore, this has no Android Permissions, so make it the owner of /dev/msm_hw3d*
# NB, this is a bit ugly
packages=/data/system/packages.xml
if [ `grep -q com.qualcomm.qx.neocore ${packages};echo $?` = "0" ];
then
neocoreUID=`awk -F\" '/com.qualcomm.qx.neocore/ {print $12}' ${packages}`
chown ${neocoreUID} /dev/msm_hw3d*
fi

we are simply setting the owner of /dev/msm_hw3d* to be com.qualcomm.qx.neocore's uid ( or whatever you use in that script )

now, I guess I could play about a bit and make a script which will do this and launch the game for you
[G1 Android Development] cameron.t90:
thankyouthankyouthankyouu! lol
[G1 Android Development] cameron.t90:
hmmm.. so neocore is running smooth now that i did what you said, the changing gpu perms, but radiant isnt running any better :/

did i miss something?
[G1 Android Development] Firerat:
its one or the other

replace

com.qualcomm.qx.neocore with the apps name ( either the android name, or the .apk filename )
[G1 Android Development] lobesy:
Reposting since it seems to have been missed the first time.
[G1 Android Development] Firerat:
reposting since you didn't read the thread
[G1 Android Development] wrsg:
i am losing track between the diff. versions on here and cyans forum, which one is the most recent/up-to-date?
[G1 Android Development] Firerat:
they both have the same a2sd version.

although CM Forums has a preview of the next ( and final ) version

once I've completed that it will be included in this patch, along with other fixes and a 'stand alone' data/data bind
[G1 Android Development] Firerat:
almost forgot..

new version, 1.3.9 , includes the new a2sdext script
[G1 Android Development] cameron.t90:
I subbed the neocore uid for the radiant uid and it did the same thing as before but didn't make radiant run any smoother. I'm probably doing something wrong lol
[G1 Android Development] wrsg:
should this work on SuperF test 3 by benbuchacher? i'm just about to try it, hopefully it won't explode my phone
[G1 Android Development] alongenemylines:
for anyone having issues with the scripts on the newest CM6 RC3 nightly:

the newest nightly runs all it's boot scripts from /system/etc/init.d (much more sane for a linux user!), and firerat's script puts the boot scripts in /dat/local/userinit.d . Moving the scripts to /system/etc/init.d fixes it all.
[G1 Android Development] Firerat:
the script put scripts in /sd-ext/userinit.d/ unless sd-ext is not mounted, in which case it puts them in /data/local/userinit.d and patches /system/etc/init.d/20userinit to look in /data/local/userinit.d

if you reflashed the 20userinit patch is clobbered

I might submit a patch for 20userinit, hopefully it will be accepted ( I see no reason why not as it doesn't seem fair to exclude people without /sd-ext mount )
[G1 Android Development] Firerat:
should be fine
[G1 Android Development] wrsg:
i tried running this on SuperF test 3 with a 128mb ext2 partition, i decided to experiment a bit and after running the main script (which i guess is when the moving of apps to the sd-ext partition takes place), and i moved a lot of apps to /data

it ran fine for a while until i tried to reboot.... and got stuck in a ******* bootloop.

i wiped the ext2 partition, destroying all my apps in the process (yes i'm learning the hard way here :)) and now i'm back to froyo but with an empty sd card until i get home tonight.

the questions i have for now are:

1. is it enough to run the 1.32 a2sd script (the one on cyanogens forum) to get my apps moved and working on the ext2 partition? what would i have gained if i had moved my apps to /data?

2. (unrelated to thread, but its your other 'baby') if i install the custom mtd partition patch, will i have to run it every time i boot, or just once when i flash a new rom?

3. i know its difficult to tell why but can you think of any reason why i ended up in a bootloop after rebooting the 1st time after running the patch?

still, i would like to thank you for your effort, i think i am nearly there with the apps on my ext2, just need to stop my destructive experimentation :)

also i want to donate as a way of saying thanks, let me know how.
[G1 Android Development] athakur999:
Not sure if you figured it out yet or not but I was also seeing the same problem. I was originally running the script with the current working directory of /sdcard and running it as "sh fr-patch139.txt".

When cd'ed to / and then ran the script as "sh /sdcard/fr-patch139.txt", it was able to correctly identify my swap partition. I haven't looked at the script yet but it looks like it might be using a relative instead of absolute path somewhere.
[G1 Android Development] Firerat:
yeap, this is the exact same script, but packaged into the 'all in one'

no, you only need to flash the boot patcher each time you flash a new ROM/Kernel ( or restore a nandroid which doesn't have a boot.img patched with the current layout .. if in doubt flash boot patcher after restoring )

You only need to flash the recovery patcher if you upgrade/switch recovery or want to resize )

Of the top of my head, nope, but give me a logcat and I will see what the problem is

experimentation is good :) especially if you have backed up ;)
[G1 Android Development] Firerat:
errm, nope

maybe you miss typed it

sh will always require the relative path regardless of what is in the script

to avoid typos ( and do less typing )

su
ash ( or bash )
sh /sdc<tab>fr-p<tab>

if you don't see the .txt on the end, <tab> again and fill in characters and <tab> until you complete the filename

http://en.wikipedia.org/wiki/Command_line_completion

everyone using *nix should use this on command line

PS <tab> on a g1 keyboard is <alt> q

I will nearly always use absolute paths within scripts, usually I will 'capture' the current working directory with pwd ( print working directory )
[G1 Android Development] wrsg:
thanks for your reply. what i meant to ask in the 1st question was: once i have run the a2sd script, then i don't need to do anything else and the apps should be on the ext2 partition?

never mind about the bootloop, it was probably my fault, and i wiped my partition afterwards anyway, so a logcat probably wouldn't tell you much at this point.

also tell us how to donate, i'm sure more than a few ppl want to thank you for your work.
[G1 Android Development] athakur999:
You're right, it wasn't the fact that I ran the script from / instead of /sdcard that "fixed" my issue, rather it was that I had my swap partition already enabled manually using swapon.

Also my "problem" wasn't really a problem, it's just that the output in the script is a bit confusing: "you currently have no swapfile or swap partition" really means "You currently have no swapfile or swap partition ACTIVE". I thought it meant it couldn't find my swap partition on mmcblk0p3 at all.

With those cleared up the script works great :)
[G1 Android Development] Firerat:
ahh, yeah, that makes sense

I thought I'd already reworded it
[G1 Android Development] wrsg:
so i ran the script (still using SuperF test 3) and checked my internal phone storage in Settings, it was about 56mb. i downloaded a couple of apps from the market to test if the apps2sd had worked properly, but the internal storage space went down to about 44mb?

is this normal behaviour? all i did was run the script with 'su', then 'sh a2sd.sh' (i renamed it), and then said no to the question about binding /data or something, was that the correct thing to do? if i do the /data bind, what exactly happens?

sorry should mention i'm using the version of the script from cyanogens forum, as im only interested in apps2sd.
[G1 Android Development] Firerat:
/data/data contains apps config files and in some cases binary files , so yes new apps still means free space on data will go down

/data/dalvik-cache is where the dex files for you apps are kept, so yes new apps will still reduce the free space on /data

BUT you can install more apps with a2sd than without it

the data/data bind puts /data/data on sdext,

the dx2c option will put dalvik-cache on sdext

if you are short of space , both these options will help, but the dalvik-cache bind will reduce performance .. so should be used as a 'last resort'

also consider using CustomMTD and gain 28mb of space on data
[G1 Android Development] wrsg:
it took its time, and several (possibly annoying) questions here, but its starting to click finally. thanking you.
[G1 Android Development] brownbomba:
Question

Hello, I used your apps2ext on a froyo rom and It worked good. The problem I have is that I decided to go back to CM5. I wiped everything including ext. I then I went back to my favorite nandroid back up. Upon booting up, I noticed that in the market it showed that my apps were not there but in reality they were there because I was down about 30 internal storage. I went to the market and installed all my apps again. They all downloaded to the ext but I was still down 30 in internal storage. I deleted all my apps and I still have not recovered the 30. I used root explorer to try and figure what was taking up that space with no luck.

How can I fixed this. Im pretty good with adb. If I delete the system image, will I loose root and or recovery?

Also my notification bar will not pull down anymore. Also my touch is slowly dying. Is there anything I can do to tweak those settings to make them work again.
[G1 Android Development] sauudmir:
Estimately how much performance is reduced by dalvik-cache bind?
[G1 Android Development] Firerat:
difficult to say, its largely dependent on your sdcard

some have had worse performance than others

personally I see it as a means to an end, if you really need the space its an option

its possible that using it in conjunction with swap has a negative effect, perhaps if you use compcache it won't be as bad
[G1 Android Development] Firerat:
in all honesty I don't know
[G1 Android Development] Foo_Blyat:
just dropping in to say Hi.

;P
[G1 Android Development] sauudmir:
Oh thats y ive been experiencing some lag for the last couple of months and i couldnt figure what coud be the bug ... yesterday i revomed the dcx2 coz had alot of internal memory almost all of it 108MB and after removing it i have 54MB left but that tiny bit of lag that one could notice (if using the phone all the time can be so annoying) is gone..

Thanks for letting us know that :)

I wouldn't suggest anyone to use dcx2 with swap unless they have a major space problem ...
[G1 Android Development] Firerat:
yeah, I offered it a a solution for cm5 DangerSPL , wasn't a problem from NoneDanger SPL as the 67mb cache was big enough for dalvik-cache, where as danagerSPL had 30mb of wasted space, Although it was never officially supported CM5 ran better on NoneDangerSPLs :)
[G1 Android Development] FatBoyExtraordinaire:
Yeah it does! Thanks once again Firerat for making the "old method" for people like me. Still using it now and couldn't be happier.
[G1 Android Development] Foo_Blyat:
dont know why im having bad luck with your scripts today but it is what it is.

i just wiped my system and installed the nightly from yesterday and when i go to turn on swap in your newest 139 file it says no swap partition is found would i like to make a swap file.

i mean, clearly i have a swap partition so i dont have a clue as to whats going on.
[G1 Android Development] Firerat:
you could give this one a shot
[G1 Android Development] Foo_Blyat:
ill def try it out after i get a meal in.

after some troubleshooting i did notice that even tho 139 wont turn on swap i can enable swap thru

sh /system/bin/swappy on

it tells me something like

XXXXX is not swap

XXXXX is not swap

XXXXX is swap

current swap partition = 30.8mb /dev/block/mmcblk0p3

would you like to install a swap file instead? (y/n)

i type N for no, then it asks me what swappiness i want, i type 20 and its done.

unfortunatly it barely swaps, like maybe 1288 mb and it cancels itself out after reboots.
[G1 Android Development] Firerat:
yeah, it was testing /proc/swaps , which assumes swap already running

then new , wip one checks the actual partitions

trouble is that might fail on older, none cm5+ roms as fdisk is either not available or doesn't have list, can't remember which
[G1 Android Development] wrsg:
ok im confused, i have apps on my sd card that can be seen when I run the a2sd script, and i also have successfully run your custom MTD patch. i changed roms from SuperF to CM6 nightly of 27 August (today) and now i can't see the apps that are on my sd on the launcher?

how do i get a log so i can show what it looks like? i dont see anything in /sd-ext

i ran your script like this

1. su

2. sh fr-patch139.txt a2sd fixp

3. (i then ran) fix_permissions

4. then rebooted

still nothing???

when i run the script i see stuff like Yell.com among others, so they are definitely there, just hidden.
[G1 Android Development] Firerat:
did apkmanager pop up with a big list of apps?
[G1 Android Development] wrsg:
yup, exactly the ones i had installed

what looks odd about them is that they all have a '-1' after the filename. Also the location for all of them is listed as /sd-ext

like i say, confusing...
[G1 Android Development] Firerat:
-1 ( or 2 ) is something added by froyo

tbh, from what you have said it worked

do

df -h

you should see

/data/app

/data/app-private

listed
[G1 Android Development] wrsg:
They are both there with roughly 20mb in use which looks about right.
[G1 Android Development] Firerat:
well, idk it _should_ be working
[G1 Android Development] bluedragon1982:
after i have run "sh /sdcard/fr-patch139.txt a2sd" , can i set the default install folder to the ext partion on my sdcard aor do i have to run apkmanger after install apks ?
[G1 Android Development] AndDiSa:
You should install them on "internal" so they go automatically to sd-ext. Wiith app-manager you can move them back to "real"-internal.
[G1 Android Development] wrsg:
been trying all morning to get the apps to show, finally given up and gonna wipe everything and start from scratch, might as well now that cm6 stable just dropped, thanks anyway.

edit: quick question, is this the correct order:

1. custom MTD

2. a2sd

3. Profit
[G1 Android Development] meisterlampe2000:
Script (swap) not working on CM6 final

Hey Firerat !

I think something is broken since the latest nightly eg. cm 6.0.0 final.

When i try to enable swap, the script cannot find the userinit file, so swap i not activated on boot:

# sh fr-patch138b.txt swap

--------------------------------

MT3G detected

--------------------------------

find: /sd-ext/userinit.d: No such file or directory

-------------------------

/data/local/userinit.d/25Swap installed

-------------------------

-----------------------------------------------------

swappy utility installed

just run swappy if you want to change your swappiness

-----------------------------------------------------

find: /userinit.d: No such file or directory

current swappiness=60

what swappiness would you like?

enter a number between 1 and 100

Is there any way to fix this ?
[G1 Android Development] Firerat:
I don't think its actually broken, it should have patched /system/etc/init.d/20userinit to also look in /data/local for user scripts ( if /sd-ext is not mounted )

I should have redirect std err to /dev/null to hide the 'errors'

( 2> /dev/null )

ahh, hold on , :)

just looking at CM6 Final, it already has /data/local/userinit.sh :)

http://github.com/CyanogenMod/andro...mmit/26a382df046ab79ba477fc4f350ce3fab402aca4

its been in since 17th Aug :)

Edit : ahhhhhh, I see the problem

it doesn't add full /data/local support , just the single /data/local/userinit.sh

which explains why the msg about patching 20userinit is missing

the full function

PatchUserinit ()
{
# patch userinit script to use /data/local/userinit.d
# I was going to make a fake sd-ext mount, but nah, no risk of any a2sd weirdness with this
for userinit in `ls /system/etc/init.d/*userinit*`;do
if [ "`grep -q userinit $userinit;echo $?`" = "0" ];
then
# check not already patched
if [ "`grep -q data/local/userinit $userinit;echo $?`" != "0" ];
then
remountrw
cat >> $userinit << "EOF"
# Firerat patching userinit to use /data/local/
# target being setups with no ext partition e.g. mt3g
if [ -e /data/local/userinit.sh ];
then
log -p i -t userinit "Executing /data/local/userinit.sh"
logwrapper /system/bin/sh /data/local/userinit.sh
setprop cm.userinit.active 1
fi

if [ -d /data/local/userinit.d ];
then
logwrapper busybox run-parts /data/local/userinit.d
setprop cm.userinit.active 1
fi
EOF
busybox chmod 700 $userinit
echo "$userinit patched to check in /data/local/"
echo "changes will take effect on next boot"
fi
fi
done
return
}

I test for it being patched with grep -q data/local/userinit ( it find that from the line /data/local/userinit.sh )

OK, to fix is straight forward

mount -o rw,remount /system
mv /data/local/userinit.d/* /system/etc/init.d/

I'll redo my patch ( to check for both components and patch acordingly ) , and submit amendment to git

Edit2: Gerrit appears to be down, when its up and I remember I'll up for review
[G1 Android Development] wrsg:
would this explain my problem with the hidden apps? > http://xdaforums.com/showpost.php?p=7883197&postcount=462
[G1 Android Development] Firerat:
no, since you have sd-ext mounted it doesn't need to look in /data/local/userinit.d
[G1 Android Development] poormanq45:
I'm having an odd issue.

I have a MT3G. I have a 96MB swap partition.

I'm running FroyoRedux 1.8.

The script runs fine, but when I type Free into terminal I am only showing ~24000 swap. It used to give me the full 96000.

The thing is, if I disable swap by /system/bin/swappy off. Then On. The full 96000 swap shows, but when I reboot it goes back to 24000.

Any suggestions? I know 96000 is a lot, but I use Opera Mini and it will reload if I do something else without 96MB of swap.
[G1 Android Development] Firerat:
try turning compcache off ( its default these days )

if that still doesn't resolve it tke a look at /proc/swaps

cat /proc/swaps
[G1 Android Development] poormanq45:
I believe that's the issue, but once I disabled compcache, swap is no longer enabled on startup. I'm going to do a full wipe and disable compcache before ever running the script.
[G1 Android Development] slimbada:
thanks for the tip on using 96mb swap. i always had operamini reloading with 32mb swap on cm6 stable. By the way i am using swapper2 app from market for managing swap.
[G1 Android Development] poormanq45:
Alright, I wiped and repeated the steps. I made sure to disable compcache, reboot, then run the swap script.

The output in ADB for cat /proc/swaps is showing all the fields blank. No Filename or anything.

Any suggestions?

Note: I was using FroyoRedux 1.7 and the patch was working fine. The biggest difference, as a lay person, that I can see is that CompCache is on by default in 1.8.

*edit* shows same thing in terminal on the phone.
[G1 Android Development] poormanq45:
Alright, I believe there may be an issue with the script.

I just the newest version of CyanogenMod. The common factor between these two roms is they're using the latest Cyanogen build 6.

The swap script works fine and recognizes the full swap partition once CompCache is disabled, but once the phone is rebooted swap is turned off.
[G1 Android Development] Firerat:
not a script issue

nothing has changed in a while

you need to get smarter with your diagnostic skills before you start blaming the script

give me logcat!!!!

btw, if my script sees anything mounted as swap, it bows out

turn off compcache or read the actual script before you jump to conclusions

muppet
[G1 Android Development] poormanq45:
What portion of logcat would you like?

What I find odd is that if I do a clean install with FroyoRedux 1.7, which is based off the previous CM6 kernel, the swap install works just fine.

Sorry, I didn't mean to say there was something was wrong with the script. I was thinking more along the lines of a possible change in the latest build broke something.
[G1 Android Development] Firerat:
lol

if your iq was 100 , I downgraded it to 60, now its 40

stop pissing about with FroyoRedux, install cm6

then figure out that the relevant logcat might be the one that happens at boot

ffs do I really need to spell it out to you, a muppet that seemed to think it knows what it is typing about

lol

idiot !
[G1 Android Development] poormanq45:
I am running CM6 at this point! I understand basic troubleshooting. I know you need to eliminate as many variables as possible.
[G1 Android Development] Firerat:
need a real logcat, not the lite version

hint :

adb logcat
[G1 Android Development] poormanq45:
UM... That's exactly what I did.

Full entry is:

adb logcat > logcat.txt

Ah.. Found the issue. I'm using a Dos window. The buffer was set to 300 lines maximum. Upped it to 9999.

Here you go
[G1 Android Development] Firerat:
it doesn't look like sd-ext is getting mounted, so 25Swap is not executed

if it was then you would see the result of the bold line in the logcat

#!/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
# 2010-08-12 Firerat, added swapfile support
FindSwap ()
{
SWAPPINESS=20
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
if [ "`sed -n '$=' /proc/swaps`" -gt "1" ];
then
echo "Swap appears to be already setup, skipping checks"
return
else
if [ "`egrep -q "sd-ext|/system/sd" /proc/mounts;echo $?`" = "0" ];
then
SD_EXT_DIRECTORY=`egrep "/sd-ext|/system/sd" /proc/mounts|awk '{ print $2 }'`
fi
if [ -e ${SD_EXT_DIRECTORY}/swapfile.swp ];
then
SWAPFILE=${SD_EXT_DIRECTORY}/swapfile.swp
else
SWAPFILE=""
fi
for isitswap in $SWAPFILE `ls /dev/block/mmcblk0p*` ; do
swapon $isitswap 2>/dev/null
if [ "$?" = "0" ];
then
echo "$isitswap is swap"
echo $SWAPPINESS > /proc/sys/vm/swappiness
break
else
[B]echo "$isitswap is not swap"[/B]
fi
done
fi
return
}
[G1 Android Development] sauudmir:
ive just installed cm 6.0 with a clean wipe and used ur script but it isn't mounting the sd-ext that have all my apps and also when i run swap it says

/sd-ext/userinit.d/25swap installed

install: write error: No space left on device

swappy utility installed but when i run swappy it says permission denied
[G1 Android Development] poormanq45:
Any suggestions on how to resolve this?

Right now I am running an earlier build of CM6 and the swap script works fine.

*edit* I tried upgrading to the latest build. When I run the script it's now saying no swap partition found.

Any idea why the older build works fine?
[G1 Android Development] G1ForFun:
Same problem for me.....the script no longer finds my swap partition.
[G1 Android Development] sauudmir:
mine doesnt even mount the external partition...

says not enough memory ...

is there a fix yet?
[G1 Android Development] Firerat:
mine is working fine, so I'm going to need logcats
[G1 Android Development] sauudmir:
Did u have a clean install with wipe?

and how to get logcat i haven't done it befor :confused: