Flash Your MMC Card

From BUG Wiki

Jump to: navigation, search

Contents

MMC Flashing via a Linux LiveCD

The initial few sections here involve downloading, burning and booting a Linux live CD. The live CD will allow Windows and Mac OS X users (both Intel and PowerPC) to boot into a Linux environment in order to perform the tasks outlined below.

Please note: The live CD does NOT require the installation of Linux on your computer. It simply allows you to boot your computer from the CD, and run all of the commands (if you do it right) without affecting any of the data on your existing hard drive(s).

Existing Linux users can choose to follow all of these directions to boot from a live CD, or skip ahead to the #Download the BUG Rootfs section, below. Linux users who choose to skip ahead should gain root privileges via su or sudo at this time.

Requirements

  • A Linux live CD such as the one from http://www.sysresccd.org/Download
  • A CD burner and a blank CD
  • Your BUG MMC Micro card with MMC adapter
  • An MMC drive and appropriate USB cable
  • Internet access
  • Basic understanding of IP network configuration

Download a Live CD Image

Note: These instructions assume that you're using the live cd from System Rescue CD. It was chosen for this example because it is a fairly small download (compared to some of the other available live cds) and provides all of the functionality required for the task at hand. You can choose to use other bootable live cds if you prefer, as long as you are able to configure internet access from within their live environment, recognize and access your MMC drive, and create an EXT3 filesystem with them.

  1. Download the latest version of the LiveCD from http://www.sysresccd.org/Download.
    1. Windows and Intel Mac owners should download the final stable version for x86 (i486-PC).
    2. Mac owners with the older, G4-based Macs should use the image listed as final stable version for PowerPC (Mac).
  2. Burn the CD image to disk.
    1. Windows users: If you do not have software to do this with, Alex Feinman's free ISO Recorder (http://isorecorder.alexfeinman.com/isorecorder.htm) should do the trick.
    2. Mac users: You should be able to use OS X's included Disk Utility app to burn the ISO image to CD.

Boot Your PC from the Live CD and Configure Networking

  1. Ensure that your MMC card is NOT plugged in yet.
  2. Boot your computer from the CD you just created. Instead of your regular OS (Windows or OS X) loading, you should see the live cd's boot screen.
    1. Windows users: You may need to press the F12 key (or another special key on your keyboard, depending on make and model) to choose to boot the computer from CD rather than its internal hard drive.
    2. Mac users: You will need to hold down the C key on your keyboard while your Mac boots in order to force it to boot from CD.
  3. Once the live cd has fully booted, you will need to configure networking. In the System Rescue CD environment, you type:
net-setup eth0
to configure networking. Other live cds may have different commands for this. For this example, we will assume you are using a wired network connection, and have only one network interface (Linux will see the first network interface as "eth0"). Wireless configuration is not covered within the scope of these directions.
If you have a DHCP server in your network environment, you should be able to simply choose "Use DHCP to auto-detect my network settings".

Download the BUG Rootfs

Type:

wget http://bugcommunity.com/downloads/files/rootfs.tar.bz2

Format Your MMC Card

We will be formatting the card using EXT3, which supports journaling of the filesystem, making filesystem corruption less likely due to "hard" shutdowns, etc.

First, BEFORE YOU PLUG IN THE MMC DRIVE, type the command:

fdisk -l

and note its output.

Next, plug the drive in, wait a few moments, then type:

fdisk -l

again. This time, you should notice a difference in the output -- a new device should be detected. Often, this device will be named something like /dev/sdf. Example output is below:

Disk /dev/sdf: 513 MB, 513802240 bytes
32 heads, 32 sectors/track, 980 cylinders
Units = cylinders of 1024 * 512 = 524288 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1         980      501744    6  FAT16

For this example, we will assume that your MMC is /dev/sdf. You should replace the "sdf" with the appropriate device from your specific system.

WARNING: Make sure to NOT use any of the devices listed in fdisk's output prior to plugging in your MMC card, or you will very likely destroy all or some of your production filesystem!

Let's unmount /dev/sdf to make sure that it is not in use by the filesystem:

umount /dev/sdf 

Now, let's format it:

mkfs.ext3 /dev/sdf1

Writing the Root Filesystem to the MMC Card

Type:

mkdir /tmp/mmc && mount /dev/sdf1 /tmp/mmc && cd /tmp/mmc
tar xvf ~/rootfs.tar.bz2

You will see the files being extracted, ending with this:

./boot/vmlinux
./linuxrc
./proc/

Unmount the MMC

cd
umount /tmp/mmc

Boot Your BUG

Once the MMC has been properly unmounted from the live cd environment's filesystem, you can remove it and place it in your BUG.

Boot the BUG!