Related
I seem to be frequently flashing or messing up my G1 so I decided to write some shell scripts to help out but they seem to only half work if at all. Actually I'm not sure what they did because they displayed no output.
This script is supposed to backup the default init.rc and mountd.conf files then replace the existing ones with the modified ones.
Though it does not work.
Code:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
mkdir /system/sd
busybox cp -a /system/etc/mountd.conf /sdcard/recovery/mountd.conf.bak
busybox cp -a /system/init.rc /sdcard/recovery/init.rc.bak
busybox cp -a /sdcard/recovery/mountd.conf /system/etc/mountd.conf
busybox cp -a /sdcard/recovery/init.rc /system/init.rc
then this is the next set to move the apks and the program caches which doesn't work.
Code:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
busybox cp -a /data/app /system/sd
rm -r /data/app
ln -s /system/sd/app /data/app
busybox cp -a /data/app-private /system/sd/app-private
rm -r /data/app-private
ln -s /system/sd/app-private /data/app-private
rm -R /data/data/com.android.browser/cache/webviewCache
ln -s /sdcard/cache/webviewCache /data/data/com.android.browser/cache/webviewCache
rm -R /data/data/com.android.vending/cache
ln -s /sdcard/cache/marketCache /data/data/com.android.vending/cache
rm -R /data/data/com.google.android.street/cache
ln -s /sdcard/cache/streetCache /data/data/com.google.android.street/cache
reboot
Plus both run and output no errors either. Who knows what problems I'll run into because I have no idea what they actually did.
Anyone see anything wrong here?
Well I'll help you.
1-) After you back up the mount and stuff and put the other back, you MUST reboot before keep going.
2-)After boot then you can copy the files or make the symlink. I suggest you dont copy the app to the sdcard on teh scrip since they should be there already. so do that manually once then the script just delete the folders and then crate the symlinmks.
I have a menu that does that and I have got some experience as why it works one day and not the other.
Rafase282 said:
Well I'll help you.
1-) After you back up the mount and stuff and put the other back, you MUST reboot before keep going.
Click to expand...
Click to collapse
I took the reboot out after the mountd.conf and init.rc did not appear to copy due to the lack of /dev/mmcblk0p2 hoping to see some sort of output why it did not run. Unfortunately it runs and backs up the files but does not replace them with the modded ones.
Rafase282 said:
2-)After boot then you can copy the files or make the symlink. I suggest you dont copy the app to the sdcard on teh scrip since they should be there already. so do that manually once then the script just delete the folders and then crate the symlinmks.
Click to expand...
Click to collapse
Not copying the apps is a good idea, modified the script to not do so.
Rafase282 said:
I have a menu that does that and I have got some experience as why it works one day and not the other.
Click to expand...
Click to collapse
Does Android require that you do a chmod on all shell scripts first?
On Debian I usually just use sudo sh ./ and it runs the script w/o changing anything on the file permissions so I figured Android would be similar if I just ran them as root. Still I see a lot of people requiring a chmod 777 on any guide referring to running shell scripts.
I will try that and report back with my findings. Thanks for replying.
Does Android require that you do a chmod on all shell scripts first? I just have to type m oon anywhere in the androud shell and my scripts run, for that i put it on /system/bin and do a chmod 4755 to the file. it is still needed to type su before you run the script.
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
mkdir /system/sd
cp /sdcard/media/Data/mountd.conf /system/etc/mountd.conf
cp /sdcard/media/Data/init.rc /system/init.rc
Thats my code for copying the modified files to the right place. So maybe you should try that.
Oh for androoid you dont unless you put it on /system/bin then you will have to use sude and sometiems it still wont run due to lack or permisions so is better to do a chmod 4755
Well I made the changes suggested and did a chmod on all the files prior to running but with no luck.
The odd thing is if I use the shell scripts as a guide list it works perfectly but if I try to launch them as a shell script all sorts of strange undesirable things happen to my phone.
The time consumed trying to use the scripts and recover from what happens from what they do out weight the effects of typing everything in.
joshtheitguy said:
Well I made the changes suggested and did a chmod on all the files prior to running but with no luck.
The odd thing is if I use the shell scripts as a guide list it works perfectly but if I try to launch them as a shell script all sorts of strange undesirable things happen to my phone.
The time consumed trying to use the scripts and recover from what happens from what they do out weight the effects of typing everything in.
Click to expand...
Click to collapse
you can only run the script once .. when the "ln -s" has already been done it has to be undone before trying to run the script again .. otherwise you would be copying the files onto themselves .. not sure if you've tried running it more than once
LucidREM said:
you can only run the script once .. when the "ln -s" has already been done it has to be undone before trying to run the script again .. otherwise you would be copying the files onto themselves .. not sure if you've tried running it more than once
Click to expand...
Click to collapse
These scripts were intended for my usage after a system restore from a update.zip file which wipes /system in the process.
My intentions were to:
1. remount the fs rw
2. copy the original init and mountd files to the sd then copy the modified to their respective places in the system folders then reboot
3. reboot then create the sym links appropriately then move my caches too
Well unfortunately the only thing that works is the backing up of the original init and mountd files.
joshtheitguy said:
These scripts were intended for my usage after a system restore from a update.zip file which wipes /system in the process.
My intentions were to:
1. remount the fs rw
2. copy the original init and mountd files to the sd then copy the modified to their respective places in the system folders then reboot
3. reboot then create the sym links appropriately then move my caches too
Well unfortunately the only thing that works is the backing up of the original init and mountd files.
Click to expand...
Click to collapse
yes .. but you can't create the sym links when they already exist .. running the update.zip only wipes the /system .. not /data .. if the links were there before the update.zip they will be there after
[HACK][ROM][BOOT.IMG][CACHE]-Stk SPL ROMs with Danger SPL size & extra 30mb! any SPL!
###########################
EDIT: 2010-06-24
This is totally out of date now
new easier and much better way of doing things can be found here
http://forum.xda-developers.com/showthread.php?t=704560
###########################
Hi All,
Just wanted to 'get out' what I have been working on the last couple of days, and give back to the community.
Introduction
This is an intro of my Cache 'Hack'
it was inspired by Speedysilwady's thread [HOW-TO] Flash *MOST* ROMs on Stock/Any SPL
What follows should be considered BETA or even ALPHA.
I don't belive there is any risk of permanent damage to your phone, worst that will happen is a bootloop.
However, any ROM or Hack carries a risk, there could be something I have missed which will destroy your phone after 2 days.
I can't think what that would be, maybe I missed it
So... If your wife is due to go into labour anytime soon, or you need your phone for work/alarm to get up for work.
Don't do it.
Not my fault if it messes up your phone or life..
OK, disclaimer over with...
The Primary goal was to give the guys with 'Stock'SPLs ROMs which normally require 'DangerSPL'
The DangerSPL basically chops /cache down a bit and shares it between /system and /data,
but this is operating on the phones firmware at a lower level, and is risky so people are reluctent to do it.
I have a solution, and as a bounus the 'DangerSPL' guys get an extra 30mb on /system.
The Idea is very simple, utilise the space available on /cache
Below I detail a way of using *all* of /cache in a ROM, without risking a 'brick' ( softbricks excluded )
So, how do we do it?
Well, intially ( in recovery ) I was just moving directories from /system into /cache and symlinking them
This didn't work all that well because of the way the init.rc mounts cache
Code:
mount yaffs2 [email protected] /cache [b]nosuid nodev[/b]
chown system cache /cache
chmod 0770 /cache
nosuid nodev, resrticts what it can be used for
so,,
Code:
mount yaffs2 [email protected] /cache
mount yaffs2 [email protected] /cache ro remount
got around that, basically I mount /cache in the same way as system
Next problem,
I found out what cache is used for
The Market uses cache to save 'incoming' apks, you could say it uses /cache as a cache, lol..
maybe other things use it, I didn't look to hard.
anyway, this is what we do to solve that
Code:
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
mount yaffs2 [email protected]ystem /system
mount yaffs2 [email protected] /system ro remount
# Firerat 2010-03-22 - Mount Cache in the same way as system
# Firerat 2010-03-24 - Market uses /cache, if its full it fails, so...
# Firerat 2010-03-24 - mount mtdblock4 on /system, and bind mount to cache in userland script
# Firerat 2010-03-24 - /system/bin/data-cache.sh
mount yaffs2 /dev/block/mtdblock4 /system/csys
chmod 0770 /system/csys/lost+found
mount yaffs2 /dev/block/mtdblock4 /system/csys ro remount
and here is the userland script ( be sure to get init.rc to execute it )
Code:
#!/system/bin/sh
# bind mount /data/cache to /cache - Firerat 2010-03-24
# check /data/cache exists, if not create
if [ ! -d /data/cache ];
then
mkdir /data/cache
fi
# check cache is not already mounted
if [ "`mount |grep -q \/cache;echo $?`" = "0" ];
then
echo "/cache is already mounted.. exiting"
exit 1;
else
busybox mount -o bind /data/cache /cache
fi
hmm, I should check permisions on that, could have sworn I had a chmod in it
I could of course do this in the init.rc, but this offers greater flexibility
for instance we could check for ext partition and use that.
ref
(cyanogen) Thanks Cy! & ccyrowski
in the a2sd script which does this with Dalvik-cache
Oh, nearly forgot, since /system/csys is now the new /cache you have to fix your symlinks
Da Dar!, it boots and you can download from the Market ( as long as you have space on data )
Above via a 'ROM flash'
OK, so it's all well and good moving stuff around in recovery,but how do we do this with a 'ROM' flash?
because I can't flash a Requires DangerSPL I can't move things in recovery Grrrr..
Within the ROM package I created a new Directory, cache with sub directory system
i.e. cache/system
and moved things into it, stuff like system/media system/bin system/xbin
upto a Max of 28mb ( ish ) see Partiton table below
I'm linux , so I use a script to quickly show me the sizes
Code:
for i in `find $1 -maxdepth 1 -type d|sed -e :a -e '$!N; s/\n/ /; ta'`
do
du -hs $i
done
then in the update-script
Code:
format CACHE:
copy_dir PACKAGE:cache CACHE:
show_progress 0.2 0
symlink csys/system/bin SYSTEM:bin
symlink csys/system/etc SYSTEM:etc
symlink csys/system/media SYSTEM:media
symlink csys/system/usr SYSTEM:usr
symlink csys/system/xbin SYSTEM:xbin
symlink csys/system/fonts SYSTEM:fonts
symlink toolbox CACHE:system/bin/start
symlink toolbox CACHE:system/bin/getevent
< snip >
symlink toolbox CACHE:system/bin/renice
symlink toolbox CACHE:system/bin/setconsole
symlink /system/csys/system/xbin/busybox CACHE:system/bin/sh
symlink busybox CACHE:system/xbin/zcip
symlink busybox CACHE:system/xbin/zcat
symlink busybox CACHE:sys< snip >
set_perm_recursive 0 0 0755 0644 SYSTEM:
set_perm_recursive 0 0 0755 0644 CACHE:system
set_perm_recursive 0 2000 0755 0755 CACHE:system/bin
set_perm 0 3003 02755 CACHE:system/bin/netcfg
set_perm 0 3004 02755 CACHE:system< snip >
symlink /system/csys/system/bin SYSTEM:bin
is probably easier to 'see'
Zip it up and sign
and well, thats it really...
flash it, find it won't boot, go to recovery , fix it, boot it , fix package, zip, sign, flash it..
Eventually it boots
Partition Tables
I have to admit , I have DangerSPL, and I'm reluctant to revert to stock
Speedysilwady of the thread which inspired me
[HOW-TO] Flash *MOST* ROMs on Stock/Any SPL
has given me some sizes
Code:
/system: 67.5M
/data: 74.7M
/cache: 67.5M
and here are the totals for mine, DangerSPL'd
Code:
/system: 90M
/data: 89.7M
/system/csys: 30M
Further movement
hmm, we have lots of space in cache on a 'none danger spl' and we probably have some room on /system on a 'dangerSPL'
we can move things on firstboot, keeping the 'ROM' compatible with both 'Danger' and 'NonDanger' SPLs
here is an extended version of the mount cache I hastily put together for King's Eris Port
DangerSPL , the 'framework' gets moved to the system partition
NoDanger the 'framework' gets moved to the 'cache' partition
Code:
###################
# What follows is specific to King Eris Port 1.x.x
# mind you the logic will work in any rom
###################
if [ -d /system/system-framework ] || [ ! -L /system/framework ];
then
exit 0;
fi
RM_CMD="busybox rm"
MV_CMD="busybox mv"
CP_CMD="busybox cp"
LS_CMD="busybox ls"
LN_CMD="busybox ln"
MKDIR_CMD="busybox mkdir"
MOUNT_CMD="busybox mount"
UMOUNT_CMD="busybox umount"
SWAPON_CMD="busybox swapon"
# nb the df sticks out, toolbox df output is easier to cut up
DF_CMD="toolbox df"
DU_CMD="busybox du"
SED_CMD="busybox sed"
GREP_CMD="busybox grep"
CUT_CMD="busybox cut"
GETPROP_CMD="getprop"
SETPROP_CMD="setprop"
E2FSCK_CMD="e2fsck"
CHMOD_CMD="busybox chmod"
CHOWN_CMD="busybox chown"
SYNC_CMD="sync"
rohardware=`$GETPROP_CMD ro.hardware`
if [ -d /data/system-framework ] && [ ! -L /data/system-framework ];
then
CsysFree_K=`$DF_CMD|$GREP_CMD \/csys\:|$CUT_CMD -d " " -f6|$SED_CMD s/K//`
SysFree_K=`$DF_CMD|$GREP_CMD \/system\:|$CUT_CMD -d " " -f6|$SED_CMD s/K//`
SysFramework_K=`$DU_CMD /data/system-framework/|$CUT_CMD -f1`
if [ $SysFramework_K -gt "1024" ] && [ $CsysFree_K -gt $SysFramework_K ];
then
$MOUNT_CMD -o rw,remount /system
$MOUNT_CMD -o rw,remount /system/csys
$CP_CMD -a /data/system-framework/ /system/csys/system-framework
# being very lazy here, I should look before I leap
$RM_CMD /system/framework
$LN_CMD -s /system/csys/system-framework /system/framework
$SYNC_CMD
$MOUNT_CMD -o ro,remount /system
$MOUNT_CMD -o ro,remount /system/csys
$RM_CMD -rf /data/system-framework
exit 0;
elif [ $SysFramework_K -gt "1024" ] && [ $SysFree_K -gt $SysFramework_K ];
then
$MOUNT_CMD -o rw,remount /system
$CP_CMD -a /data/system-framework/ /system/system-framework
# being very lazy here, I should look before I leap
$RM_CMD /system/framework
$LN_CMD -s /system/system-framework /system/framework
$SYNC_CMD
$MOUNT_CMD -o ro,remount /system
$RM_CMD -rf /data/system-framework
exit 0;
else
exit 0
fi
fi
I actally use this same free space checking logic in my modified a2sd when it comes to moving dalvik-cache
I try to keep dalvik-cache on Data, I hope to expand this to both system and user apps.
and with unionfs ( or aufs ) maybe set up something to handle priority apps on internal memory
Backups
Currently the Recovery Backups ignore /cache, so after a restore it aint going to boot.
Speedysilwady did say Bart worked for him, not tried it myself
a while back I had a look at the nandroid-mobile.sh in Amon's RA-1.5.2
I think I did see that cache was an option
anyway, I don't think it would take much to 'turn it on'
Edit : 2010-04-16
[UTIL] BART-1.2.0 Backup and Restore Tool
Now has cache backup!
not sure if its packed in a recovery.img yet
Coming soon
Example ROMs
CaNNon's Complete Eclair 1.2
King's Eris Port 1.1.2 - ( Warez removed - afaik its just the QuickOffice )
Pre Flash Patch
I have played with this before, you can see how I do it in Speedysilwady's thread
[HOW-TO] Flash *MOST* ROMs on Stock/Any SPL
so , my idea is the update script just formats /system and /cache and sets up symlinks from system to cache
making sure we have everything mounted ( mount -a ) we flash the ROM
we then flash a second Patch which re-creates the links, and flashes the boot.img along with supporting scripts.
I'm even toying with the idea of Pathcing a pre-installed system ( to get the extra 30mb )
Not tried this yet, but I think something like this will work
Code:
copy_dir SYSTEM:bin CACHE:/system/bin
delete SYSTEM:bin
symlink csys/system/bin SYSTEM:bin
copy_dir PACKAGE:cache CACHE:
symlink < all them links >
format BOOT:
write_raw_image PACKAGE:boot.img BOOT:
So, Enjoy
and I'll post the ROMs I modded a little later, I shoud check a few things first
Firerat
Cache Hack Modded ROMS ( demo )
As Promised a couple of Modded ROMs to showcase my 'Hack'
Please note the disclaimer in the OP under introduction
Full Credit for these ROMs goes to the Original DEVs , namely CaNNon202 and King
First up we have CaNNoN's Complete Eclair
original link CaNNoN202 Complete Eclair [v1.2]
as I'm sure many of you will know this was the ROM I made the 3D YouTube Patch for,
This is that ROM , Repackaged in Full
i.e. 3D Kernel, HQ Youtube/ mp4 along with the fixes for the WiFi FC and Facebook contact sync.
This should work fine as a *no wipe* update to a current CE12
if you have problems then do a wipe
Change log
system apps now on system
Gallery3D
New Camera.apk
The Camera.apk removes duplicate Gallery Icon in the Tray, and I have disabled video recording, since it didn't work anyway and most of the time cause freeze and FC )
new (rw/ro)system scripts
they know about the new cache thing
data-cache.sh
bind mount cache, runs on boot
modified a2sd
MT3G friendly, will skip apps to SD and setup swap automagically
additionally will keep Dalvik-cache on data if space available* keeping apps fast
oem-reset script
I neglected to mention, data wipe in recovery will kill the ROM (it wipes cache) , so I made a script to clear personal data
* if you get space low messages, try a cache cleaner from the Market
if you still have problems delete apps you don't need
still not enough space? either reboot phone, or run a2sd from terminal
but a Reboot / a2sd run will move cache to SD if available
Guys, I have left Launcher2 in this, but I really wouldn't recommend using it with 3D
################################
### Download ### since CE2.0 is now CacheHack AnySPL link has been removed
################################
MD5SUM = 97dfb9756bb553cf3cb42519483da3cc
################################
NOTE this is *not* CE 2.0
Second up Yet another King's Eris Port Mod
original link King's Eris2G1 v1.1.2
Change Log
2010-03-28 12:40 gmt - bug fix
fixed the issue with the framework not being moved on NoneDangerSPL
no more space warning, and Market works
system apps now on system
new (rw/ro)system scripts
they know about the new cache thing
data-cache.sh
bind mount cache, runs on boot, additonally moves system framework when 'SPL Known'
modified a2sd
MT3G friendly, will skip apps to SD and setup swap automagically
additionally will keep Dalvik-cache on data if space available* keeping apps fast
QuickOffice removed (Warez)
( FAO Mods, I hope I'm right in thinking that QO was the only Warez )
* if you get space low messages, try a cache cleaner from the Market
if you still have problems delete apps you don't need
still not enough space? either reboot phone, or run a2sd from terminal
but a Reboot / a2sd run will move cache to SD if available
tbh I haven't tested this as a no wipe,
Data is 66MB so you might get away with it if you are on DangerSPL
################################
### Download ###FR-KingErisP-112-CacheHack_S.zip
################################
MD5SUM = 735cde1f21e14b91ad20d65a7009c569
################################
Its probably going to get all confusing with two ROMs in one thread
These are intended as examples of what can be done with cache
we know that things like footprints don't work so try to keep on topic with posts
i.e. relating to the using cache for system files
if it does get too confusing I will perhaps give each its own thread.
but again, on topic would be nice
Cheers
Very Quick install instructions ( Danger Only, sorry NoneDanger, manual patching further down post )
First install Vega's Legend 0.9.0, boot that, then flash the You Tube Fixes, boot that
Then Flash
FR-VegaLegend091-CH_S.zip
You can try flashing all three at once, but for some reason you don't get a mobile data connection, no idea why.
As well as being CacheHack the above includes Loccy's KB Lights
http://forum.xda-developers.com/showthread.php?t=661343
be sure to drop by and thank them all
They are also working on a better solution, I believe the final solution will be within the system framework
But for now a while loop script will do
Edit : [UTIL] BART-1.2.0 Backup and Restore Tool
Now has cache backup!
Patching a fresh Vega Legend 0.9.1 DangerSPL
Fresh flash of Vega's Legend 0.9.0 with the 0.9.1 fixes over the top
Code:
Filesystem Size Used Available Use% Mounted o
n
/dev/block/mtdblock3 90.0M 89.5M 560.0K 99% /system
/dev/block/mtdblock5 89.8M 48.4M 41.4M 54% /data
/dev/block/mtdblock4 30.0M 1.2M 28.8M 4% /cache
Click to expand...
Click to collapse
a quick size up tool
Code:
[quote]
adb push Patch/cache/system/bin/qdu.sh /sbin/
[/quote]
Code:
chmod 755 /sbin/qdu.sh
its setup with a sha bang for an android ROM, to get it to work in recovery
Code:
sed s~system/~s~ /sbin/qdu.sh -i
now qd<tab><enter>
will show you the size of the directories of the directory your in
or
qd<tab>/syst<tab>
will show you the size of everything in /system
in an other term on your PC
Code:
[quote]adb shell watch "busybox df -h"[/quote]
will let you keep an eye on the space being used and avalilabe to you
ok, so lets begin
mount everything
Code:
mount -a
first we need to create a mount point for mtdblock4
Code:
mkdir /system/csys
and then we need to bind mount /cache to it
Code:
busybox mount -o bind /cache /system/csys
ok, lets start moving stuff
Code:
/ # qdu.sh /system/
86.3M /system/
89.5K /system/csys
1.3M /system/xbin
2.1M /system/usr
1.0K /system/sd
2.8M /system/media
[COLOR="Red"]44.4M /system/lib [/COLOR]
19.6M /system/framework
5.3M /system/fonts
2.6M /system/etc
2.8M /system/customize
5.3M /system/bin
2.0K /system/lost+found
Click to expand...
Click to collapse
lib is too big for DangerSPL
lets just move some of the other stuff and see what happens
Code:
cd /system/
mkdir csys/system
for i in usr/ xbin/ media/ fonts/ etc/ customize/ bin/;do
mv $i csys/system/
done
Code:
Filesystem Size Used Available Use% Mounted on
/dev/block/mtdblock3 90.0M 65.7M 24.3M 73% /system
/dev/block/mtdblock5 89.8M 48.4M 41.4M 54% /data
/dev/block/mtdblock4 30.0M 24.9M 5.1M 83% /system/csys
Click to expand...
Click to collapse
were still short of space on system
Code:
qdu.sh /data/
46.9M /data/
46.0M /data/app_s
954.0K /data/app
Click to expand...
Click to collapse
Code:
mv framework/ /data/
lets stick a few apps on /system/csys
after using
ls /data/app_s/ -Slh
I'm going to pick these
Code:
mv /data/app_s/Phone.apk csys/system/app/
mv /data/app_s/Mail.apk csys/system/app/
then move the system apps to system
Code:
mv /data/app_s/ app
and now, before we forget create links
Code:
ln -s csys/system/* .
cd app/
ln -s ../csys/system/app/* .
cd ../
ln -s /data/framework .[code]
now get the boot.img onto the phone and use
Code:
flash_image boot /sdcard/boot-cachehack.img
don't forget the kernel modules
Reboot, and you done.......
Patching Vega Legend 0.9.1 NoneDanger SPL
you guys have a harder and at the same time easier task in getting a sense ROM onto your phone, essentially you have more space available, but you can't flash direct.
you going to need to unzip the ROM on your PC , and have a look at the sizes
Decide what you need to put on cache, and make links
see lib and framework in the DangerSPL Walkthrough?
44.4M /system/lib
19.6M /system/framework
1.3M /system/xbin
65.3 mb right there
so in recovery
Code:
mount /system
rm -r /system/*
mkdir /system/sd
mount -a
mkdir /system/csys
mount -o bind /cache /system/csys
for i in lib framework xbin ;do
install -d /system/csys/system/$i
done
ln -s /system/csys/system/* /system/
now, on your PC zip up the ROM, don't sign it
get it onto your sdcard
Code:
unzip /sdcard/rezippedROM.zip system data -d /
that will unzip everything beginning with system and data to the / directory
when lib, framework xbin hit the links we made, they will end up on cache
links, a messy business
but I have a script for that
Code:
unzip /sdcard/rezippedROM.zip META-INF -d /data/
now, attachced is NoneDangerDIY-linksandperms.txt
( Edot 2010-04-19 Fixed the script so it works in recovery )
get that onto your sdcard and
Code:
sh /sdcard/NoneDangerDIY-linksandperms.txt
( Tip sh /sd<tab>/None<tab> )
this will translate the ROM's update-script links and permissions into unix commands, it spits them to screen and should save them in memory
do
Code:
cat /dev/install.sh
to make sure its there
then
Code:
sh /dev/install.sh
Ok, next is kernel Modules
the zip above ( FR-VegaLegend091-CH_S.zip ) contains the directories
sdcard/kernels/
and in that are 3D and RamHack kernels
choose one and
cp -a /sdcard/kernels/<kernel>/system to /system/
flash_image boot /sdcard//kernels/<kernel>/boot.img
other files, in cache/system/bin are
a2sd
rwsystem
rosystem
data-cache.sh
qdu.sh
Do not install a2sd, its modified to patch Danger, it might do strange things, I didn't think about NoneDanger when I was doing it
copy the others to /system/bin/
an then
Code:
chmod 755 /system/bin/*system
Last thing, system app_s
Code:
df
du /data/app_s
hopefully the du for app_s is less than the df of /system
if so
Code:
mv /data/app_ /system/app
if not, then use the same trick as I did for DangerSPL , and link an app from /system/csys/system/app to /system/app/
I think you will be ok though
Oh, nearly forgot , in cache/system of the zip is a file called patch
cp that to /system/
its Loccy's KB lights
yeay , woo hoo, were done
Code:
reboot
Hope that this is useful,
I know its still awkward for NoneDanger, soon I will try to make it a doddle for a dev zip up a ROM which is truly ready for AnySPL, and maybe optimise for mt3g
Coming sometime in the future..
I will do some more work on NoneDanger Sense I'm hoping to do a generic Patch to detect which SPL and install optimised for Danger, NoneDanger , and maybe I figure out something that will improve things for MT3G
So im trying to do something a little different. I am trying to transfer my Dalvik-cache from /cache to /system. Is there a way to do it after the rom is installed and functioning?
bubonik said:
So im trying to do something a little different. I am trying to transfer my Dalvik-cache from /cache to /system. Is there a way to do it after the rom is installed and functioning?
Click to expand...
Click to collapse
in a word, no
at the moment a2sd puts dalvik-cache on the SD card partition 2 ( if ext2,3,4)
via a bind mount
if no ext2,3,4 partition it remains on data
the above hack will not affect /data/dalvik-cache or the bind mount
but the partition /dev/block/mtdblock4 ( /cache now /system/csys )
will be 'full'
Anything going into /cache will go into the bind mount instead
in the original post I bind mount to /data/cache
but as I mentioned, we can bind mount any directory to /cache
I didn't look at what else uses cache, as far as I know nothing else does
putting dalvik-cache on /system is going to cause a few problems.
/system is mounted (ro) by init.rc , and tbh it should stay ro unless we really need to do something to the system files, Dalvik-cache needs to be writable
I mentioned my modified a2sd and Dalvik-cache
I commented out this
Code:
# bind mount dalvik-cache so we can still boot without the sdcard
busybox mount -o bind /system/sd/dalvik-cache /data/dalvik-cache;
busybox chmod 1000:1000 /data/dalvik-cache;
busybox chmod 771 /data/dalvik-cache;
and insterted this
Code:
DalvikCache
DalvikCache ()
{
# doubt they are going to change, but shoud set the 'paths' as variables
DataTotal_K=`$DF_CMD|$GREP_CMD \/data\:|$CUT_CMD -d " " -f2|$SED_CMD s/K//`
DataFree_K=`$DF_CMD|$GREP_CMD \/data\:|$CUT_CMD -d " " -f6|$SED_CMD s/K//`
DataDalvik_K=`$DU_CMD /data/dalvik-cache/|$CUT_CMD -f1`
# Pickup min free on data from config in future
Min_Data_Free_MB=10
Buffer_K=`expr $Min_Data_Free_MB \* 1024`
DataApp_K=`$DU_CMD /system/app/|$CUT_CMD -f1`
System_App_K=`$DU_CMD /data/app/|$CUT_CMD -f1`
if [ -d /system/sd/dalvik-cache ];
then
SD_Dalvik_K=`busybox $DU_CMD /system/sd/dalvik-cache|$CUT_CMD -f1`
else
SD_Dalvik_K="0"
fi
if [ ! -d /system/sd/dalvik-cache ] && [ "$DataDalvik_K" -lt "1024" ] && [ "`expr \( $DataApp_K + $System_App_K \) \/2`" -lt "$DataFree_K" ];
then
DalvikToIntMem
else
# if DalvikCache + a bit is too big, move to SD card
if [ "`expr $DataDalvik_K + $Buffer_K`" -gt "`expr $DataFree_K + $DataDalvik_K`" ];
then
DalvikToSdCard
else
if [ "`expr "$SD_Dalvik_K" + "$Buffer_K"`" -lt "$DataFree_K" ];
then
DalvikToIntMem
fi
fi
fi
DalvikComplete
return
}
DalvikToIntMem ()
{
if [ -d /system/sd/dalvik-cache ];
then
$MKDIR_CMD /data/dalvik-cache-temp
$CHOWN_CMD 1000:1000 /data/dalvik-cache-temp
$CHMOD_CMD 771 /data/dalvik-cache-temp
$CP_CMD -a /system/sd/dalvik-cache/* /data/dalvik-cache-temp/
$UMOUNT_CMD /data/dalvik-cache
$RM_CMD -rf /data/dalvik-cache
$MV_CMD /data/dalvik-cache-temp /data/dalvik-cache
$RM_CMD -rf /system/sd/dalvik-cache
else
if [ ! -d /data/dalvik-cache ];
then
$MKDIR_CMD /data/dalvik-cache
fi
$CHOWN_CMD 1000:1000 /data/dalvik-cache
$CHMOD_CMD 771 /data/dalvik-cache
fi
return
}
DalvikToSdCard ()
{
$MKDIR_CMD /system/sd/dalvik-cache/
$CP_CMD -a /data/dalvik-cache/* /system/sd/dalvik-cache/
$RM_CMD /data/dalvik-cache/*
return
}
DalvikComplete ()
{
if [ -d /system/sd/dalvik-cache ] && [ "`$MOUNT_CMD |$GREP_CMD -q "/data/dalvik-cache";echo $?`" != "0" ];
then
$MOUNT_CMD -o bind /system/sd/dalvik-cache /data/dalvik-cache;
fi
$CHOWN_CMD 1000:1000 /data/dalvik-cache;
$CHMOD_CMD 771 /data/dalvik-cache;
return
}
oh, in the 'header' I have things like
MKDIR_CMD="busybox mkdir"
DF_CMD="toolbox df"
you can see that while we have space I keep the dalvik-cache bytecode on the fast internal memory, unless space is limited, in which case bind mount to sd partition2 as per Cyanogen's original script
if we get space back, move dalvik-cache back
Thats my bad, I should have been more specific. I have a G1 and I dont use a2sd. Currently sd 1.10.2 uses /cache/dalvik-cache, but with 1.33.2005 that leaves only 3500 kb available for downloading apps. A huge problem.
So im trying to dump it somewhere else, the /data partition would be fine since I only have about 15 apps. I tried doing a symlink to /data/dalvik-cache after it was functioning but got boot loops. Which is why im here.
Just wondering when the ErisPort rom will be available, also could you try this with the Legend Port
M..N said:
Just wondering when the ErisPort rom will be available, also could you try this with the Legend Port
Click to expand...
Click to collapse
soon, I'm uploading now
and yes, you can use it with any rom
I had a quick look at Vega's Legend port,
Bold should be linked to system
Code:
29M ./cache
65M ./system
53M ./data
data/:
app app_s fix_permissions.sh [B]fonts[/B]
system/:
bin build.prop csys etc fonts lib sd usr xbin
cache/system/:
[B]customize framework media[/b]
all apps are going to go to sd here,
but around 30mb worth can be put back, to either /system or /system/csys
after boot, when we know how much space we have and where
so around 18mb on SD
leaving plenty of space for Dalvik-Cache
should be fast, no matter what SPL you have
Links to Modded ROMs added in second post
bubonik said:
Thats my bad, I should have been more specific. I have a G1 and I dont use a2sd. Currently sd 1.10.2 uses /cache/dalvik-cache, but with 1.33.2005 that leaves only 3500 kb available for downloading apps. A huge problem.
So im trying to dump it somewhere else, the /data partition would be fine since I only have about 15 apps. I tried doing a symlink to /data/dalvik-cache after it was functioning but got boot loops. Which is why im here.
Click to expand...
Click to collapse
ahh, sorry I nearly missed your follow up post
I wasn't aware that Dalvik-cache ever ended up on /cache, which tbh that has always confused me a little
if you look at Cyanogen's a2sd , he does mention in the comments that a bind mount is used so the system will still boot, even when no SD card ( since you don't have a dead link )
so I think the solution to your problem is to bind mount something to /cache/dalvik-cache
you should do this early in the boot process, else it will just get filled up
for instance a2sd is executed by init.rc , so it happens before the Android system kicks in, it doesn't matter if it fails to bind mount as you still have the directory available
Do i just wipe and install the droideris, also has anyone tested it.
M..N said:
Do i just wipe and install the droideris, also has anyone tested it.
Click to expand...
Click to collapse
full wipe is your best bet
as for testing.. lets just say I've flashed it more than a few times
but I am on Danger, would love some feedback from None DangerSPLs
it loads ok. although when im presented with low memory notification. i try downloading an app from the market, but it stays on the start downloading. Do you think you could make a port of the Legend Rom?
It would be nice if Htc, Tmo, google could use this to make larger updates but I doubt they'll bother.
M..N said:
it loads ok. although when im presented with low memory notification. i try downloading an app from the market, but it stays on the start downloading. Do you think you could make a port of the Legend Rom?
Click to expand...
Click to collapse
Maybe my script isn't moving the framework
That's around 30mb
( script is
/system/csys/system/bin/data-cache.sh
If anyone wants to have a look )
I'm not at home right now, but will have a proper look later
In the meantime if you reboot the dalvik cache should get moved to the sdcard
Giving you some space back.
I forgot the hero doesn't have term
so for danger spl ppl, ROMs will now be quicker (system apps), also roms which could not before be done now can?
So the 2 modded roms you posted above should work for us with Stock SPLS and if that is proven true, you have pretty much made any rom flashable on a Stock SPL'd G1. Is that correct? If so, you have just made a lot of people very happy. Great work, although that entire initial post was foreign language to me!
thank you...
I haven't tried this yet, but I am super excited to see this is being worked out. I don't have the danger spl, and I can't wait to see this work with some of the new eclair 2.1 roms. Thanks for your hard work.
hopefully this can make our roms faster with more apps on system.
FatBoyExtraordinaire said:
So the 2 modded roms you posted above should work for us with Stock SPLS and if that is proven true, you have pretty much made any rom flashable on a Stock SPL'd G1. Is that correct? If so, you have just made a lot of people very happy. Great work, although that entire initial post was foreign language to me!
Click to expand...
Click to collapse
yes theoretically any rom should fit any spl but as you can see in the first post,
it takes a lot of work to port a rom to stock using this method, but wow its very well put together and firerat def knows what he's doing with this, i was shocked to be the first to have a 2.1 Eclair Sense on a G1 with Hard/Stock/Engineering SPL thanks to Firerat who implemented the idea very well and lbcoder who suggested the general idea on my thread a while back.
Also Firerat as mentioned earlier, the script to move framework seems to have some kinda kink cuz the low spaace error exists on the eris port. Also google sync is still broken.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This is a picture of the memory layout of a regular HTC Desire running an RCMIxHD derivative (SupeROM) with the speed and responsiveness of a Desire HD.
Premise:
1. Performance degradation with HD roms (and regular ones as well) occur when essential parts of the device's operation are from the sd card, instead of working as much as possible from the internal memory.
2. Deodexed roms render a substantial part of the /system partition into a bloated archive, since no apk or jar file is actually used. Everything is odexed and copied into the dalvik-cache, which leads to -
3. The dalvik-cache of a deodexed rom is much larger than that of an odexed rom. So now we have large portions of the system partition that are not used, and a clogged data partition.
4. So we use a2sd, a2sd+, d2ext or d2we - and essentially, what we get is that almost nothing is being run from the internal memory. What a waste.
This post will be a guide for both devs and advanced users on a process that utilizes s-off'ed devices' ability to change partition layouts in order to maximize the efficiency of the device.
For devs:
0. Require the target device to be s-offed and have an hboot in accordance with the following ideas:
1. Instead of using d2ext, d2we or even a2sd+ - use a regular a2sd script, and move only /data/app to the sd card. This will act as the apk archive of downloaded apps, while the dalvik-cache, from which the apps actually run, will remain on the data partition.
2. Symlink the entire /system/app folder and /system/fonts folder to sd-ext. Symlink everything in /system/framework to sd-ext, except framework-res.apk and possibly framework.jar (for theme modding and rtl fixes, if necessary).
The result - a regular Sense FroYo rom will take only 89mb of the /system partition. RCMixHD will take 180mb - and that is after returning the VR lib folder and some other libs to the /system partition.
In other words - you can use the oxygen hboot for normal Sense FroYo, and the data++ hboot for HD-based roms. All the files will run from the dalvik-cache on the data partition, and all the user data will be there as well.
Fixing market downloads
If you wish to bypass the problem of the small cache partition limiting market downloads, then do the following steps:
1. Use the wonderful dsixda kitchen to unpack your boot.img
2. Edit the init.rc. In the exports section add the following:
Code:
export DOWNLOAD_CACHE /mnt/asec/download
and add the following right under the section titled "# Secure container public mount points":
Code:
# Market downloads
mkdir /mnt/asec/download 0777 root system
mount tmpfs tmpfs /mnt/asec/download mode=0777,gid=1000
This will place all market downloads into a temporary ram disk, which will be deleted upon the completion of the installation.
3. Repack your boot.img and place it in the rom.
You can see an example of an edited init.rc here:
http://wbss.ro/coolexe/Extra/init.rc
Note: The users of your rom will still have to flash radio updates through fastboot.
(Thanks, coolexe and baadnewz, for this idea!)
The result is maximal device responsiveness, as well as battery conservation.
An example for a modified rom (SupeROM) can be downloaded here. This one requires the data++ hboot. baadnewz's newest iNserCoinHD rom also uses it - see here.
The following post is a guide for advanced users on how to achieve the same effect on an already running rom.
For Advanced Users:
Any advanced user can turn his or her currently flashed rom into a faster rom, and gain additional space on the data partition.
Please read everything in the first post so you know what you're about to do.
Prerequisites:
adb on your system, and you know how to use it.
An ext3 or ext4 partition after the fat partition on your sd card (512mb minimum).
Your rom is an a2sd or a2sd+ rom (not d2ext or d2we).
YOU MADE A NAND BACKUP.
1. Reboot into recovery and connect your phone to the computer. Mount system, data and sd-ext. Use adb to move files from /system to /sd-ext:
Code:
adb shell
mkdir /sd-ext/system
mkdir /sd-ext/system/app
mkdir /sd-ext/system/framework
mkdir /sd-ext/system/fonts
mv /system/app/* /sd-ext/system/app/
mv /system/framework/* /sd-ext/system/framework/
mv /system/fonts/* /sd-ext/system/fonts/
2. Now we have to symlink all the files we moved. This was a trial and error process for me, since I am not a programmer. But it works.
First of all, we create files that list all the names of the files we moved:
Code:
ls /sd-ext/system/app > /tmp/sysapp
ls /sd-ext/system/framework > /tmp/sysframe
ls /sd-ext/system/fonts > /tmp/fonts
Now we check how files are already symlinked to the ext partition in our rom (so we know how to symlink ours):
Code:
ls -all /data
This will show you the symbolic links. In my case, for instance, they were pointing at /system/sd, which is common.
Now we use arrays to create all the symlinks we need. Replace /system/sd if necessary:
Code:
c=0; while read line; do array[c]=`ln -s /system/sd/system/app/"$line" /system/app/`; let c=$c+1; done < /tmp/sysapp
c=0; while read line; do array[c]=`ln -s /system/sd/system/framework/"$line" /system/framework/`; let c=$c+1; done < /tmp/sysframe
c=0; while read line; do array[c]=`ln -s /system/sd/system/fonts/"$line" /system/fonts/`; let c=$c+1; done < /tmp/fonts
This will give you a nice output of errors, but will get the job done. Just to make sure, run these commands:
Code:
ls -all /system/app
ls -all /system/framework
ls -all /system/fonts
If all is well, you just viewed your newly created symlinks.
You can run the command
Code:
df
in order to see your new memory usage.
Now you can reboot your device. If all went well, you will notice absolutely no difference from before. If this is the case, make a second nand backup (without deleting the first one).
3. So now we have a nand backup of our rearranged rom. It is time to go to http://alpharev.nl, if you have not done so already, and follow the instructions there in order to s-off your device. If you are modifying a regular Sense rom (or anything without Sense) then choose to flash the oxygen hboot. For HD roms, choose the data++ hboot.
4. Restore your second nand backup.
5. If you used a2sd+, you need to move the dalvik-cache back to your internal memory, on the /data partition (that has plenty of space for it now).
If your a2sd is darktremor's script, you can simply enter
Code:
adb shell a2sd nocache
while your device is running (NOT in recovery) and reboot.
If you have a different a2sd script, you need to reboot to the recovery, and use adb to find out where it is:
Code:
adb shell mount /system
adb shell ls /system/etc/init.d
This will show you what's the name of your script. Mine was the usual 40a2sd.
Pull this file from your device:
Code:
adb pull /system/etc/init.d/40a2sd
Open the file in a text editor, search for every occurrence of "dalvik-cache" and "app-private" and delete them, without harming the command's syntax. Save the file (don't forget to back it up as well), push it back to the device and restore its owner and permissions:
Code:
adb push 40a2sd /system/etc/init.d
adb shell chown root:shell /system/etc/init.d/40a2sd
adb shell chmod 755 /system/etc/init.d/40a2sd
Now all we have to do is to move the actual dalvik-cache and app-private.
Code:
adb shell mount /data
adb shell mount /sd-ext
adb shell rm /data/dalvik-cache
adb shell mv /sd-ext/dalvik-cache /data/
adb shell rm /data/app-private
adb shell mv /sd-ext/app-private /data/
That's it. Reboot, and you'll notice an increase in performance, as well as in storage space on the data partition.
Remember: from now on you cannot flash new themes with the usual recovery zips (unless you opted to leave the file framework-res.apk inside the original /system/framework folder). You have to push the files through adb.
Also, if you use the data++ layout, you have to use fastboot to flash new radios, and you may have trouble installing very large apps.
There is a way to enable the installation of large apps from the market, but this is for EXTREMELY advanced users, so I will not even go into details. Simply follow the section "Fixing market downloads" in the first post and flash your new boot.img using fastboot flash boot boot.img.
very nice tut
ClassicalDude said:
...
Now all we have to do is to move the actual dalvik-cache and app-private.
Code:
adb shell rm /data/dalvik-cache
adb shell mv /sd-ext/dalvik-cache /data/
adb shell rm /data/app-private
adb shell mv /sd-ext/app-private /data/
That's it. Reboot, and you'll notice an increase in performance, as well as in storage space on the data partition.
Click to expand...
Click to collapse
Everything went well for me on Cool Z v8 A2SD, thanks a lot!
Only one thing: you should edit the 2nd post just before the section I'm quoting, adding "adb shell mount /data" and "adb shell mount /sd-ext" before trying to move dalvik back to NAND, otherwise it won't work
Amazing.... just when you think thought of it all... a new bright idea pops up
Nicely done mate
nice idea, if i understand this correctly this looks like something that could help with sd speeds.
because currently even a fast sd card with a2sd/data2sd/data2ext chokes when /sd-ext/dalvik is read and /sdcard being written to.
is that about right ?
@grooltor - thanks. I fixed it. I have a few more additions that will be incorporated soon, such as coolexe's idea to increase the cache partition.
@nerdo - thanks. Like all good ideas, it came in the shower.
@ciukacz - that's the idea, and it is working indeed. You can check out the rom I posted, or the newest iNsertCoin rom, which is based on this method. Every rom, including HD and Z roms, runs smoothly this way.
Anyone tested this guide on Leedroid 2.3d? I'd do it, but i am currently overwhelmed by my final exams...
Bobuscho said:
Anyone tested this guide on Leedroid 2.3d? I'd do it, but i am currently overwhelmed by my final exams...
Click to expand...
Click to collapse
Worked perfectly on modaco r10. See no reason why it should not work on LeeDroid.
so this is basically a way of trimming up /system by relocating it and symlinking so you can reallocate the space using an alpharev table / Custom mtd layout?
Suppose for sense roms, that makes sense (forgive the pun). Cool
@ClassicalDude: thanks for the reply, i will definitely try that and post back.
however i am fairly new to all things android and need to read up before i try.
Will try that on Al-Maisan ROM (Arabic version of Starburst) tomorrow and see how it will go.
I have a problem with Titanium backup... wan't have a download a busybox.
mexxxico said:
I have a problem with Titanium backup... wan't have a download a busybox.
Click to expand...
Click to collapse
I did not encounter this problem, so I cannot help. Like it is said in the beginning of this thread - this process is for very advanced users, who know what they are doing, and who can google their way to a solution to such problems, or figure it out themselves. I will help as much as I can, but I will not do the research for you.
Thanks to baadnewz and coolexe, I added a section called "Fixing market downloads" to the first post. It's a very elegant way of placing market downloads into a temporary ram disk, which self-deletes after the app is installed.
ok,tnx. I'll tray to find a solution
swyped from my HTC Desire using XDA Premium App
wollyka said:
Will try that on Al-Maisan ROM (Arabic version of Starburst) tomorrow and see how it will go.
Click to expand...
Click to collapse
Just to report it works on Al-Maisan. (with modified boot.img for market fix too)
Thanks for the tut
I've just tried this guide on Leedroid 2.3d, here's my experience:
After sticking closely to the Guide in the 2nd post, i am getting LOADS of FCs as i boot up the device. Sense crashes, the IME crashes...everything fcs immediately.
I analysed everything but i've entered the correct commands...
So maybe the integrated A2SD script is the problem? I've cleaned it from all content saying "app-private" and "dalvik cache", as advised in the 2nd post.
Code:
#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# [email protected] (cyanogen)
# Adapted by Teknologist
#Removed this as there is no /etc/sysctl.conf as of now in MCR
/system/bin/strt
# execute any postinstall script then kill it
if [ -e /dev/block/mmcblk0p2 ];
then
# mount and set perms
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /system/sd;
busybox chown 1000:1000 /system/sd;
busybox chmod 771 /system/sd;
# clean up any old symlinks, create data directories
for i in data;
do
if [ -h /data/$i ];
then
rm /data/$i;
fi;
if [ ! -d /data/$i ];
then
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
# don't allow /data/data on sd because of upgrade issues - move it if possible
if [ -d /system/sd/data ];
then
busybox cp -a /system/sd/data/* /data/data/;
busybox rm -rf /system/sd/data;
fi;
# move apps from internal memory to sdcard
for i in app;
do
if [ ! -d /system/sd/$i ];
then
mkdir /system/sd/$i;
fi
busybox chown 1000:1000 /system/sd/$i;
busybox chmod 771 /system/sd/$i
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox cp -a /data/$i/* /system/sd/$i/;
busybox rm -f /data/$i/*;
fi;
done;
# symlink app dirs - they must be on the same filesystem
for i in app;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox rm -rf /data/$i;
busybox ln -s /system/sd/$i /data/$i;
fi;
done;
# clean up old whiteouts
for i in local misc property system tombstones data;
do
if [ -h /system/sd/$i ]; then rm -f /system/sd/$i; fi
done;
# please don't put odex files in the app directory people!
# it causes dexopt to crash when switching builds!
busybox rm -f /system/sd/app/*.odex
setprop cm.a2sd.active 1;
echo "+++ Apps-to-SD successfully enabled";
else
# replace symlinks with directories so we can boot without sd
for i in app;
do
if [ -h /data/$i ];
then
rm -f /data/$i;
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
setprop cm.a2sd.active 0;
fi;
sync;
Your a2sd script is fine. Probably some other small thing you did not notice.
how much internal memory would I have on cool z v8 after applying all those steps?
I'm trying to reodex a framework.jar file I have modified, but I'm always getting a bootloop.
I use the following .sh script to odex the file. Example:
Code:
odex_file.sh /sdcard/modded_files/framework.jar
This is the code of odex_file.sh:
Code:
#!/system/bin/sh
export BOOTCLASSPATH="/system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar"
echo "odexing $1"
odex=`echo $1 | sed -e 's/.jar/.odex/g'`
echo "Running: dexopt-wrapper $1 $odex"
dexopt-wrapper $1 $odex
echo "changing file permissions to 666"
busybox chmod 666 $odex
file=`echo $odex | sed -e 's/.*\///g'`
echo "copying signature from system/framework/$file"
busybox dd if=/system/framework/$file of=$odex bs=1 count=20 skip=52 seek=52 conv=notrunc
echo "done"
I then copy the new .odex file to /system/framework.
When I reboot, I always get a boot loop.
BTW - I am using a Galaxy S i9000.
Any ideas on what I'm doing wrong?
(I know it's been a while since the OP, but you have to dig in a few threads to find the solution, and this thread came almost first in a Google search I did.)
Check your framework jars. If they're missing the META-INF folder or the preloaded-classes file, add those to your modified deoxed jars by using those from the original, unmodified odexed jars before running dexopt-wrapper.
Even though I put this in the Epic forum, this will work on any zImage based android kernel as far as I am aware.. from Eclair to Gingerbread, maybe previous, maybe in the future..
I will post my tweaks here (please give credit), and even my ext4 modules (again please give credit, to both me and Rodderik, as he helped with one of them) for Gingerbread.
First off, you will need either a linux based computer, a remote linux box, or a virtual machine.. I don't think cygwin will be enough. I'm not going to go through the steps of setting that up because it's out of the scope of this How-to, maybe in another post.
Second, you need some scripts to decompile the initramfs from the kernel, or you can do it manually with grep or a hex editor ( I don't recommend ), I'll provide the scripts I use, which I procured from supercurio's project voodoo github then modified to work a little better with zImages that have 2 signatures (happens sometimes) like EH06...
http://chris41g.devphone.org/voodoo.tar.gz
in voodoo/config.sh you will need to set your compiler path.
also read the readme.txt it will pretty much describe how it all works, and remember all the gingebread leaks only work with gzip compression when repacking.
to unpack the initramfs
Code:
./extracter.sh -s "/path/to/original/zImage" -d "/path/where/you/want/initramfs/"
and after a few minutes your initramfs will be wherever you told it to go with -d.
now the initramfs is pretty much the meat and potatoes when repacking a kernel.
adding EXT4
this is a pretty popular request...
to do this you need just a few things, the correct modules, and the correct mount options. both of which i will provide.
the modules for Gingerbread are called ext4.ko and mbcache.ko and need to added to lib/modules in the initramfs - link http://chris41g.devphone.org/gbext4modules.tar.gz
then the following lines need to be added to init.rc lpm.rc and recovery.rc
Code:
insmod /lib/modules/mbcache.ko
insmod /lib/modules/ext4.ko
right around the lines that look like
Code:
insmod /lib/modules/fsr.ko
insmod /lib/modules/fsr_stl.ko
insmod /lib/modules/rfs_glue.ko
insmod /lib/modules/rfs_fat.ko
to the same files look for:
Code:
mount rfs /dev/block/stl9 /system check=no
and under it add
Code:
mount ext4 /dev/block/stl9 /system noatime nodiratime errors=continue
now in init.rc and recovery.rc look for
Code:
mount rfs /dev/block/stl10 /data nosuid nodev crypt check=no
and under it add
Code:
mount ext4 /dev/block/stl10 /data nosuid nodev crypt noatime nodiratime
and look for
Code:
mount rfs /dev/block/stl11 /cache nosuid nodev check=no
and under it add
Code:
mount ext4 /dev/block/stl11 /cache nosuid nodev noatime nodiratime errors=continue nobh data=writeback barrier=0 noauto_da_alloc
now usually there will be some stuff you need to comment out.. which means adding # to the beginning of the line..
i always comment this out because it can mess with my tweaks later on and its useless
Code:
mount rfs /dev/block/stl9 /system ro remount
i also comment out or delete left over stuff for other phones that samsung has a habit of leaving in our init.rc... lazy people..
How to Root a Kernel Re-Pack:
This may seem basic, and to some it is, but I'm going to cover it anyway. Also it has changed in gingerbread, as you can't suid anything in /sbin, and that is the beginning of your PATH.
First we need some files.
su binary Stable - http://forum.xda-developers.com/showthread.php?t=682828 Beta - http://chris41g.devphone.org/su3.tar.gz
Superuser.apk Beta - http://chris41g.devphone.org/Superuser.apk
busybox binary (this one is dependent on whether you have purple cwm built in or not, since we havent got that far ill assume you dont) busybox 1.20.0 compiled by me http://chris41g.devphone.org/busybox
copy those files into /sbin in the initramfs, also do a
Code:
ln -s busybox sh
from the sbin directory in your initramfs on your linux box to make a symlink from sh to busybox
then goto the initramfs root
and do
Code:
ln -s sbin bin
to make a symlink from sbin to bin, it's probably not necessary but i always do it for consistency.
now go into /sbin and make a new sh script called whatever you want.
Code:
#!/system/bin/sh
# Remount filesystems RW
busybox mount -o remount,rw /
busybox mount -o remount,rw /system
#install busybox links
busybox cp /sbin/busybox /system/bin/busybox
/system/bin/busybox rm /sbin/busybox
busybox --install -s /system/bin
busybox --install -s /system/xbin
#establish root
busybox cp -f /sbin/su /system/bin/su
chmod 6755 /system/bin/su
busybox rm /sbin/su
busybox ln -s /system/bin/su /system/xbin/su
#check if Superuser.apk exist if not install but also delete bloat to make room
if [ ! -f "/system/app/Superuser.apk" ] && [ ! -f "/data/app/Superuser.apk" ] && [[ ! -f "/data/app/com.noshufou.android.su"* ]]; then
if [ -f "/system/app/Asphalt5_DEMO_ANMP_Samsung_D700_Sprint_ML.apk" ]; then
busybox rm /system/app/Asphalt5_DEMO_ANMP_Samsung_D700_Sprint_ML.apk
fi
if [ -f "/system/app/Asphalt5_DEMO_SAMSUNG_D700_Sprint_ML_330.apk" ]; then
busybox rm /system/app/Asphalt5_DEMO_SAMSUNG_D700_Sprint_ML_330.apk
fi
if [ -f "/system/app/FreeHDGameDemos.apk" ]; then
busybox rm /system/app/FreeHDGameDemos.apk
fi
busybox cp /sbin/Superuser.apk /system/app/Superuser.apk
fi
sync
# Fix screwy ownerships
for blip in conf default.prop fota.rc init init.goldfish.rc init.rc init.smdkc110.rc lib lpm.rc modules recovery.rc res sbin bin
do
chown root.shell /$blip
chown root.shell /$blip/*
done
chown root.shell /lib/modules/*
chown root.shell /res/images/*
#setup proper passwd and group files for 3rd party root access
# Thanks DevinXtreme
if [ ! -f "/system/etc/passwd" ]; then
echo "root::0:0:root:/data/local:/system/bin/sh" > /system/etc/passwd
chmod 0666 /system/etc/passwd
fi
if [ ! -f "/system/etc/group" ]; then
echo "root::0:" > /system/etc/group
chmod 0666 /system/etc/group
fi
# fix busybox DNS while system is read-write
if [ ! -f "/system/etc/resolv.conf" ]; then
echo "nameserver 8.8.8.8" >> /system/etc/resolv.conf
echo "nameserver 8.8.4.4" >> /system/etc/resolv.conf
fi
sync
# patch to prevent certain malware apps
if [ -f "/system/bin/profile" ]; then
busybox rm /system/bin/profile
fi
touch /system/bin/profile
chmod 644 /system/bin/profile
# remount read only and continue
busybox mount -o remount,ro /
busybox mount -o remount,ro /system
Now you need to make a change in your init.rc file to call this new script..
add this to your init.rc in the services section, around where the factory bootanimation service is loaded.
Code:
# Custom Script Configuration
service userscript /system/bin/sh /sbin/[whateveryounamedyour].sh
user root
group system
critical
oneshot
now you have rooted your own repack...
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Adding init.d support...
this is pretty easy, didn't want to add another post..
Let's open up /sbin/[whateveryounamedyour].sh
right after installing Superuser.apk, lets add this section...
Code:
if [ -d /system/etc/init.d ]
then
logwrapper busybox run-parts /system/etc/init.d
fi
sync
There ya go, thats it, you're done..
-----------------------------------------------------------------------------------------------------------------------------------------------
Ok, since I'm on a roll haha lets go with bootanimations... they are different on Gingerbread..
this is all done in the init.rc so lets open that up in your text editor, I recommend Geany btw..
First off in GB I had to disable stock animations to make it not look like trash, because they won't always start at the same time.. but it's your option.. ymmv
Code:
service samsungani /system/bin/samsungani
user graphics
group graphics
disabled
oneshot
Comment that section if you want to disable the stock animations... you can leave it and custom animations will still work if you want, but fair warning, its weird...
Code:
service bootanim /system/bin/bootanimation
user graphics
group graphics
critical
oneshot
Add that section to enable custom animations..
I never have but just incase you want to, you can comment this section out to disable boot sounds..
Code:
service playsound /system/bin/playsound
user media
group system
disabled
oneshot
one more thing, the new binary works, but it doesn't know when to stop playing....
add this line to the very end of the init.rc
Code:
on property:sys.boot_completed=1
stop bootanim
Thanks to tanimn for help on that one...
Now remember, before gingerbread, custom animations were bootanimation.zip, but now they are sanim.zip you can leave it that way, or for the users sake you can crack open the [whateveryounamedyour].sh and make a workaround.
add this line to [whateveryounamedyour].sh before you remount the partitions at the end.
Code:
busybox ln -s /system/media/bootanimation.zip /system/media/sanim.zip
basically what that does is create a symlink from the users bootanimation.zip to sanim.zip, so when the bootanimation binary looks for sanim.zip its redirected to bootanimation.zip.. so the user can put bootanimation.zip in the directory transparently without having to rename...
More to come, and I'm still taking request for additions to this how to....
awesome! thanks for the post... maybe I can start putting that programming class I had last semester to good use...
Joey
holy crap...I needed this about a month ago. thanks for putting it all in one place!! and jw....why do we need the mbcache.ko? ext4 worked fine without it, in a kernel I did.
sent from my uncyanogen modded epic 4g. with the key skips.
You know I don't even know what a plus kernel does but I use it for the old school android boot animation
Sent from my SPH-D700 using xda premium
ahh nice! cant wait for the others!
I really wanted this thank for the info!
Sent from my SPH-D700 using xda premium
Anyone ... what does the plus kernel do ?
Sent from my SPH-D700 using xda premium
Digglez said:
Anyone ... what does the plus kernel do ?
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
Its basically a stock kernel with mods.
Sent from my SPH-D700 using xda premium
Any mods besides the boot animation
Sent from my SPH-D700 using xda premium
Digglez said:
Any mods besides the boot animation
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
So far, adding ext4 modules is the only mod he's shown how to do. He'll be updating his thread with more mods soon.
Sent from my SPH-D700 using xda premium
Digglez said:
Any mods besides the boot animation
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
You can include boot animation...he just hasn't shown how to do it yet like ceelos said
Like I said in the first post, I will take request, within reason...
chris41g said:
Like I said in the first post, I will take request, within reason...
Click to expand...
Click to collapse
Any way you can show us how to bake mods into the kernel? Like say, superuser, so we make pre-rooted kernels
Sent from my SPH-D700 using xda premium
Ceelos09 said:
Any way you can show us how to bake mods into the kernel? Like say, superuser, so we make pre-rooted kernels
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
Updated just now with rooting, init.d support, and bootanimations..
Could you add how to do a cwm redirector? I've searched everywhere and can't find how.
that will be one of the upcoming topics..
chris41g said:
Updated just now with rooting, init.d support, and bootanimations..
Click to expand...
Click to collapse
Thanks Chris!
Sent from my SPH-D700 using xda premium
Hope your not doing this because you plan on leaving ! D;
But once again thanks for the info ill read it daily to make sure I understand it all!
Sent from my SPH-D700
I don't plan on going anywhere... but I also don't plan on being the only one repacking kernels forever either =]
chris41g said:
that will be one of the upcoming topics..
Click to expand...
Click to collapse
Awesome
chris41g said:
I don't plan on going anywhere... but I also don't plan on being the only one repacking kernels forever either =]
Click to expand...
Click to collapse
Hopefully soon we won't have to repack them, just recompile