Related
Curently I trying to cross compile mtd utils but without success. But I starting Debian again under phone and I will compile it under phone and will post utils here when finish. P.S. tried to write to mtd without luck so I think mtd utils will give me permisions to write. If you have another idea how to write to flash, please post solution here. Currently I want to change rsa modulus inside spl but not know how to access flash (with haret I done this but after restarting phone all is back to previous state, so I need another way)
Succesfully compiled! I think it will be useful to someone
No way to write to flash, only can read Some info:
Code:
localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin# ls
doc_loadbios flash_lock flashcp mkfs.jffs2 nanddump nftldump serve_image ubidetach ubinize ubiupdatevol
docfdisk flash_otp_dump ftl_check mkfs.ubifs nandtest recv_image sumtool ubiformat ubirename
flash_erase flash_otp_info ftl_format mtd_debug nandwrite rfddump ubiattach ubimkvol ubirmvol
flash_eraseall flash_unlock jffs2dump mtdinfo nftl_format rfdformat ubicrc32 ubinfo ubirsvol
localhost:~/mtd/install/sbin# ./nandtest
usage: nandtest [OPTIONS] <device>
-h, --help Display this help output
-m, --markbad Mark blocks bad if they appear so
-s, --seed Supply random seed
-p, --passes Number of passes
-o, --offset Start offset on flash
-l, --length Length of flash to test
-k, --keep Restore existing contents after test
localhost:~/mtd/install/sbin# ./ftl_check
usage: ftl_check device
localhost:~/mtd/install/sbin# ./ftl_check /dev/mtd0
Memory region info:
Region size = 512 mb Erase block size = 128 kb
No valid erase unit headers!
localhost:~/mtd/install/sbin# ./flash_otp_info /dev/mtd0
Usage: flash_otp_info [ -f | -u ] <device>
localhost:~/mtd/install/sbin# ./flash_otp_info -f /dev/mtd0
OTPSELECT: Inappropriate ioctl for device
localhost:~/mtd/install/sbin# ./mtd_debug
usage: mtd_debug info <device>
mtd_debug read <device> <offset> <len> <dest-filename>
mtd_debug write <device> <offset> <len> <source-filename>
mtd_debug erase <device> <offset> <len>
localhost:~/mtd/install/sbin# ./mtd_debug info /dev/mtd00
open(): No such file or directory
localhost:~/mtd/install/sbin# ./mtd_debug info /dev/mtd0
mtd.type = MTD_NANDFLASH
mtd.flags = MTD_CAP_NANDFLASH
mtd.size = 536870912 (512M)
mtd.erasesize = 131072 (128K)
mtd.writesize = 2048 (2K)
mtd.oobsize = 64
regions = 0
localhost:~/mtd/install/sbin# ./nandwrite /dev/mtd0 /root/ttt/mtd.img
Writing data to block 0 at offset 0x0
libmtd: error!: cannot write 2048 bytes to mtd0 (eraseblock 0, offset 0)
error 5 (Input/output error)
Erasing failed write from 00000000 to 0x01ffff
libmtd: error!: bad eraseblock number 131072, mtd0 has 4096 eraseblocks
nandwrite: error!: /dev/mtd0: MTD Erase failure
error 22 (Invalid argument)
Data was only partially written due to error
: Invalid argument
localhost:~/mtd/install/sbin# ./mtdinfo /dev/mtd0
mtd0
Name: msm_nand
Type: nand
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 4096 (536870912 bytes, 512.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size: 2048 bytes
OOB size: 64 bytes
Character device major/minor: 90:0
Bad blocks are allowed: true
Device is writable: true
localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin# cat /root/ttt/mtd.img > /dev/mtd0
cat: write error: Input/output error
localhost:~/mtd/install/sbin# ./mtd_debug erase /dev/mtd0 0x200000 0x20000
MEMERASE: Input/output error
localhost:~/mtd/install/sbin# ./flash_erase -N -u /dev/mtd0 0x200000 0x20000
Erasing 128 Kibyte @ 200000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 16 (mtd0)
error 95 (Operation not supported)
flash_erase: error!: /dev/mtd0: MTD unlock failure
error 95 (Operation not supported)
Erasing 128 Kibyte @ 220000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 17 (mtd0)
error 95 (Operation not supported)
flash_erase: error!: /dev/mtd0: MTD unlock failure
error 95 (Operation not supported)
Erasing 128 Kibyte @ 240000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 18 (mtd0)
error 95 (Operation not supported)
flash_erase: error!: /dev/mtd0: MTD unlock failure
error 95 (Operation not supported)
Erasing 128 Kibyte @ 260000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 19 (mtd0)
error 95 (Operation not supported)
flash_erase: error!: /dev/mtd0: MTD unlock failure
error 95 (Operation not supported)
Erasing 128 Kibyte @ 280000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 20 (mtd0)
error 95 (Operation not supported)
flash_erase: error!: /dev/mtd0: MTD unlock failure
error 95 (Operation not supported)
Erasing 128 Kibyte @ 2a0000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 21 (mtd0)
error 95 (Operation not supported)
flash_erase: error!: /dev/mtd0: MTD unlock failure
error 95 (Operation not supported)
Erasing 128 Kibyte @ 2c0000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 22 (mtd0)
error 95 (Operation not supported)
flash_erase: error!: /dev/mtd0: MTD unlock failure
error 95 (Operation not supported)
Erasing 128 Kibyte @ 2e0000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 23 (mtd0)
localhost:~/mtd/install/sbin# ./flash_erase --help
Usage: flash_erase [options] MTD_DEVICE <start offset> <block count>
Erase blocks of the specified MTD device.
Specify a count of 0 to erase to end of device.
-j, --jffs2 format the device for jffs2
-N, --noskipbad don't skip bad blocks
-u, --unlock unlock sectors before erasing
-q, --quiet do not display progress messages
--silent same as --quiet
--help display this help and exit
--version output version information and exit
localhost:~/mtd/install/sbin# ./flash_erase -N -j /dev/mtd0 0x200000 0x20000
flash_erase: error!: /dev/mtd0: unable to get NAND oobinfo
error 22 (Invalid argument)
localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin# ./flash_erase -N /dev/mtd0 0x200000 0x20000
Erasing 128 Kibyte @ 200000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 16 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 220000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 17 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 240000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 18 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 260000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 19 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 280000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 20 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 2a0000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 21 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 2c0000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 22 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 2e0000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 23 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 300000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 24 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 320000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 25 (mtd0)
If I could I would like to help you, but you write something in Japanese ...
whatever good luck!
Good job pal, hope nand android will be ready suddenly, thanks you're a great dev!!
After new nand driver I am able to write to flash chip but one problem is first 0x59bffff bytes is protected! Some offsets I erased sucessfully (83%)! And succesfully writing to flash (83%) but could not write to memory where is spl I think (maybe need special access to unlock it?) Or only solution is jtag? But, maybe, I seen in kernel option in nand driver (errase call and reset call... I will try)
Code:
localhost:~/mtd/sbin# cat /proc/mtd
dev: size erasesize name
mtd0: 20000000 00020000 "msm_nand"
localhost:~/mtd/sbin# ./mtdinfo /dev/mtd0
mtd0
Name: msm_nand
Type: nand
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 4096 (536870912 bytes, 512.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size: 2048 bytes
OOB size: 64 bytes
Character device major/minor: 90:0
Bad blocks are allowed: true
Device is writable: true
localhost:~/mtd/sbin# ./flash_erase /dev/mtd0 0 4096
Erasing 128 Kibyte @ 0 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 0 (mtd0)
error 22 (Invalid argument)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 22 (Invalid argument)
Erasing 128 Kibyte @ 20000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 1 (mtd0)
error 22 (Invalid argument)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 22 (Invalid argument)
Erasing 128 Kibyte @ 40000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 2 (mtd0)
error 22 (Invalid argument)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 22 (Invalid argument)
Erasing 128 Kibyte @ 60000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 3 (mtd0)
error 22 (Invalid argument)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 22 (Invalid argument)
Erasing 128 Kibyte @ 80000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 4 (mtd0)
error 22 (Invalid argument)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 22 (Invalid argument)
Erasing 128 Kibyte @ a0000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 5 (mtd0)
error 22 (Invalid argument)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 22 (Invalid argument)
Erasing 128 Kibyte @ c0000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 6 (mtd0)
error 22 (Invalid argument)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 22 (Invalid argument)
Erasing 128 Kibyte @ e0000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 7 (mtd0)
error 22 (Invalid argument)
error 22 (Invalid argument)
Erasing 128 Kibyte @ 41a0000 -- 12 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 525 (mtd0)
error 22 (Invalid argument)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 22 (Invalid argument)
Erasing 128 Kibyte @ 41c0000 -- 12 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 526 (mtd0)
error 22 (Invalid argument)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 22 (Invalid argument)
Erasing 128 Kibyte @ 41e0000 -- 12 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 527 (mtd0)
error 22 (Invalid argument)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 22 (Invalid argument)
Erasing 128 Kibyte @ 4200000 -- 12 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 528 (mtd0)
error 22 (Invalid argument)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 22 (Invalid argument)
Erasing 128 Kibyte @ 4220000 -- 12 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 529 (mtd0)
error 22 (Invalid argument)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 22 (Invalid argument)
Erasing 128 Kibyte @ 59c0000 -- 17 % complete flash_erase: Skipping bad block at 059e0000
Erasing 128 Kibyte @ 70a0000 -- 21 % complete flash_erase: Skipping bad block at 070c0000
Erasing 128 Kibyte @ b6e0000 -- 35 % complete flash_erase: Skipping bad block at 0b700000
Erasing 128 Kibyte @ 11460000 -- 53 % complete flash_erase: Skipping bad block at 11480000
Erasing 128 Kibyte @ 116c0000 -- 54 % complete flash_erase: Skipping bad block at 116e0000
Erasing 128 Kibyte @ 14660000 -- 63 % complete flash_erase: Skipping bad block at 14680000
Erasing 128 Kibyte @ 1f820000 -- 98 % complete flash_erase: Skipping bad block at 1f840000
Erasing 128 Kibyte @ 1ffe0000 -- 100 % complete
localhost:~/mtd/sbin#
Writing only from offset 0x59c0000 and good news I think I cid unlocked my device!!! (offset 0x1FEE0000)
Code:
localhost:~/mtd/sbin# ./nandwrite -s 0x59c0000 -m --pad /dev/mtd0 ../mtd.img
Writing data to block 718 at offset 0x59c0000
Writing data to block 719 at offset 0x59e0000
Bad block at 59e0000, 1 block(s) from 59e0000 will be skipped
Writing data to block 720 at offset 0x5a00000
Writing data to block 721 at offset 0x5a20000
Writing data to block 722 at offset 0x5a40000
Writing data to block 723 at offset 0x5a60000
Writing data to block 724 at offset 0x5a80000
Writing data to block 725 at offset 0x5aa0000
Writing data to block 726 at offset 0x5ac0000
Writing data to block 727 at offset 0x5ae0000
Writing data to block 728 at offset 0x5b00000
Writing data to block 729 at offset 0x5b20000
Writing data to block 730 at offset 0x5b40000
Writing data to block 731 at offset 0x5b60000
Writing data to block 732 at offset 0x5b80000
Writing data to block 733 at offset 0x5ba0000
Writing data to block 734 at offset 0x5bc0000
Writing data to block 735 at offset 0x5be0000
Writing data to block 736 at offset 0x5c00000
....
....
good work munjeni,it's a good news!!
i will Expected for another good news.
i have a one questios:what is cid unlocked??are you test nand in your device??!!
you're the best dev
Milane, ne nisam napravio jos uvek nista, hehe no, I curently testing nand driver, and nand booting will be "only" when bootloader be unlocked (when I get access to first 0x59bffff bytes)! After that I will try something
hahahaha #define PROTECT_BLOCK_NUM (0x212)
Maybe changing to 0x0 ...DONE! Huh I have one chance to try and to write to flash hmmm... must be 100% sure to have good nand backup without bad blocks if something go bad my device will be bricked (I not care becouse I will by new phone, our phone will be for playing with jtag)
For developers here is working nand driver
munjeni said:
For developers here is working nand driver
Click to expand...
Click to collapse
Cool Man Munjeni.
You are The King of HD MINI Android and
Gabana Is The King of HD MINI WM.
Thank All of You......
Simple bootloader I think will be good now:
http://androidhtc.git.sourceforge.net/git/gitweb.cgi?p=androidhtc/tinboot.git;a=summary
Some interested links:
http://forum.xda-developers.com/showthread.php?t=614275
hi munjeni,good work ,you're the best development in the xda.
MOUNTED!!!
Code:
# mount
mount
rootfs / rootfs ro,relatime 0 0
/dev/block/mmcblk0p1 /sdcard vfat rw,noatime,nodiratime,fmask=0111,dmask=0000,al
low_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=re
mount-ro 0 0
/dev/block/loop0 /data ext2 rw,sync,noatime,nodiratime,errors=continue 0 0
/dev/block/loop1 /system ext2 rw,noatime,nodiratime,errors=continue 0 0
/dev/block/loop2 /cache ext2 rw,sync,noatime,nodiratime,errors=continue 0 0
tmpfs /dev tmpfs rw,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,relatime,size=4096k 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/vold/179:1 /mnt/sdcard vfat rw,nosuid,nodev,noexec,relatime,fmask=011
1,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed
,utf8,errors=remount-ro 0 0
/dev/block/vold/179:1 /mnt/secure/asec vfat rw,nosuid,nodev,noexec,relatime,fmas
k=0111,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=
mixed,utf8,errors=remount-ro 0 0
tmpfs /mnt/sdcard/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
/dev/block/dm-0 /mnt/asec/com.jcwp.Txwy-1 vfat ro,dirsync,nosuid,nodev,noexec,re
latime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortna
me=mixed,utf8,errors=remount-ro 0 0
/dev/block/dm-1 /mnt/asec/com.jcwp.I3Dbz-1 vfat ro,dirsync,nosuid,nodev,noexec,r
elatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortn
ame=mixed,utf8,errors=remount-ro 0 0
/dev/block/dm-2 /mnt/asec/com.jcwp.S4305-1 vfat ro,dirsync,nosuid,nodev,noexec,r
elatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortn
ame=mixed,utf8,errors=remount-ro 0 0
/dev/block/dm-3 /mnt/asec/com.demo.android.waterfallwallpaper-1 vfat ro,dirsync,
nosuid,nodev,noexec,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocha
rset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
[COLOR="Red"][B][SIZE="6"]/dev/block/mtdblock0 /mnt/sdcard/flash yaffs2 rw,relatime 0 0[/SIZE][/B][/COLOR]#
I have good news, nand driver is now able to write to region at 0x2820000 (there is master boot record, partition table, imgfs ...etc) I think we will be able now to create android nand rom creating new MBR and partition table (not 100% sure)!!!
Here is erase block offsets http://pastebin.com/xAhnEXBU
I confirm I sucessfully erased mbr and my partitions but no way to unlock spl (start offset 0x2400000) and I don't know why:
Code:
localhost:~/mtd/sbin# ./flash_erase /dev/mtd0 0x2400000 1
Erasing 128 Kibyte @ 2400000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 288 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 2400000 -- 100 % complete
If someone have skills hex editing mbr it will be good! In attachment is mbr and msflsh dump... I waiting expert with ideas and my device will be testing device!
Great job! looks great! also there must be another partition maps, for example in computer GUI Partition map, Apple Partiton, and MBR (known also as Microsoft's Master Boot Record)
& also you still need JAG picture? right?
Other partition table? MBR contains a partition table describing the locations, sizes, and other attributes of linear regions referred to as partitions! We have mbr and we have all needed to create nand rom but I need to learn now how to do it. I think will not be hard (maybe I will create linux partition layout)
I Checked some info.
I just think you should do with MBR Partition Table.
I saw EBR Scheme it's says for Linux. (not sure), but it's not famous now, looked at HD2, nothing says about MBR .. Partition Maps it's specially for computers between Mac, Linux and Windows now.
Also I checked about Linux Partition Layout that you said.. I didn't see in Mobile Phones right now (maybe future), not famous.
Anyway, seems MBR is the Default and the Famous for Mobiles right now.
Try MBR Partition Map Scheme
First I will map all wince partition tables, all offsets, all sizes, and will resize one wince partition and to free space will create one yaffs2, then I will try to see that partition from android becouse I not know if nand driver is good for reading (yes it is good for writing now but from android I see only 2 mtd - one is mtd0 and seccond is mtd0ro, but I not see partition layout from android, it is problem now)... will try to create one yaffs2 and mount it under android, if all go ok than I will delete all layouts and try creating new layout for android boot!
If you want to help, please ask some guys to hd2 forums about how to create custom android layout in nand for android, maybe someone will help. Only good thing is: I am able to edit/delete mbr, table, imgfs...
EDIT:
hmmm I have idea. Maybe puting modified spl (hex edited spl with my rsa modulus) to memory regions where it will be executed? And than signing rom with my rsa key and using regular htc utility to install all (install nbh with modified spl)
BACKGROUND
After many time I stressful with Low Disk Space when Installing many Applications, or Slow Performance when Installing Data2sd or dalvik-cache to SD. I came up with some simple Idea to make my phone have big Internal Memory Storage, yet still robust in performance.
Click to expand...
Click to collapse
Introducing....
AD2SDX - AMARULLZ DATA TO SD-EXT
by amarullz [at] yahoo [dot] com
* Oct 20 2011 (ALPHA02) - Update Compatibility
* Oct 19 2011 (ALPHA01)
WHAT IS IT??
This mod will move all Internal Memory (data) into sd-ext, "but not like data2ext", this mod will maintain the performance, because it still place dalvik-cache and system application data in Internal Memory.
HOW IT WORK??
The script will do this in the first boot:
Move Mounting Internal Memory (/data) Into /sd-ext
Mount SDCard-Ext (mmcblk0p2) partition into /data
Create dalvik-cache directory in Internal Memory data (/sd-ext), and symlink it to mmcblk0p2 (/data)
Create data directory in mmcblk0p2 (/data) And symlink it into Internal Memory data (/sd-ext)
Create symlink of app, app-private, app_s and lib_s from mmcblk0p2 (/data) to Internal memory data (/sd-ext)
Create symlink for all non-symllink of Internal Memory data (/sd-ext) into mmcblk0p2 (/data)
After Initializing Setup (First Boot), reboot the system (Just reboot, don't go into recovery), the mod will automatically do this following:
Create data_s in Internal Memory data (/sd-ext)
Move All mmcblk0p2(/data)/data/com.htc* and com.android* into Internal Memory data(/sd-ext)/data_s
Create symlink all files/directory from Internal Memory data (/sd-ext)/data_s/* into mmcblk0p2(/data)/data/ So the System Application Data still read into Internal memory, but rest Application Data will read Into SDCard.
ILLUSTRATION
{
"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"
}
INSTALLATION
For now, use adb shell and Install it manually, I am android newbie , still unfamiliar with recovery zip installer.
Delete Any A2SD Script in /system/etc/init.d ( common name was 40a2sd )
Copy 40ad2sdx into /system/etc/init.d Don't forget to chmod 755/777 it
Reboot ( 2x optional )
INSTALLATION WITH ADB IN RECOVERY MODE
Code:
C:\>adb shell
# mount /system
# exit
C:\>adb push 40ad2sdx /system/etc/init.d/
C:\>adb shell
# cd /system/etc/init.d
# rm 40a2sd
# chmod 755 40ad2sdx
# cd /
# umount /system
# exit
C:\>
NOTE: the "rm 40a2sd" should be the name of app2sd init.d file.
NOTE
If you install it after clean flash you need to reboot your phone at the 1st boot to activate System App Data on Internal Memory.
CAUTION!!!
YOU SHOULD UNZIP AND MANUALY COPY THE FILE INTO /system/etc/init.d/ - THE ZIP FILE WASN'T AUTO INSTALLER THAT CAN BE RUN IN RECOVERY!!!!
WARNING!!!
THIS MOD ONLY IN TEST STAGE, ONLY ADVANCE USER I SUGGEST TO TRY THIS SCRIPT.
I DON'T TAKE ANY RESPONSIBILITY IF YOU BROKE/BOOTLOOPS YOUR SYSTEM/ROM/PHONE.
TESTED-DEVICE / ROM
HTC Desire (Bravo)
- Cool3D RunnyMede Sense 3.5 v2, v3
- Cool3D AceS Sense 3.0 v3, v4
If You Already Test it and works,.. Please send me a feedback in your comment...
LOGS
Code:
VERSION 1.0 ALPHA02
===================
* Add framework_s into strict mmcblk0p2
* Add Create symlink for rest non-symlink files from mmcblk0p2 to mtdblock5 ( Hope will fix bootloop )
* Change loop method from `ls -d *` to `ls -a` ( may fix error on .systemapp and all file with dot name at first char )
VERSION 1.0 ALPHA01
===================
* Initial Release
* Support for clean flash or already running system
* com.android* and com.htc* set as System App Category
* dalvik-cache on Internal Memory
* add umount /sd-ext in first command
SCRIPT: ALPHA01
Code:
#!/system/bin/sh
#
# AMARULLZ DATA TO SD-EXT MOD FOR ANDROID ( AD2SDX )
# ==================================================
#
# by amarullz [at] yahoo [dot] com
# xda-developers : amarullz
# (c) 2011
# * Oct 19 (ALPHA01)
#
# Info: ~ For Changing Log
##
###
# Initializing
###
#-- SDCard Speed Fix
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
then
/system/xbin/echo "8192" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
fi;
#-- Unmount /sd-ext if it already mounted
busybox umount /sd-ext;
#-- Mount /data and move it to /sd-ext
busybox mount /data;
busybox mount --move /data /sd-ext;
#-- Mount sd-ext to /data ( You Will Get 1GB/2GB Internal Memory :D )
busybox mount -t ext4 -o noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/block/mmcblk0p2 /data;
busybox chown 1000:1000 /data;
busybox chmod 771 /data;
###[ SDEXT mmcblk0p2 STRICT ]###
# app, app_s, lib_s, app-private, data : should in /data (mmcblk0p2)
#
# ~ ALPHA02 - Add framework_s into (mmcblk0p2) strict
###
for i in framework_s app app_s lib_s app-private data;
do
#-- If Symlink in /data, delete it
if [ -h /data/$i ]
then
busybox rm /data/$i;
fi;
#-- If Directory Exists in /sd-ext, move it to /data
if [ -d /sd-ext/$i ]
then
busybox mv /sd-ext/$i /data/;
fi;
#-- If Directory Not Extst in /data, create it
if [ ! -d /data/$i ]
then
busybox mkdir /data/$i;
#-- Just Open All Permissions ;)
busybox chmod 0777 /data/$i;
fi;
#-- Now Create Symlink From /sd-ext to /data
if [ ! -h /sd-ext/$i ]
then
busybox ln -s /data/$i /sd-ext/$i;
fi;
done;
###[ INTERNAL mtdblock5 STRICT ]###
# For performance, dalvik-cache should be on /sd-ext
###
for i in dalvik-cache;
do
#-- If Symlink in /data, delete it
if [ -h /sd-ext/$i ]
then
busybox rm /sd-ext/$i;
fi;
#-- If Directory Exists in /sd-ext, move it to /data
if [ -d /data/$i ]
then
busybox mv /data/$i /sd-ext/;
fi;
#-- If Directory Not Extst in /data, create it
if [ ! -d /sd-ext/$i ]
then
busybox mkdir /sd-ext/$i;
#-- Just Open All Permissions ;)
busybox chmod 0777 /sd-ext/$i;
fi;
#-- Now Create Symlink From /sd-ext to /data
if [ ! -h /data/$i ]
then
busybox ln -s /sd-ext/$i /data/$i;
fi;
done;
###
# Now create symlink of the rest non Symlink Directories and Files on /sd-ext to /data
#
# ~ ALPHA02 - Fix ls to ls -a, it's ok, because we test -h for symlink
###
cd /sd-ext;
for i in `ls -a`;
do
if [ $i != ".." -a $i != "." ]
then
if [ ! -h /sd-ext/$i ]
then
if [ ! -h /data/$i ]
then
busybox ln -s /sd-ext/$i /data/$i;
fi;
fi;
fi;
done;
cd /;
###
# It should also need to create the rest non Symlink Directories and Files on /data to /sd-ext
# ~ ALPHA02 - Some Directory may be missing if we don't use it
###
cd /data;
for i in `ls -a`;
do
if [ $i != ".." -a $i != "." ]
then
if [ ! -h /data/$i ]
then
if [ ! -h /sd-ext/$i ]
then
busybox ln -s /data/$i /sd-ext/$i;
fi;
fi;
fi;
done;
cd /;
###
# Now Important Thing, is to move the com.htc* and com.android* data to /sd-ext (internal)
# For Good performance. So the system applications will run smooth.
#
# System application will read/write in Internal memory, and 3rd apps will run on sdcard
#
# Notice: Will be affected in 2nd boot :D, so Reboot the system after 1st boot...
###
#-- Prepare data_s in /sd-ext ( For system data )
if [ ! -d /sd-ext/data_s ]
then
busybox mkdir /sd-ext/data_s;
#-- Just Open All Permissions ;)
busybox chmod 0777 /sd-ext/data_s;
fi;
#-- Now Move All com.htc* and com.android* to Internal Memory
cd /data/data/;
for i in `ls -d com.htc* com.android*`;
do
#-- Only Non Symlink
if [ ! -h /data/data/$i ]
then
busybox mv /data/data/$i /sd-ext/data_s/;
fi;
done;
#-- Create Symlink of /data/data_s/* to /data/data/ (mmcblk0p2)
cd /sd-ext/data_s/
for i in `ls -d *`;
do
#-- Only If Symlink Not Exists
if [ ! -h /data/data/$i ]
then
busybox ln -s /sd-ext/data_s/$i /data/data/$i
fi;
done;
#-- Of Finished.... :D
INSTALL ZIP FROM RECOVERY?
Thanks to tezgomet -- Download Attachment by tezgomet >>
tezgomez said:
SD-EXT Mod - AMARULLZ DATA TO SD-EXT
from recovery
tested on BlissMod007_v03_a-STOCK
install rom and without rebooting install script
!!!WARNING!!!
INSTALL IT ON YOUR OWN RISK.
Click to expand...
Click to collapse
KNOW BUG
Titanium Backup - Restore the Application Data ( com.android*/com.htc* data )
NOT WORK ON YOUR ROM?, DON'T WORRY I WILL HELP YOU
This script (AD2SDX) alghoritm should be compatible in any android phone that support init.d, busybox and rooted, but it still depended on how the ROM place the files in your phone.
To make this script compatible with more ROM+PHONE, you can send me your file system information with this sh script (also available in attachment to download):
Code:
#!/bin/sh
echo "AD2SDX - Dump Logs...";
echo " by amarullz [at] yahoo [dot] com"
echo ""
echo "WARNING!!!"
echo "This script WILL dump an Informations About your Storages,"
echo "If you allow me to know your filesystem structures,"
echo "maybe I can help to improve AD2SDX Compatibility..."
echo ""
echo "This script WILL NOT dump any PHONE NUMBER, IMEI, DEVICE NAME"
echo "SERIAL NUMBER and ANY PERSONAL INFORMATIONS..."
echo ""
echo "But Please provide me your Device Name and ROM when you"
echo "submit it on AD2SDX Thread..."
echo ""
sleep 1
echo "Mounting data, sd-ext, and sdcard..."
mount /data
mount /sd-ext
mount /system
mount /sdcard
echo ""
echo "Dumping FileSystem..."
echo "DF" > /sdcard/ad2sdx-dump.txt
echo "==" >> /sdcard/ad2sdx-dump.txt
df >> /sdcard/ad2sdx-dump.txt
echo "" >> /sdcard/ad2sdx-dump.txt
echo "" >> /sdcard/ad2sdx-dump.txt
echo "Dumping File List on data files..."
cd /data
echo "LIST /data" >> /sdcard/ad2sdx-dump.txt
echo "==========" >> /sdcard/ad2sdx-dump.txt
ls -la >> /sdcard/ad2sdx-dump.txt
echo "" >> /sdcard/ad2sdx-dump.txt
echo "" >> /sdcard/ad2sdx-dump.txt
echo "Dumping File List on /sd-ext files..."
cd /sd-ext
echo "LIST /sd-ext" >> /sdcard/ad2sdx-dump.txt
echo "============" >> /sdcard/ad2sdx-dump.txt
ls -la >> /sdcard/ad2sdx-dump.txt
echo "" >> /sdcard/ad2sdx-dump.txt
echo "" >> /sdcard/ad2sdx-dump.txt
echo "Dumping File List on /system files..."
cd /system
echo "LIST /system" >> /sdcard/ad2sdx-dump.txt
echo "============" >> /sdcard/ad2sdx-dump.txt
ls -la >> /sdcard/ad2sdx-dump.txt
echo "" >> /sdcard/ad2sdx-dump.txt
echo "" >> /sdcard/ad2sdx-dump.txt
echo "Dumping File List on /system/etc/init.d files..."
cd /system/etc/init.d
echo "LIST init.d" >> /sdcard/ad2sdx-dump.txt
echo "===========" >> /sdcard/ad2sdx-dump.txt
ls -la >> /sdcard/ad2sdx-dump.txt
echo "" >> /sdcard/ad2sdx-dump.txt
echo "" >> /sdcard/ad2sdx-dump.txt
echo ""
echo "Finished... Thanks..."
HOW TO DUMP?
You should use adb, or Script Manager as root
Copy ad2sdx-dumpinfo.sh into your /sdcard/
(for ADB): Run "sh ad2sdx-dumpinfo.sh" in adb shell
Copy "/sdcard/ad2sdx-dump.txt" from your phone to your pc ( If you not trust me, you can review it before you send it to me )
Post comments + content of "/sdcard/ad2sdx-dump.txt" in this thread "use CODE or attachment"
COPY FILES WITH ADB
From PC to Phone
Code:
adb push c:\ad2sdx-dumpinfo.sh /sdcard/
From Phone to PC
Code:
adb pull /sdcard/ad2sdx-dump.txt c:\ad2sdx-dump.txt
SHELL
Code:
adb shell
* You are more advance than me about it ...
WARNING!!!
This script WILL dump an Informations About your Storages,
If you allow me to know your filesystem structures,
maybe I can help to improve AD2SDX Compatibility...
This script WILL NOT dump any PHONE NUMBER, IMEI, DEVICE NAME
SERIAL NUMBER and ANY PERSONAL INFORMATIONS...
USE IT YOUR OWN RISK!!!
But Please provide me your Device Name and ROM when you
submit it on AD2SDX Thread...
EXAMPLE DUMP FILE
Code:
DF
==
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 206664 64 206600 0% /dev
tmpfs 206664 0 206664 0% /mnt/asec
tmpfs 206664 4 206660 0% /mnt/asec/download
tmpfs 206664 0 206664 0% /mnt/obb
tmpfs 8192 0 8192 0% /app-cache
/dev/block/mtdblock3 148480 124428 24052 84% /system
/dev/block/mtdblock5 294528 152336 142192 52% /sd-ext
/dev/block/mtdblock4 5120 1228 3892 24% /cache
/dev/block/mmcblk0p2 1968876 547236 1321624 29% /data
/dev/block/vold/179:1
13656560 4473152 9183408 33% /mnt/sdcard
/dev/block/vold/179:1
13656560 4473152 9183408 33% /mnt/secure/asec
LIST /data
==========
drwxrwx--x 13 1000 1000 4096 Oct 20 15:16 .
drwxr-xr-x 16 0 0 0 Oct 20 15:16 ..
-rwxrwxrwx 1 0 0 1069 Oct 20 08:17 99SuperCharger.sh
lrwxrwxrwx 1 0 0 13 Oct 20 07:49 DxDrm -> /sd-ext/DxDrm
-rw-rw-rw- 1 0 0 14 Oct 20 08:17 SuperChargerAdj
-rw-rw-rw- 1 0 0 34 Oct 20 08:17 SuperChargerMinfree
-rw-rw-rw- 1 0 0 4 Oct 20 08:17 SuperChargerOptions
drwxrwxr-x 2 1000 1000 4096 Oct 20 13:32 anr
drwxrwx--x 2 1000 1000 4096 Oct 20 08:05 app
drwxrwx--x 2 1000 1000 4096 Oct 20 07:50 app-private
drwxr-xr-x 2 0 0 12288 Oct 20 08:20 app_s
drwx------ 5 1000 1000 4096 Oct 20 15:52 backup
lrwxrwxrwx 1 0 0 9 Oct 20 07:49 d -> /sd-ext/d
lrwxrwxrwx 1 0 0 20 Oct 20 07:49 dalvik-cache -> /sd-ext/dalvik-cache
drwxrwx--x 59 1000 1000 12288 Oct 20 08:22 data
lrwxrwxrwx 1 0 0 14 Oct 20 08:07 data_s -> /sd-ext/data_s
lrwxrwxrwx 1 0 0 17 Oct 20 07:49 dontpanic -> /sd-ext/dontpanic
drwxr-xr-x 2 0 0 4096 Oct 20 07:40 framework_s
lrwxrwxrwx 1 0 0 13 Oct 20 07:49 hosts -> /sd-ext/hosts
lrwxrwxrwx 1 0 0 13 Oct 20 07:49 htcfs -> /sd-ext/htcfs
drwxr-xr-x 2 0 0 4096 Oct 20 07:40 lib_s
lrwxrwxrwx 1 0 0 13 Oct 20 07:49 local -> /sd-ext/local
drwxr-xr-x 2 0 0 16384 Oct 20 07:49 lost+found
lrwxrwxrwx 1 0 0 12 Oct 20 07:49 misc -> /sd-ext/misc
lrwxrwxrwx 1 0 0 16 Oct 20 07:49 property -> /sd-ext/property
drwx------ 3 1000 1000 4096 Oct 20 07:50 secure
drwxrwxr-x 9 1000 1000 4096 Oct 21 01:00 system
-rw-r--r-- 1 0 0 3107 Oct 20 15:16 zipalign.log
LIST /sd-ext
============
drwxrwx--x 1 1000 1000 2048 Oct 20 07:38 .
drwxr-xr-x 16 0 0 0 Oct 20 15:16 ..
lrwxrwxrwx 1 0 0 23 Oct 20 08:22 99SuperCharger.sh -> /data/99SuperCharger.sh
dr-xr-xr-x 1 0 0 2048 Oct 20 07:49 DxDrm
lrwxrwxrwx 1 0 0 21 Oct 20 08:22 SuperChargerAdj -> /data/SuperChargerAdj
lrwxrwxrwx 1 0 0 25 Oct 20 08:22 SuperChargerMinfree -> /data/SuperChargerMinfree
lrwxrwxrwx 1 0 0 25 Oct 20 08:22 SuperChargerOptions -> /data/SuperChargerOptions
lrwxrwxrwx 1 0 0 9 Oct 20 08:07 anr -> /data/anr
lrwxrwxrwx 1 0 0 9 Oct 20 07:49 app -> /data/app
lrwxrwxrwx 1 0 0 17 Oct 20 07:49 app-private -> /data/app-private
lrwxrwxrwx 1 0 0 11 Oct 20 07:49 app_s -> /data/app_s
lrwxrwxrwx 1 0 0 12 Oct 20 08:07 backup -> /data/backup
drwxr-xr-x 16 0 0 0 Jan 1 1970 d
drwxrwx--x 1 1000 1000 2048 Oct 20 07:49 dalvik-cache
lrwxrwxrwx 1 0 0 10 Oct 20 07:49 data -> /data/data
drwxrwxrwx 1 0 0 2048 Oct 20 07:49 data_s
drwxr-x--- 1 0 1007 2048 Oct 20 07:49 dontpanic
lrwxrwxrwx 1 0 0 11 Oct 20 07:49 drm -> /data/local
lrwxrwxrwx 1 0 0 17 Oct 20 07:49 framework_s -> /data/framework_s
-rw-r--r-- 1 0 0 708302 Aug 1 2008 hosts
drwxr-xr-x 16 0 0 0 Oct 20 15:16 htcfs
lrwxrwxrwx 1 0 0 11 Oct 20 07:49 lib_s -> /data/lib_s
drwxrwx--x 1 2000 2000 2048 Oct 20 07:49 local
drwxrwx--- 1 0 0 2048 Oct 20 07:49 lost+found
drwxrwx--t 1 1000 9998 2048 Oct 20 15:16 misc
drwx------ 1 0 0 2048 Oct 20 21:54 property
lrwxrwxrwx 1 0 0 12 Oct 20 08:07 secure -> /data/secure
lrwxrwxrwx 1 0 0 12 Oct 20 08:07 system -> /data/system
lrwxrwxrwx 1 0 0 18 Oct 20 08:07 zipalign.log -> /data/zipalign.log
LIST /system
============
drwxr-xr-x 1 0 0 2048 Oct 20 07:41 .
drwxr-xr-x 16 0 0 0 Oct 20 15:16 ..
lrwxrwxrwx 1 0 0 13 Oct 20 07:41 app -> /sd-ext/app_s
drwxr-xr-x 1 0 2000 2048 Oct 20 07:41 bin
-rw-r--r-- 1 0 0 7966 Oct 20 08:17 build.prop
-rw-r--r-- 1 0 0 7437 Oct 20 08:17 build.prop.unsuper
drwxr-xr-x 1 0 0 2048 Oct 20 07:40 customize
drwxr-xr-x 1 0 0 2048 Oct 20 07:41 etc
drwxr-xr-x 1 0 0 2048 Oct 20 07:40 fonts
lrwxrwxrwx 1 0 0 19 Oct 20 07:41 framework -> /sd-ext/framework_s
drwxr-xr-x 1 0 0 2048 Oct 20 07:47 lib
drwxr-xr-x 1 0 0 2048 Oct 20 07:40 lost+found
drwxr-xr-x 1 0 0 2048 Oct 20 07:41 media
drwxr-xr-x 1 0 0 2048 Oct 20 07:41 usr
drwxr-xr-x 1 0 2000 2048 Oct 20 07:41 xbin
LIST init.d
===========
drwxr-xr-x 1 0 2000 2048 Oct 20 07:47 .
drwxr-xr-x 1 0 0 2048 Oct 20 07:41 ..
-rwxr-xr-x 1 0 0 446 Oct 20 13:36 00aroc
-rwxr-xr-x 1 0 2000 1167 Aug 1 2008 02ramtweaks
-rwxrwxrwx 1 0 0 4151 Oct 20 07:47 40a2sd
-rwxr-xr-x 1 0 2000 1938 Aug 1 2008 77tweaks
-rwxr-xr-x 1 0 2000 1499 Aug 1 2008 97zipalign
-rwxrwxrwx 1 0 0 1097 Oct 20 08:17 99SuperCharger
-rwxr-xr-x 1 0 2000 176 Aug 1 2008 99complete
Great!!!
Working with Leo on HyperDroid-CM7-v5.3.0.
But weired behavior: Titanium Backup crashes after every app installation immediately.
Edit: After third reboot Titanium doesn't crash any more!
This script runs like hell....wow!
---------- Post added at 07:27 PM ---------- Previous post was at 06:36 PM ----------
Strange...Titanium only crashes if I try to install apps+data...but not if I only install apps.
Waiting to install, want to see a few more guinea pigs first
It mount only ext4 partition?...
Can you add support for ext2 or ext3 partitions?
Ok, I evaluate first on my sga with xm7.1
Nice to see you again amarullz.
EXT3,2 ??
You can edit this line:
Code:
busybox mount -t ext4 -o noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/block/mmcblk0p2 /data;
busybox chown 1000:1000 /data;
busybox chmod 771 /data;
icke said:
Great!!!
Working with Leo on HyperDroid-CM7-v5.3.0.
But weired behavior: Titanium Backup crashes after every app installation immediately.
Edit: After third reboot Titanium doesn't crash any more!
This script runs like hell....wow!
---------- Post added at 07:27 PM ---------- Previous post was at 06:36 PM ----------
Strange...Titanium only crashes if I try to install apps+data...but not if I only install apps.
Click to expand...
Click to collapse
Ok, I will try, and look what Titanium Backup Do (may be the error occur when it remove/change com.android* or com.htc* data files)...
-- TIPS --
May Be try this: If you want to restore system applications data (com.android* & com.htc*), Do that in the first boot (clean flash), so the com.android* & com.htc* still in sdcard (not symlinked), after you reboot it, the mod will automatically move it to Internal Memory...
cause me bootloops
jukalo said:
cause me bootloops
Click to expand...
Click to collapse
What ROM & Device?... make sure you do the clean flash, then delete a2sd first
I am using a sense froyo rom 2.38 with kernel infinity on my device and I did a clean flash my device is wildfire even replace the ext4 to ext3 as you be explained in a above post and still the same problem
Hi Amarullz
To my understanding this is simply exchange the sd-ext becomes data partition and data partition now becomes sd-ext.
The script will move all sd-ext contents to data partition and data partition contents will mve to sd-ext. This will limit the size of sd-ext contents (not the size of sd-ext) max at data partition size. When the size of sd-ext contents is more than data partition size, the phone will not boot pass the splash screen or maybe bootloop.
Is there anyway we can mod the script to move only specific folders on sd-ext to data partition ? For example I have app_s, lib_s, frameworks_s and font_s but I want to move only app_s & lib_s to data partition and leave the rest on the sd-ext. I am totally a noob when it comes to scripting.
ckpv5 said:
Hi Amarullz
To my understanding this is simply exchange the sd-ext becomes data partition and data partition now becomes sd-ext.
The script will move all sd-ext contents to data partition and data partition contents will mve to sd-ext. This will limit the size of sd-ext contents (not the size of sd-ext) max at data partition size. When the size of sd-ext contents is more than data partition size, the phone will not boot pass the splash screen or maybe bootloop.
Is there anyway we can mod the script to move only specific folders on sd-ext to data partition ? For example I have app_s, lib_s, frameworks_s and font_s but I want to move only app_s & lib_s to data partition and leave the rest on the sd-ext. I am totally a noob when it comes to scripting.
Click to expand...
Click to collapse
No, I don't move all sd-ext data into /data partition. Actually:
1. Move "mount point" of /data to /sd-ext
2. Mount mmcblk0p2 (commonly mounted on /sd-ext) to /data
All Data remain on mmcblk0p2 but symlinked to /sd-ext for app2sd compatibility except for com.android*, com.htc* and dalvik-cache.
But I know it may not work on all device/rom yet ( still need to fix compatibility ), because something like this maybe happened:
My Script blacklisted "app, app_s, lib_s, app-private, data" in Internal Storage (will move it into mmcblk0p2), If ROM used another directory name, example for app_s is .systemapp, system won't boot, because /system/app symlinked to /sd-ext/.systemapp and there is no /sd-ext/.systemapp because the /sd-ext was originally (/data) [ /system/app should be pointed to /data/.systemapp or /sd-ext/.systemapp pointed to /data/.systemapp ] - Understand what I mean? .
This area on script will strict the "app, app_s, lib_s, app-private, data" into mmcblk0p2 ( in original data only symlink )
Code:
###
# app, app_s, lib_s, app-private, data : should in /data (mmcblk0p2)
###
for i in app app_s lib_s app-private data;
do
#-- If Symlink in /data, delete it
if [ -h /data/$i ]
then
busybox rm /data/$i;
fi;
#-- If Directory Exists in /sd-ext, move it to /data
if [ -d /sd-ext/$i ]
then
busybox mv /sd-ext/$i /data/;
fi;
#-- If Directory Not Extst in /data, create it
if [ ! -d /data/$i ]
then
busybox mkdir /data/$i;
#-- Just Open All Permissions ;)
busybox chmod 0777 /data/$i;
fi;
#-- Now Create Symlink From /sd-ext to /data
if [ ! -h /sd-ext/$i ]
then
busybox ln -s /data/$i /sd-ext/$i;
fi;
done;
And this area will strict "dalvik-cache" in Internal Memory
Code:
for i in dalvik-cache;
do
#-- If Symlink in /data, delete it
if [ -h /sd-ext/$i ]
then
busybox rm /sd-ext/$i;
fi;
#-- If Directory Exists in /sd-ext, move it to /data
if [ -d /data/$i ]
then
busybox mv /data/$i /sd-ext/;
fi;
#-- If Directory Not Extst in /data, create it
if [ ! -d /sd-ext/$i ]
then
busybox mkdir /sd-ext/$i;
#-- Just Open All Permissions ;)
busybox chmod 0777 /sd-ext/$i;
fi;
#-- Now Create Symlink From /sd-ext to /data
if [ ! -h /data/$i ]
then
busybox ln -s /sd-ext/$i /data/$i;
fi;
done;
You can modify this line for your needs:
for i in app app_s lib_s app-private data;
for i in dalvik-cache;
UPDATE ALPHA 02, WITH Compatibility Fix, Add strict framework_s into mmcblk0p2, + dot files fix (.systemapp)
492 free space on internal memory!
I tried this mod on RunnyMede V3 (with coolexes move dalvik to sd script) on a working system (didn't install from scratch) and it works.
Some "problems" I noticed:
- After restart had to resync everything, from contacts, Calendar to fb shortcuts in contacts
- All htc widgets on homescreens were gone (inclusive clock)
- the biggest one: there are no more shortcuts on lockscreen. Try to get them back from personalisation menu, no chance!
I think it should be tried with fresh install. Maybe if I'll find the time I'll try it.
Anyway. Thanks for the script and keep up the work!
flash it from recovery!!!!
Amarullz plz could you make it to flash it from recovery??? PLz it will be gourgeos!!!
Klewe said:
492 free space on internal memory!
I tried this mod on RunnyMede V3 (with coolexes move dalvik to sd script) on a working system (didn't install from scratch) and it works.
Some "problems" I noticed:
- After restart had to resync everything, from contacts, Calendar to fb shortcuts in contacts
- All htc widgets on homescreens were gone (inclusive clock)
- the biggest one: there are no more shortcuts on lockscreen. Try to get them back from personalisation menu, no chance!
I think it should be tried with fresh install. Maybe if I'll find the time I'll try it.
Anyway. Thanks for the script and keep up the work!
Click to expand...
Click to collapse
Try clean flash, I not test it on already running system yet.
About zip install on recovery... I will learn it first... cause I am newbie in Android
751 mb free space internal memory!!
On Blissy mod007 Rom fresh install with stock hboot i have 123 mb internal memory, then with root explorer i erase 40a2sd from system/etc/init.d and i copy you`re 40a2sdx and reboot.After reboot i have 751 mb free space on internal memory, but no icons on lockscreen and no widgets at all!!!
Appreciate a lot you`re work man!!!TNX a lot!!
blissmod007 v03--->774mb internal storage
I used to use data2w..
But i will give it a shot..
Sent from my HTC Desire using xda premium
SD-EXT Mod - AMARULLZ DATA TO SD-EXT
SD-EXT Mod - AMARULLZ DATA TO SD-EXT
from recovery
tested on BlissMod007_v03_a-STOCK
install rom and without rebooting install script
!!!WARNING!!!
INSTALL IT ON YOUR OWN RISK.
Hey,
this is a very nice and good script..much faster as data2ext with sense 3.5 roms..
i have only one problem..i get a wifi error with this script..(tried on 2 different roms...also the same if i change the file in rom.zip and flash it)
Maybe you have a tip for me..?!? (because its strange..not get this error with data2ext or a2sd)
otherwise really good work
with kind regards...Alex
Hey, every time i try to flash any rom to my htc evo 3d phone through CMR, it aborts with an error ( see Bottom of Script in Red )
"Starting recovery on Thu Jan 26 19:39:59 2012
can't open /dev/tty0: No such file or directory
framebuffer: fd 3 (540 x 960)
ClockworkMod Recovery v5.0.2.0
recovery filesystem table
=========================
0 /tmp ramdisk (null) (null)
1 /boot emmc /dev/block/mmcblk0p20 (null)
2 /recovery emmc /dev/block/mmcblk0p21 (null)
3 /system ext4 /dev/block/mmcblk0p22 (null)
4 /data ext4 /dev/block/mmcblk0p23 (null)
5 /cache ext4 /dev/block/mmcblk0p24 (null)
6 /misc emmc /dev/block/mmcblk0p31 (null)
7 /sd-ext ext4 /dev/block/mmcblk1p2 (null)
8 /sdcard vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1
I:Completed outputting fstab.
Irocessing arguments.
I:Checking arguments.
I:device_recovery_start()
Command: "/sbin/recovery"
ro.secure=0
ro.allow.mock.location=1
ro.debuggable=1
persist.service.adb.enable=1
ro.build.id=GINGERBREAD
ro.build.display.id=full_shooteru-eng 2.3.5 GINGERBREAD eng.koush.20110905.114634 test-keys
ro.build.version.incremental=eng.koush.20110905.114634
ro.build.version.sdk=10
ro.build.version.codename=REL
ro.build.version.release=2.3.5
ro.build.date=Mon Sep 5 11:46:56 PDT 2011
ro.build.date.utc=0
ro.build.type=eng
ro.build.user=koush
ro.build.host=Koushik-Lion.local
ro.build.tags=test-keys
ro.product.model=Full Android on Emulator
ro.product.brand=Android
ro.product.name=full_shooteru
ro.product.device=shooteru
ro.product.board=shooteru
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.manufacturer=unknown
ro.product.locale.language=en
ro.product.locale.region=US
ro.wifi.channels=
ro.board.platform=msm8660
ro.build.product=shooteru
ro.build.description=full_shooteru-eng 2.3.5 GINGERBREAD eng.koush.20110905.114634 test-keys
ro.build.fingerprint=Android/full_shooteru/shooteru:2.3.5/GINGERBREAD/eng.koush.20110905.114634:eng/test-keys
keyguard.no_require_sim=true
ro.ril.hsxpa=1
ro.ril.gprsclass=10
ro.config.notification_sound=OnTheHunt.ogg
ro.config.alarm_alert=Alarm_Classic.ogg
ro.kernel.android.checkjni=1
ro.setupwizard.mode=OPTIONAL
net.bt.name=Android
net.change=net.bt.name
dalvik.vm.stack-trace-file=/data/anr/traces.txt
ro.factorytest=0
ro.serialno=HT17VV300540
ro.bootmode=recovery
ro.baseband=10.13.9020.08_2M
ro.carrier=Rogers
ro.bootloader=1.49.1107
ro.hardware=shooter_u
ro.revision=1
init.svc.recovery=running
init.svc.adbd=running
I:Checking for extendedcommand...
I:Running extendedcommand...
Waiting for SD Card to mount (20s)
SD Card mounted...
Verifying SD Card marker...
8752a05edf8911386bec6dc8d2988bd2
8752a05edf8911386bec6dc8d2988bd2
I:Running script:
I:
ui_print("ROM Manager Version 4.8.1.4");
ui_print("January 26, 2012");
ui_print("Preparing to install ROM...");
run_program("/cache/dowipedalvikcache.sh");
assert(install_zip("/sdcard/ics-deck-e3d-pre-alpha1.zip"));
parse returned 0; 0 errors encountered
ROM Manager Version 4.8.1.4
January 26, 2012
Preparing to install ROM...
about to run program [/cache/dowipedalvikcache.sh] with 1 args
mount: mounting /dev/block/mmcblk0p24 on /cache failed: Device or resource busy
mount: mounting /dev/block/mmcblk1p2 on /sd-ext failed: No such file or directory
umount: can't umount /sd-ext: Invalid argument
run_program: child exited with status 1
-- Installing: /sdcard/ics-deck-e3d-pre-alpha1.zip
Finding update package...
I:Update location: /sdcard/ics-deck-e3d-pre-alpha1.zip
Opening update package...
Installing update...
script aborted: assert failed: getprop("ro.product.device") == "shooter" || getprop("ro.build.product") == "shooter"
assert failed: getprop("ro.product.device") == "shooter" || getprop("ro.build.product") == "shooter"
E:Error in /sdcard/ics-deck-e3d-pre-alpha1.zip
(Status 7)
Installation aborted.
result was NULL, message is: assert failed: install_zip("/sdcard/ics-deck-e3d-pre-alpha1.zip")
If any one can shine some light on my situation it would be great...
Thansk
Hahaha, I laugh at my self for this one.
The roms I was trying to install were not meant for my "model" phone.. CDMA & GSM.
I have a GSM model and not a CDMA, I was trying to install a CDMA on a GSM.
Wow I can't believe I could be that stupid...
Lol. Thanks for all the help.
Sent from my HTC EVO 3D X515m using XDA App
As of yesterday I am unable to flash any roms through recovery or from manager. Below is the content of the recovery.log. if I am reading it correctly the recovery thinks I have the crespo and not crespo4g. Any ideas?
W:Unable to get recovery.fstab info for /datadata during fstab generation! W:Unable to get recovery.fstab info for /emmc during fstab generation! W:Unable to get recovery.fstab info for /sd-ext during fstab generation! I:Completed outputting fstab. Irocessing arguments. mtd: successfully wrote block at 0 I:Set boot command "boot-recovery" I:Checking arguments. I:device_recovery_start() Command: "/sbin/recovery"
ro.secure=1 ro.allow.mock.location=0 ro.debuggable=1 persist.sys.usb.config=mass_storage,adb ro.build.id=MR1 ro.build.display.id=full_crespo-userdebug 4.0.3 MR1 eng.koush.20120131.000848 test-keys ro.build.version.incremental=eng.koush.20120131.000848 ro.build.version.sdk=15 ro.build.version.codename=REL ro.build.version.release=4.0.3 ro.build.date=Tue Jan 31 00:09:11 PST 2012 ro.build.date.utc=0 ro.build.type=userdebug ro.build.user=koush ro.build.host=Koushik-Lion.local ro.build.tags=test-keys ro.product.model=Full Android on Crespo ro.product.brand=Android ro.product.name=full_crespo ro.product.device=crespo ro.product.board=herring ro.product.cpu.abi=armeabi-v7a ro.product.cpu.abi2=armeabi ro.product.manufacturer=unknown ro.product.locale.language=en ro.product.locale.region=US ro.wifi.channels= ro.board.platform=s5pc110 ro.build.product=crespo ro.build.description=full_crespo-userdebug 4.0.3 MR1 eng.koush.20120131.000848 test-keys ro.build.fingerprint=Android/full_crespo/crespo:4.0.3/MR1/eng.koush.20120131.000848:userdebug/test-keys ro.build.characteristics=nosdcard ro.cm.device=crespo rild.libpath=/vendor/lib/libsec-ril.so rild.libargs=-d /dev/ttyS0 ro.sf.lcd_density=240 keyguard.no_require_sim=true ro.com.android.dateformat=MM-dd-yyyy ro.config.ringtone=Ring_Synth_04.ogg ro.config.notification_sound=pixiedust.ogg ro.config.alarm_alert=Alarm_Classic.ogg ro.opengles.version=131072 wifi.interface=wlan0 wifi.supplicant_scan_interval=15 dalvik.vm.heapstartsize=5m dalvik.vm.heapgrowthlimit=48m dalvik.vm.heapsize=128m dalvik.vm.lockprof.threshold=500 dalvik.vm.dexopt-flags=m=y net.bt.name=Android net.change=net.bt.name dalvik.vm.stack-trace-file=/data/anr/traces.txt ro.factorytest=0 ro.serialno=3230F441278B00EC ro.bootmode=unknown ro.baseband=D720SPRLC1 ro.carrier=SPR ro.bootloader=D720SPRKC5 ro.hardware=herring ro.revision=34 ro.emmc=0 init.svc.recovery=running service.adb.root=1 init.svc.adbd=running
I:Checking for extendedcommand... I:Running extendedcommand... Waiting for SD Card to mount (20s) SD Card mounted... Verifying SD Card marker... 04c0c146802dbcc99a47ee72e9f95c63 I:Running script: I: ui_print("ROM Manager Version 5.0.0.6"); ui_print("April 19, 2012"); ui_print("Preparing to install ROM..."); run_program("/cache/dowipedalvikcache.sh"); format("/cache"); format("/data"); format("/sd-ext"); assert(install_zip("/sdcard/download/aokp_crespo4g_build-32-2.zip"));
parse returned 0; 0 errors encountered ROM Manager Version 5.0.0.6 April 19, 2012 Preparing to install ROM... about to run program [/cache/dowipedalvikcache.sh] with 1 args mount: mounting /dev/block/mtdblock4 on /cache failed: Device or resource busy mount: can't find /sd-ext in /etc/fstab umount: can't umount /sd-ext: Invalid argument run_program: child exited with status 1 Formatting /cache... mtd: not erasing bad block at 0x11b80000 Formatting /data... Creating filesystem with parameters: Size: 1073741824 Block size: 4096 Blocks per group: 32768 Inodes per group: 8192 Inode size: 256 Journal blocks: 4096 Label: Blocks: 262144 Block groups: 8 Reserved block group size: 63 Created filesystem with 11/65536 inodes and 8536/262144 blocks warning: wipe_block_device: Discard failed
Formatting /sd-ext...
-- Installing: /sdcard/download/aokp_crespo4g_build-32-2.zip mtd: successfully wrote block at 0 I:Set boot command "boot-recovery" Finding update package... I:Update location: /sdcard/download/aokp_crespo4g_build-32-2.zip Opening update package... Installing update... script aborted: assert failed: getprop("ro.product.device") == "crespo4g" || getprop("ro.build.product") == "crespo4g" assert failed: getprop("ro.product.device") == "crespo4g" || getprop("ro.build.product") == "crespo4g" E:Error in /sdcard/download/aokp_crespo4g_build-32-2.zip (Status 7) Installation aborted. result was NULL, message is: assert failed: install_zip("/sdcard/download/aokp_crespo4g_build-32-2.zip")
Sent from my Nexus S 4G using Tapatalk
your nexsus ha been identified :
ro.product.device=crespo
and when the install script start, it compare its own value :
ro.product.device=crespo4G
to the one above
and there an error
The problem is why we have ro.product.device=crespo at the beginning of the log ?
For me the problem is : your nexus is identified as a Crespo and you try to install a Crespo4G
Very strange !
If this function "ro.product.device" is used by recovery, maybe you could try to reinstall the recovery ?
You should flash a custom recovery and ROM corresponding to your hardware version. The version can be found beneath your battery on a sticker.
That is what is weird. I have had a custom recovery and roms since I bought my phone last year. This just started happening yesterday. Haven't flashed a recovery or new from for a couple if weeks.
Sent from my Nexus S 4G using Tapatalk
Update
Reflashed my recovery and now I can flash rooms just fine. Strange.
Sent from my Nexus S 4G using Tapatalk
Hello guys, i am a new android user. My device (Huawei T8620) running on Android ICS suddenly power off and could not boot back. When i tried updating the firmware it shows error dump txt file
Starting recovery on Wed Jan 4 12:45:22 2012
framebuffer: fd 4 (320 x 480)
ioctl(): blank: Invalid argument
ioctl(): blank: Invalid argument
app_info item=board_id content=MTK6515_T8620.VerC
BoardType=MTK6515_T8620
recovery filesystem table
=========================
0 /tmp ramdisk (null) (null) 0
1 /boot emmc boot (null) 0
2 /cache ext4 /dev/block/mmcblk0p2 (null) 0
3 /data ext4 /dev/block/mmcblk0p3 (null) 0
4 /misc emmc misc (null) 0
5 /recovery emmc recovery (null) 0
6 /sdcard vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 0
7 /system ext4 /dev/block/mmcblk0p6 (null) 0
8 /Insdcard vfat /dev/block/mmcblk0p4 (null) 0
I:Boot command: UPDATE:SD
E:failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/command
I:no boot messages
I:check otaupdate is done clear boot message
open /data/recovery/command failed
Entry Force mode SD upgrade........................................... ..........
battery voltage is 4106,that's OK!
sdcard is mounted
Init dload file num=0,filename=/sdcard/dload/update.app
file -/sdcard/dload/update.app size=ffffffff bytes.
Open /sdcard/dload/update.app failed
Init dload file num=1,filename=/sdcard/dload/update_cust.app
file -/sdcard/dload/update_cust.app size=ffffffff bytes.
Open /sdcard/dload/update_cust.app failed
no APP files found in SD card
Exit Force mode SD upgrade........................................... ...........
E:failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/log
E:failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_log
E:Can't open /cache/recovery/last_log
E:failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_install
E:Can't open /cache/recovery/last_install
E:failed to mount /cache (Invalid argument)
W:Can't unlink /cache/recovery/command
Could you please help me out guys.. i'm stuck! Thanks..and of course my phone is rooted.
SOLVED
Resolved and Running on stock Rom ICS 4.0.3 again.