*

Welcome, Guest. Please login or register.
Did you miss your activation email?

Check out the new and improved 2010 Xtra Ordinary OS for the XO laptop!
Pages: [1] 2 3
Print
Author Topic: Multiboot olpc.fth + fstab files  (Read 28650 times)

Multiboot olpc.fth + fstab files

atraw
Commenter

Posts: 24


January 16, 2008, 05:33:46 AM

Anybody experimenting with different Linux Distros on the XO should find the following files quite helpfull:

Multiboot /boot/olpc.fth
Code:
\
\ XO Multiboot olpc.fth
\
\ Boot standard image from internal flash if circle button is pressed
game-key-mask h# 80 and if
    " ro root=mtd0 console=ttyS0,115200 console=tty0 fbcon=font:SUN12x22" to boot-file
    " nand:\boot\vmlinuz" to boot-device
    " nand:\boot\olpcrd.img" to ramdisk
else
\
\ Boot alternate image from internal flash if checker button is pressed
game-key-mask h# 2 and if
    \ Boot alternate image from internal fash if checker button is pressed
    " ro root=mtd0 console=ttyS0,115200 console=tty0 fbcon=font:SUN12x22" to boot-file
    " nand:\boot-alt\vmlinuz" to boot-device
    " nand:\boot-alt\olpcrd.img" to ramdisk
\
\ Uncomment to boot image from USB-Stick:
\ else
\   " ro root=/dev/sda1 rootdelay=1 console=ttyS0,115200 console=tty0 fbcon=font:SUN12x22" to boot-file
\   " disk:\boot\vmlinuz" to boot-device
\   " disk:\boot\olpcrd.img" to ramdisk
\
\ Uncomment to boot image from SD-Card:
\ else
\   " ro root=/dev/mmcblk0p1 rootdelay=1 console=ttyS0,115200 console=tty0 fbcon=font:SUN12x22" to boot-file
\   " sd:\boot\vmlinuz" to boot-device
\   " sd:\boot\olpcrd.img" to ramdisk
then
then
boot

Multiboot /etc/fstab
Code:
#
# XO Multiboot /etc/fstab
#

# Uncomment if you are booting via internal flash
#  mtd0                    /                      jffs2    defaults,noatime 1 1

# Uncomment if you are booting from a usb-stick:
# /dev/sda1 / ext3 noatime,errors=remount-ro 0 1

# Uncomment if you are booting from a SD card:
# /dev/mmcblk0p1 / ext3 noatime,errors=remount-ro 0 1

# Uncomment if you want to access internal flash via /mnt/flash
# mtd0                    /mnt/flash                       jffs2    defaults,noatime,noauto 1 1

# Uncomment if needed (not necesarry in Ubuntu)
# devpts                  /dev/pts                devpts  gid=5,mode=620    0 0
# tmpfs                   /dev/shm                tmpfs   defaults,size=15% 0 0
# proc                    /proc                   proc    defaults          0 0
# sysfs                   /sys                    sysfs   defaults          0 0
Logged

#1 Re: Multiboot olpc.fth + fstab files

humptybump
Contributor
*
Posts: 69



WWW
January 16, 2008, 05:54:55 AM

at what point should the designated key be pressed - before power-on, during the 5 second count down, etc. ?
Logged

#2 Re: Multiboot olpc.fth + fstab files

atraw
Commenter

Posts: 24


January 16, 2008, 06:19:51 AM

at what point should the designated key be pressed - before power-on, during the 5 second count down, etc. ?

You have to press the key immediately after pressing power-on and before the 5 second count down.
If the press is detected you will get "Release the game key to continue" message and the XO will boot with the new boot settings.

In case you haven't  found out yet: Try pressing rocker right (= right arrow on the left gamepad) after power-on.
Logged

#3 Re: Multiboot olpc.fth + fstab files

quixote
Contributor
*
Posts: 73


January 16, 2008, 11:08:34 AM

Is there a problem with uncommenting all the lines, so that the information is there regardless of which boot method is used?

Thanks for your excellent work on this! 
Logged

#4 Re: Multiboot olpc.fth + fstab files

atraw
Commenter

