Masahiro Yamada d726f225f5 cmd: rework "license" command
The previous commit ("add a new command to show .config contents")
improves the basic infrastructure of "embed a compressed file into
the U-Boot image, and print it by a command".  The same pattern for
the "license" command.

This commit reworks the command to improve the following:

[1] Improve log style

Kbuild style log

  GZIP    cmd/license_data.gz
  CHK     cmd/license_data_gz.h
  UPD     cmd/license_data_gz.h
  CHK     cmd/license_data_size.h
  UPD     cmd/license_data_size.h

instead of the bare Make log:

cat ./Licenses/gpl-2.0.txt | gzip -9 -c | \
		tools/bin2header license_gzip > ./include/license.h

[2] Collect related code into the "cmd" directory

Prior to this commit, the license.h was created by tools/Makefile,
placed under the "include" directory, included from cmd/license.c,
and deleted by the top-level Makefile.  It is not a good idea to
scatter related code.

[3] Drop the fixed-malloc size LICENSE_MAX

Just allocate the minimum required size of buffer because we know
the size of the original gpl-2.0.txt.

[4] Fix more issues

Terminate the buffer with zero to prevent puts() from over-running.
Add "static" to do_license.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-02-08 15:56:28 -05:00
..
2017-02-08 15:56:28 -05:00
2016-08-16 11:44:09 +08:00
2017-01-28 14:04:51 -05:00
2016-02-06 12:00:59 +01:00
2016-03-22 12:16:08 -04:00
2016-03-14 15:34:50 -06:00
2016-09-09 15:53:14 -04:00
2016-05-02 18:37:09 -04:00
2016-04-18 17:11:36 -04:00
2017-01-20 09:15:24 -05:00
2016-07-16 09:43:12 -04:00
2017-01-21 15:12:33 -05:00
2016-01-25 10:39:43 -05:00
2017-02-08 15:56:28 -05:00
2016-02-06 12:00:59 +01:00
2017-01-21 15:12:33 -05:00
2017-02-08 15:56:28 -05:00
2016-10-31 10:13:18 -04:00
2017-02-08 15:56:28 -05:00
2017-01-12 13:16:26 -05:00
2016-12-01 11:09:44 +09:00
2016-01-25 10:39:43 -05:00
2016-07-24 20:36:29 -05:00
2016-09-01 20:08:48 -05:00
2016-12-27 11:24:18 -05:00
2016-10-06 20:57:42 -04:00
2016-09-07 08:49:02 -04:00
2016-09-12 08:44:54 -04:00
2016-03-27 09:12:55 -04:00
2016-02-06 12:00:59 +01:00
2017-02-01 09:02:57 +01:00
2016-02-26 08:53:10 -07:00