Re: [RFC PATCH 0/1] Add driver for bootstage stash

Rob Landley <[email protected]> Fri, 23 May 2025 14:43:57 -0500
Newsgroups org.kernel.vger.linux-embedded
Message-ID <[email protected]>
On 5/23/25 02:34, Federico Giovanardi wrote:
> Hello,
> 
> The note about the data format also was my initial thought, by just 
> copying a C structure we might have issues as soon one party changes it, 
> and they might not be perfectly aligned.
> 
> To avoid inventing yet-another-data-format I've used msgpack in the past 
> for that (the format https://github.com/msgpack/msgpack/blob/master/ 
> spec.md, not the library ); because the specs are so simple they can be 
> implemented in a few lines, and it's something with a reference. But I 
> don't have a lot of experience in upstreaming stuff on the kernel, so I 
> don't know if it might cause someone to don't be happy. Anyway, I can 
> contribute the implementation if needed.

I note that if it has an external build-time dependency, I will not only 
never enable it, I will go to great lengths to _disable_ it. I maintain 
a patch to build x86-64 without that ridiculous fourth ELF library, for 
example:

https://landley.net/bin/mkroot/latest/linux-patches/0005-x86-64-elfcrap.patch

The traditional approach to exporting data was to have synthetic 
filesystems like /sys and /blah produce human readable ascii output that 
could be easily parsed, because unix is textual.

Ala "Write programs to handle text streams, because that is a universal 
interface." from https://en.wikipedia.org/wiki/Unix_philosophy (quoting 
Peter Salus's "a quarter century of unix" in 1994 which was itself 
quoting... I think Doug McIlroy?

Rob

P.S. The whole digression into Plan 9 muddied the waters, not because 
they backed off on it but because the original authors of unix doubled 
down on their sequel project, and then unix copied things like the 
concept of synthetic filesystems from that. The difference is Unix was 
published freely in 1974 and Plan 9 was closed source proprietary until 
2000, so the first changed the world and the second is a footnote must 
people weren't aware existed until it had basically died, and then mined 
it for ideas they could port to what they were using without ever 
touching the incompatibly licensed code...