[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.
Hey guys, just got my hands on one of these suckers, it runs 2.1
Can anyone point me in the right direction to get root?
Im also looking for froyo, however dont expect it soon, manufacturer is working on it.
Sent from my S7 using XDA App
I second davidcampbell! We need froyo here
The root method is the same as the s7.
download z4root from market and root, after wards install busybox by titanium backup and you are set.
The app2sd mod works for this device since it is similar to the sony x10 on 2.1 but is risky because i lost wifi aftewards. So just explore until we get some real developers working on it hopefully cm6.1 port but after huawei realeases the recovery.img and source to mess around with though.
being able to overclock to 1ghz wouldnt hurt either.
S7 Bootloader?
Has anyone figured out how to get into the bootloader for this device?
Havent been able to through any apps \ commands. Just go to a black screen and thats it, and recovery sends you into factory settings for your device
I only know that pressing back key and call\send key when when powering on the device puts it into update mode.
alexisprz said:
The root method is the same as the s7.
download z4root from market and root, after wards install busybox by titanium backup and you are set.
The app2sd mod works for this device since it is similar to the sony x10 on 2.1 but is risky because i lost wifi aftewards. So just explore until we get some real developers working on it hopefully cm6.1 port but after huawei realeases the recovery.img and source to mess around with though.
being able to overclock to 1ghz wouldnt hurt either.
Click to expand...
Click to collapse
Zomg, nice, thank you alexisprz, it's rooting time
I really wish Android had a better term for rooting, it sounds like I'm either breaking it, or trying to cram my man bits into it some how.
Will this affect my ability to use the manufacturers update to froyo in the future?
UPDATE: z4root worked great, I installed busybox no problemo, very happy forum member here
sir i just bought one telstra touch tab can you plz help me to debrand it and unlock it i also have jtag too
pre needs, new rom and rooted with busybox on SD with linux ext2/3 Partition.
download z4root from market and root
copy 3 files to sd
run App-2-sd.sh
File 1 "App-2-sd.sh"
#!/bin/sh
# untitled.sh
#
#
# Created by Andew Blazely on 5/02/11.
# Copyright 2011 SOFTHOUSE. All rights reserved.
#
# un Hash data if you wish but it will slow the S7 down and cause lots of waiting problems
# pre needs, new rom and rooted with busybox on SD with linux ext2/3 Partition.
# mount the file systems
mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system
busybox mkdir /system/sd
mount -t ext2 /dev/block/vold/179:2 /system/sd
# archive dirs (easier than copying)
cd /data/
busybox tar -cvf /system/sd/app.tar app
busybox tar -cvf /system/sd/app-private.tar app-private
# busybox tar -cvf /system/sd/data.tar data
busybox tar -cvf /system/sd/dalvik-cache.tar dalvik-cache
# unpack arcives in correct place
cd /system/sd
busybox tar -xvf app.tar
busybox tar -xvf app-private.tar
# busybox tar -xvf data.tar
busybox tar -xvf dalvik-cache.tar
# cleanup
busybox rm *.tar
# copy and set system files
busybox cp /sdcard/install-recovery.sh /system/etc
busybox cp /sdcard/init-sd.sh /system/etc
busybox chmod 755 /system/etc/install-recovery.sh
busybox chmod 755 /system/etc/init-sd.sh
# un Hash whatis needed if you intend NOT to remove SD
#cd /data/app
#busybox rm -rf *
#cd /data/app-private
#busybox rm -rf *
#cd /data/data/
#busybox rm -rf *
#cd /data/dalvik-cache
#busybox rm -rf *
# binding mount of new file structure
mount -o bind /system/sd/app /data/app
mount -o bind /system/sd/app-private /data/app-private
# mount -o bind /system/sd/data /data/data
mount -o bind /system/sd/dalvik-cache /data/dalvik-cache
reboot
File 2 "init-sd.sh"
#!/system/bin/sh
#
MYLOG=/sdcard/install-recovery.log
echo "$(date) Starting install-recovery.sh" > $MYLOG
echo "$(date) Waiting SD to become ready..." >> $MYLOG
sleep 10
# un Hash whatis needed if you intend NOT to remove SD
#echo "$(date) Erasing system files..." >> $MYLOG
#cd /data/app
#busybox rm -rf *
#cd /data/app-private
#busybox rm -rf *
#cd /data/data/
#busybox rm -rf *
#cd /data/dalvik-cache
#busybox rm -rf *
#echo "$(date) Erased system files..." >> $MYLOG
mount -t ext2 /dev/block/vold/179:2 /system/sd 1>>$MYLOG 2>>$MYLOG
mount -o bind /system/sd/app /data/app 1>>$MYLOG 2>>$MYLOG
mount -o bind /system/sd/app-private /data/app-private 1>>$MYLOG 2>>$MYLOG
# Hash this out if you haven't moved /data/data
#mount -o bind /system/sd/data /data/data 1>>$MYLOG 2>>$MYLOG
# Hash this out if you haven't move /data/dalvik-cache
mount -o bind /system/sd/dalvik-cache /data/dalvik-cache 1>>$MYLOG 2>>$MYLOG
mount >> $MYLOG
echo "$(date) Finishing install-recovery.sh" >> $MYLOG
File 3 "install-recovery.sh"
#!/system/bin/sh
#
/system/etc/init-sd.sh&
And BOB's your uncle.. this has worked many times for me give it a try
Talk in the CM7 threads has revealed that many people remove apps from CM7 before flashing/after flashing/using an update zip. This thread has a quick and easy method to remove apps (and other things) from CM7 on boot using an init.d script.
This method requires s-off (as the system is mounted as rw) and requires a little knowledge of android, however I will produce a 1 time only flash zip if people need it.
The following script is used and I will explain it below and what to modify;
If using Windows, don't use Notepad. I suggest Notepad++
/system/etc/init.d/50rm
Code:
#!/system/bin/sh
#mount system rw
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system;
#apps to delete
#send installed apps to /data/packages
pm list packages -f > /data/packages
for i in CarHomeLauncher LiveWallpapers LiveWallpapersPicker Protips;
do
if [ -e /system/app/$i.apk ];
then
rm -f /system/app/$i.apk;
grep $i.apk /data/packages > /data/pname;
pname2=$(sed 's/\(.*=\)\(.*\)/\2/' /data/pname);
pm uninstall $pname2;
fi;
done;
rm -f /data/packages
rm -f /data/pname
#delete camera_click sound
if [ -e /system/media/audio/ui/camera_click.ogg ];
then
rm -f /system/media/audio/ui/camera_click.ogg;
fi;
#mount system ro
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
Save the script as /system/etc/init.d/50rm (adb push 50rm /system/etc/init.d/50rm) and change permissions to 750 (adb shell chmod 750 /system/etc/init.d/50rm).
Next, so that this script is kept through flashes of new CM7 versions, we add it to the custom_backup_list.txt found in /system/etc/ (if you don't have one, create one).
/system/etc/custom_backup_list.txt
Code:
etc/init.d/50rm
There are two situations to show how things can be deleted:
1)#apps to delete
The line to change here is the for i in ... line (10) where there is a list of app names to uninstall.
Change names to what you want to be deleted from /system/app. Do not include .apk in the name.
2)#delete camera click sound
This is an example of how to delete other files that are wanted to be deleted. As an example, I have put the camera click sound. The full directory of the file will be needed.
What the script does:
The script will check if these files are there and then delete them. With the system apps, I have put in a script that should uninstall the files using the package manager (which I think is working, but am currently testing it because I'm not sure package manager can be run whilst booting, but post-boot my pm list packages -f reveals none of the packages)
Requests:
If anyone has a better, more efficient way of using the pm to uninstall the apps, please mention it. I am a novice when it comes to shell scripting and can only go by what I have done so far.
Changelog:
25/04/2011 - initial release
26/04/2011 - changed some strings
Script - http://bit.ly/golKIb (right click - save link as - check there is no file extension) - adb push 50rm /system/etc/init.d/50rm; adb shell chmod 750 /system/etc/init.d/50rm
How to use the custom_backup_list.txt in more ways - (by freerunner @ CM Forums)
Any problems, post here or add me to gtalk
subscribed, thanks mate.
i'll look into this when i get the time
Could anyone write a procedure that checks /system/build.prop, finds the line "ro.sf.lcd_density=240" and swapps it for "ro.sf.lcd_density=210"?
JDima said:
Could anyone write a procedure that checks /system/build.prop, finds the line "ro.sf.lcd_density=240" and swapps it for "ro.sf.lcd_density=210"?
Click to expand...
Click to collapse
Already done that. Once again, its not the cleanest way of doing things, but its as much as I know.
Change LCD Density on Boot
Code:
#!/system/bin/sh
#change lcd_density and reboot if new install
density=$(grep ro.sf.lcd_density=240 /system/build.prop);
if [ $density = "ro.sf.lcd_density=240" ];
then
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system;
sed -i 's/ro.sf.lcd_density=240/ro.sf.lcd_density=210/g' /system/build.prop;
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
reboot;
fi;
What the script does:
Checks the LCD Density and if it is 240, it will change it to 210 (or whatever value people want by changing ro.sf.lcd_density=210 to the denisty they want). It then reboots immediately (whilst still on splash screen) so that the new density is loaded when you boot the phone.
Why is this needed when there are apps on the market?:
Many of the apps on the market need to be re-run on new rom flashes or are not permanent. This can be made permanent by adding to the custom_backup_list.txt and will be done every new flash in CM7.
Is this way better than deleting apps/sounds before flashing, or is it just alternative?
Personally I find it more easy to delete apps and other stuff via adb when the rom is instaled.
expl0de said:
Is this way better than deleting apps/sounds before flashing, or is it just alternative?
Personally I find it more easy to delete apps and other stuff via adb when the rom is instaled.
Click to expand...
Click to collapse
Its an alternative way that does it for you. All you have to do is put the script on your phone, add it to the custom_backup_list.txt and let the script work for you.
iinga, thanks!
Why? Because https://market.android.com/details?id=lv.n3o.lcddensity (for example) doesn't seem to work after reboot, and it has slightly different behavior (check out the keyboard for instance). The build.prop method is the "cleanest" one.
JDima said:
iinga, thanks!
Why? Because https://market.android.com/details?id=lv.n3o.lcddensity (for example) doesn't seem to work after reboot, and it has slightly different behavior (check out the keyboard for instance). The build.prop method is the "cleanest" one.
Click to expand...
Click to collapse
Agreed, which is why I wrote that script in the first place
Problem. The script does exactly nothing.
Code:
--------- beginning of /dev/log/main
I/cm ( 79): Welcome to Android 2.3.3 / CyanogenMod-7.0.2.1-Desire
I/cm ( 80): _
I/cm ( 81): __ __ _ ___ _ _ __ ___ __ _ _ _ _ __ __))
I/cm ( 82): ((_ \(/'((_( ((\( ((_)((_( (('((\( ((`1( ((_)((_(
I/cm ( 83): )) _))
I/cm ( 84):
I/mountsd ( 98): Checking filesystems..
I//system/xbin/run-parts( 74): e2fsck 1.41.10 (10-Feb-2009)
I//system/xbin/run-parts( 74): /dev/block/mmcblk0p2: recovering journal
I//system/xbin/run-parts( 74): /dev/block/mmcblk0p2: clean, 133/438272 files, 260021/875449 blocks
I/logwrapper( 104): busybox terminated by exit(0)
I/logwrapper( 109): busybox terminated by exit(0)
I/logwrapper( 111): busybox terminated by exit(0)
I/mountsd ( 113): /sd-ext successfully mounted
I/busybox ( 127): S2E: Initialization...
I/busybox ( 127): S2E: /sd-ext/app mount as /data/app
I/busybox ( 127): S2E: /sd-ext/app-private mount as /data/app-private
I/busybox ( 127): S2E: /sd-ext/download mount as /cache/download
I/busybox ( 127): S2E: Done!
I/logwrapper( 127): busybox terminated by exit(0)
[B]I//system/xbin/run-parts( 74): run-parts: /system/etc/init.d/50rm exited with code 111[/B]
I/logwrapper( 74): /system/xbin/run-parts terminated by exit(1)
The permissions are correct.
Here's my 50rm:
Code:
#!/system/bin/sh
#mount system rw
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system;
if [ -e /system/media/audio/ui/camera_click.ogg ];
then
rm -f /system/media/audio/ui/camera_click.ogg;
fi;
#change lcd_density and reboot if new install
density=$(grep ro.sf.lcd_density=240 /system/build.prop);
if [ $density = "ro.sf.lcd_density=240" ];
then
sed -i 's/ro.sf.lcd_density=240/ro.sf.lcd_density=210/g' /system/build.prop;
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
reboot;
fi;
#mount system ro
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
JDima said:
Code:
#!/system/bin/sh
#mount system rw
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system;
if [ -e /system/media/audio/ui/camera_click.ogg ];
then
rm -f /system/media/audio/ui/camera_click.ogg;
fi;
#change lcd_density and reboot if new install
density=$(grep ro.sf.lcd_density=240 /system/build.prop);
if [ $density = "ro.sf.lcd_density=240" ];
then
sed -i 's/ro.sf.lcd_density=240/ro.sf.lcd_density=210/g' /system/build.prop;
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
reboot;
fi;
#mount system ro
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
Click to expand...
Click to collapse
Try removing the "mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;" in the lcd density if section (before reboot).
iinga said:
Try removing the "mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;" in the lcd density if section (before reboot).
Click to expand...
Click to collapse
Predictably, it didn't help.
No way would mounting /system as RO be performed twice - because the script terminates after any of them one way or another.
JDima said:
Predictably, it didn't help.
No way would mounting /system as RO be performed twice - because the script terminates after any of them one way or another.
Click to expand...
Click to collapse
I know it wouldn't perform twice, however I was wondering why it fails to run the script.
It has been working for me, but now trying to work out what is different is difficult.
iinga said:
It has been working for me, but now trying to work out what is different is difficult.
Click to expand...
Click to collapse
Could you post the whole script you're using yourself (if it includes changing density)?
JDima said:
Could you post the whole script you're using yourself (if it includes changing density)?
Click to expand...
Click to collapse
Code:
#!/system/bin/sh
#mount system rw
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system;
#change lcd_density and reboot if new install
density=$(grep ro.sf.lcd_density=240 /system/build.prop);
if [ $density = "ro.sf.lcd_density=240" ];
then
sed -i 's/ro.sf.lcd_density=240/ro.sf.lcd_density=220/g' /system/build.prop;
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
reboot;
fi;
#apps to delete
pm list packages -f > /system/packages
for i in CarHomeLauncher LiveWallpapers LiveWallpapersPicker Protips DSPManager GenieWidget FileManager;
do
if [ -e /system/app/$i.apk ];
then
rm -f /system/app/$i.apk;
grep $i.apk /system/packages > /system/pname;
pname2=$(sed 's/\(.*=\)\(.*\)/\2/' /system/pname);
pm uninstall $pname2;
fi;
done;
rm /system/packages;
rm /system/pname;
#delete camera_click sound
if [ -e /system/media/audio/ui/camera_click.ogg ];
then
rm -f /system/media/audio/ui/camera_click.ogg;
fi;
#mount system ro
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
http://www.iinga.net/desire/50rmlcd
Nope. Same thing with your script. I even tried granting the script maximum permissions - useless.
Can anyone else verify the script actually works?
JDima said:
Nope. Same thing with your script. I even tried granting the script maximum permissions - useless.
Can anyone else verify the script actually works?
Click to expand...
Click to collapse
Are you s-off?
iinga said:
Are you s-off?
Click to expand...
Click to collapse
Off course
A detailed reproduction of my steps:
1) Place 50rm into /system/etc/init.d via Root Explorer (shouldn't make any difference)
2) Change permissions on 50rm.
3) Doublecheck the permissions.
4) Create and configure custom_backup_list.txt
5) Reflash the same ROM (I'm using custom MTD - however, that also shouldn't change anything)
6) Verify visually that the script didn't work.
7) Verify that 50rm is in place with correct permissions.
8) Reboot and adb logcat...
JDima said:
Off course
A detailed reproduction of my steps:
1) Place 50rm into /system/etc/init.d via Root Explorer (shouldn't make any difference)
2) Change permissions on 50rm.
3) Doublecheck the permissions.
4) Create and configure custom_backup_list.txt
5) Reflash the same ROM (I'm using custom MTD - however, that also shouldn't change anything)
6) Verify visually that the script didn't work.
7) Verify that 50rm is in place with correct permissions.
8) Reboot and adb logcat...
Click to expand...
Click to collapse
I just did step 5 and my phone goes to splash screen, reboots from splash screen, fully boots in density 220.
Code:
adb shell grep ro.sf.lcd_density /system/build.prop
ro.sf.lcd_density=220
How did you create your script? When I just created it using notepad for windows, I get the Exit Code 111 and no LCD Density change.
Creating with notepad ++, script runs fine and LCD density gets changed correctly.
iinga said:
How did you create your script? When I just created it using notepad for windows, I get the Exit Code 111 and no LCD Density change.
Creating with notepad ++, script runs fine and LCD density gets changed correctly.
Click to expand...
Click to collapse
Dammit...
Thanks, mate, it worked
Having encrypted /data, I'd been interested in encrypting the SD card, either in full, or a full partition. As a new poster to xda, posting without citing reference links does prove a bit more challenging, but here goes:
Given an HTC Sensation, rooted, with Cyanogenmod 9.1 (ICS), and Clockwork Recovery, I partitioned (thru Clockwork) the SD card into FAT32, ext, and swap. Your milage may vary on the next step, but using Fedora, I accessed the SD card, deleted the ext partition, and recreated as an encrypted partition, type ext4. (read up on cryptsetup for alternative ways to create this) For the sake of this post, we'll use the password, "ChangeMe".
I installed LUKS Manager from Google Play, which provides lm.cryptsetup, a renamed binary of Guardian Project's cryptsetup. I didn't use LUKS Manager's implementation of creating encrypted folders, instead, the whole sd-ext partition has been encrypted.
To mount the device at startup, I have the script 99sd-extLUKinit, located at /system/etc/init.d/
#!/system/bin/sh
# Not quite sure what these do, but kept them in
sync;
setprop lk.filesystem.ready 1;
# Remount the root file system to allow changes
mount -o remount,rw rootfs /
# Create the mount point and create a symbolic link
mkdir /mnt/sd-ext
ln -s /mnt/sd-ext /sd-ext
# Decrypt the SD card via cryptsetup, device resides on /dev/block/sd-ext
# Hopefully prompt user for password, but for now, echoed in
echo ChangeMe | lm.cryptsetup luksOpen /dev/block/mmcblk1p2 sd-ext
# Clean errors
e2fsck -y /dev/mapper/sd-ext
# Mount the SD Card via cryptsetup block device
mount -t ext4 -o noatime,nodiratime,barrier=1 /dev/mapper/sd-ext /mnt/sd-ext/
# Remount the root file system to prevent changes
mount -o remount,ro rootfs /
Once verified that the system will automount the encrypted ext4 /mnt/sd-ext partition:
ls /sd-ext
should return with lost & found directory
I moved /data/app and /data/app-private to the encrypted partition:
cp -a /data/app /sd-ext/app
rm -r /data/app
ln -s /sd-ext/app /data/app
cp -a /data/app-private /sd-ext/app-private
rm -r /data/app-private
ln -s /sd-ext/app-private /sd-ext/app-private
I want to introduce a new android project - Entware. It can be considered as an Optware replacement.
Entware (arm version for cortex-a9 or higher) was first done for routers
_cannot post url ((((
Later it was tested on NASes
_cannot post url ((((
It is based on another project Qnapware, that is based on Entware (mipsel version).
Today I've tested Entware.arm on android (routed RK3188 TV stick) and it works.
I'm rather new to android. So my instuctions given below may not always be correct. I was installing Entware.arm connecting to android host using SshDroid.
1. I need a writeble /opt folder. I've done the following
Code:
/system/bin/mount -o rw,remount /
mkdir /opt
/system/bin/mount -o ro,remount /
I have a ext2 formated external sd card (symlinks are needed). I have made a directory and mount binded it to opt
Code:
mkdir /mnt/external_sd/entware.arm
mount -o bind /mnt/external_sd/entware.arm /opt
I do not know why android does not have shell in /bin
So let's make one
Code:
/system/bin/mount -o rw,remount /
mkdir /bin
ln -s /system/bin/sh /bin/sh
/system/bin/mount -o ro,remount /
Now I'll need a local root profile with the content to execute global Entware profile:
Code:
[email protected]:/data/data/berserker.android.apps.sshdroid/home # pwd
/data/data/berserker.android.apps.sshdroid/home
[email protected]:/data/data/berserker.android.apps.sshdroid/home # cat .profile
#!/system/bin/sh
. /opt/etc/profile
The preparation is finished. Now let install Entware
Code:
wget h__p_//qnapware.zyxmon.org/binaries-armv7/installer/entware_install_arm.sh
chmod +x ./entware_install_arm.sh
./entware_install_arm.sh
After the installation - logout and login again (to execute /opt/etc/profile) and install packages
Code:
opkg install mc
If something in my instructions does not fit android philosophy - please inform me.
Addition:
To make Entware changes permanent we needs startup script. Something like
Code:
#!/system/bin/sh
sleep 3
/system/bin/mount -o rw,remount /
sleep 1
/system/bin/chmod 777 /mnt/external_sd
/system/bin/mkdir /opt
/system/bin/mkdir /bin
ln -s /system/bin/sh /bin/sh
/system/bin/mount -o ro,remount /
sleep 3
/system/bin/mount -t ext2 -o rw /dev/block/mmcblk0p1 /mnt/external_sd
/system/bin/mount -o bind /mnt/external_sd/entware.arm /opt
sleep 2
/opt/etc/init.d/rc.unslung start
This script creates /bin /opt folders creates symlink /bin/sh, binds /opt to Entware folder location and starts Entware services.
zyxmon said:
I want to introduce a new android project - Entware. It can be considered as an Optware replacement.
Entware (arm version for cortex-a9 or higher) was first done for routers
_cannot post url ((((
Later it was tested on NASes
_cannot post url ((((
It is based on another project Qnapware, that is based on Entware (mipsel version).
Today I've tested Entware.arm on android (routed RK3188 TV stick) and it works.
I'm rather new to android. So my instuctions given below may not always be correct. I was installing Entware.arm connecting to android host using SshDroid.
1. I need a writeble /opt folder. I've done the following
Code:
/system/bin/mount -o rw,remount /
mkdir /opt
/system/bin/mount -o ro,remount /
I have and ext2 formated external sd card (symlinks are needed). I have made a directory and moun binded it to opt
Code:
mkdir /mnt/external_sd/entware.arm
mount -o bind /mnt/external_sd/entware.arm /opt
I do not know why android does not have shell in /bin
So let's make one
Code:
/system/bin/mount -o rw,remount /
mkdir /bin
ln -s /system/bin/sh /bin/sh
/system/bin/mount -o ro,remount /
Now I'll need a local root profile with the content to execute gloabal Entware profile:
Code:
[email protected]:/data/data/berserker.android.apps.sshdroid/home # pwd
/data/data/berserker.android.apps.sshdroid/home
[email protected]:/data/data/berserker.android.apps.sshdroid/home # cat .profile
#!/system/bin/sh
. /opt/etc/profile
The preparation is finished. Now install Entware
Code:
wget h__p_//qnapware.zyxmon.org/binaries-armv7/installer/entware_install_arm.sh
chmod +x ./entware_install_arm.sh
./entware_install_arm.sh
After the installation - logout and login again (to execute /opt/etc/profile) and install packages
Code:
opkg install mc
If something in my instructions does not fit android philosophy - please inform me.
Addition:
To make Entware changes permanent on needs sturtup script. Something like
Code:
#!/system/bin/sh
sleep 3
/system/bin/mount -o rw,remount /
sleep 1
/system/bin/chmod 777 /mnt/external_sd
/system/bin/mkdir /opt
/system/bin/mkdir /bin
ln -s /system/bin/sh /bin/sh
/system/bin/mount -o ro,remount /
sleep 3
/system/bin/mount -t ext2 -o rw /dev/block/mmcblk0p1 /mnt/external_sd
/system/bin/mount -o bind /mnt/external_sd/entware.arm /opt
sleep 2
/opt/etc/init.d/rc.unslung start
This script creates /bin /opt folders creates symlink /bin/sh, binds /opt to Entware folder location and starts Entware services.
Click to expand...
Click to collapse
Interesting.
Is this for smart phones???
GokulNC said:
Interesting.
Is this for smart phones???
Click to expand...
Click to collapse
Entware will work on armv7l/cortex-a9 or compatible CPU. It does not matter, weather it is smart phone, tablet, router or NAS.
Working well on this end, except for the fact that it has no concept of Android users and groups. For example, ls -l from busybox returns things like user "1000" group "1000", and bash with a PS1 including \u returns "I have no name!". Thoughts?