I wouldn't bother with this. There is an excellent project named Buildroot for the exact purpose. There is also Yocto but it generates bigger images in their recommended configuration but you can always tweak it.
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.
Thank you guys for all the links to related projects. I need to create embedded Linux image for a project in the near future, so your links are quite handy.
Does anyone have an idea how a minimal base Linux image can run inside a browser? Like can we create a small virtual Linux server right inside a browser?
Is the Linux kernel compatible with multiboot specification yet?<p><a href="http://www.gnu.org/software/grub/manual/multiboot/multiboot.html" rel="nofollow">http://www.gnu.org/software/grub/manual/multiboot/multiboot....</a>