rpi-rt-kernel icon indicating copy to clipboard operation
rpi-rt-kernel copied to clipboard

Consider using kpartx

Open dberlin opened this issue 2 years ago • 0 comments

You currently manually calculate the loop partition offsets, etc. This is very fragile, and actually breaks for no obvious reason on some of my machines

kpartx is a tool (installable by apt in dockerfile) that is meant to do this for you.

If you run kpartx -a -v {RASPBIOS}.img in your build.sh, it will create /dev/mapper/loop0p1 (boot) and /dev/mapper/loop0p2 (root), which you can mount without any flags/issues at all. It will take care of figuring out the partitions by actually reading the partition table out of the image, rather than guessing offsets.

dberlin avatar Aug 19 '22 04:08 dberlin