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

Proposed by Neil Wilson on 2010-12-02
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 2010-12-02 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.
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?)

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.

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.

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> on 2010-12-02

Merge upstream

459. By Neil Wilson <email address hidden> on 2010-12-02

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

458. By Neil Wilson <email address hidden> on 2010-12-01

Merge lp:vmbuilder

457. By Neil Wilson <email address hidden> on 2010-08-11

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

456. By Neil Wilson <email address hidden> on 2010-08-11

Fix failing manifest option.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'VMBuilder/contrib/cli.py'
2--- VMBuilder/contrib/cli.py 2010-07-09 21:48:56 +0000
3+++ VMBuilder/contrib/cli.py 2010-12-02 18:41:58 +0000
4@@ -377,7 +377,7 @@
5 size = 0
6 disk_idx = 0
7 for line in file(self.options.part):
8- pair = line.strip().split(' ',1)
9+ pair = line.strip().split(' ')
10 if pair[0] == '---':
11 self.do_disk(hypervisor, curdisk, size, disk_idx)
12 curdisk = list()
13
14=== modified file 'VMBuilder/disk.py'
15--- VMBuilder/disk.py 2010-12-02 08:14:16 +0000
16+++ VMBuilder/disk.py 2010-12-02 18:41:58 +0000
17@@ -287,7 +287,12 @@
18 def create(self, disk):
19 """Adds partition to the disk image (does not mkfs or anything like that)"""
20 logging.info('Adding type %d partition to disk image: %s' % (self.type, disk.filename))
21- run_cmd('parted', '--script', '--', disk.filename, 'mkpart', 'primary', self.parted_fstype(), self.begin, self.end)
22+ if self.begin == 0:
23+ logging.info('Partition at beginning of disk - reserving first cylinder')
24+ partition_start = "63s"
25+ else:
26+ partition_start = self.begin
27+ run_cmd('parted', '--script', '--', disk.filename, 'mkpart', 'primary', self.parted_fstype(), partition_start, self.end)
28
29 def mkfs(self):
30 """Adds Filesystem object"""
31
32=== modified file 'VMBuilder/plugins/ubuntu/dapper.py'
33--- VMBuilder/plugins/ubuntu/dapper.py 2010-12-02 08:15:01 +0000
34+++ VMBuilder/plugins/ubuntu/dapper.py 2010-12-02 18:41:58 +0000
35@@ -69,7 +69,7 @@
36 fp = open(manifest, 'w')
37 fp.write(manifest_contents)
38 fp.close
39- self.call_hook('fix_ownership', manifest)
40+ self.context.call_hooks('fix_ownership', manifest)
41
42 def update(self):
43 self.run_in_target('apt-get', '-y', '--force-yes', 'dist-upgrade',

Subscribers

People subscribed via source and target branches