Right now we don't do partial writes, do we? If we did, this isn't dangerous as long as we rewrite the entire lar entry, is it?
You are right, we don't do partial writes right now, but it is the 800 pound gorilla in the room. Everything about the design of LAR is based around the concept of partial writes, so we really can't ignore it.
One of our problems is that we have made partial writes a high priority, but we haven't clearly defined how they are going to work. Adding new code to an existing ROM isn't a difficult concept, but when it comes to changing or replacing blobs, it gets very vague, and IMHO very scary. None of our current v3 platforms support fallback, so just one blown sector is death, even if LAR can detect it and print a "gee, we're sorry but the ROM is corrupted message". I am having trouble being convinced that this is any safer then writing a full ROM, but thats off-topic for this message.
The point is that we have to always be aware that the LAR could change from boot to boot. If we need to support a dynamic LAR, then we need to keep the bayou related complexity to a minimum, or at least as low as the circumstances will allow.
It seems like supporting partial writes means knowing the details that right now only flashrom knows. Maybe we should bite off a smaller chunk and make flashrom support partial writes. In other words we create a valid LAR updated however the user wanted, make sure they know if they're changing the bootblock or something else that's critical, and then let flashrom only write the portions that have changed. That way we keep the details where they belong.
Thanks, Myles