Try fixing grub, added some comments

This commit is contained in:
Anders Ingemann 2013-09-15 22:57:15 +02:00
parent a9c465cf8c
commit 6f05774d2c
2 changed files with 9 additions and 0 deletions

View file

@ -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')

View file

@ -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}). '