Installing Fedora Core: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (remove categories from this obsolete page)
 
(34 intermediate revisions by 19 users not shown)
Line 1: Line 1:
{{Deprecated}}

'''See [[Fedora on XO]] for how to run the Fedora 10 Linux distribution on your 2008 or 2009 XO laptop.'''



==Overview==
==Overview==


This page describes how to install Fedora Core on the One Laptop per Child hardware. As of the writing of this document, the A-Test boards have been built and distributed to several hundred people. Fedora Core does run on the hardware, with some minor changes. We'll walk you through how to make those changes.
This page describes how to install [[Fedora Core]] on '''ancient, obsolete 2006 prototype''' One Laptop per Child hardware using a USB Hard Disk Drive. As of the writing of this document, the A-Test boards have been built and distributed to several hundred people.


==Requirements==
==Requirements==
Line 10: Line 16:


* 1 A-Test (or pre-A-Test) OLPC board
* 1 A-Test (or pre-A-Test) OLPC board
* 1 powered USB hub
* 1 USB flash drive (aka: thumb drive, pen drive, flash key)
* 1 USB hard drive
* 1 USB hard drive
* 1 USB ethernet adapter
* 1 USB ethernet adapter
Line 17: Line 21:
* 1 USB keyboard
* 1 USB keyboard
* 1 USB mouse
* 1 USB mouse
* 1 powered USB hub
====Why you need the ''powered'' USB hub====
* The board only has 3 USB ports, and there are 5 USB peripherals involved.
* But even if you are only using 3 USB peripherals, you still might need a powered hub, because the board's internal power converters are wimpy on ATest; fixed on later boards.


===Software===
===Software===

