Jeremy's Thoughts - More Fedora on XO
Cycling, Fedora, MIT SDM and Miscellany

Jeremy Katz
Date: 2008-10-08 11:55
Subject: More Fedora on XO
Security: Public
Tags:fedora, olpc

So, you just got your XO to do some testing of Fedora on OLPC. You update the software that was on there, get a developer key, wait a day, and then get all ready to boot your Fedora image off of the SD card ....

And it boots. But it's slow. Very very slow. Some slowness is to be expected... this isn't a fast machine. But it should probably be a little bit speedier than it is. So want to try out a few experiments to try to help pin down the cause of the slowness? Then read on, pick a case and leave comments about your results.

  1. Try using a persistent overlay instead of the in-memory one. Add --overlay-size-mb to your livecd-iso-to-disk invocation. Amount should be relative to the size of your SD card.
  2. See if/how much having swap available helps. You can create a file on the SD card with dd, run mkswap against the file and then enable it on the XO. The best test for this would probably be to boot the XO single-user and run swapon from there and then do telinit 5.
  3. Try disabling some services from the live image. Again boot to single-user, chkconfig some services and then telinit 5
  4. ... your idea here. Hopefully other people have some ideas of things to try as well. Try them out and let us know how it goes.
Post A Comment | 11 Comments | Add to Memories | Share | Link



jlaska
User: jlaska
Date: 2008-10-08 16:01 (UTC)
Subject: Boot to single user?
How do you boot to single user on the XO?

I haven't seen the grub-style bootloader menu in order to modify boot arguments. Do you have to hit at the open firmware timeout, and add boot arguments there?
Reply | Thread | Link



Jeremy Katz
User: katzj
Date: 2008-10-08 16:04 (UTC)
Subject: Re: Boot to single user?
There isn't a bootloader. You can do open firmware magic, but honestly, the easiest thing to do is to mount the SD card on another box and edit boot\olpc.fth. You'll see the obvious line with kernel arguments to change.
Reply | Parent | Thread | Link



jlaska
User: jlaska
Date: 2008-10-08 16:21 (UTC)
Subject: Unable to find persistent overlay: using temporary
I've added "--overlay-size-mb 768" to my livecd-iso-to-disk.sh script ... but it didn't seem to stick.
Reply | Thread | Link



Jeremy Katz
User: katzj
Date: 2008-10-08 17:29 (UTC)
Subject: Re: Unable to find persistent overlay: using temporary
What does the boot\olpc.fth contain?
Reply | Parent | Thread | Link



jlaska
User: jlaska
Date: 2008-10-08 17:39 (UTC)
Subject: Re: Unable to find persistent overlay: using temporary
# cat /media/OLPC-Live/boot/olpc.fth 
\ Boot script for USB boot
patch 2drop erase claim-params
: high-ramdisk  ( -- )
   cv-load-ramdisk
   h# 22c +lp l@ 1+   memory-limit  umin  /ramdisk -  ( new-ramdisk-adr )
   ramdisk-adr over  /ramdisk move                    ( new-ramdisk-adr )
   to ramdisk-adr
;
' high-ramdisk to load-ramdisk

: set-bootpath-dev  ( -- )
   " /chosen" find-package  if                       ( phandle )
      " bootpath" rot  get-package-property  0=  if  ( propval$ )
         get-encoded-string                          ( bootpath$ )
         [char] \ left-parse-string  2nip            ( dn$ )
         dn-buf place                                ( )
      then
   then

   " /sd"  dn-buf  count  sindex  0>=   if
          " sd:"
   else
          " u:"
   then
   " BOOTPATHDEV" $set-macro
;

