Package VMBuilder :: Package plugins :: Package ubuntu :: Module jaunty
[frames] | no frames]

Source Code for Module VMBuilder.plugins.ubuntu.jaunty

 1  # 
 2  #    Uncomplicated VM Builder 
 3  #    Copyright (C) 2007-2009 Canonical Ltd. 
 4  #     
 5  #    See AUTHORS for list of contributors 
 6  # 
 7  #    This program is free software: you can redistribute it and/or modify 
 8  #    it under the terms of the GNU General Public License version 3, as 
 9  #    published by the Free Software Foundation. 
10  # 
11  #    This program is distributed in the hope that it will be useful, 
12  #    but WITHOUT ANY WARRANTY; without even the implied warranty of 
13  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
14  #    GNU General Public License for more details. 
15  # 
16  #    You should have received a copy of the GNU General Public License 
17  #    along with this program.  If not, see <http://www.gnu.org/licenses/>. 
18  # 
19  import suite 
20  import logging 
21  import VMBuilder.disk as disk 
22  from   VMBuilder.util import run_cmd 
23  from   VMBuilder.plugins.ubuntu.intrepid import Intrepid 
24   
25 -class Jaunty(Intrepid):
26 xen_kernel_flavour = 'server' 27 ec2_kernel_info = { 'i386' : 'aki-c553b4ac', 'amd64' : 'aki-d653b4bf' } 28 ec2_ramdisk_info = { 'i386' : 'ari-c253b4ab', 'amd64' : 'ari-d753b4be' } 29 chpasswd_cmd= [ 'chpasswd' ] 30
31 - def install_ec2(self):
32 self.run_in_target('apt-get', '--force-yes', '-y', 'install', 'server^') 33 self.install_from_template('/etc/update-motd.d/51_update-motd', '51_update-motd') 34 self.install_from_template('/etc/ec2-init/is-compat-env', 'is-compat-env') 35 self.run_in_target('chmod', '755', '/etc/update-motd.d/51_update-motd')
36
37 - def mangle_grub_menu_lst(self):
38 bootdev = disk.bootpart(self.vm.disks) 39 run_cmd('sed', '-ie', 's/^# kopt=root=\([^ ]*\)\(.*\)/# kopt=root=UUID=%s\\2/g' % bootdev.fs.uuid, '%s/boot/grub/menu.lst' % self.destdir) 40 run_cmd('sed', '-ie', 's/^# groot.*/# groot=%s/g' % bootdev.fs.uuid, '%s/boot/grub/menu.lst' % self.destdir) 41 run_cmd('sed', '-ie', '/^# kopt_2_6/ d', '%s/boot/grub/menu.lst' % self.destdir)
42