2008-07-09 22:30:30 +08:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2007 by OpenMoko, Inc.
|
|
|
|
* Author: Harald Welte <laforge@openmoko.org>
|
|
|
|
*
|
2013-07-08 09:37:19 +02:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2008-07-09 22:30:30 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
|
2016-03-15 12:49:12 -04:00
|
|
|
/* Licenses/gpl-2.0.txt is currently 18092 bytes in size */
|
2008-07-09 22:30:30 +08:00
|
|
|
#define LICENSE_MAX 20480
|
|
|
|
|
|
|
|
#include <command.h>
|
|
|
|
#include <malloc.h>
|
|
|
|
#include <license.h>
|
|
|
|
|
2010-06-28 22:00:46 +02:00
|
|
|
int do_license(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
2008-07-09 22:30:30 +08:00
|
|
|
{
|
2016-03-15 12:49:12 -04:00
|
|
|
char *dst = malloc(LICENSE_MAX);
|
2008-07-09 22:30:30 +08:00
|
|
|
unsigned long len = LICENSE_MAX;
|
|
|
|
|
|
|
|
if (!dst)
|
|
|
|
return -1;
|
|
|
|
|
2016-03-15 12:49:12 -04:00
|
|
|
if (gunzip(dst, LICENSE_MAX, license_gzip, &len) != 0) {
|
2008-07-09 22:30:30 +08:00
|
|
|
printf("Error uncompressing license text\n");
|
|
|
|
free(dst);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
puts(dst);
|
|
|
|
free(dst);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-07-31 15:01:53 +02:00
|
|
|
U_BOOT_CMD(
|
|
|
|
license, 1, 1, do_license,
|
2009-05-24 17:06:54 +02:00
|
|
|
"print GPL license text",
|
|
|
|
""
|
|
|
|
);
|