Hello Sascha, On 30.11.21 11:47, Sascha Hauer wrote: > On Thu, Nov 25, 2021 at 05:10:37PM +0100, Ahmad Fatoum wrote: >> First boot with uninitialized state is needlessly verbose: >> >> state: New state registered 'state' >> state: Detected old on-storage format >> ERROR: state: Error, invalid header crc in raw format, calculated 0x7bd5c66f, found 0x00000000 >> state: Ignoring broken bucket 0@0x00000000... >> state: Detected old on-storage format >> ERROR: state: Error, invalid header crc in raw format, calculated 0x7bd5c66f, found 0x00000000 >> state: Ignoring broken bucket 1@0x00040000... >> state: Detected old on-storage format >> ERROR: state: Error, invalid header crc in raw format, calculated 0x7bd5c66f, found 0x00000000 >> state: Ignoring broken bucket 2@0x00080000... >> ERROR: state: Failed to find any valid state copy in any bucket >> ERROR: state: Failed to read state with format raw, -2 >> >> This has confused barebox-state novices more than once. Let's handle >> the zeroed state case specially and reduce output in that case, so >> it now looks like this: >> >> state: New state registered 'state' >> state: Detected old on-storage format >> state: Detected old on-storage format >> state: Detected old on-storage format >> state state.of: Fresh state detected, continuing with defaults >> >> This is only the output when CRC is zero (hinting at zeroed state >> partition). If crc != zero, then output is a little more verbose than >> before: > > Should we handle crc == 0xffffffff in the same way for flash devices? I never minded it in practice, because it's only there the very first time. The problem is with emulated targets, where you see it every time and sometimes from people who don't know it's expected. I've tested this with cfi-flash and mtd-ram in QEMU and TinyEMU and there I read zeroes, so that's what's addressed. If you think it's worthwhile to do it for crc == ~0 as well, feel free to fix up on apply. :-) Cheers, Ahmad > > Sascha > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox