31
32
def install_ec2(self):
32
33
self.run_in_target('apt-get', '--force-yes', '-y', 'install', 'server^')
33
34
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
# lucid and later wont have an /etc/ec2-init, so only write
36
# that file if the dir exists
37
if os.path.isdir("/etc/ec2-init"):
38
self.install_from_template('/etc/ec2-init/is-compat-env', 'is-compat-env')
35
39
self.run_in_target('chmod', '755', '/etc/update-motd.d/51_update-motd')
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)
41
def mangle_grub_menu_lst(self, disks):
42
bootdev = disk.bootpart(disks)
43
run_cmd('sed', '-ie', 's/^# kopt=root=\([^ ]*\)\(.*\)/# kopt=root=UUID=%s\\2/g' % bootdev.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)