gregdek ([info]gregdek) wrote,
@ 2007-11-23 14:09:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Oh, right. I'm not actually an engineer.
A fact of which I'm reminded every time I try to do something cool/necessary/worthwhile that involves any kind of coding task at all. Even the easy stuff.

Friends, lend me your expertise. The goal is worthy: to build a maintainable live image for OLPC testing. And it should be simple, but I continue to be tripped up by my own ignorance.

First, some background. I believe that one of the biggest challenges facing the OLPC project is the disconnect between the intended user base (kids in the developing world) and the strongest potential contributor base (savvy Linux geeks). This problem is especially acute in the beginning stages, because there are comparatively few users, and they are all kids. Successful open source projects tend to be projects that draw their contributor base from the most knowledgeable user base of that project, right? That's a problem for OLPC.

The way to mitigate that risk is by involving as many contributor-class users as possible -- and one of the best ways to do *that* is to make it as simple as possible for people to experience OLPC. Give 1 Get 1 will help (four days left, get yours now!), but still, it seems to me that it's absolutely crucial for an interested developer to be able to get "OLPC" running as quickly as possible, whether they've invested in the physical unit or not. Simply put: when I go to speak about the XO, I want to be able to burn a bunch of DVDs, hand them out, and say "there's your XO, take it for a spin, get excited, and then get involved."

Hence the idea for a live image. It's not a new idea, either; there were Pilgrim builds happening months ago. But they bitrotted, and no one has really picked up this ball. I thought I'd give it a shot -- since I used to be an engineer once. Allegedly.

So I built a kickstart file for a live image, to be used with Fedora's livecd-creator. Here it is. What does it do? Simple:

1. Builds a Fedora live image with qemu and kqemu. kqemu, notably, is pulled from ATRpms. Yes, I know it's dirty, but qemu+kqemu is the favored mechanism for OLPC emulation at this point. Yes, we should probably move on to kvm, but joyride isn't building those images; it's building ext3 images. Yes, I know it's possible to convert the ext3 images to virtualbox / vmware / kvm-compatible images, but that's not in the build process yet. I'm trying to work with what we've got right now. Patches welcome.

2. Downloads the latest build of the OLPC image and drop it into the Fedora Live image. Actually trickier than I'd supposed; apparently it's necessary to wget this from a static IP address, since I guess dhcp isn't running at this point. The only way I could get this to work was to run Apache on my build box and download from 127.0.0.1. Suboptimal, to be sure.

3. Writes a script to load the OLPC image into qemu with a single command. I've actually got this bit working. Pretty dead simple; even I can't screw it up. Once the OLPC image is on the disk and kqemu is loaded, it's just a one-liner to get it running.

4. Puts a link on the desktop to "click and run" that script. Except it doesn't. This, friends, is where I appear to be completely incompetent. I try just telling the init script to dump a file into /home/fedora/Desktop, but then when I boot, that file doesn't exist. I can dump it into / and it's there, but the same file, dumped into /home/fedora/Desktop, disappears. And I have no idea why.

It's killing me, because I'm really close to having an awesome live image, suitable for USB key or DVD, that would allow a user to boot up, click on the Big Glowing XO Icon, and see the OLPC come up in emulation -- and not only that, but to have a kickstart that will allow the buildmaster (hi, Dennis) to automatically create that live media image with the build of every new OLPC image.

So, so close. But I've spent most of my Thanksgiving break on this, and I've got to move on to other stuff. Like making sure that FUDCon happens, and putting my hands on more community budget for the next fiscal year. So it goes.

Anyway. Try it out. Patches welcome.



(13 comments) - (Post a new comment)

/etc/skel?
(Anonymous)
2007-11-23 09:37 pm UTC (link)
Hey this is Anderson Silva, from RH, are you trying to put a shortcut.desktop file into /home/fedora/Desktop?

Does a fedora user get created at it? Do you copy the file before the user creation or afterwards?

Could it be the contents of /etc/skel reseting your Desktop directory when the fedora user is created?

(Reply to this) (Thread)

Re: /etc/skel?
(Anonymous)
2007-11-23 09:41 pm UTC (link)
never mind, ~/Desktop is not part of /etc/skel. :-)

(Reply to this) (Parent)(Thread)

