Is it also possible to repartition the image with conventional tools?
How about setting a boot flag and writing it back to e.g. an USB stick?
How about setting a boot flag and writing it back to e.g. an USB stick?
~# dd if=/dev/zero of=image.img bs=1M count=100
~# LODEVICE=$(losetup --find --show image.img)
~# fdisk $LODEVICE
~# losetup -d $LODEVICE
^ The above creates a 100MB disk image, binds it to a loopback device, runs fdisk, and then detaches it. I'm not sure how formatting the partition would work but presumably those tools have an offset option too?edit: this page explains using offsets for mke2fs and doesn't require losetup: https://superuser.com/questions/737072/userspace-manipulatio...
also, losetup can now scan the device for partition tables and make partition-specific loopbacks! https://stackoverflow.com/a/15200862
https://www.embeddedarm.com/products/TS-7800
That was before I found multistrap.
fallocate -l 1G disk.img
parted ./disk.img