]> git.ipfire.org Git - thirdparty/u-boot.git/blame - cmd/license.c
cmd: nvedit: set H_INTERACTIVE in do_env_default
[thirdparty/u-boot.git] / cmd / license.c
CommitLineData
83d290c5 1// SPDX-License-Identifier: GPL-2.0+
0a823aa2
HW
2/*
3 * (C) Copyright 2007 by OpenMoko, Inc.
4 * Author: Harald Welte <laforge@openmoko.org>
0a823aa2
HW
5 */
6
7#include <common.h>
0a823aa2
HW
8#include <command.h>
9#include <malloc.h>
0a823aa2 10
d726f225
MY
11#include "license_data_gz.h"
12#include "license_data_size.h"
13
14static int do_license(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
0a823aa2 15{
d726f225
MY
16 char *dst;
17 unsigned long len = data_size;
18 int ret = CMD_RET_SUCCESS;
0a823aa2 19
d726f225 20 dst = malloc(data_size + 1);
0a823aa2 21 if (!dst)
d726f225 22 return CMD_RET_FAILURE;
0a823aa2 23
d726f225
MY
24 ret = gunzip(dst, data_size, (unsigned char *)data_gz, &len);
25 if (ret) {
0a823aa2 26 printf("Error uncompressing license text\n");
d726f225
MY
27 ret = CMD_RET_FAILURE;
28 goto free;
0a823aa2 29 }
d726f225
MY
30
31 dst[data_size] = 0;
0a823aa2 32 puts(dst);
d726f225
MY
33
34free:
0a823aa2
HW
35 free(dst);
36
d726f225 37 return ret;
0a823aa2
HW
38}
39
388a29d0
FM
40U_BOOT_CMD(
41 license, 1, 1, do_license,
a89c33db
WD
42 "print GPL license text",
43 ""
44);