https://www1.informatik.uni-erlangen.de/tresor
It has been on HN before. I doubt anyone is running it on tablet to secure their lights, TV, and toiles though.
(Everyone, forgive the joke; but I loved this presumed user's artcile on Android light controls in hotels: https://news.ycombinator.com/item?id=11266796)
a) Use signatures instead of hashes and keep the "correct" signature secret. This would prevent attacker from hard-coding correct looking output into the tampered system.
b) Do not store the correct signature anywhere where the potentially tampered system could read it. I'm thinking using smartphone or possibly some usb module for verification, or maybe just rely on users memory (assisted with something akin to SSH randomart fingerprints)
c) Fill free space on /boot with random data and calculate the signature for the whole partition. This is to detect if attacker attempts to store backup copies of untampered files.
To me it's not immediately obvious how attacker could tamper with boot files without detection, presuming that their ability to tamper is restricted to the hard drive (i.e. no firmware attacks etc).
edit: for clarification, I'm talking only hypothetically here, I'm not considering this sort of system for personal use nor would I be recommending it to anyone else.
[1] https://www.google.co.uk/search?q=rootkit+intercepting+open+...
[2] http://phrack.org/issues/66/16.html
[3] https://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thomp...
Could you be bit more specific about this?
Or the attacker could just use the hard drive. Pick a random block. Chances are decent the corruption won't be noticed anytime soon, especially if the block is, say, at the end of the ext4 journal, which was probably clean at shutdown anyway.
By that argument, if the attacker can modify the contents of /boot then you've lost and this doesn't buy you anything.