1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import os
20 import VMBuilder.disk as disk
21 from VMBuilder.util import run_cmd
22 from VMBuilder.plugins.ubuntu.intrepid import Intrepid
23
25 valid_flavours = { 'i386' : ['generic', 'server', 'virtual'],
26 'amd64' : ['generic', 'server', 'virtual'],
27 'lpia' : ['lpia', 'lpiacompat'] }
28 xen_kernel_flavour = 'server'
29 ec2_kernel_info = { 'i386' : 'aki-c553b4ac', 'amd64' : 'aki-d653b4bf' }
30 ec2_ramdisk_info = { 'i386' : 'ari-c253b4ab', 'amd64' : 'ari-d753b4be' }
31 chpasswd_cmd= [ 'chpasswd' ]
32
34 self.run_in_target('apt-get', '--force-yes', '-y', 'install', 'server^')
35 self.install_from_template('/etc/update-motd.d/51_update-motd', '51_update-motd')
36
37
38 if os.path.isdir("/etc/ec2-init"):
39 self.install_from_template('/etc/ec2-init/is-compat-env', 'is-compat-env')
40 self.run_in_target('chmod', '755', '/etc/update-motd.d/51_update-motd')
41
43 rootdev = disk.rootpart(disks)
44 bootdev = disk.bootpart(disks)
45 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)
46 run_cmd('sed', '-ie', 's/^# groot.*/# groot=%s/g' % bootdev.fs.uuid, '%s/boot/grub/menu.lst' % self.context.chroot_dir)
47 run_cmd('sed', '-ie', '/^# kopt_2_6/ d', '%s/boot/grub/menu.lst' % self.context.chroot_dir)
48