vmbuilder team mailing list archive
-
vmbuilder team
-
Mailing list archive
-
Message #00066
[Merge] lp:~brightbox/vmbuilder/exclude-first-cylinder into lp:vmbuilder
Neil Wilson has proposed merging lp:~brightbox/vmbuilder/exclude-first-cylinder into lp:vmbuilder.
Requested reviews:
VMBuilder (vmbuilder)
Related bugs:
#578199 ubuntu-vm-builder builds images with no post-MBR gap
https://bugs.launchpad.net/bugs/578199
There are three changes in this branch.
- Reserve 63 sectors at the beginning of a disk for partition table details. This ensure that grub doesn't use blocklists and allows the user to switch to GPT if they so desire.
- A fix for the manifest option.
- A fix so that the file list format works with disks.
The commits can be cherry picked as required.
HTH.
--
https://code.launchpad.net/~brightbox/vmbuilder/exclude-first-cylinder/+merge/42530
Your team VMBuilder is requested to review the proposed merge of lp:~brightbox/vmbuilder/exclude-first-cylinder into lp:vmbuilder.
=== modified file 'VMBuilder/contrib/cli.py'
--- VMBuilder/contrib/cli.py 2010-07-09 21:48:56 +0000
+++ VMBuilder/contrib/cli.py 2010-12-02 18:41:58 +0000
@@ -377,7 +377,7 @@
size = 0
disk_idx = 0
for line in file(self.options.part):
- pair = line.strip().split(' ',1)
+ pair = line.strip().split(' ')
if pair[0] == '---':
self.do_disk(hypervisor, curdisk, size, disk_idx)
curdisk = list()
=== modified file 'VMBuilder/disk.py'
--- VMBuilder/disk.py 2010-12-02 08:14:16 +0000
+++ VMBuilder/disk.py 2010-12-02 18:41:58 +0000
@@ -287,7 +287,12 @@
def create(self, disk):
"""Adds partition to the disk image (does not mkfs or anything like that)"""
logging.info('Adding type %d partition to disk image: %s' % (self.type, disk.filename))
- run_cmd('parted', '--script', '--', disk.filename, 'mkpart', 'primary', self.parted_fstype(), self.begin, self.end)
+ if self.begin == 0:
+ logging.info('Partition at beginning of disk - reserving first cylinder')
+ partition_start = "63s"
+ else:
+ partition_start = self.begin
+ run_cmd('parted', '--script', '--', disk.filename, 'mkpart', 'primary', self.parted_fstype(), partition_start, self.end)
def mkfs(self):
"""Adds Filesystem object"""
=== modified file 'VMBuilder/plugins/ubuntu/dapper.py'
--- VMBuilder/plugins/ubuntu/dapper.py 2010-12-02 08:15:01 +0000
+++ VMBuilder/plugins/ubuntu/dapper.py 2010-12-02 18:41:58 +0000
@@ -69,7 +69,7 @@
fp = open(manifest, 'w')
fp.write(manifest_contents)
fp.close
- self.call_hook('fix_ownership', manifest)
+ self.context.call_hooks('fix_ownership', manifest)
def update(self):
self.run_in_target('apt-get', '-y', '--force-yes', 'dist-upgrade',
Follow ups