I started a discussion about this topic in haiku forum, but I start it here as well.
BFS has no data integrity check, but we have those HPKG files that are read only filesystems that lives ontop of the BFS root filesystem. I know some of you hate hpkgs but they introduce some interesting features. One of those (and most important) actually is not implemented: the integrity check! It's easy to check if there's a corruption, you need just a checksum!
That's why I implemented a way to check them, and if possible to automatically fix a corrupted package. Along with this feature I added the possibility to download a package instead of installing it (this has been a missing piece in pkgman for me).
My actual implementation works this way:
when you install a package from a repository you get its checksum as well (that's the way haikuports works).
My modifications write the checksum as an attribute. Any accidental corruption can be easily detected with a cli command (fsck.hpkgs) or through a GUI App (IntegrityChecker) that scans /boot/system/packages files.
Remember this is not a security feature, just an integrity check for accidental corruptions. It's not meant to fight intended corruptions or malwares. You can mean it if the corruption is saved alongside with a new checksum attribute, or just removing the checksum attribute.
It seems there will be a rust implementation of hpkg format, that integrates errors and corruption detection within hpkg archives. But I'm not sure how it works and if it spans the same scope. But that's interesting.
What do you think about this feature?