Customizing NAND images
Jump to navigation
Jump to search
This page describes how to create a jffs2 image from a laptop's internal NAND, producing an image that can be flashed onto a different XO.
Steps:
- Make the changes on the XO machine that you want to be present in the generated image.
- Download the build tree corresponding to the image currently on the NAND. To find which build number you're running on the NAND, you can cat /boot/olpc_build or look in the Developer Console (alt-equals). For build342, the build tree address is http://olpc.download.redhat.com/olpc/streams/development/build342/devel_jffs2/olpc-redhat-stream-development-build-342-20070326_1758-devel_jffs2-tree.tar.bz2
- Make sure you have the `mtd-utils` package installed on your non-XO machine. It provides /usr/sbin/mkfs.jffs2 and /usr/sbin/sumtool.
- mkdir jffs2 && cd jffs2 && tar xjf ~/olpc-redhat-stream-development-build-342-20070326_1758-devel_jffs2-tree.tar.bz2
- The jffs2/ directory will now look similar to the root file system of the NAND. We're going to rsync from the laptop to the other machine, which will copy over the files on the NAND that aren't already in the build tree.
- If you've logged into sugar and want the user to see the welcome prompt with your image, you can rm /home/olpc/.sugar/default/config.
- init 1 on the XO machine.
- Bring up networking on the XO and other machine; they need to be able to communicate over ssh.
- On the XO, rsync -a / --exclude=/sys --exclude=/proc --exclude=/dev --exclude=/var/lib/stateless foo@bar.com:/home/foo/jffs2
- On the other machine, once the XO's prompt has returned and the rsync is finished:
- sudo /usr/sbin/mkfs.jffs2 -n -e128KiB -r jffs2/ -o jffs2-pre.img
- sudo /usr/sbin/sumtool -n -p -e 128KiB -i jffs2-pre.img -o jffs2.img
The jffs2.img file is now your image -- you can copy it to a USB disk, and write it to a laptop by interrupting the Open Firmware boot and saying copy-nand disk:\jffs2.img.