[PATCH] Open Firmware device tree virtual filesystem
Segher Boessenkool
segher at kernel.crashing.org
Mon Jan 1 18:52:36 EST 2007
>> If you *really* want (the option of) showing things as text
>> in the filesystem, you better make it so that there is a
>> one-to-one translation back to binary. For example, what
>> does this mean, is it a text string or two bytes:
>>
>> 01.02
>>
>> Yes you as a user can guess, but scripts can't (reliably).
>
> We have some extensive code in fs/openpromfs/inode.c that
> determines whether a property is text or not. I can't
> guarentee it works %100, but it's very context dependant
> (only the driver "knows") but it works for all the cases
> I've tried.
It's still a heuristic, I don't think the kernel should be
doing things like this; leave the guesswork to userland,
where different users can guess in different ways if they
want/need.
Some real life properties contain _both_ a binary part and
a text part, btw.
> I really think you're making a mountain out of a mole hill, to be
> honest :-)
Heh. There is one big problem: text representation is useless
(to scripts etc.) unless it can be transformed back to binary;
i.e., it has to be possible to reliably detect _how_ some
property is represented into text, something that cannot be
done with how openpromfs handles it.
Segher
More information about the Devel
mailing list