Posts: 24


January 16, 2008, 12:22:53 PM

Is there a problem with uncommenting all the lines, so that the information is there regardless of which boot method is used?

The device in "root=" in /boot/olpc.fth has to match the  root filesytem in the /etc/fstab file. Which is different depending on where you are booting from.

It is possible to use filesystem labels or UUID numbers for mounting the root filesytem instead of device names. But I still have to find a way in OpenFirmware to detect if the boot should happen from "disk:" or "sd:".

So at the moment you have to edit the files by hand.
« Last Edit: January 17, 2008, 02:55:08 AM by atraw » Logged

#5 Re: Multiboot olpc.fth + fstab files

gravity
New

Posts: 2


January 20, 2008, 03:53:33 AM

I'm completely illiterate when it comes to linux and running commands in terminal. I've done everything in the write up to install ubuntu but what I don't understand is what I'm supposed to do with these two commands.

Do I put them in text files and save them as olpc.fth what do I do with the fstab one?

Once I get them on my usb drive do I run them? How do I run them?

Yup I'm a noob.

Thanks in advance
Logged

#6 Re: Multiboot olpc.fth + fstab files

quixote
Contributor
*
Posts: 73


January 20, 2008, 09:46:08 AM

gravity: atraw may have other advice, in which case, listen to him!

The first file, olpc.fth:  copy the text in that window to clipboard and save in a text editor, like notepad (Windows), or gedit (Linux).  If you're booting from USB, then remove the "\" from these lines
Code:
\
\ Uncomment to boot image from USB-Stick:
 else
   " ro root=/dev/sda1 rootdelay=1 console=ttyS0,115200 console=tty0 fbcon=font:SUN12x22" to boot-file
  " disk:\boot\vmlinuz" to boot-device
   " disk:\boot\olpcrd.img" to ramdisk
\
Don't remove \ from other lines, because the script will then try to read them and lose its tiny mind.

The olpc.fth file then goes in the /boot directory on your USB which has all the Ubuntu operating system files on it.

The fstab is a file in the /etc directory which tells the OS how to see (i.e. "mount") certain drives (or "partitions" in linux-speak). This is the /etc on your USB with the ubuntu OS.  Copy the original to a backup first.  This is a critical file, and if you make a mistake you will want a backup.

Open /etc/fstab in notepad or gedit.  Carefully compare what you see with what atraw has in the box, and you'll see the differences.  Change to match atraw's fstab.  Again, depending on whether your boot device is a USB or SD card, you uncomment the relevant lines. 

You don't need the sugar OS lines (everything after the SD card lines), even if you want to have a dual boot system, as far as I know.  When you boot into sugar, you press the circle key and it accesses the internal flash memory, which has sugar's own /etc/fstab that hasn't been changed and has all the right settings for sugar.

Hope that helps.
Logged

#7 Re: Multiboot olpc.fth + fstab files

atraw
Commenter

Posts: 24


January 22, 2008, 03:18:24 AM

gravity: atraw may have other advice, in which case, listen to him!
The first file, olpc.fth:  copy the text in that window to clipboard and save in a text editor, like notepad (Windows), or gedit (Linux).  If you're booting from USB, then remove the "\" from these lines