Right now, you need to use [http://fedoraproject.org/wiki/Testing Rawhide]—the Fedora development branch—(or unstable) version of Fedora Core to install on the laptop. We will be putting our kernel changes, dependency and software changes into FC Rawhide. So our current requirements for the software include:

* A recent Rawhide snapshot; not all builds may work, even if they're recent—we provide some known good snapshots.
* A place to host that snapshot on your network; there are a couple of sources listed below, if absolutely needed.
* The serenity to accept that sometimes Rawhide is broken.
* A strong will to live.


==Download==
==Download==


Get an OS image from [http://olpc.download.redhat.com/olpc/streams/development/latest/devel_ext3/ http://olpc.download.redhat.com/olpc/streams/development/latest/devel_ext3/]. You want the ".img.bz2" file, for example:
You will want to use one of our Rawhide snapshots. The reason is that Rawhide is fast-moving and you will want to use snapshots that we have tested.


olpc-redhat-stream-development-build-86-20060922_1506-devel_ext3.img.bz2
A rawhide snapshot from May 27th, 2006 that works with these instructions is available from these three mirrors:


==Installing==
* http://olpc.download.redhat.com/olpc/rawhide-snapshots/2006-05-27-0237/
* http://www-crca.ucsd.edu/~msp/olpc/rawhide-snapshots/2006-05-27-0237/


Follow the directions at [[OS images for USB disks]], under the "Dedicated USB disk" section.
==Getting Ready to Install==


==Enlarging the Partition==
To ease readability, lines where you enter commands will be shown in <font color="green">'''green'''</font>, and text printed by the computer will be shown in black. All important text will be shown as '''bold'''.


The OLPC OS images are 512MB (to fit the onboard flash), but you are installing them to a larger drive. Therefore we must enlarge the partition. Once you have transferred the image to the USB device (the 'dd' step), and synced all disks (the 'sync' step), get a root shell. Then, start the 'fdisk' command like so:
===Setting up a bootable image===

Insert your USB key into another Fedora machine and run the command '''dmesg'''. The output should look something like this:
[username@computername images]$ <font color="green">'''dmesg'''</font>
.
.
.
usb-storage: waiting for device to settle before scanning
Vendor: Kingston Model: DataTraveler 2.0 Rev: 6.16
Type: Direct-Access ANSI SCSI revision: 00
SCSI device '''sda''': 2004991 512-byte hdwr sectors (1027 MB)
sda: Write Protect is off
sda: Mode Sense: 45 00 00 08
sda: assuming drive cache: write through
SCSI device sda: 2004991 512-byte hdwr sectors (1027 MB)
sda: Write Protect is off
sda: Mode Sense: 45 00 00 08
sda: assuming drive cache: write through
sda: sda1
sd 3:0:0:0: Attached scsi removable disk sda
sd 3:0:0:0: Attached scsi generic sg0 type 0
usb-storage: device scan complete
.
.
.
[username@computername images]$

Note the fact that this USB key has shown up as <tt>sda</tt>. You will need this in a moment.

'''Make sure the device is not mounted.''' You can do this with a simple '''mount''' command. If '''/dev/sda1''' shows up in the output, it's mounted. You can unmonut it by running '''umount /dev/sda1'''. Like so:

[username@computername images]$ <font color="green">'''mount'''</font>
/dev/hda2 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hda1 on /boot type ext3 (rw)
'''/dev/sda1 on /media/Kingston type vfat (rw,noexec,nosuid,nodev,shortname=winnt,uid=500)'''
[username@computername images]$ <font color="green">'''sudo umount /dev/sda1''' </font>
[username@computername images]$


Go to the Fedora Rawhide tree [http://olpc.download.redhat.com/olpc/rawhide-snapshots/2006-05-27-0237/ here]. Get the file

images/diskboot.img

This is the file that contains a bootable image that you can use to boot on the board and run the installer. You will need to copy it in a raw format to the USB key. You do this using the '''dd''' command to the '''raw device.''' Note that this is '''/dev/sda''' not '''/dev/sda1'''. Make sure that you use the 'dd' command with the correct drive, as this will destroy or replace any filesystems or data on this drive.

[root@mobile2 2006-06-08-0245]# <font color="green">'''dd if=images/diskboot.img of=/dev/sda'''</font>
16384+0 records in
16384+0 records out
8388608 bytes (8.4 MB) copied, 1.88433 seconds, 4.5 MB/s
[root@computername 2006-06-08-0245]#

===Boot on the laptop===

Insert the '''USB flash drive''' into one of the USB ports which is directly connected to the laptop. Do not connect it through the USB hub.

Power on the laptop board. If the BIOS detects the flash drive you will see a message in the upper left hand corner of the screen that says something like:

Press F1 for Setup INITIALIZING BOOT USB DEVICE - DataTraveler 2.0
USB Storage Class Device [xxxxxxxx/xxxx/xxxx]

or

Press F1 for Setup INITIALIZING BOOT USB DEVICE - WD1600BB-00RDA0
USB BOOTABLE HDD DEVICE [xxxxxxxx/xxxx/xxxx]

You should see the Linux kernel being loaded and then the installer being loaded. If you don't, try the USB key in a different port or disconnecting the hub. The BIOS and USB are very flaky right now because this is a temporary BIOS until LinuxBIOS comes up on the boards. In fact, you might have to disconnect the USB hub while the kernel and initrd are loaded off the USB key and then connect it quickly once the kernel has started booting.

==Installing==


[root@localhost ~]# fdisk /dev/sda
Congratulations! Now you've made it to the Linux installer boot screen. From here you should type


Be '''sure''' to replace '/dev/sda' with the actual device name of the USB Hard Disk Drive on which you are installing the OLPC OS.
linux selinux=0 text


Next, type 'p' to show the current partition table:
and hit return to enter the text mode installer. The graphical installer will not run on this machine because it does not have enough memory. We disable selinux during this install because for some reason it turns a 40 minute install into a 4 hour ordeal. We aren't sure why at this point. Please note the above instructions that say that you might have to plug the USB hub in after the initrd has been loaded and the kernel starts up due to problems with the USB stack and the BIOS.


Command (m for help): p<br>
You may also have to remove the USB plug for the keyboard and plug it back in again once the kernel has started. Once again, USB and BIOS bugs. Just don't be alarmed if your keyboard suddenly doesn't work.
Disk /dev/sda: 5000 MB, 5000970240 bytes
16 heads, 62 sectors/track, 9846 cylinders
Units = cylinders of 992 * 512 = 507904 bytes<br>
Device Boot Start End Blocks Id System
/dev/sda1 1 993 492497 83 Linux
Command (m for help):


Next, you wish to delete the existing partition:
From here you need to pick your install type. We've been using HTTP installs and we have D-Link USB ethernet devices that require that we pick the <tt>asix</tt> driver. We're going to assume you know how to set up a web server or nfs server to install from and you know how to set your network settings so that it can find it.


Command (m for help): d
When you're setting up a partition table I suggest that you use the smallest configuration possible. This means no logical volume groups. Just three partitions:
Selected partition 1<br>


If you type 'p' again to print the partition table, you'll notice that the partition has been deleted:


Command (m for help): p<br>
Drive file system Mount point Size
Disk /dev/sda: 5000 MB, 5000970240 bytes
/dev/sda1 ext3 /boot (about 128MB)
16 heads, 62 sectors/track, 9846 cylinders
/dev/sda2 swap N/A (about 1GB)
Units = cylinders of 992 * 512 = 507904 bytes<br>
/dev/sda3 ext3 / (everything else)
Device Boot Start End Blocks Id System<br>
Command (m for help):


Next, you wish to re-create the partition with a much larger size:
This makes it very easy to fix things later. Because we are going to have to fix things later. And, yes, we really do need a gig of swap. We've run out of memory with only 512MB.


Command (m for help): n
Once you've partitioned you might have to restart to get the new partition table. Make sure you do restart instead of just trying to forge ahead.
Command action
e extended
p primary partition (1-4)


Type the letter 'p' here to create a new primary partition.
Follow the installer prompts until you get to package selection. You should be able to install the packages you want, but be warned that picking a lot of packages will take a long time on this machine. We usually install a minimal system (unselect all the high level packages) and then install packages as we need. If you really want to install packages now, don't be surprosed if it takes a couple hours.


p
==Fixing post-install==


Type '1' here to create primary partition number 1:
Assuming that your install was successful and you've rebooted the machine you probably see an error like this:


Partition number (1-4): 1
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempting to kill init!
<c0416e96> panic+0x46/0x188 <x04194cd> do_exit+0x75/0x72c
<c04121ab> do_page_fault+0x22a/0x5a9 <c0419bf1> sys_exit_group+0x0/0xd
<c0402cc7> syscall_call+0x7/0xb


Just hit return here to start the partition at cylinder #1:
This is good news. This means that you've got an install that's completed and tried to boot. The panic is a symptom of the fact that your kernel doesn't have the usb modules loaded and can't find the disk. Lucky for you this is pretty easy to fix.


First cylinder (1-9846, default 1): 1
===Fixing the initrd===


Just hit return here to end the partition at the end of the disk:
First, you have to pull your '''USB hard drive''' out of the laptop board and plug it into another machine. You should mount the /boot and / partitions on your drive. In my examples, my root partition is mounted in /media/disk and my /boot partition is mounted in /media/disk-1. Depending on what machine you're using, 'disk' and 'disk-1' may be switched, or may be called something else, like 'usbdisk' and 'usbdisk-1'.


Last cylinder or +size or +sizeM or +sizeK (1-9846, default 9846):
'''Note:''' Make sure that you're changing the files on the hard drive you want to fix, not on the hard drive that already works!
Using default value 9846<br>


You may type 'p' again to print out the new partition table:
Once you've done that cd into the /boot partition on your USB hard drive. You should see a set of files like this:


Command (m for help): p<br>
config-2.6.16-1.2221_FC6 lost+found
Disk /dev/sda: 5000 MB, 5000970240 bytes
grub System.map-2.6.16-1.2221_FC6
16 heads, 62 sectors/track, 9846 cylinders
initrd-2.6.16-1.2221_FC6.img vmlinuz-2.6.16-1.2221_FC6
Units = cylinders of 992 * 512 = 507904 bytes<br>
Device Boot Start End Blocks Id System
/dev/sda1 1 9846 4883615+ 83 Linux


Now, type 'w' to write the partition table to the disk and quit fdisk.
The '''initrd-2.6.16-1.2221_FC6.img''' is the file we're interested in fixing. The '''initrd''' is a file that contains extra modules the kernel needs in order to find extra hardware devices as well as the initial startup script that mounts your root partition and kicks off the rest of the boot process.


==Enlarging the filesystem==
There are two things we will be fixing:


Now that the partition is large enough, you must resize the filesystem to take advantage of all the new space. First we have to 'fsck' (file system check) the file system to ensure that it is clean. Be '''sure''' to replace the '/dev/sda1' with the actual device you are using, and make sure that you '''do''' have the '1' on the end, to specify checking of the first partition, not the entire device.
First, the modules for the usb drives are missing. We will have to pull them out of the kernel directory and add them to the initrd.


[root@localhost ~]# fsck.ext3 /dev/sda1
Second, we need to add a delay during the boot process so that once the usb modules are loaded, the devices are given a chance to settle and the hard drives show up before attempting to mount root.
e2fsck 1.39 (29-May-2006)
/dev/sda1 is mounted.<br>
WARNING!!! Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.<br>
Do you really want to continue (y/n)? yes<br>


Type 'y' here to continue checking:
The '''initrd''' is a file that's compressed and stored as a cpio archive. In order to extract the files we'll need to decompress it and explode the archive you may want to get into your root account so you don't have to type 'sudo' every line:


OLPCRoot: recovering journal
[root@computername ~]# <font color='green'>'''cd /media/disk-1/''' </font>
OLPCRoot: clean, 18986/123464 files, 337653/492496 blocks
[root@computername disk-1]# <font color='green'>'''ls'''</font>
[root@localhost ~]#
config-2.6.16-1.2221_FC6 lost+found
grub System.map-2.6.16-1.2221_FC6
initrd-2.6.16-1.2221_FC6.img vmlinuz-2.6.16-1.2221_FC6
[root@computername disk-1]# <font color='green'>'''ls -l''' </font>
total 3533
-rw-r--r-- 1 root root 59376 May 26 13:27 config-2.6.16-1.2221_FC6
drwxr-xr-x 2 root root 1024 Jun 8 09:13 grub
-rw-r--r-- 1 root root 1101550 Jun 8 09:08 initrd-2.6.16-1.2221_FC6.img
drwx------ 2 root root 12288 Jun 8 04:51 lost+found
-rw-r--r-- 1 root root 796900 May 26 13:27 System.map-2.6.16-1.2221_FC6
-rw-r--r-- 1 root root 1625946 May 26 13:27 vmlinuz-2.6.16-1.2221_FC6
[root@computername disk-1]# <font color='green'>'''mkdir work''' </font>
[root@computername disk-1]# <font color='green'>'''cd work''' </font>
[root@computername work]# <font color='green'>'''gzip -cd ../initrd-2.6.16-1.2221_FC6.img | cpio -i''' </font>
4765 blocks
[root@computername work]# <font color='green'>'''ls''' </font>
bin dev etc init lib proc sbin sys sysroot
[root@computername work]#


Next, you will resize the actual filesystem. Choose a size that matches or is slightly less than the size of your actual USB hard disk drive. resize2fs will warn you if the size you chose is too big. In that case, just readjust the size and try again.
What we want to do is to add two files to the lib/ directory that are missing. The missing files are the drives for USB1 and USB2 devices. Those files are:


[root@localhost ~]# resize2fs /dev/sda1 4500M
ehci-hcd.ko
resize2fs 1.39 (29-May-2006)
ohci-hcd.ko
Filesystem at /dev/sda1 is mounted on /media/OLPCRoot; on-line resizing required
Performing an on-line resize of /dev/sda1 to 4608000 (1k) blocks.


When that step is complete (it could take a while), type 'sync' to ensure data is flushed to disk. '''Wait until the disk activity light has stopped''' before unplugging the disk.
They are located in the kernel modules directory on the root partition that you mounted earlier. In my case they would be at:


==Done!==
/media/disk/lib/modules/2.6.16-1.2221_FC6/kernel/drivers/usb/host/ehci-hcd.ko
/media/disk/lib/modules/2.6.16-1.2221_FC6/kernel/drivers/usb/host/ohci-hcd.ko


You may now connect the drive to an OLPC developer board and boot it.
Keeping in mind that on any particular machine, it 'disk' may be 'usbdisk' or 'disk-1' or 'usbdisk-1' or something like that. Copy them into the lib/ directory that you just extracted.


==Additional Setup==
[root@computername work]# <font color='green'>'''cd lib'''</font>
[root@computername lib]# <font color='green'><b>cp -v \
/media/disk/lib/modules/2.6.16-1.2221_FC6/kernel/drivers/usb/host/ohci-hcd.ko \
/media/disk/lib/modules/2.6.16-1.2221_FC6/kernel/drivers/usb/host/ehci-hcd.ko .</b></font>
`/media/disk/lib/modules/2.6.16-1.2221_FC6/kernel/drivers/usb/host/ohci-hcd.ko' -> `./ohci-hcd.ko'
`/media/disk/lib/modules/2.6.16-1.2221_FC6/kernel/drivers/usb/host/ehci-hcd.ko' -> `./ehci-hcd.ko'
[root@computername lib]# <font color='green'>'''ls''' </font>
dm-mirror.ko dm-zero.ko jbd.ko sd_mod.ko
dm-mod.ko ehci-hcd.ko ohci-hcd.ko usb-storage.ko
dm-snapshot.ko ext3.ko scsi_mod.ko
[root@computername lib]#


The OLPC OS images are set up to automatically start [[Sugar]]. You may not want this. After booting and arriving at the Sugar login screen, switch to a virtual terminal by pressing Ctrl+Alt+F1 all at the same time. You will then see a login prompt. You may log in as 'root' with no password. Change the password to something secure!!! Next, remove the contents of /etc/sysconfig/desktop and leave the file blank to stop sugar from starting by default.
Now that you've put the modules in the right place you have to tell the init program to load them during startup. At the same time, we will have to add a delay to the startup so that once those modules are loaded the devices will be detected once they have spun up.


==Adding more software to the system==
cd up to the '''work/''' directory and edit the '''init''' file using vi:


Since the OLPC images are quite stripped due to the 512MB requirement, you may wish to install additional software. Before installing either a Gnome or KDE environment, you must resolve a conflict between Sugar's artwork package, and the normal Fedora artwork package.
[root@computername lib]# <font color='green'>'''pwd /media/disk-1/work/lib''' </font>
[root@mobile2 lib]# <font color='green'>'''cd ..''' </font>
[root@computername work]# <font color='green'>'''ls''' </font>
bin dev etc init lib proc sbin sys sysroot
[root@mobile2 work]# <font color='green'>'''vi init''' </font>


First, try to install redhat-artwork:
In that file, look for the following section and add what I've added. The lines that I've added show up in bold:


yum install redhat-artwork
echo Setting up hotplug.
hotplug
echo Creating block device nodes.
mkblkdevs
mount -t usbfs /proc/bus/usb /proc/bus/usb
<font color='green'>'''echo "Loading ehci-hcd.ko module"'''
'''insmod /lib/ehci-hcd.ko'''
'''echo "Loading ohci-hcd.ko module"'''
'''insmod /lib/ohci-hcd.ko''' </font>
echo "Loading scsi_mod.ko module"
insmod /lib/scsi_mod.ko
echo "Loading sd_mod.ko module"
insmod /lib/sd_mod.ko
echo "Loading usb-storage.ko module"
insmod /lib/usb-storage.ko
echo Waiting for driver initialization.
stabilized /proc/bus/usb/devices
<font color='green'>'''echo Waiting for driver initialization in case stabilize does not work'''
'''sleep 12''' </font>
echo "Loading jbd.ko module"
insmod /lib/jbd.ko


This will download redhat-artwork and its dependencies. When 'yum' asks:
Now that you've added the right lines to the init and you've also added the required modules, it's time to put the <tt>initrd</tt> back together again. To do that you need to make a backup of the current initrd, make a file list of the files to be included in the new initrd (remember, you've added some times) and then reassemble the initrd into an archive. The commands should look like this:


Is this ok [y/N]:
[root@computername work]# <font color='green'>'''mv ../initrd-2.6.16-1.2221_FC6.img ../initrd-2.6.16-1.2221_FC6.img.backup''' </font>
[root@computername work]# <font color='green'>'''find . > ../initrd-file-list''' </font>
[root@computername work]# <font color='green'>'''cat ../initrd-file-list | cpio -o -c > ../initrd-2.6.16-1.2221_FC6.img''' </font>
4892 blocks
[root@computername work]# <font color='green'>'''ls -l ..'''</font>
total 4646
-rw-r--r-- 1 root root 59376 May 26 13:27 config-2.6.16-1.2221_FC6
drwxr-xr-x 2 root root 1024 Jun 8 09:13 grub
-rw-r--r-- 1 root root 1130820 Jun 15 10:43 initrd-2.6.16-1.2221_FC6.img
-rw-r--r-- 1 root root 1101550 Jun 8 09:08 initrd-2.6.16-1.2221_FC6.img.backup
-rw-r--r-- 1 root root 620 Jun 15 10:42 initrd-file-list
drwx------ 2 root root 12288 Jun 8 04:51 lost+found
-rw-r--r-- 1 root root 796900 May 26 13:27 System.map-2.6.16-1.2221_FC6
-rw-r--r-- 1 root root 1625946 May 26 13:27 vmlinuz-2.6.16-1.2221_FC6
drwxr-xr-x 9 root root 1024 Jun 15 10:38 work
[root@computername work]#


Type 'y' to proceed. The install will fail with a file conflict for /etc/gtk-2.0/gtkrc. That's fine, we'll proceed to force-install redhat-artwork and it's fedora-logos dependency:
At this point you should have a working initrd and the right modules in place. You should be able to unmount the drives, reconnect the drive '''directly into the laptop motherboard''' (don't connect through the hub or the BIOS might not find the drive!) and reboot. But since you're here we suggest that you fix up the grub options for the board first.


-bash-3.1# cd /var/cache/yum/development/packages
===Grub Options===
-bash-3.1# rpm -Uhv redhat-artwork-5.0.7-1.fc6.i386.rpm fedora-logos-6.0.6-1.fc6.noarch --force


Note that your package versions might be slightly different; that's fine. Replace the filenames in the command above with the versions in the 'packages' directory. Now you may install your desktop environment of choice.
We suggest that you add some options to grub that will make using X on the laptop easier, assuming you decide to install it. To do that, edit the file /boot/grub/grub.conf and add the options on bold to the boot options:


===Installing Gnome===
[root@computername work]# <font color='green'> '''vi /boot/grub/grub.conf''' </font>


To install a Gnome desktop environment, run:


-bash-3.1# yum install nautilus gedit gdm gnome-panel gnome-session
title Fedora Core (2.6.16-1.2221_FC6)
root (hd0,0)
kernel /vmlinuz-2.6.16-1.2221_FC6 ro root=LABEL=/ <font color='green'>'''selinux=0 vga=0x311 video=fbdev:ypan''' </font>


This will download and install the major pieces of the GNOME desktop. When 'yum' asks:
To install X, once you are logged in, type in "yum install xfree86" to retrieve and install the package.


Is this ok [y/N]:
==Common Errors==


Type 'y' to proceed. If yum fails due to dependency issues, you may need to wait until the problem gets fixed, or you may file a bug at [http://bugzilla.redhat.com Red Hat Bugzilla].
* "invalid file system" on boot
* kernel panic on boot


===Invalid initrd===
===Installing KDE===


If you would like the KDE environment, you could type:
You may still encounter a kernel panic even after fixing the initrd. This is caused when we recompress the archive. This may or may not be an issue. We're not sure what causes it quite yet.


yum install kdebase kdeutils
RAMDISK: Compressed image found at block 0
No filesystem could mount root, tried: ext2 iso9660
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
<c0416e96> panic+0x46/0x188 <c06e6a7f> mount_block_root+0x214/0x223
<c0463261> sys_mknod+0x27/0x2b <c06e8d90> initrd_load+0xc7/0x372
<c06e6b75> prepare_namespace+0x8d/0x100 <c0453c7e> sys_acces+0x1f/0x23
<c04003d5> init+0x159/0x22b <c0402ba6> ret_from_fork+0x6/0x20
<c040027c> init+0x0/0x22b <c040027c> init+0x0/0x22b
<c0401005> kernel_thread_helper+0x5/0xb


This will download and install the major pieces of the KDE desktop. When 'yum' asks:
If this happens to you, don't compress the archive.


Is this ok [y/N]:


Type 'y' to proceed. If yum fails due to dependency issues, you may need to wait until the problem gets fixed, or you may file a bug at [http://bugzilla.redhat.com Red Hat Bugzilla].
[[Category:Developers]]

Latest revision as of 23:04, 5 November 2008

Stop hand.png WARNING:
The content of this section is considered
DEPRECATED and OBSOLETE
It is preserved for historical or documenting reasons.

See Fedora on XO for how to run the Fedora 10 Linux distribution on your 2008 or 2009 XO laptop.


Overview

This page describes how to install Fedora Core on ancient, obsolete 2006 prototype One Laptop per Child hardware using a USB Hard Disk Drive. As of the writing of this document, the A-Test boards have been built and distributed to several hundred people.

Requirements

Hardware

You will need a few pieces of hardware to install the software on the A-Test board.

  • 1 A-Test (or pre-A-Test) OLPC board
  • 1 USB hard drive
  • 1 USB ethernet adapter
  • 1 external VGA-compatible monitor for display
  • 1 USB keyboard
  • 1 USB mouse
  • 1 powered USB hub

Why you need the powered USB hub

  • The board only has 3 USB ports, and there are 5 USB peripherals involved.
  • But even if you are only using 3 USB peripherals, you still might need a powered hub, because the board's internal power converters are wimpy on ATest; fixed on later boards.

Software

Download

Get an OS image from http://olpc.download.redhat.com/olpc/streams/development/latest/devel_ext3/. You want the ".img.bz2" file, for example:

olpc-redhat-stream-development-build-86-20060922_1506-devel_ext3.img.bz2 

Installing

Follow the directions at OS images for USB disks, under the "Dedicated USB disk" section.

Enlarging the Partition

The OLPC OS images are 512MB (to fit the onboard flash), but you are installing them to a larger drive. Therefore we must enlarge the partition. Once you have transferred the image to the USB device (the 'dd' step), and synced all disks (the 'sync' step), get a root shell. Then, start the 'fdisk' command like so:

[root@localhost ~]# fdisk /dev/sda

Be sure to replace '/dev/sda' with the actual device name of the USB Hard Disk Drive on which you are installing the OLPC OS.

Next, type 'p' to show the current partition table:

Command (m for help): p
Disk /dev/sda: 5000 MB, 5000970240 bytes 16 heads, 62 sectors/track, 9846 cylinders Units = cylinders of 992 * 512 = 507904 bytes
Device Boot Start End Blocks Id System /dev/sda1 1 993 492497 83 Linux Command (m for help):

Next, you wish to delete the existing partition:

Command (m for help): d
Selected partition 1

If you type 'p' again to print the partition table, you'll notice that the partition has been deleted:

Command (m for help): p
Disk /dev/sda: 5000 MB, 5000970240 bytes 16 heads, 62 sectors/track, 9846 cylinders Units = cylinders of 992 * 512 = 507904 bytes
Device Boot Start End Blocks Id System
Command (m for help):

Next, you wish to re-create the partition with a much larger size:

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)

Type the letter 'p' here to create a new primary partition.

p

Type '1' here to create primary partition number 1:

Partition number (1-4): 1

Just hit return here to start the partition at cylinder #1:

First cylinder (1-9846, default 1): 1

Just hit return here to end the partition at the end of the disk:

Last cylinder or +size or +sizeM or +sizeK (1-9846, default 9846): 
Using default value 9846

You may type 'p' again to print out the new partition table:

Command (m for help): p
Disk /dev/sda: 5000 MB, 5000970240 bytes 16 heads, 62 sectors/track, 9846 cylinders Units = cylinders of 992 * 512 = 507904 bytes
Device Boot Start End Blocks Id System /dev/sda1 1 9846 4883615+ 83 Linux

Now, type 'w' to write the partition table to the disk and quit fdisk.

Enlarging the filesystem

Now that the partition is large enough, you must resize the filesystem to take advantage of all the new space. First we have to 'fsck' (file system check) the file system to ensure that it is clean. Be sure to replace the '/dev/sda1' with the actual device you are using, and make sure that you do have the '1' on the end, to specify checking of the first partition, not the entire device.

[root@localhost ~]# fsck.ext3 /dev/sda1
e2fsck 1.39 (29-May-2006)
/dev/sda1 is mounted.
WARNING!!! Running e2fsck on a mounted filesystem may cause SEVERE filesystem damage.
Do you really want to continue (y/n)? yes

Type 'y' here to continue checking:

OLPCRoot: recovering journal
OLPCRoot: clean, 18986/123464 files, 337653/492496 blocks
[root@localhost ~]# 

Next, you will resize the actual filesystem. Choose a size that matches or is slightly less than the size of your actual USB hard disk drive. resize2fs will warn you if the size you chose is too big. In that case, just readjust the size and try again.

[root@localhost ~]# resize2fs /dev/sda1 4500M
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/sda1 is mounted on /media/OLPCRoot; on-line resizing required
Performing an on-line resize of /dev/sda1 to 4608000 (1k) blocks.

When that step is complete (it could take a while), type 'sync' to ensure data is flushed to disk. Wait until the disk activity light has stopped before unplugging the disk.

Done!

You may now connect the drive to an OLPC developer board and boot it.

Additional Setup

The OLPC OS images are set up to automatically start Sugar. You may not want this. After booting and arriving at the Sugar login screen, switch to a virtual terminal by pressing Ctrl+Alt+F1 all at the same time. You will then see a login prompt. You may log in as 'root' with no password. Change the password to something secure!!! Next, remove the contents of /etc/sysconfig/desktop and leave the file blank to stop sugar from starting by default.

Adding more software to the system

Since the OLPC images are quite stripped due to the 512MB requirement, you may wish to install additional software. Before installing either a Gnome or KDE environment, you must resolve a conflict between Sugar's artwork package, and the normal Fedora artwork package.

First, try to install redhat-artwork:

yum install redhat-artwork

This will download redhat-artwork and its dependencies. When 'yum' asks:

Is this ok [y/N]:

Type 'y' to proceed. The install will fail with a file conflict for /etc/gtk-2.0/gtkrc. That's fine, we'll proceed to force-install redhat-artwork and it's fedora-logos dependency:

-bash-3.1# cd /var/cache/yum/development/packages
-bash-3.1# rpm -Uhv redhat-artwork-5.0.7-1.fc6.i386.rpm fedora-logos-6.0.6-1.fc6.noarch --force

Note that your package versions might be slightly different; that's fine. Replace the filenames in the command above with the versions in the 'packages' directory. Now you may install your desktop environment of choice.

Installing Gnome

To install a Gnome desktop environment, run:

-bash-3.1# yum install nautilus gedit gdm gnome-panel gnome-session

This will download and install the major pieces of the GNOME desktop. When 'yum' asks:

Is this ok [y/N]:

Type 'y' to proceed. If yum fails due to dependency issues, you may need to wait until the problem gets fixed, or you may file a bug at Red Hat Bugzilla.

Installing KDE

If you would like the KDE environment, you could type:

yum install kdebase kdeutils

This will download and install the major pieces of the KDE desktop. When 'yum' asks:

Is this ok [y/N]:

Type 'y' to proceed. If yum fails due to dependency issues, you may need to wait until the problem gets fixed, or you may file a bug at Red Hat Bugzilla.