Originally Posted By: mlord
It's not you, but rather the frickin closed-source firmware and Windows installer program. They insist on destroying a perfectly good partition layout, even when *not* running a builder image. I'm just using a bit of guesswork to try and prevent that.

Did your earlier correct guess that it's the CHUNK_PUMPHDA (0x20) in the upgrade file that tells the firmware to do the re-partition operation, not work out? Omitting that would seem a more robust solution than preventing partition table rewrites on a sector-by-sector basis, particular if the actual sector numbers can vary with disk geometry.

And though most of the Windows installer is closed-source, the code it uses to do the upgrading is actually visible in the Emptool open-source distribution, lib/protocol/upgrader.cpp.

I still also think that you should arrange that, whatever the disk geometry, the music partition ends up at the same sector offset it would with the stock image. And that the easiest way to achieve that would be to repurpose, not resize, the existing partitions.

Peter