]>
Commit | Line | Data |
---|---|---|
0a823aa2 HW |
1 | /* |
2 | * (C) Copyright 2007 by OpenMoko, Inc. | |
3 | * Author: Harald Welte <[email protected]> | |
4 | * | |
1a459660 | 5 | * SPDX-License-Identifier: GPL-2.0+ |
0a823aa2 HW |
6 | */ |
7 | ||
8 | #include <common.h> | |
9 | ||
8a7367ac | 10 | /* Licenses/gpl-2.0.txt is currently 18092 bytes in size */ |
0a823aa2 HW |
11 | #define LICENSE_MAX 20480 |
12 | ||
13 | #include <command.h> | |
14 | #include <malloc.h> | |
15 | #include <license.h> | |
0a823aa2 | 16 | |
54841ab5 | 17 | int do_license(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
0a823aa2 | 18 | { |
8a7367ac | 19 | char *dst = malloc(LICENSE_MAX); |
0a823aa2 HW |
20 | unsigned long len = LICENSE_MAX; |
21 | ||
22 | if (!dst) | |
23 | return -1; | |
24 | ||
8a7367ac | 25 | if (gunzip(dst, LICENSE_MAX, license_gzip, &len) != 0) { |
0a823aa2 HW |
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 | ||
388a29d0 FM |
36 | U_BOOT_CMD( |
37 | license, 1, 1, do_license, | |
a89c33db WD |
38 | "print GPL license text", |
39 | "" | |
40 | ); |