add raw image file creation

This commit is contained in:
Olivier Sallou 2013-07-10 11:27:49 +02:00
parent 778ec8c270
commit 0854f7920e
2 changed files with 4 additions and 2 deletions

View file

@ -7,7 +7,7 @@
},
"bootstrapper": {
"mount_dir": "/target",
"mount_dir": "/tmp/target",
"tarball": true,
"device": "/dev/sda"
},

View file

@ -10,7 +10,9 @@ class FormatVolume(Task):
phase = phases.volume_preparation
def run(self, info):
dev_path = info.manifest.bootstrapper['device']
mkmount = 'create -f raw "'+info.manifest.bootstrapper['mount_dir']+'" "'+str(info.manifest.volume['size'])+'"'
log_check_call(['/usr/bin/qemu-img',mkmount])
dev_path = info.manifest.bootstrapper['mount_dir']
mkfs = '/sbin/mkfs.{fs}'.format(fs=info.manifest.volume['filesystem'])
log_check_call([mkfs, dev_path])