User:NeoAmsterdam/11.2.0/Bootable SD: Difference between revisions

From OLPC
Jump to navigation Jump to search
(I've been at this all for at least NINE HOURS >_< Yeah, so the instruction are incomplete, but the gist is obvious at this point so I'm alright with uploading the partial instructions.)
 
(Two caveats: the kernel's fine now, but "we're hanging here" because /lib/modules can't be found... DANGER!)
Line 3: Line 3:
Be advised: you could go to the shops, buy ingredients, cook dinner, eat it, clean up, wash the dishes, and ''still'' be waiting for the whole procedure to finish.
Be advised: you could go to the shops, buy ingredients, cook dinner, eat it, clean up, wash the dishes, and ''still'' be waiting for the whole procedure to finish.


<div style="color: #a00; border: thin solid #f00; background: #faa;"><div style="text-align: center; text-decoration: underline; color: #f00;">'''''STOP! DO NOT PROCEED!'''''</div>This document is still in the process of being written. These instructions are not complete and could leave you in limbo.</div>
<div style="color: #a00; border: thin solid #f00; background: #faa;"><div style="text-align: center; text-decoration: underline; color: #f00;">'''''STOP! DO NOT PROCEED! DANGER! WARNING! BAD STUFF HERE!!!'''''</div>These instructions don't work (I just found out the hard way). Don't do this!</div>
<div style="margin-left: 5%; margin-right: 5%; font-size: 80%; font-family: serif; background: #faa; color: #500;">

= Before you Begin =
= Before you Begin =
* <span style="color: red;">This procedure will erase any data stored on the XO-1.</span>
* <span style="color: red;">This procedure will erase any data stored on the XO-1.</span>
Line 112: Line 112:


Release 11.2.0 will now "automagically" be installed to the XO-1's internal storage. When it finishes (about 9½ minutes later), the XO-1 will restart. Wait until you are presented with the "Name" screen before moving on to the next phase.
Release 11.2.0 will now "automagically" be installed to the XO-1's internal storage. When it finishes (about 9½ minutes later), the XO-1 will restart. Wait until you are presented with the "Name" screen before moving on to the next phase.
<div style="color: #a00; border: thin solid #f00; background: #faa;">This document is still in the process of being written.<br /><span style="color: black;">For the benefit of the curious, here are the '''''unconfirmed''''' instructions.</span></div><br /><div style="margin-left: 5%; margin-right: 5%; font-size: 80%; font-family: serif; background: #ccc; color: #333;">
<div style="color: #a00; border: thin solid #f00; background: #faa;">This document is still in the process of being written.<br /><span style="color: black;">For the benefit of the curious, here are the '''''unconfirmed''''' instructions.</span></div><br /><div style="margin-left: 5%; margin-right: 5%; font-size: 80%; font-family: serif; background: #fcc; color: #333;">
=== Graft 11.2.0's Kernel onto the SD Card ===
=== Graft 11.2.0's Kernel onto the SD Card ===
Now that Release 11.2.0 has been installed to the NAND, we can copy the "new" kernel onto the SD card.
Now that Release 11.2.0 has been installed to the NAND, we can copy the "new" kernel onto the SD card.
Line 126: Line 126:
The necessary boot files should now be grafted properly onto the SD card. <tt style="color: green; background: #cfc;"><b>shutdown</b> -r now</tt> at your own peril.
The necessary boot files should now be grafted properly onto the SD card. <tt style="color: green; background: #cfc;"><b>shutdown</b> -r now</tt> at your own peril.


</div>
</div>
</div>

Revision as of 15:29, 8 August 2011

One of these days I'm going to figure out the Forth behind the NAND flashing in OpenFimware...

If you've been following the OS installation sagas you'll know that there is no cheat code or OpenFirmware command for installing an OS image to an SD card on an XO-1 (as there is for the XO-1.5). Previously we grafted the OS from /versions/pristine onto the SD card. Unfortunately this approach doesn't appear to work with Relese 11.2.0 (Build 874) (phooey!). Instead, we bootstrap the process by making a 10.1.3 bootable SD card and apply the “simple” offline update instructions to mosey on up to 11.2.0.

Be advised: you could go to the shops, buy ingredients, cook dinner, eat it, clean up, wash the dishes, and still be waiting for the whole procedure to finish.

STOP! DO NOT PROCEED! DANGER! WARNING! BAD STUFF HERE!!!
These instructions don't work (I just found out the hard way). Don't do this!

Before you Begin

  • This procedure will erase any data stored on the XO-1.
  • This procedure will erase any data stored on the SD card.
  • Do not execute these instructions on battery power.
  • This procedure requires the SD card to be partitioned.
    Disk partitioning is beyond the scope of this document.
  • The SD will be formatted as an ext3 filesystem.
    This is not an optimal arrangement for SD cards.
  • Refrain from altering the volume label.
    /boot/olpc.fth expects it to be "OLPCRoot".
  • Children should get permission from a parent, guardian, teacher, and/or Linux guru before attempting this procedure.
    Adult supervision is not required, but it is highly recommended.

Requirements

  • An XO-1
  • A USB drive with ≥2GB capacity and formatted as FAT-32
    Actally, you need at least 1,052,798,976 bytes of storage space to hold build 874. This is less than the "traditional" gigabyte (1,073,741,824 bytes) but larger than the "redefined" gigabyte (1,000,000,000 bytes). Since USB drive manufacturers rarely (if ever) measure capacity in base 1024, we have to assume that all "1GB" sticks are in fact 50.35MB/52.79MB too small to be used for our purposes.
  • An SD card with at least 2GB of storage capacity
    When I tried to update the OS on the built-in NAND drive using this method, I ended up with a "no space left on device" error. Since the NAND is 1GB, and considering the "when isn't a gigabyte a gigabyte" schpiel, let's play it safe and use a 2GB SD card.
  • A Developer's key ("Dev Key")
  • Internet access

Procedure

Pre-Installation

  1. Back up your data!
    I take no responsibility for preventable data loss.
  2. Download build 860, build 874, the build 874 update, and their associated filesystem information:
  3. Copy os860.img, os860.img.fs.zip, os874.img, os874.img.fs.zip, and your Dev Key to the root directory of the USB drive.
  4. Create two folders called "860" and "874"
  5. Copy os874.img and os874.img.fs.zip into a folder called 874 on your USB drive.
  6. Rename os860.img.fs.zip to fs.zip

Installing 10.1.3 to the NAND

YamaKeep.JPG
  1. Shut down the XO-1.
  2. If there is an SD card in the SD card slot, eject it now.
  3. Insert the USB drive.
  4. Hold down all four game keys ( + + O + ×) while pressing the power button.
    Keep all four game keys depressed until the XO-1 prompts you otherwise (see illustration).

Release 10.1.3 will now "automagically" be installed to the XO-1's internal storage. When it finishes (about 8½ minutes later), the XO-1 will restart. Wait until you are presented with the "Name" screen (see illustration) before moving on to the next phase.

The "Name" screen

Grafting 10.1.3 to the SD Card

  1. Drop into a console.
    ♦ ctrl + ♢ alt + Mesh key f1 small.png f1
  2. Drop runlevels.
    /sbin/init 3
  3. Insert the SD card into the SD slot.
    If you have not partitioned the SD card, do so now. See the 10.1.2 Bootable SD note for more information.
  4. Initialize a filesystem on the SD card.
    mkfs.ext3 -L OLPCRoot /dev/mmcblk0p1
  5. Create a mount point for the SD card.
    mkdir /mnt/sd
  6. Mount the SD card.
    mount -t ext3 /dev/mmcblk0p1 /mnt/sd
  7. Copy the OS's files from the pristine build directory to the SD card.
    This can take as long as three hours. Have patience.
    cp -pr /versions/pristine/860/* /mnt/sd/.
  8. Copy the pristine build directory itself to the SD card.
    cp -pr /versions/* /mnt/sd/versions/.
    This takes just as long as the first copy. This second copy is necessary because the upgrading/synchronizing will fail if these files are missing.
  9. Create a mount point for the USB drive.
    mkdir /mnt/usb
  10. Mount the USB drive.
    mount -t vfat /dev/sda1 /mnt/usb
    Note: There is no guarantee that sda1 is the correct device, but if no other USB device has been plugged in since the XO restarted, then it will be the most likely case.
  11. Copy your Dev Key to the SD card now
    cp /mnt/usb/develop.sig /mnt/sd/security/develop.sig
  12. Unmount the USB drive.
    umount /mnt/usb
  13. Remove the USB drive's mount point.
    rmdir /mnt/usb
  14. Create the home directory.
    mkdir -p /mnt/sd/home/olpc
  15. Change ownership of the home directory.
    chown -R olpc:olpc /mnt/sd/home/olpc
  16. Unmount the SD card.
    umount /mnt/sd
  17. Remove the SD card's mount point.
    rmdir /mnt/sd

Release 10.1.3 has now been grafted onto the SD card. If the USB drive is plugged in, remove it now. shutdown -r now and your XO-1 should reboot from the SD card.


Upgrading to 11.2.0

Confirm the Boot Device

  1. As with last time, wait until you are presented with the "Name" screen.
  2. Drop into a console.
    ♦ ctrl + ♢ alt + Mesh key f1 small.png f1
  3. List the currently mounted devices.
    mount
    If the first line of the output begins with /dev/mmcblk0p1 on / then you have sucessfully booted from the SD card. If not, stop: you probably booted from the NAND.

Issuing the Update

  1. Drop runlevels.
    /sbin/init 3
  2. Plug in the USB drive.
  3. Create a mount point within /media for the USB drive.
    mkdir /media/usb
    The mount point must be within /media - do not use /mnt!
  4. Mount the USB drive.
    mount -t vfat /dev/sda1 /media/usb
    Note: There is no guarantee that sda1 is the correct device, but if no other USB device is plugged in and the XO has just restarted, then it will be the most likely case.
  5. Update the SD card to 11.2.0 using the “simple” offline updater.
    Technically we're synchronizing files; practically, we're upgrading the OS. This took about 110 minutes. Have patience.
    olpc-update -v --usb
    • Resist temptation and do not use the --reboot flag. You'll be sorry.
    • Interestingly enough, when I tried to update the OS on the built-in NAND drive using this method, I ended up with a "no space left on device" error. Go figure.
  6. Unmount the USB drive.
    umount /media/usb
  7. Remove the USB drive.

Release 11.2.0 has now been grafted onto the SD card... sort of: if you were to restart, you will find that the XO locks up at the bootsplash. This is because the XO is trying to boot an "old" kernel and the bootsplash is masking that error from the user (see illustration). This is why you should not the --reboot flag with olpc-update. Instead, shutdown -h now and wait for the system to power off.

There's an error hiding behind this bootsplash.

Don't ask me why the kernel doesn't get upgraded along with every other package because I just don't know - it's even possible that the developers don't know. In any event, we will have to copy the kernel for 11.2.0 from a clean installation onto the SD card - coincidentally, that will take place a few minutes from now.

Installing 11.2.0 to the NAND

Before we can install 11.2.0 to the NAND, we have to move the installation files for 10.1.3 out of the way.

Preparing 11.2.0 for Installation from USB

  1. Once the XO has been powered off, eject the SD card from the SD card slot.
  2. Power up the XO.
    You'll be booting into Release 10.1.3 from the NAND. Wait for the "Name" screen to appear.
  3. Drop into a console.
    ♦ ctrl + ♢ alt + Mesh key f1 small.png f1
  4. Insert the USB drive.
  5. Create a mount point for the USB drive.
    mkdir /mnt/usb
  6. Mount the USB drive.
    mount -t vfat /dev/sda1 /mnt/usb
    Note: There is no guarantee that sda1 is the correct device, but if no other USB device has been plugged in since the XO restarted, then it will be the most likely case.
  7. Change into the USB's directory
    cd /mnt/usb
  8. Move the 10.1.3 installation files from the USB's root directory to the 860 directory.
    mv os860.img 860/os860.img ;
    mv fs.zip 860/os860.img.fs.zip ;
  9. Move the 11.2.0 installation files from the 874 directory to the USB's root directory.
    mv 874/os874.img os874.img ;
    mv 874/os874.fs.zip fs.zip ;

    Your USB drive is now properly prepared for installing Release 11.2.0 to the NAND.
  10. Move out of the USB's directories
    cd /
  11. Unmount the USB drive.
    umount /mnt/usb
  12. Remove the USB drive's mount point.
    rmdir /mnt/usb
    Do not unplug the USB drive.
  13. Power off the XO
    shutdown -h now
  14. Once powered off, hold down all four game keys ( + + O + ×) while pressing the power button.
    Keep all four game keys depressed until the XO-1 prompts you otherwise (you've done this before).

Release 11.2.0 will now "automagically" be installed to the XO-1's internal storage. When it finishes (about 9½ minutes later), the XO-1 will restart. Wait until you are presented with the "Name" screen before moving on to the next phase.

This document is still in the process of being written.
For the benefit of the curious, here are the unconfirmed instructions.

Graft 11.2.0's Kernel onto the SD Card

Now that Release 11.2.0 has been installed to the NAND, we can copy the "new" kernel onto the SD card.

  1. Drop into a console.
    ♦ ctrl + ♢ alt + Mesh key f1 small.png f1
  2. Drop runlevels.
    /sbin/init 3
  3. Insert the SD card into the SD slot.
  4. Create a mount point for the SD card.
    mkdir /mnt/sd
  5. Mount the SD card.
    mount -t ext3 /dev/mmcblk0p1 /mnt/sd
  6. Copy the kernel... or should it be the whole of /boot/*???... to /mnt/sd/boot/ - I don't know yet, but the answer will definitely be here-ish. I hope.
  7. Unmount the SD card.
    umount /mnt/sd
  8. Remove the SD card's mount point.
    rmdir /mnt/sd

The necessary boot files should now be grafted properly onto the SD card. shutdown -r now at your own peril.