Jump to content


Photo

Sd Card With Ext2 Filesystem


  • Please log in to reply
4 replies to this topic

#1 CyprianZ

CyprianZ

    Member

  • Member
  • PipPip
  • 26 posts
  • Gender:Male
  • Interests:photography, Linux, ANSI C, travelling

Posted 05 March 2011 - 04:36 PM

Hi,
not sure, if it is a right place, to start this thread, so don't scream :)

I noticed that sometimes my caanoo breaks the fat filesystem on sd card . So I thought that perhaps it would not do it with ext2 fs.
here is what I did.

First of all I tried to modify initscripts, but then I discovered, that caanoo does not load /sbin/init (nor /bin/init), but it loads /etc/rd.d/binscript instead.
I'm not sure what does this program do (it is compiled, I googled a bit to find it's source code, but I couldn't, and I'm not at all fluent with ARM assembly code), but I found out, that one of the things it does, it runs gp2xmenu. So I copied the gp2xmenu into gp2xmenu.orig
and I had created a script file in its' place. Now, when I turn on the caanoo with ext2 formatted card, it would get mounted, and it would be used, but when you take it out, or connect the unit with a PC the card would be umounted, and you should reboot the unit in order to get it remounted. the FAT formatted SD cards would be used as usual (you can pull them and place them back, and these would be mounted just the usual way).

so here is how I did it.
Warning, I take no responsibility for any damage, you coud do trying to reproduce, what I did to my unit.

you need dropbear server and a way to get to your caanoo (you could use usbnetwowrking, or wifi connection, the choice is yours).
then log in to your unit, and remount root filesystem:
mount /dev/root / -o rw,remount
now change the gp2xmenu:
cd /usr/gp2x
mv /usr/gp2x/gp2xmenu /usr/gp2x/gp2xmenu.orig
now create a wrapper script, that will be running gp2xmenu:
cd /usr/gp2x
vi gp2xmenu

I put into the script something like this:
#!/bin/sh
dir=/usr/gp2x
hostname caanoo
/sbin/insmod /lib/modules/2.6.24/kernel/fs/ext2.ko 
mount /dev/mmcblk0p1 /mnt/sd 
${dir}/gp2xmenu.orig

change permissions to the script
chmod 777 gp2xmenu

and then remount rootfs

mount /dev/root / -o ro,remount

and turn off the unit.

now, let's prepare a sd card, let's say, your card is seen in your pc as /dev/sdc1
mke2fs -b 4096 -L caanoo /dev/sdc1
blocksize is set to 4KB, why? because I read somewhere, that if we want optimal write speed on an SD card, we need to have as large blocks, as it is possible (the more sectors are written at once the better see http://elm-chan.org/.../mmc/mmc_e.html ), and it seems to work a bit:)

and that's it.

few things you have to have in mind:

apps,game, ebook, etc... directory names should should have names in lowercase.
these directories above, should be accessible by anyone.

and gngeo emulator needs its' rc file named ad "gngeorc." (I've spent a moment on figuring out why it does not want to work:) )


Hope, that some more people would like to experiment with caanoo hacking:)

Edited by CyprianZ, 17 November 2011 - 06:28 PM.


#2 zx-81

zx-81

    Mega GP Mania

  • GP Guru
  • 679 posts
  • Gender:Male
  • Location:Earth

Posted 06 March 2011 - 10:20 AM

thanks for the hint, but you may be very carefull if you want to upgrade your fw. I'm not sure if the fw flash process support ext2 (i guess not).

I'm using ext2 to get a chroot env on a usb pen, with all my debug env installed :P

#3 CyprianZ

CyprianZ

    Member

  • Member
  • PipPip
  • 26 posts
  • Gender:Male
  • Interests:photography, Linux, ANSI C, travelling

Posted 06 March 2011 - 10:51 AM

thanks for the hint, but you may be very carefull if you want to upgrade your fw. I'm not sure if the fw flash process support ext2 (i guess not).

I'm using ext2 to get a chroot env on a usb pen, with all my debug env installed :P

well, I have another SD card, which would be used only for upgrades, my final goal is to change the firmware updater, so I could have automunt ext2/vfat sd cards options. I have few ideas, on how exactly utilize the fact i have ext2 on sd card :)
but first I have to do some research:)

#4 zx-81

zx-81

    Mega GP Mania

  • GP Guru
  • 679 posts
  • Gender:Male
  • Location:Earth

Posted 06 March 2011 - 12:21 PM

i succeed even to launch a debian chroot distro. I'm using ext2 + chroot stuff mainly for debug purposes (gdb etc ...)

#5 zergling

zergling

    Member

  • Member
  • PipPip
  • 7 posts

Posted 16 November 2011 - 03:28 AM

.

Edited by zergling, 16 November 2011 - 09:16 PM.