User:NeoAmsterdam/10.1.2/Bootable SD

From OLPC
< User:NeoAmsterdam
Revision as of 22:01, 3 September 2010 by NeoAmsterdam (talk | contribs) (To Do: optional installs (activities, dev key, adjusting the volume label in olpc.fth); chowning olpc:olpc; post-install (swapspace, de-futzing fstab))
Jump to navigation Jump to search
The instructions on this page are not complete.

Before you Begin

Warnings

  • This procedure will erase any data stored on the XO.
  • This procedure will erase any data stored on the SD card.
  • This procedure will erase any data stored on the USB drive.
  • This procedure requires the SD card to be partitioned: fdisk skill is required.
  • This procedure takes a long time to execute; do not execute these instructions on battery power.

Caveats

  • The SD card will be partitioned for Linux and have an ext3 filesystem. This is not an optimal arrangement for SD cards, but it works.
  • /boot/olpc.fth will have to be edited if volume label of the ext3 partition on the SD card is different than "OLPCRoot"
    • This can be done in OpenFirmware using µemacs if necessary.
  • yum will not work because /var/cache/yum and temp are mounted in /etc/fstab
    • This can be edited post-install, but we'll do it as part of the install's optional phase
  • The second install phase takes forever. (That's the price you have to pay for GNOME)

Unknowns

  • This procedure was accomplished on an XO-1. I suspect, but cannot confirm, that this procedure will work on an XO-1.5.

Requirements

  • An XO
  • A USB drive with at least 1GB of storage capacity formatted using FAT-32
    • A 1GB USB drive will do, but if you will need more space if you intend to install activities from the USB key.
    • I recommend a 2GB USB drive. Larger is always better.
  • An SD card with at least 1GB of storage capacity
    • Use an SD card whose capacity exceeds the XO's (otherwise you will defeat the purpose of installing 10.1.2 to the SD card).
    • I use a 16GB Transcend SDHC card, model number TS16GSDHC6.
  • Build 852 and its associated filesystem information
    • While you can download these files to the USB drive from your XO, I highly recommend downloading these files on a different computer.

Optional Files

  • Developer's key ("Dev Key")
    • If you don't know what this is, don't worry; if you do, make sure you have a copy of it.
  • Activities
    • I prefer to have my activites on the USB drive instead of having to download them post-install.

Procedure

Pre-Installation

Back Up Your Data

This may seem obvious, but it warrants repeating: this procedure will erase all the data on your XO and SD card, and possibly your USB key as well. Back up your data!

Create Installation Drive

  1. If your USB drive is not formatted as a FAT-32 drive, do so now.
    Note: Windows 7 appears to format USB drives using exFAT by default. The XO cannot read exFAT - You must use FAT-32.
  2. Download build 852 and its associated filesystem information:
  3. Copy os852.img and os852.img.fs.zip to the root directory of the USB drive
  4. Rename os852.img.fs.zip to fs.zip

Optional

  • If you have a Dev Key, copy it to the root directory of your USB drive.
  • If you downloaded activities:
    1. Make a directory named Activities in the root directory of your USB drive.
    2. Copy the activities into the Activities directory.

First Installation

This phase of the procedure will install release 10.1.2 to the XO's built-in storage.

  1. This is your last chance to back up your data. If you haven't done so, do so now.
  2. Shut down the XO.
  3. Eject SD card.
  4. Insert the USB drive.
  5. Hold down all four game keys ( + + O + ×)
  6. Press the power button.
    Keep all four game keys depressed until the XO prompts you otherwise.

You may now leave the XO unattended while it installs release 10.1.2 to the built-in storage.

Second Installation

This phase of the procedure will copy the 10.1.2 installation from the XO's built-in storage to a freshly-formatted SD card.

Note: This document will gloss over fdisk. See the Linux Partition HOWTO for more information.
  1. When you see the "Name:" screen, drop into a console.
    Press ♦ ctrl + ♢ alt + Mesh key f1 small.png f1.
  2. Drop the runlevel.
    /sbin/init 3
  3. Insert SD card into its slot.

fdisk

This will prepare the SD card for formatting.

  1. Parition the SD card for Linux.
    fdisk /dev/mmcblk0
  2. Print out the partition table.
    p
    This information will determine your next step.
    • If one parition is shown and it isn't Linux-style, change the partition type:
      T
      83
    • If no partitions are shown, create one:
      n
      p
      1
      Accept the defaults from this point on.
    • If the partition is not flagged as active, activte it:
      a
      1
  3. Confirm the partition arrangement.
    p
    There should be only one partition listed, beginning with /dev/mmcblk0p1 * 1 and ending with 83 Linux. If you see something different, or if more than one parition is shown, do not proceed any further.
  4. Once confirmed, write the partition arrangement.
    w

mkfs.ext3

This will create a clean filesystem on the SD card.

  1. Create an ext3 filesystem. Unless you are compelled otherwise, set the volume label to OLPCRoot.
    Note: The volume label can be anything you like, but it will require some additional intervention in order to make the SD card bootable.
    mkfs.ext3 -L OLPCRoot /dev/mmcblk0p1

mount

This will make the SD card accessible.

  1. Create a mount point for the SD card.
    mkdir /mnt/sd
  2. Mount the SD card.
    mount -t ext3 /dev/mmcblk0p1 /mnt/sd

cp

This will copy the 10.1.2 installation from the XO's built-in storage to the SD card.

Note: This part of the procedure can take as long as three hours. The XO will appear unresponsive during this time.
  1. Copy the files from the pristine build directory to the SD card.
    cp -pr /versions/pristine/852/* /mnt/SD/.
    • If you want to make sure the XO is copying, use cp -pvr /versions/pristine/852/* /mnt/SD/.. Beware that this will slow down the copying speed somewhat.

mkdir

This will create your home directory. The XO will be somewhat dysfunctional without it.

  1. Create the home directory.
    mkdir -p /mnt/SD/home/olpc

Optional Installations

USB never removed and autofs shouldn't be a prob. but add note re: unmounting automounts

  • mkdir /mnt/usb
  • mount usb

Dev key

  • cp /mnt/usb/develop.key /mnt/sd/security/develop.key

Activities

  • mkdir /mnt/sd/home/olpc/Activities
  • cd /mnt/sd/home/olpc/Activities
  • cp -rv /mnt/usb/*.xo . ;
  • cp -rv /mnt/usb/*.xol . ;
  • ls -1 | while read i ; do unzip $i ; rm $i ; done

Swapfile

/var/vm? /swap? omit the whole thing?

  • dd if=/dev/zero of=1m bs=1048576 count=1
  • for i in {1..512} ; do cat 1m >> swapfile ; done ; # (w/ note as to why repeat 1MB loops in lieu of `dd... bs=1048576 count=512)
  • mkswap swapfilename

Device Label

nano /sd/boot/olpc.fth

  • rename appropriate line

Overclocking

nano /sd/boot/olpc.fth

  • insert command where appropriate (if so desired)

4: Post-Installation

  • cd /mnt/sd/home
  • chown -r olpc:olpc olpc
  • shutdown -h now
  • remove all devices
  • reboot (w/ note: recommend verbose boot 1st time, normal boot 2nd time)

Troubleshooting

List of "oops"s I came across

What next?

This remainder of this page contains no actionable information.

First Attempt

Failure

  • Failure
    used cp -prv /versions/pristine/852/* /mnt/sd/. (it lit. takes HOURS to copy over); boot yields the following:
FATAL: Module scsi_wait_scan not found.
FATAL: Module scsi_wait_scan not found.
FATAL: Module scsi_wait_scan not found.
FATAL: Module scsi_wait_scan not found.
FATAL: Module scsi_wait_scan not found.


No root device found

Boot has failed, sleeping forever.

Observations

  • Noticed that OFW looks for root=LABEL=OLPCRoot or somesuch, and my SD was formatted mkfs.ext3 -v -L OLPC-SD (oops?).
    • Maybe editing /boot/olpc.fth with µemacs in OFW?
    • Manually specifying kernel arg/root dev. in OFW (until "in")?
  • Penguin, not OLPC logo, shows in corner of screen... oopsie or intentional? [ shrugs shoulders ]

Post-Mortem

  1. Boot into OFW (note: make sure to mention developer key required)
  2. emacs sd:\boot\olpc.fth
    • BTW, didn't it occur to anyone that there isn't an F5/F6/F7/F8 key on an OLPC keyb? ^X^S won't work, and I can't tell which button/key I'm pressing!
  3. Down near the end - look for the last screenful:
" nand"  dn-buf count  sindex 0>= if
   " root=/dev/mtdblock0 rootfstype=jffs2"
else
   " root=LABEL=OLPCRoot rootfstype=ext3"
then
  1. Switching root=LABEL=OLPCRoot to root=LABEL=OLPC-SD (note: maybe tell people to mkfs.ext3 -v -L OLPCRoot instead of editing a posteriori w/ dev key)

Second Attempt

Failure

<TUX>

[    7.824604] dracut: Switching root
dracut: Switching root
init: readahead-collector.event main process (870) terminated with status 1
                Welcome to Fedora OLPC Release 10 (based on Fedora 11)
                Press 'I' to enter interactive startup
Starting udev: udevd-event[1113]: unknown format char 'g'


udevadm settle - timeout of 0 seconds reached, the event queue contains:
  /sys/devices/virtual/tty/tty0 (656)
  /sys/devices/virtual/tty/console (653)
  /sys/devices/virtual/net/lo (651)
  /sys/devices/virtual/block/ram9 (623)
  /sys/devices/virtual/block/ram8 (622)
  /sys/devices/virtual/block/ram7 (621)
  /sys/devices/virtual/block/ram6 (620)
  /sys/devices/virtual/block/ram5 (619)
  /sys/devices/virtual/block/ram4 (618)
  /sys/devices/virtual/block/ram3 (617)
  /sys/devices/virtual/block/ram2 (616)
  /sys/devices/virtual/block/ram15 (615)
  /sys/devices/virtual/block/ram14 (614)
  /sys/devices/virtual/block/ram13 (613)
  /sys/devices/virtual/block/ram12 (612)
  /sys/devices/virtual/block/ram11 (611)
  /sys/devices/virtual/block/ram10 (610)
  /sys/devices/virtual/block/ram1 (609)
  /sys/devices/virtual/block/ram0 (608)
  /sys/devices/platform/rtc_cmos/rtc/rtc0 (585)
  /sys/devices/pci0000:00/0000:00:0c.1/mmc_host/mmc0/mmc0:b368/block/mmcblk0/mmcblk0p1 (544)
Wait timeout. Will continue in the background.             [FAILED]
/etc/init.d/functions: line 494: /usr/bin/plymouth: Input/output error

[  662.777089] EXT3-fs error (device: mmcblk0p1): ext3_get_inode_loc: unable to read inode block - in
ode=17748, block65625
[  988.376632] EXT3-fs error (device: mmcblk0p1): ext3_find_entry: reading directory #311662 offset 0
udevd-event[991]: exec of program '/sbin/alsactl' failed'

Observations

Looks like a total hang, but no "I give up" message on screen, so sipping coffee and pondering next move... (SD card busted? 10.1.2 not expecting to boot off SD? Can I fsck from withing OFW?)

Post-mortem

OFW doesn't seem to have fsck, so...

  1. Restarted from 10.1.2 on NAND
  2. /sbin/init 3 in console.
  3. fsck.ext3 -v /dev/mmcblk0p1 returned OLPC-SD: clean, 43246/981120 files, 353740/3922425 blocks.
  4. fsck.ext3 -fv /dev/mmcblk0p1 found a problem with inode 13 - fixed (please let that be the reason)
  5. shtudown -r now

Third Attempt

Apparent Success

Greeted with "Name:_____" screen .o0( "I'd like to thank my momma and Elvis..." )

Observations

Boot was kinda sluggish (part key generation, part olpc-configure note: doing a mkdir -pv /mnt/sd/home/olpc after copying to /mnt/sd is imperative), and was done with √ held down - time to take off the training wheels

Post-Mortem

  1. shoutdown -h now, sip some more coffee, and boot without any "cheat codes".

Fourth Attempt

Observations

Something's wrong: Boot screen stuck at one dot for a long time, then blank console with blinking cursor; no command prompt, no response to keyb input.

Post-Mortem

Forcing a poweroff, waiting, and trying again w/o cheat codes.

Fifth Attempt

Apparent Success

Boot sequence looks normal (I'm gonna hafta get used to seeing "sugar labs" in the lower left). One more poweroff, another coffee, and I'll confirm success in a few minutes (I hope)!

Apparent Success

Boot sequence looks normal (I'm gonna hafta get used to seeing "sugar labs" in the lower left). One more poweroff, another coffee, and I'll confirm success in a few minutes (I hope)!

Sixth Attempt

Successful

Boots on its own while on battery :-D

Observations

  • Boot animation seems to be much faster than before
  • Wireless network colors are different than in 802.
  • Still can't get used to having to scroll horizontally so see control panel options.
  • No activities (no surprise - see [[1]])
    • After DLing activities, all icons went blank and had to three-finger Sugar

Post-Mortem

¡GOL!, but where's "Restart"??

Seventh Attempt/Second Confirmation =

Sugar, GNOME, and console all work... High-fives all 'round, smoke 'em if you got 'em, and I'll start writing the how-to asap.

Next Steps

  • Fix YUM problems (Why on Earth are /var/cache/yum, /var/tmp, /var/log being mounted as devices?!? Because /etc/fstab said so - YUM won't work with the mount to /tmp - comment the lines out in fstab)
    • Install WINE, TeXLive, GCC, and a few non-free YUMmies
  • Swap space (512MB, probably)
  • /etc/motd
  • Setup SSH...
  • And why can't I shutdown or restart from GNOME? And why can't GNOME end a session cleanly (read: go back to sugar)? And where is the battery monitor for GNOME? And why the bleep can't I shutdown or restart from GNOME??