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

Source Code for Module VMBuilder.plugins.ubuntu.intrepid

 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 VMBuilder.disk as disk 
20  from   VMBuilder.util import run_cmd 
21  from   VMBuilder.plugins.ubuntu.hardy import Hardy 
22   
23 -class Intrepid(Hardy):
24 valid_flavours = { 'i386' : ['386', 'generic', 'server', 'virtual'], 25 'amd64' : ['generic', 'server', 'virtual'], 26 'lpia' : ['lpia', 'lpiacompat'] } 27 default_flavour = { 'i386' : 'virtual', 'amd64' : 'virtual', 'lpia' : 'lpia' } 28 xen_kernel_flavour = 'virtual' 29 ec2_kernel_info = { 'i386' : 'aki-714daa18', 'amd64' : 'aki-4f4daa26' } 30 ec2_ramdisk_info = { 'i386': 'ari-7e4daa17', 'amd64' : 'ari-4c4daa25' } 31
32 - def install_ec2(self):
33 # workaround for policy bug on ubuntu-server. (see bug #275432) 34 self.run_in_target('apt-get', '--force-yes', '-y', 'install', 'policykit') 35 self.run_in_target('apt-get', '--force-yes', '-y', 'install', 'server^') 36 self.install_from_template('/etc/update-motd.d/51_update-motd', '51_update-motd') 37 self.run_in_target('chmod', '755', '/etc/update-motd.d/51_update-motd') 38 self.install_from_template('/etc/ec2-init/is-compat-env', 'is-compat-env')
39
40 - def mangle_grub_menu_lst(self, disks):
41 rootdev = disk.rootpart(disks) 42 bootdev = disk.bootpart(disks) 43 run_cmd('sed', '-ie', 's/^# kopt=root=\([^ ]*\)\(.*\)/# kopt=root=UUID=%s\\2/g' % rootdev.fs.uuid, '%s/boot/grub/menu.lst' % self.context.chroot_dir) 44 run_cmd('sed', '-ie', 's/^# groot.*/# groot=%s/g' % bootdev.fs.uuid, '%s/boot/grub/menu.lst' % self.context.chroot_dir) 45 run_cmd('sed', '-ie', '/^# kopt_2_6/ d', '%s/boot/grub/menu.lst' % self.context.chroot_dir)
46