I'm trying to initialise the entropy pool in Linux random(4) at kernel build time with data from the building machine's /dev/urandom. Initialising it at boot time is sometimes tricky & this solves that problem in some cases.
I've written code that does that, but it was pretty ugly. Generate source code for an initialised pool[] array, #include it into the driver, & mess with the makefile to ensure the array is rebuilt on every compile & deleted afterward so an enemy cannot read it.
It would be cleaner to just generate a chunk of binary data, say pool.o, & link that into the driver. You'd still need to mess with the makefile some.
My question is: how would I access that array from the rest of the driver code. I suspect I need some incantation along the lines of: static u32 *pool = __pool.o ; but I've no idea exactly what.