User:NeoAmsterdam/Installing build 8.0.2 to a bootable SD card: Difference between revisions

From OLPC
Jump to navigation Jump to search
(With gratitude to the folks at irc://irc.oftc.net/olpc-devel for their guidance. A longer, more explicative version is on my "to do" list.)
 
(Major overhaul - more detailed)
Line 1: Line 1:
This document will explain how to make a bootable SD card for use with your XO (and then abuse your newfound storage capacity).
<div style="background: #faa; border: thin solid red; color: red;"><span style="font-weight: bold; font-size: 141.4%;">WARNING:</span><br />The procedures outlined in this document will cause data to be overwritten. Do not proceed without taking the appropriate steps to safeguard your data.</div>

= Short Version =
= Read Me First =
== Warnings ==
* <span style="color: red;">This procedure will erase and overwrite everything stored on the XO and the SD card. Back up your data!</span>
* <span style="color: red;">Do not execute this procedure on battery power. Any power interruption could lead render your XO irrecoverable.</span>
* <span style="color: red;">This procedure requires the use of <tt>fdisk</tt> for partitioning. Do not attempt this procedure if you are a Linux novice.</span>
* <span style="color: red;">Execute this procedure at your own risk. I will provide clarifications and explanations if requested, but I will not provide tech-support-style help.</span>

== Caveats ==
* <span style="color: orange;">The SD card will be formatted as an ext3 filesystem. This is not an ideal filesystem for SD cards.</span>
* <span style="color: orange;">This document assumes you already have a developer key.</span>
* <span style="color: orange;">This document assumes that <tt>fdisk</tt> automatically recognizes the starting and ending cylinders for the SD card.</span>

== Notes ==
* This document assumes that the USB drive is already formatted as a vfat/ms-dos file system.
* All the instructions on this page are verbose. Even though it takes longer, it'll allow you to keep tabs on the XO's progress.
* Children should get permission from a parent, guardian, teacher, and/or Linux guru before attempting this procedure.<br />Adult supervision is not required, but is highly recommended.

== Requirements ==
== Requirements ==
* An [[XO]]<br />Obviously.
* A USB drive:
* A [[USB]] drive<br />512 MB is barely large enough, 1 GB will do nicely.
** FAT-32/vfat format.
* An [[SD]] card<br />512 MB is barely large enough, 1 GB will do, but larger will always be better.
** 512 MB or larger.
* A developer's key<br />The instructions for obtaining a developer's key can be found [[Activation and developer keys|here]].
== Instructions ==
* Internet connectivity<br />You will need to download <!--at least--> two files.
# Store [http://download.laptop.org/xo-1/os/official/802/jffs2/fs.zip fs.zip] and [[http://download.laptop.org/xo-1/os/official/802/jffs2/os802.img os802.img]] to the USB drive.

# Clean-install as described [[Clean-install procedure|here]].
== Optional ==
# Upon reboot, enter the [[Console#The_Console|console]].
* You will probably want to use a second computer to download two required files and to back up the XO's data.
# Repartition and format the SD card for ext3.

# Mount the SD card.
= The Procedure =
# Copy <tt>/versions/pristine/802</tt> to the SD card recursively with the preserve permissions flag set.
== Safeguarding Your Data ==
# Make the <tt>/home/olpc</tt> directory on the SD card and change the owner to <tt>olpc:olpc</tt>.
# Copy the [[Activation and developer keys|developer key]] to the SD card.
# Plug in the USB drive, insert the SD card.
# <span style="color: red;">Backup your data</span> by copying files/activities to your USB drive.
# Unmount the SD card.
# Drop into the [[Console#The_Console|the console]].<br />Press <b>◆ ctrl</b> + <b>◇ alt</b> + <b>[[Image:Mesh key f1 small.png|12px]] f1</b> to enter the console, then press <b>[[Image:Key enter.jpg|12px]]  enter</b> to log in as root.
The SD card and NAND are now bootable and in pristine condition.
# Determine the USB drive's mount point.<br /><b><tt>mount</tt></b> will output a series of mounted devices. Look for something like <tt>/dev/sda1 on /media/USB type vfat</tt>: make note of the mount point (<tt>/media/USB</tt> in this example).
= Long Version =
# Copy the developer key to the USB drive.<br /><b><tt>mkdir -pv /media/USB/security ; cp -v /security/develop.sig /media/USB/security</tt></b>
<i>Yet to be written</i>.
# Return to the graphical environment.<br />Press <b>◆ ctrl</b> + <b>◇ alt</b> + <b>[[Image:Home key f3 small.png|12px]] f3</b>.
# Enter the [[Journal]] and unmount the USB key.<br />Unmounting is explained [[Journal Activity#External storage devices|here]]
# Unplug the USB drive.
== Acquiring the Software ==
The directions in this section assume that you're using a second computer.
# <span style="color: red;">Backup your data</span> by copying files/activities from your USB drive.
# Download [http://download.laptop.org/xo-1/os/official/802/jffs2/fs.zip fs.zip] and [http://download.laptop.org/xo-1/os/official/802/jffs2/os802.img os802.img] to your USB drive.<br />You should now have <tt>fs.zip</tt>, <tt>os802.img</tt>, and a folder called <tt>security</tt> which contains <tt>develop.sig</tt> on the USB drive.
<!--
# <i>Optional:</i>
## Make a directory/folder on the USB drive called "Activities".
## Download activities, such as [[Browse]] or [[Terminal]], into the "Activities" folder. A list of all activities can be found [[Activities/All|here]].
-->
# Eject the USB drive.
The remainder of this document assumes that you're using the XO.
== Preparing for Installation ==
# Drop into the [[Console#The_Console|the console]].
# Stop [[Sugar]] and the automounting daemon by lowering the runlevel.<br /><b><tt>/sbin/init 3</tt></b>
# Determine mounted devices<br /><b><tt>mount</tt></b><br /> will list all the mounted devices.<br />If you see <tt>/dev/mmcblk0p1</tt> mentioned, run <b><tt>umount /dev/mmcblk0p1</tt></b>.<br />If the XO responds with the <tt>device is busy</tt> error message, try <b><tt>cd / ; umount /dev/mmcblk0p1</tt></b>.<br />If the device still can't be unmounted, <b>stop what you're doing</b> - you cannot proceed any further.
# <span style="color: red;">Quick-format the SD card<br /><b><tt>dd if=/dev/zero of=/dev/mmcblk0 bs=512 count=8</tt></b></span>
# <span style="color: red;">Paritition the SD card.<br /><b><tt>fdisk /dev/mmcblk0</tt></b><br />You will now be running <tt>fdisk</tt> interactively. Create a new primary partition that runs the length of the drive, flag it as bootable, make sure it's type <tt>83</tt> (Linux), and write the changes.</span>
# <span style="color: red;">Format the SD card<br /><b><tt>mkfs.ext3 -L "OLPC-SD" /dev/mmcblk0p1</tt></b></span>
# Turn off the XO<br /><b><tt>shutdown -h now</tt></b>
== Installing the OS ==
# With the XO powered off, plug in the USB drive.
# Hold down all four game keys (<b>╳</b>, <b>✓</b>, <b>○</b>, and <b>◻</b>) while your power on the XO.<br />Do note release the four game keys until you see "<tt>Release the game keys to continue</tt>" at the top of the screen.<br />Once you release the game keys, the XO will begin installing the OS to the NAND.
# Wait.
#* I recommend setting up a fresh pot of coffee during this intermission. By the time you turn on the coffee machine, the XO will present you with the registration screen.
# Drop into the [[Console#The_Console|the console]].<br /><b>◆ ctrl</b> + <b>◇ alt</b> + <b>[[Image:Mesh key f1 small.png|12px]] f1</b>.
# Mount the USB drive.<br /><b><tt>mkdir /mnt/USB ; mount -t vfat /dev/sda1 /mnt/USB</tt></b>
# Mount the SD card.<br /><b><tt>mkdir /mnt/SD ; mount -t ext3 /dev/mmcblk0p1 /mnt/SD</tt></b>
# Copy the developer key from the USB drive to the SD card.<br /><b><tt>cp -rv /mnt/USB/security /mnt/SD</tt></b>
# Copy the OS from the NAND to the SD card.<br /><b><tt>cp -prv /versions/pristine/802 /mnt/SD</tt></b>
# Wait.
#* Remember that fresh pot of coffee you set up a short while ago? Now is the time to pour yourself a cup. By the time you're halfway through the coffee, the XO will be ready for you.
# Create the olpc user's home directory.<br /><b><tt>mkdir -pv /mnt/SD/home/olpc ; chown -rv olpc:olpc /mnt/SD/home/olpc</tt></b>
<!--
# If you downloaded activities onto your USB drive, install them to the SD card.
## Copy the Activities folder to the olpc user's home directory.<br /><b><tt>cp -rv /mnt/USB/Activities /mnt/SD/home/olpc</tt></b><br />These files will have to be decompressed later.
-->
# Unmount the USB drive and SD card.<br /><b><tt>umount /mnt/USB ; unmount /mnt/SD</tt></b>
# Remove the temporary directories.<br /><b><tt>rmdir -v /mnt/USB /mnt/SD</tt></b>
# Restart.<br /><b><tt>shutdown -r now</tt></b>
You should now be booting off of the SD card.
----
= See Also =
* [[Installing to SD Card]]
-----
<span style="color: gray;"><i><b>To Do:</b> Install activities from USB, make a swapfile, tweak olpc.fth (maybe).</i></span>
[[Category:Hardware]]

Revision as of 00:15, 22 February 2010

This document will explain how to make a bootable SD card for use with your XO (and then abuse your newfound storage capacity).

Read Me First

Warnings

  • This procedure will erase and overwrite everything stored on the XO and the SD card. Back up your data!
  • Do not execute this procedure on battery power. Any power interruption could lead render your XO irrecoverable.
  • This procedure requires the use of fdisk for partitioning. Do not attempt this procedure if you are a Linux novice.
  • Execute this procedure at your own risk. I will provide clarifications and explanations if requested, but I will not provide tech-support-style help.

Caveats

  • The SD card will be formatted as an ext3 filesystem. This is not an ideal filesystem for SD cards.
  • This document assumes you already have a developer key.
  • This document assumes that fdisk automatically recognizes the starting and ending cylinders for the SD card.

Notes

  • This document assumes that the USB drive is already formatted as a vfat/ms-dos file system.
  • All the instructions on this page are verbose. Even though it takes longer, it'll allow you to keep tabs on the XO's progress.
  • Children should get permission from a parent, guardian, teacher, and/or Linux guru before attempting this procedure.
    Adult supervision is not required, but is highly recommended.

Requirements

  • An XO
    Obviously.
  • A USB drive
    512 MB is barely large enough, 1 GB will do nicely.
  • An SD card
    512 MB is barely large enough, 1 GB will do, but larger will always be better.
  • A developer's key
    The instructions for obtaining a developer's key can be found here.
  • Internet connectivity
    You will need to download two files.

Optional

  • You will probably want to use a second computer to download two required files and to back up the XO's data.

The Procedure

Safeguarding Your Data

  1. Plug in the USB drive, insert the SD card.
  2. Backup your data by copying files/activities to your USB drive.
  3. Drop into the the console.
    Press ◆ ctrl + ◇ alt + Mesh key f1 small.png f1 to enter the console, then press Key enter.jpg  enter to log in as root.
  4. Determine the USB drive's mount point.
    mount will output a series of mounted devices. Look for something like /dev/sda1 on /media/USB type vfat: make note of the mount point (/media/USB in this example).
  5. Copy the developer key to the USB drive.
    mkdir -pv /media/USB/security ; cp -v /security/develop.sig /media/USB/security
  6. Return to the graphical environment.
    Press ◆ ctrl + ◇ alt + Home key f3 small.png f3.
  7. Enter the Journal and unmount the USB key.
    Unmounting is explained here
  8. Unplug the USB drive.

Acquiring the Software

The directions in this section assume that you're using a second computer.

  1. Backup your data by copying files/activities from your USB drive.
  2. Download fs.zip and os802.img to your USB drive.
    You should now have fs.zip, os802.img, and a folder called security which contains develop.sig on the USB drive.
  3. Eject the USB drive.

The remainder of this document assumes that you're using the XO.

Preparing for Installation

  1. Drop into the the console.
  2. Stop Sugar and the automounting daemon by lowering the runlevel.
    /sbin/init 3
  3. Determine mounted devices
    mount
    will list all the mounted devices.
    If you see /dev/mmcblk0p1 mentioned, run umount /dev/mmcblk0p1.
    If the XO responds with the device is busy error message, try cd / ; umount /dev/mmcblk0p1.
    If the device still can't be unmounted, stop what you're doing - you cannot proceed any further.
  4. Quick-format the SD card
    dd if=/dev/zero of=/dev/mmcblk0 bs=512 count=8
  5. Paritition the SD card.
    fdisk /dev/mmcblk0
    You will now be running fdisk interactively. Create a new primary partition that runs the length of the drive, flag it as bootable, make sure it's type 83 (Linux), and write the changes.
  6. Format the SD card
    mkfs.ext3 -L "OLPC-SD" /dev/mmcblk0p1
  7. Turn off the XO
    shutdown -h now

Installing the OS

  1. With the XO powered off, plug in the USB drive.
  2. Hold down all four game keys (, , , and ) while your power on the XO.
    Do note release the four game keys until you see "Release the game keys to continue" at the top of the screen.
    Once you release the game keys, the XO will begin installing the OS to the NAND.
  3. Wait.
    • I recommend setting up a fresh pot of coffee during this intermission. By the time you turn on the coffee machine, the XO will present you with the registration screen.
  4. Drop into the the console.
    ◆ ctrl + ◇ alt + Mesh key f1 small.png f1.
  5. Mount the USB drive.
    mkdir /mnt/USB ; mount -t vfat /dev/sda1 /mnt/USB
  6. Mount the SD card.
    mkdir /mnt/SD ; mount -t ext3 /dev/mmcblk0p1 /mnt/SD
  7. Copy the developer key from the USB drive to the SD card.
    cp -rv /mnt/USB/security /mnt/SD
  8. Copy the OS from the NAND to the SD card.
    cp -prv /versions/pristine/802 /mnt/SD
  9. Wait.
    • Remember that fresh pot of coffee you set up a short while ago? Now is the time to pour yourself a cup. By the time you're halfway through the coffee, the XO will be ready for you.
  10. Create the olpc user's home directory.
    mkdir -pv /mnt/SD/home/olpc ; chown -rv olpc:olpc /mnt/SD/home/olpc
  11. Unmount the USB drive and SD card.
    umount /mnt/USB ; unmount /mnt/SD
  12. Remove the temporary directories.
    rmdir -v /mnt/USB /mnt/SD
  13. Restart.
    shutdown -r now

You should now be booting off of the SD card.


See Also


To Do: Install activities from USB, make a swapfile, tweak olpc.fth (maybe).