~ubuntu-branches/ubuntu/precise/vm-builder/precise

« back to all changes in this revision

Viewing changes to VMBuilder/plugins/ubuntu/jaunty.py

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2010-02-22 13:56:18 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100222135618-la13e3mu397rg0m1
Tags: 0.12.0-0ubuntu1
* New upstream release. (FFe: LP: #525741)
  - All patches incorporated upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#
19
19
import suite
20
20
import logging
 
21
import os
21
22
import VMBuilder.disk as disk
22
23
from   VMBuilder.util import run_cmd
23
24
from   VMBuilder.plugins.ubuntu.intrepid import Intrepid
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')
36
40
 
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)
42
46