blob: b07de72d36ca0ccedd148f12f14336b3af53b1d4 [file] [log] [blame]
Harald Welte5708dbf2008-07-09 22:30:30 +08001/*
2 * (C) Copyright 2007 by OpenMoko, Inc.
3 * Author: Harald Welte <laforge@openmoko.org>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Harald Welte5708dbf2008-07-09 22:30:30 +08006 */
7
8#include <common.h>
9
Harald Welte5708dbf2008-07-09 22:30:30 +080010/* COPYING is currently 15951 bytes in size */
11#define LICENSE_MAX 20480
12
13#include <command.h>
14#include <malloc.h>
15#include <license.h>
Harald Welte5708dbf2008-07-09 22:30:30 +080016
Wolfgang Denk6262d0212010-06-28 22:00:46 +020017int do_license(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
Harald Welte5708dbf2008-07-09 22:30:30 +080018{
19 char *tok, *dst = malloc(LICENSE_MAX);
20 unsigned long len = LICENSE_MAX;
21
22 if (!dst)
23 return -1;
24
25 if (gunzip(dst, LICENSE_MAX, license_gz, &len) != 0) {
26 printf("Error uncompressing license text\n");
27 free(dst);
28 return -1;
29 }
30 puts(dst);
31 free(dst);
32
33 return 0;
34}
35
Frans Meulenbroeks7675a092010-07-31 15:01:53 +020036U_BOOT_CMD(
37 license, 1, 1, do_license,
Wolfgang Denkc54781c2009-05-24 17:06:54 +020038 "print GPL license text",
39 ""
40);