mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-10-07 17:40:30 +00:00
Try fixing grub, added some comments
This commit is contained in:
parent
a9c465cf8c
commit
6f05774d2c
2 changed files with 9 additions and 0 deletions
|
@ -17,6 +17,9 @@ class ConfigureGrub(Task):
|
|||
grub_dir = os.path.join(boot_dir, 'grub')
|
||||
|
||||
if isinstance(info.volume, LoopbackVolume):
|
||||
# GRUB cannot deal with installing to loopback devices
|
||||
# so we fake a real harddisk with dmsetup.
|
||||
# Guide here: http://ebroder.net/2009/08/04/installing-grub-onto-a-disk-image/
|
||||
info.volume.unmount()
|
||||
info.volume.unmap()
|
||||
info.volume.link_dm_node()
|
||||
|
@ -45,3 +48,8 @@ class ConfigureGrub(Task):
|
|||
info.volume.mount_root(info.root)
|
||||
info.volume.mount_boot()
|
||||
info.volume.mount_specials()
|
||||
|
||||
# Best guess right now...
|
||||
device_map_path = os.path.join(grub_dir, 'device.map')
|
||||
with open(device_map_path, 'w') as device_map:
|
||||
device_map.write('(hd0) /dev/mapper/vda\n')
|
||||
|
|
|
@ -21,6 +21,7 @@ class VirtualBoxVolume(LoopbackVolume):
|
|||
raise VolumeError(msg)
|
||||
nbd_max_part = int(self._module_param('nbd', 'max_part'))
|
||||
if nbd_max_part < num_partitions:
|
||||
# Found here: http://bethesignal.org/blog/2011/01/05/how-to-mount-virtualbox-vdi-image/
|
||||
msg = ('The kernel module `nbd\' was loaded with the max_part '
|
||||
'parameter set to {max_part}, which is below '
|
||||
'the amount of partitions for this volume ({num_partitions}). '
|
||||
|
|
Loading…
Add table
Reference in a new issue