Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,737,925 Members 52,532 Now Online
XDA Developers Android and Mobile Development Forum

[Dev Kernel] 2.6.29 Support for ext2/ext3/ext4/yaffs2

Tip us?
 
raspdeep
Old
(Last edited by raspdeep; 10th August 2010 at 07:18 PM.)
#1  
Senior Member - OP
Thanks Meter 21
Posts: 642
Join Date: Nov 2007
Default [Dev Kernel] 2.6.29 Support for ext2/ext3/ext4/yaffs2

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
 
darksnarfer
Old
#2  
darksnarfer's Avatar
Member
Thanks Meter 1
Posts: 59
Join Date: Jun 2010
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.
 
bub181
Old
#3  
Senior Member
Thanks Meter 7
Posts: 251
Join Date: Jul 2007
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.

Quote:
Originally Posted by darksnarfer View Post
I think I read you can't mount a yaffs2 partition anywhere, it has to be an MTD flash device.
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.
 
darksnarfer
Old
#4  
darksnarfer's Avatar
Member
Thanks Meter 1
Posts: 59
Join Date: Jun 2010
Quote:
Originally Posted by bub181 View Post
Does the kernel that rasdeep posted load the existng flash devices/partitions as MTD devices?
Just checked, there isn't any /dev/block/mtd* so I guess the kernel still can't see them as mtd.
 
ivanmmj
Old
#5  
ivanmmj's Avatar
Retired Moderator
Thanks Meter 34
Posts: 5,164
Join Date: Jan 2007

 
DONATE TO ME
/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.
God bless you!!!
 
raspdeep
Old
(Last edited by raspdeep; 11th August 2010 at 01:51 AM.)
#6  
Senior Member - OP
Thanks Meter 21
Posts: 642
Join Date: Nov 2007
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
 
bub181
Old
#7  
Senior Member
Thanks Meter 7
Posts: 251
Join Date: Jul 2007
Quote:
Originally Posted by raspdeep View Post
modifying the init.rc is secondary because that is easy..
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.
 
raspdeep
Old
#8  
Senior Member - OP
Thanks Meter 21
Posts: 642
Join Date: Nov 2007
Quote:
Originally Posted by bub181 View Post
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.
i'm afraid so for now until someone found a way to extract the initramfs from later kernel and restore it back after modification..
 
ivanmmj
Old
#9  
ivanmmj's Avatar
Retired Moderator
Thanks Meter 34
Posts: 5,164
Join Date: Jan 2007

 
DONATE TO ME
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.
God bless you!!!
 
bub181
Old
(Last edited by bub181; 11th August 2010 at 02:04 AM.)
#10  
Senior Member
Thanks Meter 7
Posts: 251
Join Date: Jul 2007
Quote:
Originally Posted by raspdeep View Post
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?
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....S_Target_Image
http://processors.wiki.ti.com/index.php/MTD_Utilities
http://processors.wiki.ti.com/index....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?

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

XDA Xposed Tuesday: Blur Your System Notification Panel – XDA Developer TV

Listen, we love innovative applications and modules that … more

Android 4.4.3 Begins Rolling Out to European HTC One M8

Shortly after the USA Unlocked and Developer Editions of the HTC One M8 received the … more

Modernize Your Emails with Email Popup

SMS andHangouts messages likely won’t ever replace traditional Emails for more formal … more

Change Your Toast Notification Style with XToast

Android uses multipletypes of notifications. One of these isknown as a toast notification. … more