Merge lp:~brightbox/vmbuilder/exclude-first-cylinder into lp:vmbuilder

Proposed by Neil Wilson
Status: Needs review
Proposed branch: lp:~brightbox/vmbuilder/exclude-first-cylinder
Merge into: lp:vmbuilder
Diff against target: 43 lines (+8/-3)
3 files modified
VMBuilder/contrib/cli.py (+1/-1)
VMBuilder/disk.py (+6/-1)
VMBuilder/plugins/ubuntu/dapper.py (+1/-1)
To merge this branch: bzr merge lp:~brightbox/vmbuilder/exclude-first-cylinder
Reviewer Review Type Date Requested Status
VMBuilder Pending
Review via email: mp+42530@code.launchpad.net

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Hi Neil,

are there bugs open for the other two commits? I'll go ahead and cherry-pick
the one relevant to 578199 right now, but would like tosee testcases for hte
other two. (i.e. the .split(' ') one - what would be in pair[2:], and do we
actually always want to discard it?)

Revision history for this message
Neil Wilson (neil-aldur) wrote :

Serge,

The other two commits are just me patching up vmbuilder 0.12 so that it will build images from the specifications in Scott Moser's EC2 build system (automated-ec2-builds). The partitition specifications there are for a partition based hypervisor (Xen) and won't work with the vanilla vmbuilder on KVM. The patch just makes it work with the same data.

https://code.launchpad.net/~ubuntu-on-ec2

Apologies for not formalising this, or making more progress on getting grub2 support into vmbuilder. Christmas stuff has got in the way. I'm hoping to get onto it over the Holidays.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Quoting Neil Wilson (<email address hidden>):
> Serge,
>
> The other two commits are just me patching up vmbuilder 0.12 so that it will build images from the specifications in Scott Moser's EC2 build system (automated-ec2-builds). The partitition specifications there are for a partition based hypervisor (Xen) and won't work with the vanilla vmbuilder on KVM. The patch just makes it work with the same data.
>
> https://code.launchpad.net/~ubuntu-on-ec2
>
> Apologies for not formalising this, or making more progress on getting grub2 support into vmbuilder. Christmas stuff has got in the way. I'm hoping to get onto it over the Holidays.

Thanks, Neil. Whenever you get a chance to create those bugs, just assign
them to me and point back to this tree, and I'll cherry-pick the relevant
commits once I verify the testcases.

Revision history for this message
Guilhem Lettron (guilhem-fr) wrote :

partition_start = "63s" break any partition alignement.

I prefer let parted choose the better one with "align=opt".

Unmerged revisions

460. By Neil Wilson <email address hidden>

Merge upstream

459. By Neil Wilson <email address hidden>

Fix to exclude first cylinder (sectors 0-62) from partition for the
benefit of grub.

458. By Neil Wilson <email address hidden>

Merge lp:vmbuilder

457. By Neil Wilson <email address hidden>

Remove the split limit so that file partition layouts can be used on disks

456. By Neil Wilson <email address hidden>

Fix failing manifest option.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
377 size = 0377 size = 0
378 disk_idx = 0378 disk_idx = 0
379 for line in file(self.options.part):379 for line in file(self.options.part):
380 pair = line.strip().split(' ',1)380 pair = line.strip().split(' ')
381 if pair[0] == '---':381 if pair[0] == '---':
382 self.do_disk(hypervisor, curdisk, size, disk_idx)382 self.do_disk(hypervisor, curdisk, size, disk_idx)
383 curdisk = list()383 curdisk = list()
384384
=== 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 @@
287 def create(self, disk):287 def create(self, disk):
288 """Adds partition to the disk image (does not mkfs or anything like that)"""288 """Adds partition to the disk image (does not mkfs or anything like that)"""
289 logging.info('Adding type %d partition to disk image: %s' % (self.type, disk.filename))289 logging.info('Adding type %d partition to disk image: %s' % (self.type, disk.filename))
290 run_cmd('parted', '--script', '--', disk.filename, 'mkpart', 'primary', self.parted_fstype(), self.begin, self.end)290 if self.begin == 0:
291 logging.info('Partition at beginning of disk - reserving first cylinder')
292 partition_start = "63s"
293 else:
294 partition_start = self.begin
295 run_cmd('parted', '--script', '--', disk.filename, 'mkpart', 'primary', self.parted_fstype(), partition_start, self.end)
291296
292 def mkfs(self):297 def mkfs(self):
293 """Adds Filesystem object"""298 """Adds Filesystem object"""
294299
=== 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 @@
69 fp = open(manifest, 'w')69 fp = open(manifest, 'w')
70 fp.write(manifest_contents)70 fp.write(manifest_contents)
71 fp.close71 fp.close
72 self.call_hook('fix_ownership', manifest)72 self.context.call_hooks('fix_ownership', manifest)
7373
74 def update(self):74 def update(self):
75 self.run_in_target('apt-get', '-y', '--force-yes', 'dist-upgrade',75 self.run_in_target('apt-get', '-y', '--force-yes', 'dist-upgrade',

Subscribers

People subscribed via source and target branches