User:NeoAmsterdam/10.1.2/Bootable SD: Difference between revisions
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)) |
No edit summary |
||
(16 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
[[Image:YamaDone.JPG|right|thumb|link=|If only it were this easy]] |
|||
<div style="border: thin solid #ff7f00; background: #ffd0aa; color: #a50; font-weight: bold; text-align: center;">The instructions on this page are not complete.</div> |
|||
Unlike the XO-1's built-in storage, there is no [[Cheat codes|cheat code]] or [[Open Firmware|OpenFirmware]] command for installing an OS image to an SD card. More's the pity, as this procedure takes significantly longer than a [[Release_notes/10.1.2#XO-1|clean install]] (as depicted). The instructions on this page show how to install [[Release_notes/10.1.2|Release 10.1.2 (Build 852)]] to an SD card on an XO-1. |
|||
When you are finished, you will be able to run the OS from the SD card while leaving the OS stored in the XO's internal memory virtually intact. Moreover, given the continuously increasing capacities of SD cards, you can have as much storage space as your heart desires (and your wallet allows). |
|||
Please read this document thoroughly before proceeding - many a trouble can be prevented this way. Also, 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). |
|||
= Before you Begin = |
= Before you Begin = |
||
== Warnings == |
== Warnings == |
||
* This procedure will erase any data stored on the XO. |
* <span style="color: red;">This procedure will erase any data stored on the XO.</span> |
||
* This procedure will erase any data stored on the SD card. |
* <span style="color: red;">This procedure will erase any data stored on the SD card.</span> |
||
* This procedure will erase any data stored on the USB drive. |
* <span style="color: red;">This procedure will erase any data stored on the USB drive.</span> |
||
* This procedure requires the SD card to be partitioned: <tt><b>fdisk</b></tt> skill is required. |
* <span style="color: red;">This procedure requires the SD card to be partitioned: <tt><b>fdisk</b></tt> skill is required.</span> |
||
*: You may refer to the See the [http://tldp.org/HOWTO/Partition/fdisk_partitioning.html Linux Partition HOWTO] by [http://tldp.org The Linux Documentation Project] for more information. |
|||
* This procedure takes a long time to execute; do not execute these instructions on battery power. |
|||
* <span style="color: red;">This procedure takes a long time to execute; do not execute these instructions on battery power.</span> |
|||
== Caveats == |
== 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. |
* <span style="color: orange;">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.</span> |
||
* <tt>/boot/olpc.fth</tt> will have to be edited if volume label of the ext3 partition on the SD card is different than "OLPCRoot" |
* <span style="color: orange;"><tt>/boot/olpc.fth</tt> will have to be edited if volume label of the ext3 partition on the SD card is different than "OLPCRoot"</span> |
||
** This can be done in OpenFirmware using µemacs if necessary. |
** This can be done in OpenFirmware using µemacs if necessary. |
||
* <tt><b>yum</b></tt> will not work because <tt>/var/cache/yum</tt> and <tt>temp</tt> are mounted in <tt>/etc/fstab</tt> |
* <span style="color: orange;"><tt><b>yum</b></tt> will not work because <tt>/var/cache/yum</tt> and <tt>temp</tt> are mounted in <tt>/etc/fstab</tt></span> |
||
** This can be edited post-install, but we'll do it as part of the install's optional phase |
** 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) |
* <span style="color: orange;">The second install phase takes forever. (That's the price you have to pay for having GNOME)</span> |
||
== 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 = |
= Requirements = |
||
* An XO |
* An XO |
||
** I suspect, but cannot confirm, that this procedure will work on an XO-1.5. Anyone with an XO-1.5 who has tried this method of creating a bootable SD is encouraged to document their results on the discussion page. |
|||
* A USB drive with at least 1GB of storage capacity formatted using FAT-32 |
* A USB drive with at least 1GB of storage capacity formatted using FAT-32 |
||
** A 1GB USB drive will do, but |
** A 1GB USB drive will do, but 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. |
** I recommend a 2GB USB drive. Larger is always better. |
||
* An SD card with at least 1GB of storage capacity |
* 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). |
** 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 |
* 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. |
** While you ''can'' download these files to the USB drive from your XO, I highly recommend downloading these files on a different computer. |
||
Line 56: | Line 59: | ||
== First Installation == |
== First Installation == |
||
This phase of the procedure will install release 10.1.2 to the XO's built-in storage. |
This phase of the procedure will install release 10.1.2 to the XO's built-in storage. The process takes less than 10 minutes. |
||
[[Image:YamaKeep.JPG|thumb|right|link=]] |
|||
# This is your last chance to back up your data. If you haven't done so, do so now. |
# This is your last chance to back up your data. If you haven't done so, do so now. |
||
# Shut down the XO. |
# Shut down the XO. |
||
Line 63: | Line 67: | ||
# Hold down all four game keys (<b>✓</b> + <b>◻</b> + <b>O</b> + <b>×</b>) |
# Hold down all four game keys (<b>✓</b> + <b>◻</b> + <b>O</b> + <b>×</b>) |
||
# Press the power button. |
# Press the power button. |
||
#: Keep all four game keys depressed until the XO prompts you otherwise |
#: Keep all four game keys depressed until the XO prompts you otherwise (see illustration) |
||
You may now leave the XO unattended while it installs release 10.1.2 to the built-in storage. |
You may now leave the XO unattended while it installs release 10.1.2 to the built-in storage. |
||
== Second Installation == |
== 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.< |
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. <span style="color: red;">The process can take as long as three hours.</span> |
||
[[Image:NA 852 S Name Screen.png|thumb|right|link=|The second installation can't begin until you see this on your screen]] |
|||
# When you see the "Name:" screen, drop into a console. |
|||
# When you see the "Name:" screen (see illustration), drop into a console. |
|||
#:Press <b>♦ ctrl</b> + <b>♢ alt</b> + <b>[[Image:Mesh key f1 small.png|16px|link=]] f1</b>. |
#:Press <b>♦ ctrl</b> + <b>♢ alt</b> + <b>[[Image:Mesh key f1 small.png|16px|link=]] f1</b>. |
||
# Drop the runlevel. |
# Drop the runlevel. |
||
Line 109: | Line 114: | ||
This will copy the 10.1.2 installation from the XO's built-in storage to the SD card.<div style="float: right; border: thin solid gray; max-width: 50% !important;"><b>Note:</b> This part of the procedure can take as long as three hours. The XO will appear unresponsive during this time.</div> |
This will copy the 10.1.2 installation from the XO's built-in storage to the SD card.<div style="float: right; border: thin solid gray; max-width: 50% !important;"><b>Note:</b> This part of the procedure can take as long as three hours. The XO will appear unresponsive during this time.</div> |
||
# Copy the files from the pristine build directory to the SD card. |
# Copy the files from the pristine build directory to the SD card. |
||
#: <tt style="color: white; background: black"><b>cp</b> -pr /versions/pristine/852/* /mnt/ |
#: <tt style="color: white; background: black"><b>cp</b> -pr /versions/pristine/852/* /mnt/sd/.</tt> |
||
#* If you want to make sure the XO is copying, use <tt style="color: white; background: black"><b>cp</b> -pvr /versions/pristine/852/* /mnt/ |
#* If you want to make sure the XO is copying, use <tt style="color: white; background: black"><b>cp</b> -pvr /versions/pristine/852/* /mnt/sd/.</tt>. Beware that this will slow down the copying speed somewhat. |
||
=== <tt><b>mkdir</b></tt> === |
=== <tt><b>mkdir</b></tt> === |
||
This will create your home directory. The XO will be somewhat dysfunctional without it. |
This will create your home directory. The XO will be somewhat dysfunctional without it. |
||
# Create the home directory. |
# Create the home directory. |
||
#: <tt style="color: white; background: black"><b>mkdir</b> -p /mnt/ |
#: <tt style="color: white; background: black"><b>mkdir</b> -p /mnt/sd/home/olpc</tt> |
||
== Optional Installations == |
== Optional Installations == |
||
The instructions in this section are optional. The "must do" installation procedure resumes at "[[User:NeoAmsterdam/10.1.2/Bootable SD#Installation Cleanup|Installation Cleanup]]" |
|||
# If you have removed the USB drive, reinsert it now. |
|||
# Create a mount point for the USB drive. |
|||
#: <tt style="color: white; background: black"><b>mkdir</b> /mnt/usb</tt> |
|||
# Mount the USB drive.<div style="float: right; border: thin solid gray; max-width: 50% !important;"><b>Note:</b> Although <tt>sda1</tt> is the most likely device idenfier, it is not guaranteed to be the correct one.</div> |
|||
#: <tt style="color: white; background: black"><b>mount</b> -t vfat /dev/sda1 /mnt/usb</tt> |
|||
=== Dev Key === |
|||
# Copy the Dev Key from the USB drive to the SD card. |
|||
#: <tt style="color: white; background: black"><b>cp</b> /mnt/usb/develop.sig /mnt/sd/security/develop.sig</tt> |
|||
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 === |
=== Activities === |
||
# Copy the activities directory from the USB drive to the user's home folder. |
|||
* mkdir /mnt/sd/home/olpc/Activities |
|||
#: <tt style="color: white; background: black"><b>cp</b> -r /mnt/usb/Activities /mnt/sd/home/olpc/.</tt> |
|||
* cd /mnt/sd/home/olpc/Activities |
|||
# Change to the newly-installed activities directory. |
|||
* cp -rv /mnt/usb/*.xo . ; |
|||
#: <tt style="color: white; background: black"><b>cd</b> /mnt/sd/home/olpc/Activities</tt> |
|||
* cp -rv /mnt/usb/*.xol . ; |
|||
# Unzip the activities. |
|||
* ls -1 | while read i ; do unzip $i ; rm $i ; done |
|||
#: <tt style="color: white; background: black"><b>ls</b> -1 | <b>while</b> <b>read</b> i ; <b>do</b> <b>unzip</b> $i ; <b>done</b></tt> |
|||
=== Swapfile === |
|||
# Remove the activity packages |
|||
/var/vm? /swap? omit the whole thing? |
|||
#: <tt style="color: white; background: black"><b>rm</b> *.xo *xol</tt> |
|||
* 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? = |
|||
=== Adjusting the Volume Label === |
|||
<div style="border: thin solid #ff0000; background: #ffaaaa; color: #a00; font-weight: bold; text-align: center;">This remainder of this page contains no actionable information.</div> |
|||
If you chose a volume label other than "OLPCRoot", edit <tt>olpc.fth</tt>. |
|||
# <tt style="color: white; background: black"><b>nano</b> /mnt/sd/boot/olpc.fth</tt> |
|||
# Scroll towards the end of the document. |
|||
# Replace the volume label from <tt>OLPCRoot</tt> to the volume label you chose. |
|||
# Save and quit. |
|||
=== Unblocking <tt><b>yum</b></tt> === |
|||
= First Attempt = |
|||
Release 10.1.2 has a feature that prevents <tt><b>yum</b></tt> from functioning. To reenable <tt><b>yum</b></tt>, edit <tt>fstab</tt>. |
|||
== Failure == |
|||
# <tt style="color: white; background: black"><b>nano</b> /mnt/sd/etc/fstab</tt> |
|||
* '''Failure'''<br />used <tt>cp -prv /versions/pristine/852/* /mnt/sd/.</tt> (it lit. takes ''HOURS'' to copy over); boot yields the following: |
|||
# Comment out the following mount points: |
|||
FATAL: Module scsi_wait_scan not found. |
|||
#* <tt>/temp</tt> |
|||
FATAL: Module scsi_wait_scan not found. |
|||
#* <tt>varcacheyum</tt> |
|||
FATAL: Module scsi_wait_scan not found. |
|||
#* <tt>vartmp</tt> |
|||
FATAL: Module scsi_wait_scan not found. |
|||
#* <tt>varlog</tt> |
|||
FATAL: Module scsi_wait_scan not found. |
|||
# Save and quit. |
|||
No root device found |
|||
Boot has failed, sleeping forever. |
|||
=== Optional Install Cleanup === |
|||
== Observations == |
|||
These must be executed before resuming the required instructions. |
|||
* Noticed that OFW looks for root=LABEL=OLPCRoot or somesuch, and my SD was formatted <tt>mkfs.ext3 -v -L OLPC-SD</tt> (oops?). |
|||
# Unmount the USB drive |
|||
** Maybe editing <tt>/boot/olpc.fth</tt> with µemacs in OFW? |
|||
#: <tt style="color: white; background: black"><b>umount</b> /mnt/usb</tt> |
|||
** Manually specifying kernel arg/root dev. in OFW (until "in")? |
|||
# Remove the USB drive's mount point |
|||
* Penguin, not OLPC logo, shows in corner of screen... oopsie or intentional? [ shrugs shoulders ] |
|||
#: <tt style="color: white; background: black"><b>rmdir</b> /mnt/usb</tt> |
|||
== |
== Installation Cleanup == |
||
This section contains the last set instructions required to complete the installation procedure. |
|||
# Boot into OFW ('''note:''' make sure to mention developer key required) |
|||
# Change ownership of the user's home folder. |
|||
# <tt>emacs sd:\boot\olpc.fth</tt> |
|||
#: <tt style="color: white; background: black"><b>chown</b> -R olpc:olpc /mnt/sd/home/olpc</tt> |
|||
#* 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! |
|||
# Unmount the SD card |
|||
# Down near the end - look for the last screenful: |
|||
#: <tt style="color: white; background: black"><b>umount</b> /mnt/sd</tt> |
|||
" nand" dn-buf count sindex 0>= if |
|||
# Remove the SD card's mount point |
|||
" root=/dev/mtdblock0 rootfstype=jffs2" |
|||
#: <tt style="color: white; background: black"><b>rmdir</b> /mnt/sd</tt> |
|||
else |
|||
# Restart the XO |
|||
" root=LABEL=OLPCRoot rootfstype=ext3" |
|||
#: <tt style="color: white; background: black"><b>shutdown</b> -r now </tt> |
|||
then |
|||
#* Note: You will probably want to restart in verbose mode. To do that, hold down the <b>✓</b> key at startup. |
|||
# Switching <tt>root=LABEL=OLPCRoot</tt> to <tt>root=LABEL=OLPC-SD</tt> ('''note:''' maybe tell people to <tt>mkfs.ext3 -v -L OLPCRoot</tt> instead of editing a posteriori w/ dev key) |
|||
#* Once you've restarted, drop into a console (press <b>♦ ctrl</b> + <b>♢ alt</b> + <b>[[Image:Mesh key f1 small.png|16px|link=]] f1</b>) and run <tt style="color: white; background: black"><b>df</b></tt>: its output will indicate whether you booted from SD card or the NAND. The best indicator is if you see <tt>/dev/mmcblk0p1</tt> mounted as <tt>/</tt>. |
|||
= 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' |
|||
= Post-Installation Troubleshooting = |
|||
== Observations == |
|||
== Failure to Start == |
|||
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 <tt>fsck</tt> from withing OFW?) |
|||
If the system fails to boot after the above steps, try turning it off, holding down the checkmark button, and turning it back on. Let go of the checkmark button when it tells you to. This will show the details of what is happening as it tries to boot up. If you see the message <tt>dracut: FATAL: No or empty root= argument</tt> a few lines before it stops, then you will need to put your developer key on the SD card. This is covered in the optional steps above. |
|||
== |
== Stalling on Startup == |
||
Occasionally the XO will seem to stall during the boot animation sequence, even though it ''has'' booted fully. A workaround that seems to fix this problem is to disable <tt>0-boot-anim-start</tt>. |
|||
OFW doesn't seem to have <tt>fsck</tt>, so... |
|||
# Drop into a console |
|||
# Restarted from 10.1.2 on NAND |
|||
#: Press <b>♦ ctrl</b> + <b>♢ alt</b> + <b>[[Image:Mesh key f1 small.png|16px|link=]] f1</b> |
|||
# <tt>/sbin/init 3</tt> in console. |
|||
#: For some reason (probably a <tt>$PATH</tt> issue), neither the Sugar Terminal nor GNOME's Terminal can find <tt><b>chkconfig</b></tt>. |
|||
# <tt>fsck.ext3 -v /dev/mmcblk0p1</tt> returned <tt>OLPC-SD: clean, 43246/981120 files, 353740/3922425 blocks</tt>. |
|||
# Disable <tt>0-boot-anim-start</tt>. |
|||
# <tt>fsck.ext3 -fv /dev/mmcblk0p1</tt> found a problem with inode 13 - fixed (please let ''that'' be the reason) |
|||
#: <tt style="background: black; color: white;"><b>chkconfig</b> 0-boot-anim-start --levels 0123456 off</tt> |
|||
# <tt>shtudown -r now</tt> |
|||
If you also disable <tt>z-boot-anim-stop</tt>, you may find that the cursor from the OpenFirmware console will remain onscreen post-boot. Therefore, you may leave <tt>z-boot-anim-stop</tt> as is. |
|||
= 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 <tt>mkdir -pv /mnt/sd/home/olpc</tt> after copying to /mnt/sd is ''imperative''), and was done with √ held down - time to take off the training wheels |
|||
== Post-Mortem == |
|||
# <tt>shoutdown -h now</tt>, 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 [[http://wiki.laptop.org/go/User:NeoAmsterdam/8.0.2/Activities|note]]) |
|||
** After DLing activities, all icons went blank and had to three-finger Sugar |
|||
== Post-Mortem == |
|||
<b><i>¡GOL!</i></b>, 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. |
|||
You can reset the boot animation to its default settings by running <tt style="background: black; color: white;"><b>chkconfig</b> 0-boot-anim-start --levels 5 on</tt>. |
|||
= Next Steps = |
|||
* Fix YUM problems <s>(Why on Earth are <tt>/var/cache/yum</tt>, <tt>/var/tmp</tt>, <tt>/var/log</tt> being mounted as devices?!? </s> 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?? |
Latest revision as of 01:42, 18 February 2011
Unlike the XO-1's built-in storage, there is no cheat code or OpenFirmware command for installing an OS image to an SD card. More's the pity, as this procedure takes significantly longer than a clean install (as depicted). The instructions on this page show how to install Release 10.1.2 (Build 852) to an SD card on an XO-1.
When you are finished, you will be able to run the OS from the SD card while leaving the OS stored in the XO's internal memory virtually intact. Moreover, given the continuously increasing capacities of SD cards, you can have as much storage space as your heart desires (and your wallet allows).
Please read this document thoroughly before proceeding - many a trouble can be prevented this way. Also, 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).
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.
- You may refer to the See the Linux Partition HOWTO by The Linux Documentation Project for more information.
- 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 having GNOME)
Requirements
- An XO
- I suspect, but cannot confirm, that this procedure will work on an XO-1.5. Anyone with an XO-1.5 who has tried this method of creating a bootable SD is encouraged to document their results on the discussion page.
- A USB drive with at least 1GB of storage capacity formatted using FAT-32
- A 1GB USB drive will do, but 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).
- 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
- 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.
- Download build 852 and its associated filesystem information:
- os852.img (604MB)
- os852.img.fs.zip (398KB)
- Copy os852.img and os852.img.fs.zip to the root directory of the USB drive
- 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:
- Make a directory named Activities in the root directory of your USB drive.
- 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. The process takes less than 10 minutes.
- This is your last chance to back up your data. If you haven't done so, do so now.
- Shut down the XO.
- Eject SD card.
- Insert the USB drive.
- Hold down all four game keys (✓ + ◻ + O + ×)
- Press the power button.
- Keep all four game keys depressed until the XO prompts you otherwise (see illustration)
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. The process can take as long as three hours.
- When you see the "Name:" screen (see illustration), drop into a console.
- Press ♦ ctrl + ♢ alt + f1.
- Drop the runlevel.
- /sbin/init 3
- Insert SD card into its slot.
fdisk
This will prepare the SD card for formatting.
- Parition the SD card for Linux.
- fdisk /dev/mmcblk0
- 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
- 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.
- Once confirmed, write the partition arrangement.
- w
mkfs.ext3
This will create a clean filesystem on the SD card.
- 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.
- Create a mount point for the SD card.
- mkdir /mnt/sd
- 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.
- 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.
- Create the home directory.
- mkdir -p /mnt/sd/home/olpc
Optional Installations
The instructions in this section are optional. The "must do" installation procedure resumes at "Installation Cleanup"
- If you have removed the USB drive, reinsert it now.
- Create a mount point for the USB drive.
- mkdir /mnt/usb
- Mount the USB drive.Note: Although sda1 is the most likely device idenfier, it is not guaranteed to be the correct one.
- mount -t vfat /dev/sda1 /mnt/usb
Dev Key
- Copy the Dev Key from the USB drive to the SD card.
- cp /mnt/usb/develop.sig /mnt/sd/security/develop.sig
Activities
- Copy the activities directory from the USB drive to the user's home folder.
- cp -r /mnt/usb/Activities /mnt/sd/home/olpc/.
- Change to the newly-installed activities directory.
- cd /mnt/sd/home/olpc/Activities
- Unzip the activities.
- ls -1 | while read i ; do unzip $i ; done
- Remove the activity packages
- rm *.xo *xol
Adjusting the Volume Label
If you chose a volume label other than "OLPCRoot", edit olpc.fth.
- nano /mnt/sd/boot/olpc.fth
- Scroll towards the end of the document.
- Replace the volume label from OLPCRoot to the volume label you chose.
- Save and quit.
Unblocking yum
Release 10.1.2 has a feature that prevents yum from functioning. To reenable yum, edit fstab.
- nano /mnt/sd/etc/fstab
- Comment out the following mount points:
- /temp
- varcacheyum
- vartmp
- varlog
- Save and quit.
Optional Install Cleanup
These must be executed before resuming the required instructions.
- Unmount the USB drive
- umount /mnt/usb
- Remove the USB drive's mount point
- rmdir /mnt/usb
Installation Cleanup
This section contains the last set instructions required to complete the installation procedure.
- Change ownership of the user's home folder.
- chown -R olpc:olpc /mnt/sd/home/olpc
- Unmount the SD card
- umount /mnt/sd
- Remove the SD card's mount point
- rmdir /mnt/sd
- Restart the XO
- shutdown -r now
- Note: You will probably want to restart in verbose mode. To do that, hold down the ✓ key at startup.
- Once you've restarted, drop into a console (press ♦ ctrl + ♢ alt + f1) and run df: its output will indicate whether you booted from SD card or the NAND. The best indicator is if you see /dev/mmcblk0p1 mounted as /.
Post-Installation Troubleshooting
Failure to Start
If the system fails to boot after the above steps, try turning it off, holding down the checkmark button, and turning it back on. Let go of the checkmark button when it tells you to. This will show the details of what is happening as it tries to boot up. If you see the message dracut: FATAL: No or empty root= argument a few lines before it stops, then you will need to put your developer key on the SD card. This is covered in the optional steps above.
Stalling on Startup
Occasionally the XO will seem to stall during the boot animation sequence, even though it has booted fully. A workaround that seems to fix this problem is to disable 0-boot-anim-start.
- Drop into a console
- Press ♦ ctrl + ♢ alt + f1
- For some reason (probably a $PATH issue), neither the Sugar Terminal nor GNOME's Terminal can find chkconfig.
- Disable 0-boot-anim-start.
- chkconfig 0-boot-anim-start --levels 0123456 off
If you also disable z-boot-anim-stop, you may find that the cursor from the OpenFirmware console will remain onscreen post-boot. Therefore, you may leave z-boot-anim-stop as is.
You can reset the boot animation to its default settings by running chkconfig 0-boot-anim-start --levels 5 on.