Thanks for answering the question. Just a small remark: The stick has to be formated with a ext3 filesystem (which you won't be able to read in Windows by default).

So if you want to edit the files in Windows using notepad you will need a program like Explore2fs (See http://en.wikipedia.org/wiki/Ext3 for more Info).
Logged

#8 Re: Multiboot olpc.fth + fstab files

gravity
New

Posts: 2


January 22, 2008, 09:56:55 AM

Hey,

A million thanks for answering my question. Now onto noobie question number 2.

I'm on a macbook pro running osx 10.4. I can't seem to find a way to read the usb drive so I can edit the necessary files. Do you have any recommendations? Can I do all of this editing on my olpc?

Thanks,
Gravity
« Last Edit: January 22, 2008, 10:10:42 AM by gravity » Logged

#9 Re: Multiboot olpc.fth + fstab files

jmdeschamps
Commenter

Posts: 18


January 22, 2008, 11:11:53 AM

Just in passing ATRAW:
my usb key is formatted in ext2 and Ubuntu-Xfce works like a charm (now |-: )
So ext3 doesn't seem an absolute pre-requisite BUT I have no idea what ext2 or ext3 means (I guess it's a disk formatting scheme)
Now I formatted my usb key on a regular Ubuntu machine using Parted - I thought I had set it for ext3 but re-reading my key again on Ubuntu, i noticed it was ext2 which made me change my olpc.fth file which finally made everything work (I mean Ubuntu on my key and Sugar when no usb key is inserted)
Logged

#10 Re: Multiboot olpc.fth + fstab files

jmdeschamps
Commenter

Posts: 18


January 22, 2008, 11:17:16 AM

By the way, would there be enough interest to have a dedicated Ubuntu section on this forum for people who like me -admire Sugar and Activities - but still want there *normal* work environment on a standard *nix Huh
Logged

#11 Re: Multiboot olpc.fth + fstab files

quixote
Contributor
*
Posts: 73


January 22, 2008, 03:59:54 PM

good point about formats and Windows!  I should have thought to say that!

ext2 is non-journaling, ext3 is a journaling filesystem.  The latter are more robust, which is nice for a boot device Wink   SD cards for some reason tend to have ext2 or  fat16.  I have no idea why.  Seems stupid.

By the way, would there be enough interest to have a dedicated Ubuntu section on this forum for people who like me -admire Sugar and Activities - but still want there *normal* work environment on a standard *nix ??

YES!  Definitely.  Let's have an ubuntu section!
« Last Edit: January 24, 2008, 01:39:11 PM by quixote » Logged

#12 Re: Multiboot olpc.fth + fstab files

quixote
Contributor
*
Posts: 73


January 22, 2008, 04:03:31 PM

gravity: I'm sure there's a straight text editor somewhere on the Mac, but it's been years since I used one and I don't remember what it was called.  I see things like bbedit and textmate mentioned on Google.

Yes, you can do all the text editing on the XO, but it's all command line and vi and I don't think you'd like it.
Logged

#13 Re: Multiboot olpc.fth + fstab files

linuxspice
Commenter

Posts: 18


January 22, 2008, 05:11:25 PM

quixote:  One possible reason to format a Linux SD card with ext2 rather than ext3 might be to avoid "extra" writes to the card (which would happen with a journalling filesystem, since the journal on disk needs to be maintained along with the files), with the aim of increasing the card's useful life.  This is presumably also the reason the OLPC's internal NAND flash drive is mounted with the "noatime" option (this option avoids extra writes to maintain "last access time" timestamps, which are rarely used on most systems anyway).

On the other hand, I don't know much "extra" writing is actually done in practice when using ext3 versus ext2.  Are there any filesystem gurus out there who could clear this up?  I would also prefer to use ext3 if it doesn't unnecessarily grind down SD cards over time.
Logged

#14 Re: Multiboot olpc.fth + fstab files

quixote
Contributor
*
Posts: 73


January 24, 2008, 01:38:08 PM

quixote:  One possible reason to format a Linux SD card with ext2 rather than ext3 might be to avoid "extra" writes to the card

Good point!
Logged
Pages: [1] 2 3
Print
Jump to:  

Welcome, Guest. Please login or register.
Did you miss your activation email?
February 09, 2010, 04:12:13 AM

Login with username, password and session length
Recent Topics
[Today at 12:50:43 AM]

[February 08, 2010, 11:59:31 PM]

[February 08, 2010, 11:43:34 PM]

[February 06, 2010, 01:30:32 PM]

[February 05, 2010, 05:14:11 PM]

[February 04, 2010, 07:21:32 PM]

[February 04, 2010, 01:50:58 PM]

[February 02, 2010, 07:37:01 PM]

[February 02, 2010, 12:28:12 PM]

[February 02, 2010, 10:55:23 AM]
Members
Total Members: 4128
Latest: divinegrace29
Stats
Total Posts: 30203
Total Topics: 3647
Online Today: 81
Online Ever: 220
(February 05, 2009, 11:29:32 AM)
Users Online
Users: 1
Guests: 55
Total: 56