[Pkg-escience-soc2009] [SCM] Tool for creating VM images. branch, master, updated. e8d2b53afcdef695b7415a3f04f04a5add0e5117

David Wendt dcrkid at yahoo.com
Wed Aug 12 04:19:04 UTC 2009


The following commit has been merged in the master branch:
commit 1434554d008bd095acc8045b7589231cfdff0d26
Author: David Wendt <dcrkid at yahoo.com>
Date:   Sat Aug 8 00:31:03 2009 -0400

    fixed the kernel installation - we now grab a kernel even if we don't use a bootloader
    
    this should make vanilla zen and EKI/ERI building work now

diff --git a/VMBuilder/plugins/debian/distro.py b/VMBuilder/plugins/debian/distro.py
index e990112..fa5e141 100644
--- a/VMBuilder/plugins/debian/distro.py
+++ b/VMBuilder/plugins/debian/distro.py
@@ -239,19 +239,19 @@ EOT''')
             return self.xen_ramdisk_path()
 
     def __kernel_path(self):
-        path = '/boot/vmlinuz-%s' % self.find_linux_kernel(self.suite, flavour = None, arch = self.vm.arch)
+        path = '/boot/vmlinuz-%s-%s' % (self.find_linux_kernel(self.suite, flavour = None, arch = self.vm.arch), self.suite.default_flavour[self.vm.arch])
         return path
 
     def __ramdisk_path(self):
-        path = '/boot/initrd.img-%s' % self.find_linux_kernel(self.suite, flavour = None, arch = self.vm.arch)
+        path = '/boot/initrd.img-%s-%s' % (self.find_linux_kernel(self.suite, flavour = None, arch = self.vm.arch), self.suite.default_flavour[self.vm.arch])
         return path
 
     def xen_kernel_path(self):
-        path = '/boot/vmlinuz-%s-%s' % (self.xen_kernel_version(), self.suite.xen_kernel_flavour)
+        path = '/boot/vmlinuz-%s-%s-%s' % (self.xen_kernel_version(), self.suite.xen_kernel_flavour, self.suite.default_flavour[self.vm.arch])
         return path
 
     def xen_ramdisk_path(self):
-        path = '/boot/initrd.img-%s-%s' % (self.xen_kernel_version(), self.suite.xen_kernel_flavour)
+        path = '/boot/initrd.img-%s-%s-%s' % (self.xen_kernel_version(), self.suite.xen_kernel_flavour, self.suite.default_flavour[self.vm.arch])
         return path
 
     def get_ec2_kernel(self):
diff --git a/VMBuilder/plugins/debian/etch.py b/VMBuilder/plugins/debian/etch.py
index d5a3326..aacfea8 100644
--- a/VMBuilder/plugins/debian/etch.py
+++ b/VMBuilder/plugins/debian/etch.py
@@ -91,6 +91,9 @@ class Etch(suite.Suite):
 
             logging.debug("Creating device.map")
             self.install_device_map()
+        else:
+            logging.debug("Installing kernel")
+            self.install_kernel_without_bootloader()
 
         logging.debug("Installing extra packages")
         self.install_extras()
@@ -165,7 +168,10 @@ class Etch(suite.Suite):
         self.update_passwords()
 
     def kernel_name(self):
-        return 'linux-image-2.6-%s' % (self.vm.flavour or self.default_flavour[self.vm.arch],)
+        if not isinstance(self.vm.hypervisor, VMBuilder.plugins.xen.Xen):
+            return 'linux-image-2.6-%s' % (self.vm.flavour or self.default_flavour[self.vm.arch],)
+        else:
+            return 'linux-image-2.6-%s-%s' % (self.xen_kernel_flavour, self.vm.flavour or self.default_flavour[self.vm.arch])
 
     def config_network(self):
         self.vm.install_file('/etc/hostname', self.vm.hostname)
@@ -285,6 +291,10 @@ class Etch(suite.Suite):
         self.install_from_template('/etc/kernel-img.conf', 'kernelimg', { 'updategrub' : self.updategrub }) 
         run_cmd('chroot', self.destdir, 'apt-get', '--force-yes', '-y', 'install', self.kernel_name(), 'grub')
 
+    def install_kernel_without_bootloader(self):
+        self.install_from_template('/etc/kernel-img.conf', 'kernelimg', { 'updategrub' : '/bin/true' }) 
+        run_cmd('chroot', self.destdir, 'apt-get', '--force-yes', '-y', 'install', self.kernel_name())
+
     def install_grub(self):
         self.run_in_target('apt-get', '--force-yes', '-y', 'install', 'grub')
         run_cmd('cp', '-a', '%s%s/%s/' % (self.destdir, self.grubroot, self.vm.arch == 'amd64' and 'x86_64-pc' or 'i386-pc'), '%s/boot/grub' % self.destdir) 

-- 
Tool for creating VM images.



More information about the Pkg-escience-soc2009 mailing list