Boot Chart

From wiki.gp2x.org
GP2X Wikipedia.jpgThis page needs to be cleaned up.
Some points:
  • 1st person text needs to be removed.
  • Formatting needs to be improved.
  • This page needs to be linked to others like it, so that this page isn't orphaned and left to die.
  • It probably needs to be moved to a more descriptive title, like "Boot Time" or something.
  • In the long term, this page is very old, and may contain useless information. It needs to be checked over by someone who knows what they're talking about, and can update any information.
Boot Chart: thumbnail

Theoddbot created a boot chart for the GP2X using bootchart.

Contents

Reducing Boot Up Time Through Firmware

I'd say you can remove everything from 11s to 16s on that chart without trying too hard, but I'd rather someone with a serial cable and debricking skills tried it smile.gif.

From what I can tell, init could be replaced with a small shell script that:

  mount -a # mount extra filesystems
  automount & # start automount in the background
  
  # any suggestions as to what else we need ?
  
  # run the menu in a loop so we never exit
  while ((1)); do
  cd /usr/gp2x
  ./gp2xmenu
  done


Also, using a static /dev rather than devfs would probably free 1.4mb of ram. Might not be much on a desktop system, but it's useful on the GP2X..

12 Second Boot-up

Ok now that we have kernel source I've done some playing with the filesystems. I cloned the root partition onto the spare nand as both a jffs2 image and a cramfs image.

jffs2:

  • mount: 20 seconds
  • find /: 3 seconds

cramfs:

  • mount: 0.03 seconds
  • find / : 0.32 seconds


Also, the cramfs image is only 5mb, compared to 13.4mb or so for the jffs2.

I think the 43 seconds figure is a bit out, it's probably scanning the whole 39mb partition in 43 seconds, compared to 24mb for the real one, so realistically its about 20 seconds.

I anticipate that this will wipe about 12 seconds off the boot time, but we'll have to see.

Robster will take a look at my modified kernel and try and use a cramfs root partition, and see how much it speeds up boot time.

Whoever I flamed about jffs2 not being slow, I humbly apologise

OK, thanks to art103 for trying this out, we have a total boot time of 12.2 seconds from power on !!!

Test Image

Ok, the first test image is available, for you brave souls. Grab it from http://brendan.mine.nu/gp2x/cramfs/

Readme(v1) at GP32x Forums. Readme(v2) at GP32x Forums.

Realistically, the chances of brickage are rather low, since GPH's method of flashing the firmware is used, you will be able to flash your old gp2xkernel.img back without any trouble. This system will not modify the original filesystem in any way.

Make your Own CramFS Image

From mwolson:

To make it somewhat easier to create your own cramfs images, I've uploaded a starter tarball to my site.

This is mostly based on theoddbot's image, but with a few bootchartd-related things removed, some directories (/root, /home) symlinked to /tmp, and empty /dev directory, since this gets created automatically at startup anyway. In particular, it is assumed that you have your HOME directory set to /mnt/sd, as recommended in other threads.

Assuming that you have a GNU/Linux distribution on your machine, do the following to create a custom image.

  • Download my tarball.
  • Make sure you have the mkcramfs binary available. If you make your own Linux kernel, you probably have this.
     cp cramfs-base-0.0.1/base mycramfs
     su -c "chown -R yourname:yourname mycramfs"

Where "yourname" is your login name.

  • Make your changes.
     su -c "chown -R root:root mycramfs"
     su -c "mkcramfs mycramfs mycramfs.dump"
  • Copy mycramfs.dump to your SD card, and follow theoddbot's instructions for the rest of it, using "mycramfs.dump" instead of "cramfs-1.4.dump".

The reason for using "su" so much is to make sure that everything in the created image is owned by root. You could probably get away with not using "su", but I haven't tested that scenario.

Personal tools