Skip to contentSkip to conversation

boot loaders for domain != 0

PATCH In review Ian Pratt 5 participants 6 messages Feb 3, 2005 Kbuild

lore
Share & tools
lore

Ian Pratt

author
#0 lore raw
Quoted 11 lines
Quoted 5 lines

I think you could get most of this functionality by allowing the location of the kernel to be specified as a file within one of the guests virtual disks (assuming dom0 knows how to mount the root file system).

Except that you really want to be able to update from within the guest what kernel is used instead of having to specify it in dom0. That then
makes the guest almost completely independent on questions of what software runs inside it.

You'll still need a config file in domain 0 that says what the 'boot disk' for the domain is and what virtual ethernet interfaces it gets etc.

Quoted 5 lines
Quoted 1 line

We could also access a config file within the guest's

virtual disk that

Quoted 2 lines

could be used to override a subset of the config parameters (e.g. command line, kernel image name etc).

Quoted 9 lines

Parsing a grub.conf is easy enough that you're probably just as well off
reading it from dom0 and parsing it to determine what the right thing to
boot is. You can even do it without mounting by using something like libext2fs. Going really all out would then make it so that when you first started a guest domain, you'd be presented with a menu to pick what you want (based on the boot loader config), just like you would with a normal machine.

Yep, grub.conf wouldn't be a bad config format to use, though it's obviously not as flexible as ourcurrent config file that enable varibles etc.

Using libext2fs would be nice from a security POV (it's probably not too hard to crash Linux getting it to mount a suitably crafted filesystem structure), but it doesn't help if the client is using XFS or Reiserfs etc (though I'm not sure Grub supports these anyhow). Perhaps insisting on an ext3 /boot is OK.

Ian

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl

#1 lore raw
Quoted 19 lines · Ian Pratt
Quoted 5 lines
Quoted 1 line

We could also access a config file within the guest's

virtual disk that

Quoted 2 lines

could be used to override a subset of the config parameters (e.g. command line, kernel image name etc).

Quoted 9 lines

Parsing a grub.conf is easy enough that you're probably just as well off
reading it from dom0 and parsing it to determine what the right thing to
boot is. You can even do it without mounting by using something like libext2fs. Going really all out would then make it so that when you first started a guest domain, you'd be presented with a menu to pick what you want (based on the boot loader config), just like you would with a normal machine.

Yep, grub.conf wouldn't be a bad config format to use, though it's obviously not as flexible as ourcurrent config file that enable varibles etc.

Quoted 5 lines

Using libext2fs would be nice from a security POV (it's probably not too hard to crash Linux getting it to mount a suitably crafted filesystem structure), but it doesn't help if the client is using XFS or Reiserfs etc (though I'm not sure Grub supports these anyhow). Perhaps insisting on an ext3 /boot is OK.

grub will support them, and there are libraries for most of the other filesystems too. Doing things such that other filesystems can be plugged in would be reasonable, but for a first pass, ext[23] /boot is probably reasonable.

Jeremy

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl

#2 lore raw
In reply to Ian Pratt
Quoted 9 lines · Ian Pratt

Using libext2fs would be nice from a security POV (it's probably not too hard to crash Linux getting it to mount a suitably crafted filesystem structure), but it doesn't help if the client is using XFS or Reiserfs etc (though I'm not sure Grub supports these anyhow). Perhaps insisting on an ext3 /boot is OK.

Ian

I contemplated doing this for not just grub but also for ISOLinux so that you could boot off of a CDROM. A really intelligent loader would determine which Kernel the system is trying to load (i.e. 2.6.10 vs. 2.4.23) and load an appropriate Xen kernel.

I looked into it a bit and it wouldn't be terribly hard to support boot splash screens either. Like Jeremy, this is on my TODO list but I figured I look into this after getting a new set of management tools (since this is mostly management-level stuff).

For what it's worth, I think doing a quick mount, read, and then umount is the easiest approach since it extends well to doing things like peeking at an ISO's contents by mounting an ISO image. Using libraries would probably introduce some nasty dependencies without really gaining much...

Regards,

Signature · 10 lines
Anthony Liguori
[email protected]



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
#3 lore raw
In reply to Ian Pratt
Quoted 5 lines · Ian Pratt

Using libext2fs would be nice from a security POV (it's probably not too hard to crash Linux getting it to mount a suitably crafted filesystem structure), but it doesn't help if the client is using XFS or Reiserfs etc (though I'm not sure Grub supports these anyhow). Perhaps insisting on an ext3 /boot is OK.

grub supports reiserfs if you use it with "notail" mount option (at least Gentoo Handbook says that).

-jkt

Signature · 8 lines
cd /local/pub && more beer > /dev/mouth


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
#4 lore raw

PATCH 1/1 Xen Grub-style boot loader

Ok, here's something I hacked up this afternoon to try and get the ball moving on this.

It's a simple grub style ncurses application. This is my ncurses app so it's probably even easier than what I did. It parses a grub.conf file and let's a user pick an entry.

Right now it just prints out what the user selected. I'm not sure how it should integrate into the existing tools. Thoughts? Integrating it shouldn't be pretty easy.

Note: It looks quite ugly in gnome-terminal. I'm sure there's a way to handle the different term types better in curses. It looks just fine though on a real terminal though.

Regards,

Anthony Liguori
Email: [email protected]

Signed-off-by Anthony Liguori
Makefile +31 -0
diff -urN xenoloader-empty/Makefile xenoloader/Makefile
@@ -0,0 +1,31 @@
+###############################################################################
+##
+##   Makefile
+##
+##   Copyright (C) International Business Machines  Corp., 2005
+##   Author(s): Anthony Liguori ([email protected])
+##
+##   Xen Psuedo-Boot Loader
+##
+##   This library is free software; you can redistribute it and/or modify
+##   it under the terms of the GNU Lesser General Public License as published
+##   by the Free Software Foundation; either version 2.1 of the License, or
+##   (at your option) any later version.
+##
+##   This library is distributed in the hope that it will be useful,
+##   but WITHOUT ANY WARRANTY; without even the implied warranty of
+##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+##   the GNU Lesser General Public License for more details.
+##
+##   You should have received a copy of the GNU Lesser General Public License
+##   along with this library; if not, write to the Free Software
+##   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+###############################################################################
+
+CFLAGS=-Wall -g
+
+all: main.o
+	$(CC) $(CFLAGS) -o xenoloader main.o -lcurses
+
+clean:; $(RM) main.o xenoloader
main.c +278 -0

278 lines not on this page · raw message

#5 lore raw

Re: [PATCH] Xen Grub-style boot loader

Quoted 3 lines · Anthony Liguori

It's a simple grub style ncurses application. This is my ncurses app so it's probably even easier than what I did. It parses a grub.conf file and let's a user pick an entry.

Right now it just prints out what the user selected. I'm not sure how it should integrate into the existing tools. Thoughts? Integrating it shouldn't be pretty easy.

I'm sorry, my typing seems a bit off today. It should read, "This is my first ncurses app" and "Integrating it should be pretty easy". I didn't want anyone to think that it would be difficult to integrate :-)

Regards,
Anthony Liguori

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl