Download your raspberry image of
choice. In my case I needed the redsleeve distro.
We want to be able to mount/modify the second partition on /mnt. Run:
which should add a loop device in /dev/mapper:
The second partition is now mapped to /dev/mapper/loop0p2. Mount:
We can now modify the disk image as we please. Remember to
kpartx -d when done.