|
|
|
|
|
by mwcampbell
3884 days ago
|
|
As I get some pleasure out of writing scripts to build finely tuned minimal images like this, I found the article interesting. However, I think manipulating a qcow2 image directly via nbd is over-complicating it. I think it would be better to create a sparse file, mount that via a loopback device, work with that, and then convert it to a qcow2 image (or vmdk or whatever) at the end. |
|
First, when building a system image with make, it works best to have each step result in a separate image file so that make can rebuild your image when a dependency changes without having to completely start over. Using .qcow2 images means that only the diffs are stored in each image file, instead of having a dozen 4GB .bin files.
Second, because the loopback device requires root by default, you end up running "sudo make" as part of your build process. But with .vmdk or .qcow2 files, tools like libguestfs can mount the filesystem for manipulation without root. If you're planning to distribute your work, then "git clone && cd project && make" is more accessible directing your users to modify their user permissions or elevating to root.