set-bootpath-dev
"  root=UUID=fb1cd69b-00e6-4e34-a4e1-3b218cfa9c5c rootfstype=ext3 rw liveimg overlay=UUID=fb1cd69b-00e6-4e34-a4e1-3b218cfa9c5c quiet  rhgb " to boot-file
" ${BOOTPATHDEV}\syslinux\initrd0.img" expand$ to ramdisk
" ${BOOTPATHDEV}\syslinux\vmlinuz0" expand$ to boot-device
unfreeze
boot
Reply | Parent | Thread | Link



Jeremy Katz
User: katzj
Date: 2008-10-08 17:49 (UTC)
Subject: Re: Unable to find persistent overlay: using temporary
That looks okay... what does /proc/cmdline look like after you've booted? And LiveOS/ has an overlay-$l-$u file (where $l is the label of the SD card, $u is the uuid)
Reply | Parent | Thread | Link



jlaska
User: jlaska
Date: 2008-10-08 19:23 (UTC)
Subject: Re: Unable to find persistent overlay: using temporary
> That looks okay... what does /proc/cmdline look like after you've booted?

# cat /proc/cmdline
root=UUID=fb1cd69b-00e6-4e34-a4e1-3b218cfa9c5c rootfstype=ext3 rw liveimg overlay=UUID=fb1cd69b-00e6-4e34-a4e1-3b218cfa9c5c quiet rhgb

> And LiveOS/ has an overlay-$l-$u file (where $l is the label of the
> SD card, $u is the uuid)

/media/OLPC-Live/LiveOS/overlay--fb1cd69b-00e6-4e34-a4e1-3b218cfa9c5c
Reply | Parent | Thread | Link



jlaska
User: jlaska
Date: 2008-10-08 20:26 (UTC)
Subject: Re: Unable to find persistent overlay: using temporary
Problem solved ...

I introduced this by running: mklabel /dev/sdb1 after writing the live image.

I've fixed this now by doing:

$ dd if=/dev/zero of=/dev/sdb bs=512 count=1
$ parted /dev/sdb
mklabel msdos
mkpart primary ext3 0 2048M
mkpart primary ext3 2048M 3072M
toggle 1 boot

$ mkfs -t ext3 -L OLPC-Live /dev/sdb1
$ mkswap -L SWAP /dev/sdb2

$ livecd-iso-to-disk.sh ...


Overlay now seems happy ... thanks!
Reply | Parent | Thread | Link



User: thefinalzone.blogspot.com
Date: 2008-10-09 03:57 (UTC)
Subject: typo on livecd-iso-to-disk
# bash livecd-iso-to-disk.sh --xo --overlay-size-mb 2047 --extra-kernel-args 3 olpc-gnome.iso /dev/sdd1
Verifying image...
/home/luya/Templates/fedora_on_xo/olpc-gnome.iso: 7f4978d6a17f8eb59acfa224f355f395
Fragment sums: b1641134e653d748a55dd6e98dc4f7d37c12aa9724683148eabbb8e593af
Fragment count: 20
Checking: 100.0%

The media check is complete, the result is: PASS.

It is OK to use this media.
Copying live image to USB stick
Updating boot config file
sed: can't read /media/usbdev.xFvGOz/syslinux/isolinux.cfg.cfg: No such file or directory


I removed the extra ".cfg".
Reply | Thread | Link



User: (Anonymous)
Date: 2008-10-10 18:40 (UTC)
Subject: question about over-size
This might all be evident to me if I new anything about livecd, but I don't. What's an overlay? You say that overlay-size should be "relative to the size of your SD card". In what way? The same as? Some percentage of? thanks
Reply | Thread | Link



Jeremy Katz
User: katzj
Date: 2008-10-10 18:58 (UTC)
Subject: Re: question about over-size
The overlay is where all changes to the system land. By using overlay-size, they get written to a file on the SD card rather than into memory.

As for how big to make it -- at least 512 megs, more depending on how big your SD card is. Given some recent testing of other things, more than 512 is probably overkill and with the next image, it's going to be tough to get larger than that with a 4 gig SD card.
Reply | Parent | Thread | Link



browse
my journal
September 2013