Hi Marc,
> Is anybody planning on making smartmontools endian-safe ? I am using
> smartctl on a ppc (big-endian) board, it is usable but a lot of values
> are byte swapped including flags, LBA sectors, it also causes smartctl
> to think SMART is not supported forcing the use of -T permissive.
I'm really delighted to get your email. I have been wondering for a long
time if smartmontools would work on a big-endian machine.
It should be possible to easily (and cleanly) fix all the endian-order
problems, by adding a switch that byte swaps all the two- and four-byte
quantities in the different SMART data structures, as soon as these are
read from the disk.
I can't do this myself since I have no way to test it -- but I'd be
interested in working with you to do this -- what do you think.
To get a flavor for what is involved, we'd need to write six functions
that byte-swap the requisite data in each of the six different SMART data
structures. To see what such a function would look like, see the function
fixsamsungerrorlog() in atacmds.c [this corrects some byte order
problems in a disk with bugs in the firmware].
Let me know if you are interested in doing this with me.
Cheers,
Bruce
|