Re: [PATCH] Support 'b' format for printing raw bytes with fdtget

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi Rafał,

On Mon, 6 Dec 2021 at 09:09, Rafał Miłecki <zajec5@xxxxxxxxx> wrote:
>
> From: Rafał Miłecki <rafal@xxxxxxxxxx>
>
> FT is sometimes used for storing raw data. That is quite common for
> U-Boot FIT images.
>
> Extracting such data is not trivial currently. Using type 's' (string)
> will replace every 0x00 (NUL) with 0x20 (space). Using type 'x' will
> print bytes but in xxd incompatible format.
>
> This commit adds support for 'b' (binary) format. Example usage:
> fdtget -t b firmware.itb /images/foo data > image.raw
>
> Signed-off-by: Rafał Miłecki <rafal@xxxxxxxxxx>
> ---
>  fdtget.c |  5 +++++
>  util.c   | 24 ++++++++++++++----------
>  2 files changed, 19 insertions(+), 10 deletions(-)

I think this is a good idea.

I'm worried about using 'b' which we already use as a modifier. Won't
that be ambiguous? Perhaps not, but it needs a doc update, at least.

Please add to fdtput also

Please add some tests too.

Regards,
SImon




[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux