Prepare a bootable SD card to run Balsa

From LSDevLinux
Revision as of 17:27, 2 February 2010 by Mayhewn (talk | contribs) (Step 1: Build BALSA: Improve wording)

Jump to: navigation, search

Introduction

This set of instructions tells you how to install a BALSA Prototype onto a SD card

The BALSA build finishes with the set of BALSA files in a bzip2 tarball in the .../balsa-builder/builder directory. These are instructions for decompressing those files and loading them onto an SD card. The goal is to build a bootable BALSA SD card.

The user must have access to sudo privileges.

In the case of initializing multiple SD cards, Steps 1 and 2 below only need to be performed once.

The Procedure

Step 1: Build BALSA

See the BALSA Prototype instructions.

Step 2: Decompress the BALSA tarball

This step decompresses the BALSA tarball into an intermediate directory. The intermediate directory must be on a Linux filesystem (e.g. ext2 or ext3; not FAT or NTFS). The code below assumes that the intermediate directory is named built and is a sibling directory to the balsa-builder directory. If you want to put it elsewhere, replace built and ../balsa-builder/builder/ with a paths/directories of your choice. Open a terminal and use cd to get to the parent of the balsa-builder directory you made in Step 1. Run these commands:

mkdir built
sudo chown root:root built
cd built
sudo tar --numeric-owner -xpjf ../balsa-builder/builder/latest.tbz2

Step 3: Initialize the SD card

If the SD card has a BALSA build on it already, this step can be omitted.

You will need a Linux system with gparted installed that can read a SD card.

WARNING!! gparted is a partition editor. It is a powerful and dangerous tool. If you don't know what a partition is, you shouldn't be doing this. Read the instructions below and understand them. Follow them closely.

  1. This procedure will destroy all the data on the SD card. Back up any data on it you want to keep.
  2. Plug in the SD card.
  3. Start gparted. You will see a screen that looks like this:
    600px
  4. Select the SD card in gparted device window. (Red Circle 1)
  5. In the menu, select View|Device Information and make sure that you're working on the right device. (Blue Circle 2)
  6. Click on the mounted partition. (Green Circle 3)
  7. In the menu, select Partition|Unmount
  8. If there is more than 1 partition on the SD card, use the previous two instructions to unmount them all.
  9. The next command cannot be undone. Make sure you are working on the right device.
  10. In the menu, select Device|Create Partition Table.
    By default, gparted will make an msdos partition table. This is correct. Click the Create button.
  11. gparted will return with the SD card completely unallocated.
  12. Click on the unallocated area (the same place the partition used to be).
  13. In the menu, select Partition | Create New Partition. You will see this dialogue box. Fill it out as specified below:
    500px
    Create as: Primary Partition (Red Circle 1)
    File System: ext3 (Blue Circle 2)
    Label: OLPCRoot (Green Circle 3)
  14. Click on the Add button.
  15. The main gparted screen will come back. It won't create the partition until you click the green check mark (Red Circle below)
    600px
  16. gparted will create the partition with an empty file system. When you mount the SD, it should look like this:
    600px

Step 4: copy/update the BALSA build onto the SD card

Mount the SD card and cd into to the built directory you created in step 2.

The following commands assume that the SD card is mounted as /media/OLPCRoot. If it's not, replace /media/OLPCRoot in the next command with the mount point from your system.

sudo rsync --delete -axHAX ./ /media/OLPCRoot

If you want to monitor the progress of the rsync replace the last command above with:

sudo rsync --delete -axHAX --progress ./ /media/OLPCRoot

To do