[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFC: Output files for netboot-xen flavour



On Tue, 2008-07-22 at 12:35 +0200, Frans Pop wrote:
> On Tuesday 22 July 2008, Ian Campbell wrote:
> > I've attached a patch which implements this and would appreciate any
> > comments. In particular I'm pretty sure dumping xm-debian.cfg into
> > build/config/i386 is not the right place -- any suggestions?
> 
> Such files belong in build/boot/x86 and can be copied from there as 
> needed.

Thanks, I've done that.

> You should also check if the current MANIFEST entries are still needed and 
> if a new MANIFEST entry is needed for your config file.

Good point, thanks!

New patch is attached with these two changes and the updates from
Bastian's review of the python code. Output is:
        $ tree dest/netboot/xen/
        dest/netboot/xen/
        |-- initrd.gz
        |-- vmlinuz
        `-- xm-debian.cfg

Only remaining concern is how to authenticate the downloaded files, is
there a way? I couldn't find a signature of anything relevant in the
dists tree so I just stuck a print of "WARNING: Installer kernel and
ramdisk are not authenticated." which is a bit lame...

Since linux-kernel-di-i386-2.6 went through new yesterday I included the
patch to enable the netboot-xen flavour. An upload of the new
base-installer (for the 686-bigmem kernel selection) is needed before it
becomes usable though.

Ian.
-- 
Ian Campbell

BOFH excuse #62:

need to wrap system in aluminum foil to fix problem
Index: config/i386/netboot-xen.cfg
===================================================================
--- config/i386/netboot-xen.cfg	(revision 54567)
+++ config/i386/netboot-xen.cfg	(working copy)
@@ -2,6 +2,7 @@
 TYPE=netboot
 include config/i386/netboot.cfg
 EXTRANAME=netboot/xen/
-MANIFEST-NETBOOT_DIR = "PXE boot directory for tftp server (Xen)"
-MANIFEST-NETBOOT_TAR = "tarball of PXE boot directory (Xen)"
-MANIFEST-MINIISO = "tiny CD image that boots the netboot installer (Xen)"
+MANIFEST-KERNEL = "kernel image for installing under Xen"
+MANIFEST-INITRD = "initrd for installing under Xen"
+MANIFEST-XENCFG = "example Xen configuration"
+TARGET = $(KERNEL) $(INITRD) xen_config
Index: config/i386.cfg
===================================================================
--- config/i386.cfg	(revision 54567)
+++ config/i386.cfg	(working copy)
@@ -1,4 +1,4 @@
-MEDIUM_SUPPORTED = cdrom netboot netboot-gtk hd-media # netboot-xen #floppy #monolithic
+MEDIUM_SUPPORTED = cdrom netboot netboot-gtk netboot-xen hd-media #floppy #monolithic
 
 # The version of the kernel to use.
 BASEVERSION = 2.6.25-2
Index: config/x86.cfg
===================================================================
--- config/x86.cfg	(revision 54567)
+++ config/x86.cfg	(working copy)
@@ -16,6 +16,9 @@
 # The directory boot screens for syslinux will go in.
 BOOT_SCREEN_DIR = 
 
+# Location for Xen example configuration.
+XENCFG = $(SOME_DEST)/$(EXTRANAME)xm-debian.cfg
+
 # Compress binaries to save more space.
 # Doesn't really save much since we gzip the image later though.
 .PHONY: arch_tree
@@ -291,3 +294,9 @@
 	if [ -n "$(SPLASH_PNG)" ]; then \
 		cp $(SPLASH_PNG) $(TEMP_NETBOOT_DIR)/$(BOOT_SCREEN_DIR)/splash.png; \
 	fi
+
+.PHONY: xen_config
+xen_config:
+	install -m 644 boot/x86/xm-debian.cfg $(XENCFG)
+	update-manifest $(XENCFG) $(MANIFEST-XENCFG)
+
Index: boot/x86/xm-debian.cfg
===================================================================
--- boot/x86/xm-debian.cfg	(revision 0)
+++ boot/x86/xm-debian.cfg	(revision 0)
@@ -0,0 +1,182 @@
+#  -*- mode: python; -*-
+#============================================================================
+# Example Python setup script for Debian guest installation.
+#============================================================================
+#
+# Standard options are configured as normal. Only a subset are included below.
+# See /usr/share/doc/xen-utils-common/examples for full examples.
+#
+# After standard options are configure use
+#    xm create xm-debian.cfg install=true"
+# to start the Debian Installer.
+#
+# In the installation case the following additional variables exist:
+# install-arch: which architecture to install. e.g. i386 or amd64
+# install-suite: which Debian version to install. e.g. lenny or sid
+# install-mirror: which Debian mirror to use
+#   e.g. http://ftp.uk.debian.org/debian
+# install-installer: where to obtain the Debian Installer bits, by
+#   default these are located under install-mirror. To use a nightly
+#   snapshot: http://people.debian.org/~joeyh/d-i/images/daily/
+# install-extra: extra command line arguments
+#============================================================================
+
+
+#----------------------------------------------------------------------------
+# Standard variables
+
+# Initial memory allocation (in megabytes) for the new domain.
+memory = 128
+
+# A name for your domain. All domains must have different names.
+name = "ExampleDomain"
+
+# 128-bit UUID for the domain.  The default behavior is to generate a new UUID
+# on each call to 'xm create'.
+#uuid = "06ed00fe-1162-4fc4-b5d8-11993ee4a8b9"
+
+# List of which CPUS this domain is allowed to use, default Xen picks
+#cpus = ""         # leave to Xen to pick
+#cpus = "0"        # all vcpus run on CPU0
+#cpus = "0-3,5,^1" # run on cpus 0,2,3,5
+
+# Number of Virtual CPUS to use, default is 1
+#vcpus = 1
+
+#----------------------------------------------------------------------------
+# Define network interfaces.
+
+# By default, no network interfaces are configured.  You may have one created
+# with sensible defaults using an empty vif clause:
+#
+# vif = ['']
+#
+# or optionally override backend, bridge, ip, mac, script, type, or vifname:
+#
+# vif = ['mac=00:16:3e:00:00:11, bridge=xenbr0']
+#
+# or more than one interface may be configured:
+#
+# vif = ['', 'bridge=xenbr1']
+
+vif = ['']
+
+#----------------------------------------------------------------------------
+# Define the disk devices you want the domain to have access to, and
+# what you want them accessible as.
+# Each disk entry is of the form phy:UNAME,DEV,MODE
+# where UNAME is the device, DEV is the device name the domain will see,
+# and MODE is r for read-only, w for read-write.
+#
+# NB: Only xvd devices are supported by the kernel in Debian Lenny and later.
+
+disk = ['phy:hda1,xvda,w']
+
+#----------------------------------------------------------------------------
+# Define frame buffer device.
+#
+# By default, no frame buffer device is configured.
+#
+# To create one using the SDL backend and sensible defaults:
+#
+# vfb = [ 'type=sdl' ]
+#
+# This uses environment variables XAUTHORITY and DISPLAY.  You
+# can override that:
+#
+# vfb = [ 'type=sdl,xauthority=/home/bozo/.Xauthority,display=:1' ]
+#
+# To create one using the VNC backend and sensible defaults:
+#
+# vfb = [ 'type=vnc' ]
+#
+# The backend listens on 127.0.0.1 port 5900+N by default, where N is
+# the domain ID.  You can override both address and N:
+#
+# vfb = [ 'type=vnc,vnclisten=127.0.0.1,vncdisplay=1' ]
+#
+# Or you can bind the first unused port above 5900:
+#
+# vfb = [ 'type=vnc,vnclisten=0.0.0.0,vnunused=1' ]
+#
+# You can override the password:
+#
+# vfb = [ 'type=vnc,vncpasswd=MYPASSWD' ]
+#
+# Empty password disables authentication.  Defaults to the vncpasswd
+# configured in xend-config.sxp.
+
+
+#============================================================================
+# Debian Installer specific variables
+
+def check_bool(name, value):
+    value = str(value).lower()
+    if value in ('t', 'tr', 'tru', 'true'):
+        return True
+    return False
+
+global var_check_with_default
+def var_check_with_default(default, var, val):
+    if val:
+        return val
+    return default
+
+xm_vars.var('install', use='Install Debian, default: false', check=check_bool)
+
+xm_vars.var("install-arch",
+            use='Debian mirror to install from (default: i386)',
+            check=lambda var, val: var_check_with_default('i386', var, val))
+xm_vars.var("install-mirror",
+            use='Debian mirror to install from (default: http://ftp.debian.org/debian)',
+            check=lambda var, val: var_check_with_default('http://ftp.debian.org/debian', var, val))
+xm_vars.var("install-suite",
+            use='Debian suite to install (default: lenny)',
+            check=lambda var, val: var_check_with_default("lenny", var, val))
+xm_vars.var("install-installer",
+            use='Debian installer to use (default: uses install-mirror)',
+            check=lambda var, val: var_check_with_default(None, var, val))
+xm_vars.var("install-extra",
+            use='Extra command line options (default: None)',
+            check=lambda var, val: var_check_with_default(None, var, val))
+xm_vars.check()
+
+if not xm_vars.env.get('install'):
+    bootloader="pygrub"
+else:
+    import os.path
+    print "Install Mirror: %s" % xm_vars.env['install-mirror']
+    print "Install Suite: %s" % xm_vars.env['install-suite']
+    if xm_vars.env['install-installer']:
+        installer = xm_vars.env['install-installer']
+    else:
+        installer = xm_vars.env['install-mirror']+"/dists/"+xm_vars.env['install-suite'] + \
+                    "/main/installer-"+xm_vars.env['install-arch']+"/current/images"
+    print "Installer: %s" % installer
+
+    print
+    print "WARNING: Installer kernel and ramdisk are not authenticated."
+    print
+
+    import urllib
+    kernel, _ = urllib.urlretrieve(installer + "/netboot/xen/vmlinuz")
+    ramdisk, _ = urllib.urlretrieve(installer + "/netboot/xen/initrd.gz")
+
+    if xm_vars.env['install-extra']:
+        extras=[xm_vars.env['install-extra']]
+    else:
+        extras=[]
+
+    # Reboot will just restart the installer since this file is not
+    # reparsed, so halt and restart that way.
+    extras.append("debian-installer/exit/always_halt=true")
+    extras.append("--")
+    extras.append("quiet")
+
+    try:
+        vfb
+    except NameError, e:
+        extras.append("console=hvc0")
+
+    extra = str.join(" ", extras)
+    print "command line is \"%s\"" % extra

Property changes on: boot/x86/xm-debian.cfg
___________________________________________________________________
Added: svn:mergeinfo

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: