summaryrefslogtreecommitdiff
path: root/utils/mkrk27boot/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/mkrk27boot/main.c')
-rw-r--r--utils/mkrk27boot/main.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/utils/mkrk27boot/main.c b/utils/mkrk27boot/main.c
new file mode 100644
index 0000000000..5ba69b5a98
--- /dev/null
+++ b/utils/mkrk27boot/main.c
@@ -0,0 +1,55 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id:$
9 *
10 * Copyright (C) 2012 by Andrew Ryabinin
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include<stdio.h>
23#include "mkrk27boot.h"
24
25
26int main(int argc, char **argv)
27{
28 char* img_file = NULL;
29 char* rkw_file = NULL;
30 char* out_img_file = NULL;
31 char* out_rkw_file = NULL;
32
33 if (argc == 4) {
34 img_file = argv[1];
35 rkw_file = argv[2];
36 out_img_file = argv[3];
37 out_rkw_file = "BASE.RKW";
38 } else if (argc == 5) {
39 img_file = argv[1];
40 rkw_file = argv[2];
41 out_img_file = argv[3];
42 out_rkw_file = argv[4];
43 } else {
44 fprintf(stdout, "\tusage: mkrk27boot <img file> <rkw file> <output img file> [<output rkw file>]\n");
45 fprintf(stdout, "\tIf output rkw file is not specified, the default is to put rkw file to BASE.RKW\n");
46 return -1;
47 }
48 if (mkrk27_patch(img_file, rkw_file, out_img_file, out_rkw_file)) {
49 fprintf(stdout, "%s\n", mkrk27_get_error());
50 return -1;
51 }
52 fprintf(stdout, "Success!\n");
53 return 0;
54}
55