Creating basebox broken on Debian Sid
When vagrant/definitions/tails-builder/create_box.sh
calculates $IMG_SIZE
it parses the output of qemu-img info --output=json
looking for virtual-size
, and expecting the output to look like:
{
"virtual-size": 21474836480,
"filename": "/home/anonym/src/tails/tails/_tmp_package/box.img",
"cluster-size": 65536,
"format": "qcow2",
"actual-size": 1104367616,
"format-specific": {
"type": "qcow2",
"data": {
"compat": "1.1",
"compression-type": "zlib",
"lazy-refcounts": false,
"refcount-bits": 16,
"corrupt": false,
"extended-l2": false
}
},
"dirty-flag": false
}
but on Debian Sid I get:
{
"children": [
{
"name": "file",
"info": {
"children": [
],
"virtual-size": 1104216064,
"filename": "/home/anonym/src/tails/tails/_tmp_package/box.img",
"format": "file",
"actual-size": 1104367616,
"format-specific": {
"type": "file",
"data": {
}
},
"dirty-flag": false
}
}
],
"virtual-size": 21474836480,
"filename": "/home/anonym/src/tails/tails/_tmp_package/box.img",
"cluster-size": 65536,
"format": "qcow2",
"actual-size": 1104367616,
"format-specific": {
"type": "qcow2",
"data": {
"compat": "1.1",
"compression-type": "zlib",
"lazy-refcounts": false,
"refcount-bits": 16,
"corrupt": false,
"extended-l2": false
}
},
"dirty-flag": false
}
i.e. two instances of virtual-size
, resulting in an $IMG_SIZE
of 2\n20
which makes vagrant box add
complain that it is corrupt. I am not sure if this is due to the new version of qemu-img
or something else new in Debian Sid, but we need to parse the output more carefully. By indentation level looks fine to me.
Edited by anonym