Re: /etc/skel?
[info]gregdek
2007-11-23 09:49 pm UTC (link)
Heh.

At the time, I wasn't writing a shortcut.desktop file; I was actually just dumping the script into ~/Desktop. I have since removed that bit from the ks file since it wasn't working.

And yes, I was basically catting a here document. And I was doing it after the creation of the Fedora user.

(Reply to this) (Parent)(Thread)

Re: /etc/skel?
(Anonymous)
2007-11-23 10:13 pm UTC (link)
you may want to create a shortcut then that spawn it with xterm -e or something like that.

(Reply to this) (Parent)


[info]katzj
2007-11-23 10:50 pm UTC (link)
The fedora user is created at boot time in the fedora-live initscript. You should be able to create the symlink there (be sure to mkdir -p /home/fedora/Desktop first obviously) and have it work. The alternate and arguably slightly cleaner way is to include something like the /etc/X11/xinit/xinitrc.d/zz-liveinst.sh script which is in the anaconda package.

Other comments I'd have are:
1) kqemu? kqemu??? Ew. Include kvm for cases where the user has hardware emulation available and just fall back to stock qemu if not. kqemu isn't _as_ kitten killing now that it's GPL'd, but it's still pretty much a dead end
2) Install virt-manager and the rest of the libvirt stack. And then instead of running qemu directly, set up the libvirt guest config and virt-manager can then be used for launching and interacting with the guest.

(Reply to this) (Thread)


[info]katzj
2007-11-23 11:07 pm UTC (link)
Incidentally, if you want a hand, poke me on Monday. I'm hoping to spend as little of the weekend as possible on the laptop :-)

(Reply to this) (Parent)

Ah-HAH!
[info]gregdek
2007-11-24 12:05 am UTC (link)
"You should be able to create the symlink there (be sure to mkdir -p /home/fedora/Desktop first obviously) and have it work."

Mr. Katz, what you fail to understand is that nothing, to me, is obvious. I had presumed that the Desktop directory would be created as a result of the creation of the fedora user. Clearly, I was mistaken.

And yes, I know qemu+kqemu is the suck, but it's the thing that everyone proclaims *working* across all platforms (multiple Lunixes, Windows, etc.) Doesn't mean that I can't explore the libvirt stuff, but I just don't know it nearly as well. Maybe I'll harass you for more info -- does the ext3 image need to be converted to vbox format?

(Reply to this) (Parent)(Thread)

Re: Ah-HAH!
[info]katzj
2007-11-24 01:07 am UTC (link)
Yeah, but it doesn't matter about working across all platforms, only working on Fedora if you're building a live image :-)

And an image that works with qemu/kqemu will work just fine with kvm as well as virt-manager.

(Reply to this) (Parent)

yea
[info]Kevin Mark [myopenid.com]
2007-11-24 01:49 am UTC (link)
I have been looking for this proverbial livecd with an XO desktop so that I could burn a few and get adults or kids to try it out but have been only able to build it and run it on my gusty desktop. I would have loved such a thing say in the early part of 2007 for the runup to the g1g1 challange. But whenever it comes, it will be welcome ;-)

(Reply to this)

We've ordered one.
[info]margaretc
2007-11-24 03:13 am UTC (link)
On a slightly different subject, my husband the non-techie tree guy heard about OLPC and wanted to get one. I had considered it, but I'm such a skinflint that I hadn't done more than that. He fronted the cash and now we have one on the way (for the guy in my icon). I'm a sysadmin @ Duke, and benefit from the CentOS project a great deal. I'm looking forward to getting the laptop and setting it up for my son, and I'd be happy to let you know what works for us and what doesn't. I'm not expecting him to use it much right away, but he's already got the hang of a mouse and is learning to type. So it should be fun.

(Reply to this)

OLPC LiveCD
[info]michaelt1
2007-12-14 09:53 pm UTC (link)
I am Running the NEW OLPC livecd release 12/05/2007 ...

I would like to know what do I to do to have it install itself
on my hard drive ... It is a old system and I what the Real deal
OLCP running on it ... It is ok if it re-parations or reformats is fine ...

Help Please

Michael

(Reply to this)

(Reply from suspended user)

(Reply from suspended user)

(13 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…