Related
Here is the kernel with yaffs2 and MTD block support, I am missing some mtd util tools like nandwrite so i cannot continue. Those that have the tools like mkyaffs2image, nandwrite, flash_eraseall can try to create an image and mount it
here are the steps that i think should work:
# mknod /dev/mtd0 c 90 0
# flash_eraseall /dev/mtd0
# mkyaffs2image /data/data yaffs2.img
# nandwrite -p /dev/mtd0 yaffs2.img
# mkdir /data/data2
# mount -t yaffs2 /dev/mtdblock0 /data/data2
If you have the tools, please attach so we can continue.. Its getting late so I am going to bed, have fun
Download
yaffs2_support.tar
Oh my god! I was just about to post similar findings, what a coincidence!
I just had compiled a kernel with yaffs2 support. My idea was to modify /init.rc in the kernel to mount the partitions with yaffs2 instead of rfs. Problem: we can't just change the filesystem without backing up and restoring all the files inside. My idea was to do that inside the recovery. Mount a mountpoint, backup with tar to /sdcard, unmount, format with dd (in theory a partition filled with 0's is ok for yaffs2), mount again with yaffs2 and restore from tar.
I'm stuck at the point that I can't seem able to mount any partition with yaffs2 previously formatted (with /system/xbin/busybox dd if=/dev/zero of=/dev/block/stl10). If I mount (/system/xbin/busybox mount -t yaffs2 /dev/block/stl10 /dbdata) there is always an "Invalid argument" error. It happens with /dev/block/stl*, /dev/block/bml* and /dev/block/mmcblk*
I'm no kernel expert, neither I know a lot about yaffs2, but I think I read you can't mount a yaffs2 partition anywhere, it has to be an MTD flash device.
Anyway, I'm going to try with the tools you said. Wish me luck.
Thanks for your work rasdeep! Is it only YAFFS2 and MTD support that you added? Because the kernel already had support for EXT2 and EXT3.
darksnarfer said:
I think I read you can't mount a yaffs2 partition anywhere, it has to be an MTD flash device.
Click to expand...
Click to collapse
Does the kernel that rasdeep posted load the existng flash devices/partitions as MTD devices?
I think as a start you only have to worry about formatting the /dev/block/mmcblk0p2 device which is mapped to the /data directory. With the new lag fix we are only moving directories stored in /data and that is what gives a big performance improvement. RyanZA did tests and found that the /dbdata partition was already quite fast and I don't think we have to worry about the /system partition etc. because we don't really write to them.
I think after a new firmware flash the /dev/block/mmcblk0p2 (mounted as /data) will be safe to format into YAFFS2 without loosing anything important.
I think these are the steps we can do:
1. Flash new firmware with repartition option on to erase everything.
2. Boot into recovery and format /dev/block/mmcblk0p2 as YAFFS2 filesystem.
3. Copy on new a init.rc script which will mount /dev/block/mmcblk0p2 to /data as a YAFFS2 filesystem and not a RFS filesytem to get much faster speeds.
bub181 said:
Does the kernel that rasdeep posted load the existng flash devices/partitions as MTD devices?
Click to expand...
Click to collapse
Just checked, there isn't any /dev/block/mtd* so I guess the kernel still can't see them as mtd.
/data is on the internal SD not in NAND so will we be able to use yaffs2 at all? I was working on formatting to EXT4 and adding the init.rc to match as well as compiling with EXT4 support, but if yaffs2 works, I'm fine with that.
modifying the init.rc is secondary because that is easy.. the main problem now is to be able to manually setup yaffs2 to mount properly.. if everything works like it should, init.rc can be change in matter of seconds
its funny now u said mtd not found.. i know we can mknod /dev/mtd* but there should be /dev/mtdblock* when booting with kernel right? hmm.. something to investigate further..
keep suggestions and finding coming, we may hit something that i've missed
problem is im lacking those tools that will do write to flash directly.. for example nandwrite.. anyone has that can share so i can try more stuff?
also, are my steps for "preparing" yaffs2 partitions/image correct? if anyone familiar with yaffs, please give some insight
raspdeep said:
modifying the init.rc is secondary because that is easy..
Click to expand...
Click to collapse
Do you need to recompile the kernel to modify the init.rc? If not could you post some instructions on how to do it please? I would like to try some things in there before /data gets mounted as a RFS filesystem.
bub181 said:
Do you need to recompile the kernel to modify the init.rc? If not could you post some instructions on how to do it please? I would like to try some things in there before /data gets mounted as a RFS filesystem.
Click to expand...
Click to collapse
i'm afraid so for now until someone found a way to extract the initramfs from later kernel and restore it back after modification..
I think it would be easier to start out with EXT2 since we can easily format that. Just as a proof of concept. I'm planning to do so tonight. Then I'll add support for EXT4 formatting and try that.
raspdeep said:
problem is im lacking those tools that will do write to flash directly.. for example nandwrite.. anyone has that can share so i can try more stuff?
Click to expand...
Click to collapse
Have you seen these pages rasdeep? They seem to describe how to create the YAFFS filesystem. Also, are there any /dev/mtdblock* devices using the kernel that you created? According to what I read elsewhere it is supposed to create both /dev/mtd* and /dev/mtdblock*. I think we have to use /dev/mtdblock* to create the new filesystem.
http://processors.wiki.ti.com/index.php/Create_a_YAFFS_Target_Image
http://processors.wiki.ti.com/index.php/MTD_Utilities
http://processors.wiki.ti.com/index.php/Put_YAFFS_Image_to_Flash
Also, I know that the Nexus One uses YAFFS2 for its internal filesystem. Maybe someone has worked out a way to write a new image file for that and we can use what they have learnt?
Can we potentially use this kernal (with the right tools) to format the NAND in YAFFS2 instead of RFS? Then still have way of flashing firmware onto it?
If so, that would be awesome and it would seem to have the least draw backs.
Currently the A2SD lag fix requires an external microsd card, and the one click lag fix, mounts a EXT2 image ontop of the RFS NAND, and that could drastically affect NAND life.
This is great !!!
Thank you raspdeep and all the devs here, this is one step closer to a stable kernel and a permanent genuine solution for the lag problem as far as a n00b like me understands
cheers !
Daemos said:
Can we potentially use this kernal (with the right tools) to format the NAND in YAFFS2 instead of RFS? Then still have way of flashing firmware onto it?
If so, that would be awesome and it would seem to have the least draw backs.
Click to expand...
Click to collapse
Not if we can't mount the NAND as a MTD-device instead of STL-device.
Daemos said:
Currently the A2SD lag fix requires an external microsd card, and the one click lag fix, mounts a EXT2 image ontop of the RFS NAND, and that could drastically affect NAND life.
Click to expand...
Click to collapse
Say what? /data/ is mounted on the internal SSD, not the NAND. /dbdata/ is however mounted on the NAND. Just do a df -h and you can see all the mountpoints.
Also, mounting and using a ext2-image that reside on an rfs-partition will not damage your drive. The rfs filesystem is still the one used to store the image itself (the ones and the zeros), even though you write it inside an image that uses another filesystem.
I stumbled upon these documents while Googling for STL-devices:
http://www.samsung.com/global/busin...y/downloads/LinuStoreII_GPL Compliance_10.pdf
http://www.samsung.com/global/busin...ionmemory/downloads/RFS_130_Porting_Guide.pdf
I haven't had the time to read them through yet. But if there's a porting guide, there must be a way to reverse it
Go go reverse engineers!
Is it really necessary to format the NAND with another filesystem? /dbdata seems fast enough as it is. Wouldn't it be enough (and easier?) to only convert the internal SD to yaffs2?
Quote from someone that knows a lot more than I do:
yaffs2 won't work on a sdcard
Click to expand...
Click to collapse
http://twitter.com/wesgarner/status/20805997718
So right now we have /data that is mounted in the second partition of the internal sdcard (mmcblk0p2), where all the critical files are stored (data, dalvik-cache, etc..) but we can't use yaffs2 there because it's not MTD.
We could, however, format and mount the other partitions (/system, /dbdata, /cache, etc...) with yaffs2, but that might not help because there isn't many heavy read/write there. And we should figure out how to make the kernel see them as /dev/block/mtdblock* instead of /dev/block/stl*.
rasdeep, can you share the .config for the kernel you used? I managed to get some mtd devices (atleast in /proc/mtd) but they were virtual devices. Maybe we need some more options enabled in the kernel.
Also, anybody knows why there are /dev/block/stl* and /dev/block/bml* they seem the same though.
darksnarfer said:
Also, anybody knows why there are /dev/block/stl* and /dev/block/bml* they seem the same though.
Click to expand...
Click to collapse
According to http://www.samsung.com/global/busin...ducts/fusionmemory/Products_XSR_Brochure.html
STL and BML are independent layers for managing I/O to the NAND devices
STL manages the sector translations while BML manages the invalid blocks (whatever that means)
Did any of you notice that in init.rc there are many references to yaffs2 ? Perhaps in engineering Samsung did use it ?
Chainfire said:
Did any of you notice that in init.rc there are many references to yaffs2 ? Perhaps in engineering Samsung did use it ?
Click to expand...
Click to collapse
Yeah, I think they are just android standard (maybe they took them from a template) and commented to use their better(?) filesystem.
darksnarfer said:
Quote from someone that knows a lot more than I do:
http://twitter.com/wesgarner/status/20805997718
So right now we have /data that is mounted in the second partition of the internal sdcard (mmcblk0p2), where all the critical files are stored (data, dalvik-cache, etc..) but we can't use yaffs2 there because it's not MTD.
We could, however, format and mount the other partitions (/system, /dbdata, /cache, etc...) with yaffs2, but that might not help because there isn't many heavy read/write there. And we should figure out how to make the kernel see them as /dev/block/mtdblock* instead of /dev/block/stl*.
rasdeep, can you share the .config for the kernel you used? I managed to get some mtd devices (atleast in /proc/mtd) but they were virtual devices. Maybe we need some more options enabled in the kernel.
Also, anybody knows why there are /dev/block/stl* and /dev/block/bml* they seem the same though.
Click to expand...
Click to collapse
Ok, so what filesystem does the internal SD use currently? Would it help if we change that to EXT4? That would emulate the current mimocan fix, but without having to use an external SD card.
Hi all
ive been using A2SD and A2SD+ for a while now.
But the only way Ive ever been able to avoid a boot loop with any custom rom is is i use adb and parted to partition the SD card as per:
http://androidandme.com/2009/08/news/how-to-manually-partition-your-sd-card-for-android-apps2sd/
If I use any other method (including via my custom recovery image - Amon RA) my desire just gets caught in a boot loop.
I get the impression that others dont have this limitation.
Any ideas?
I used Amon_RA 1.7.0.1 R5 from here http://forum.xda-developers.com/showthread.php?t=721792 to partition my SD card and convert the Ext2 to Ext3. Works like a charm with LeeDroid 1.4c.
Did you convert to Ext3?
Hi Stooby,
Thanks for the reply.
Yes, thats the same Recovery image I have installed, and Ive tried all sorts of things:
- leave as ext2
- convert ext2 to ext3
- convert ext3 to ext4
- repair ext partition
Also tried partitioning via clockworkmod / Rom Manager, same results
Regardless of whatever rom I use, the only way I seem to be able to get out of boot loop is partitioning via adb
Mods - I just realised I posted this in development - feel free to move it to a better home if you see fit.
subvertbeats said:
Regardless of whatever rom I use, the only way I seem to be able to get out of boot loop is partitioning via adb
Click to expand...
Click to collapse
That's weird - I've never had any problems creating Ext2/3/4 partitions using that recovery.
FWIW, I was using Amon_RA's recovery roms back when I had my old Dream, and never had your problem with those either!
Hopefully, someone with more knowledge will be along soon to make a constructive suggestion or 2.
I have had a look on the forums and I cannot find how to do what I want, sorry if it is a noobish question.
I've a GSM HTC desire on orange (UK), running cyanogenMod 6.1.1. The recovery is clockworkmod 2.5.0.7 and the bootloader is HBOOT-0.93.0001 (alpharev)
I am trying to install RCMix S v2.0 Evolutionary Sense. It seems it requires s-off to do this easily and I also need to have my SD card (16Gig) partitioned with 1Gig of ext3. The current size of the ext3 partition is 0.75Gig (I know it's a silly size I chose originally). Once this is done I should be able to load the correct bootloader for the Rom and then flash the Rom itself.
I have just flashed my phone using alpharev 1.8 to load a bootloader that gives me s-off.
I wanted to resize my ext3 partition to 1Gig, I tried using minitool partition wizard (which I used the first time) but it won't let me resize the ext partition even after making room by shrinking the fat32 partition.
I am wondering if there is a way to do this without formatting the SD card. My worry is if my phone won't boot if I format the card to resize the partition because as I understand it some system data is on the SD card. Am I worrying about nothing?
Backup your sd card then use rom manager to create your ext partition size. No matter what when resizing you have to format.
Swyped...
GParted will also do it.
Might as well convert to Ext4 while you are at it.
I also couldnt find a way to resize the ext3 partition in windows.
So i made a full nandroid backup (incl SD-EXT) in recovery, deleted old ext3 partition and created a bigger new one. Then just restored the SD-EXT backup from recovery.
Worked well and no data lost
Edit: Is there an advantage from ext3 to ext4? I´m using Insertcoin A2SD V49
I think I will do a nandroid back up and just reformat the card how I did the first time.
777ace My desire is PVT-1 S-off. Also you've got the rom I am trying to install. So I think I'll flash the 0.93/CM7 Hboot that you have.
What are the advantages to using Ext4 rather than Ext3. I assume Ext4 is what you use? Did you need to flash a new radio or did you just do it by choice?
Ext4 is just the evolution of Ext3, and is supposedly more reliable and performs better. I upgraded to 4, because I read alot of people recommending this for many of the new ROMs coming out...a bit of research and the move made sense.
You should already have 0.93 HBoot, if you want to use RCMix (or most of the more recent ROMs). After that, pushing the CM7.img thru something like Android Flasher is easy as.
I flashed the radio back when I was on LeeDroid 2.3f and have kept it since. If you want to upgrade, you can also push the radio.img with Android Flasher.
This http://gavinroy.com/initial-ext3-vs-ext4-results should put things into perspective.
I try to partition my sd-card using ClockworkMod Recovery 5.8.0.0.
It went ok, and I can see my partition using adb shell
Code:
# mount
...
/dev/block/mmcblk0p2 on /sd-ext type ext3 (rw,nodev,noatime,nodiratime,barrier=1,nodelalloc,data=ordered)
/dev/block/mmcblk0p1 on /sdcard type vfat (rw,nodev,noatime,nodiratime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
I want to convert ext3 to ext4 so I plug my phone in the USB and mount it in the recovery.
However Gparted can't find any partition in my sdcard. When I try to view it using disk utilities It only shows the FAT32 partition.
I don't understand why gparted can't detect any partition ( it shows unallocated ). Something wrong with the partition table of the sd-card formatted by CWM ? Anyone have solved this before ?
Delete all partitions on your SD card and then partition again.
MatDrOiD said:
Delete all partitions on your SD card and then partition again.
Click to expand...
Click to collapse
How to delete them if I can't see them ? I try to re-partition using CWM but still the same.
Delete partitions with cwm, and then create 1 big fat 32 partition. Alternately use Linux fdisk, which will "see" it.
After one partition is created, use parted, or 4ext.
fdisk or parted both can't find any partition...
But anyway.. after installing MIUI which convert my partition to ext4 automatically the problem is gone, every partition can be seen... So it must be some problem with CWM partition script
It ought to detect the partitions if you use a micro sd card reader. I assume you connected it via the Desire, in recovery?
Droidzone said:
It ought to detect the partitions if you use a micro sd card reader. I assume you connected it via the Desire, in recovery?
Click to expand...
Click to collapse
Yes, maybe that's the problem. I connected it via the Desire in recovery.
What could be wrong ? Because now (after flashing MIUI_xj xpart), I can see all partitions though connected via the Desire.
UPDATE : I still can't see the sd-ext if I mount USB storage in the recover...
ikidntu said:
Yes, maybe that's the problem. I connected it via the Desire in recovery.
What could be wrong ? Because now (after flashing MIUI_xj xpart), I can see all partitions though connected via the Desire.
Click to expand...
Click to collapse
First, erase that crappy recovery from your phone. Then install 4ext. Should fix it.
Droidzone said:
First, erase that crappy recovery from your phone. Then install 4ext. Should fix it.
Click to expand...
Click to collapse
... exactly what I thought atm
when you mount ur desire with usb mass storage option under recovery, it mount ONLY the FAT partition...
put the microsd in a microsd adapter on ur laptop..u will see both...
@droidzone come on, don't call CWM crappy ..every recovery is based on that..koush did a great work in order to write it for about every device (a tons of device support it now)..i agree it's a basic recovery (and maybe there are some limitations)..but it's thanks to that base recovery that now devs can easily mod it and improve it...it's like you and ur rom..ur rom its probably the best htc sense based rom for the desire, but you will never be able to do that without the crappy htc rom, and htc was never be able to do that without the crappy aosp rom made by google..i hope you got what i mean lol...modify is easy than create something from new
@andQlimax, my bone of contention is not with Koush's CWMR. It is with that half baked product called "Clockwork mod touch for Desire" that was recently released here without proper testing (the OP was using this, and his problems are directly caused by the faulty recovery). The very least the "developer" should test is to do a full backup and restore on his own phone after compilation. He has no right to treat poor hapless newbies as guinepigs. I wonder if that person even owns a Desire. If he did and he missed the fact that the recovery he released does not have the capacity to make sd-ext backups, I really feel for him.
People trust developers who release Recovery. If they cant trust their recovery to make proper backup, what's the point of calling it a Recovery software?
I have the utmost respect for Koush, Paul O'Brien and others for their development work. I dont intend to mean any sort of disrespect for those masters and pioneers of Android development. I also respect them for keeping CWMR; and Cyanogen for keeping CM open source despite all circunstances.
anyway i think the touch recovery posted in the dev section come directly from the koush build, he released it and it's on its site http://www.clockworkmod.com/rommanager for some devices
koush usually ask some people to test the recovery for him before he release it, probably someone didn't noticed that bug
Thank you. I wasnt aware of that. But I see that the subversion has increased to 5.8.0.2 while yorzua has still attached the faulty 5.8.0.0.
up to 2.8.0.0 with f2fs!
to install your first f2fs os2sd rom (internal MTD partitions won't format as f2fs)
make sure your card is already partitioned for os2sd.
go to wipe>advanced, select data, press repair or change filesystem, change filesystem. f2fs.
repeat for system.
do the same but ext4 to revert.
.
Mostly clean fork of OmniROM/android_bootable_recovery, with patches from TechV/android_bootable_recovery and my modifications.
Meant for OS2SD, so you can flash things not meant specifically for the Optimus V (like pa_gapps, or other things I once recommended but don't sit well with trying to walk people through getting working anymore, like CrossBreeder,) and have it flash correctly to the OS2SD /system and /data partitions which most recoveries won't do without some natty prodding through ADB. And sometimes not even then.
You'll need this for my kitkat ROM. With the recent androidarmv6 TLS-enabling and swapping /system and /data partitions in the kernel, this is now the ONLY recovery that will properly flash my ROMs.
partition 1 is still /sdcard.
partition 2 is system. I moved it arbitrarily several times because it seems I'm the only one actively developing for thunderc right now, and now it matches HardLight's p500 OS2SD setup.
partition 3 is swap.
partition 4 is now ext4 /data. It was, in the first iteration of OS2SD, ext4 /cache, but I moved that back to mtdblock1 for speed and space.
The OS2SD partitioner knows the new layout: /sdcard, /system, /swap, /data. In Internal mode it knows the internal layout, /sdcard, /sd-ext, swap.
Now a unified Internal/OS2SD recovery!
Things that are different from stock TWRP:
In the title bar it tells if in Internal or OS2SD mode.
Whichever mode it is in, it will flash generic zips like CrossBreeder or whatever, to the appropriate partitions.
Under Advanced is a button to switch modes, labelled with whichever mode it's NOT in. It gives an abort option and swiper to activate the switch.
v4 release fixes mode switch bug.
It will flash internal roms correctly whichever mode it is in. also OS2SD roms formatted like mine where it's mount EMMC /system in the updater script.
The main point to the multi is to be able to flash the generic zips without modifying them to either internal or os2sd as wished. And to be able to format internal or OS2SD partitions separately without changing their names.
And also, the partitioner is different in each mode to reflect the partitions used.
In OS2SD, it makes vfat, system, swap, data.
In Internal it makes vfat, sd-ext, swap.
I made it multi mode because I still support internal builds for thunderc even though I don't use em myself.
Has all the TWRP 2.7.1.0 goodies like 'Repair or Change File System' under Advanced Wipe, and text wraparound.
Download
NOTE: the screen will probably blank while partitioning and won't come back on until it finishes. you can either ignore it, or increase/disable the screen timeout under settings>screen.
IMPORTANT: When you flash the new recovery, reboot recovery to be sure it works, before flashing ROM.
Thanks to TechVendetta for his source or I'd not have messed with TWRP at all.
Not to mention the partitioning code.
Thanks to androidarmv6 for the android_device_lge_p500/msm7x27-common tweaks for TWRP which I shamelessly kanged with credit given, from thunderg to thunderc, like my 3.0 kernel and much of my device folder setup.
And thanks to @Dees_Troy et al for TWRP source code. Very very pretty, fun to modify, and I love the terminal and file manager.
If any original devs of TWRP happen to see this, my apologies for mangling the source to my own ends. It's a work in progress and I take full responsibility for any bugs or glitches. And thank you again for sharing.
reserved
reserved
this spot reserved for future informational post.
internal (stock TWRP) version uploaded.
os2sd v3 uploaded.
Strongly recommended upgrade if you're using os2sd. Removes internal system and data from fstabs to fix mounting conflicts. It'll still flash files that mount them by device (/dev/block/mtdblock5 or 6 for system and data)
new updated internal and tweaked os2sd versions.
advise upgrade.
bump
new version, multi-function internal/os2sd. only flashes TLS enabled builds from 08022014 onwards, unfortunately. Everything else for the Optimus V or S, has the internal /system and /data partitions reversed from this recovery version (and newer rom builds.)
It's a change that completely breaks backwards compatibility, which I dislike immensely, but the phone does run faster and have more system space without fighting for it.
so, since no-one else has built anything for these phones that I'm aware of for months now, I feel free to make any changes I see fit no matter how exorbitant or incompatible they may be.
Just wait till I switch the whole shebang over to f2fs instead of yaffs2, that's going to break any remaining reverse compatibility with other recoveries or roms that might still linger about. I'll have to build a stock kernel for f2fs and make an f2fs redo of Rhode rom so that people can still activate the phones without having to completely redo the recovery and reformat the mtd partitions and all.
bump.
mode switch freeze-up bug fixed.
uses older update-binary to flash this from other recoveries.
v4 released.
bugs?
I've noticed some issues with this version of TWRP, so I thought I'd come here and list what I can remember off the top of my head.
after flashing zips, the 'wipe cache/dalvik' button causes the recovery to hang
under the mount option, you select what partitions you want to mount, then press 'mount USB storage', and windows gives a sound I hadn't heard before-- it's like the tone for plugging something in usb, but it is only one tone repeated 3 times, I suppose so as to indicate a communication error of some kind. When you then press 'unmount', windows sounds the proper tones, and you then get access, but only to the SD card. Enabling or disabling MTP has no effect.
Hm. There were one or two little niggling things, but I seem to have forgotten them. I should write stuff down, huh?