Commit Graph

42 Commits

Author SHA1 Message Date
Dan Horák
8ca2bcc67e use a safe way to copy the chip string
based on https://developers.redhat.com/blog/2019/08/12/efficient-string-copying-and-concatenation-in-c

Fixes: https://github.com/rockchip-linux/rkdeveloptool/issues/55
2021-06-18 18:29:25 +02:00
liuyi
46bb4c0736 v1.32:
1.support to upgrade 356x loader

Signed-off-by: liuyi <liuyi@rock-chips.com>
2021-04-08 11:34:59 +08:00
liuyi
e607a5d6ad 1.fix erase ubi bug
2.fix download ubi bug

Signed-off-by: liuyi <liuyi@rock-chips.com>
2021-02-03 16:28:03 +08:00
liuyi
e541b7bbff 1.support erase block forcely
2.fix create gpt bug

Signed-off-by: liuyi <liuyi@rock-chips.com>
2021-01-22 14:26:24 +08:00
liuyi
1e890c4fcf Merge branch 'master' of https://github.com/rockchip-linux/rkdeveloptool 2020-08-31 14:24:51 +08:00
liuyi
0dcb0a4ca1 1.support to write ubi image
2.cut off iconv reference

Signed-off-by: liuyi <liuyi@rock-chips.com>
2020-08-31 14:18:37 +08:00
liuyi
468237fe72 1.support to write ubi image
2.cut off iconv reference

Signed-off-by: liuyi <liuyi@rock-chips.com>
2020-08-31 11:46:24 +08:00
Peter Robinson
aca206f7e9 Use signed char for variable
Architectures other than x86 don't by default treat char as signed so
be explicit so the build doesn't fail when building on other arches
such as Arm.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2019-06-28 12:06:34 +01:00
Kever Yang
c49bf47e08 fix array boundry error
g++ -DHAVE_CONFIG_H -I. -I./cfg  -Wall -Werror -Wextra -Wreturn-type
-fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE
-I/usr/include/libusb-1.0    -O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions
-fstack-protector-strong -grecord-gcc-switches
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -c
-o main.o main.cpp
main.cpp: In function 'bool unpackBoot(char*)':
main.cpp:1734:11: error: array subscript 20 is outside array bounds of
'char [20]' [-Werror=array-bounds]1734 |  str[len] = 0;|  ~~~~~~~~~^~~
main.cpp:1772:7: note: while referencing 'name'1772 |  char name[MAX_NAME_LEN];|       ^~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:475: main.o] Error 1

Reported-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-06-28 12:51:18 +08:00
Open Source Software for Rockchip SoCs(moved to https://github.com/rockchip-linux/)
5e44dcd9e7
Merge pull request #39 from cmuellner/compilation
Fix compilation issue in split_item().
2019-06-28 11:38:42 +08:00
Caesar Wang
cd6053d277 Revert "Fixed Build Failed - gcc 8.2.0"
This reverts commit c43947cfb1.
2019-06-28 11:33:07 +08:00
Open Source Software for Rockchip SoCs(moved to https://github.com/rockchip-linux/)
04dfeff18a
Merge pull request #38 from cmuellner/parser
parse_parameter: Continue parsing after 'mtdparts'.
2019-06-28 11:29:58 +08:00
Christoph Muellner
02bc776388 Fix compilation issue in split_item().
Recent compilers complain with the following message:

  main.cpp: In function ‘void split_item(STRING_VECTOR&, char*)’:
  main.cpp:2840:10: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying as many bytes from a string as its length

This patch addresses this issue.

Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
2019-06-26 15:13:09 +02:00
Christoph Muellner
8be0e034fd parse_parameter: Continue parsing after 'mtdparts'.
The parse_paramter loop iterates over a parameter.txt file's contents
and parses that line-by-line. However, the current implementation
silently stops after parsing 'mtdparts'. This is problematic if
a 'uuid' token is found in one of the following lines.

This patch addresses the problem, by simply continue to iterate
over the next lines after 'mtdparts'.

Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
2019-06-26 15:12:45 +02:00
yangkunlun
c43947cfb1 Fixed Build Failed - gcc 8.2.0
ERROR:

main.cpp:2841:10: error: ‘char* strncpy(char*, const char*, size_t)’
output truncated before terminating nul copying as many bytes from
a string as its length [-Werror=stringop-truncation]

Since the allocation is only 100*char, the reasonable fix would be
limit the strncpy to only (100-1)*char.
2019-02-23 22:26:27 +08:00
Open Source Software for Rockchip SoCs(moved to https://github.com/rockchip-linux/)
953670e6ce
Merge pull request #19 from kgoger/pack_cmd_fix
Fix pack parsing
2018-09-03 09:01:51 +08:00
liuyi
081d237ad5 rkdeveloptool: v1.3
1.add LD to list devices
2.add PRM to write parameter
3.change PGPT to PPT to support print parameter and GPT

Signed-off-by: liuyi <liuyi@rock-chips.com>
2018-03-28 09:22:40 +08:00
Klaus Goger
544ec1d465 Fix pack parsing
The index needѕ to be incremented after a valid path was found. Otherwise
gOpts.loader[index].name will be out of of bound after the second
iteration.

Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2018-01-08 08:55:52 +01:00
陈豪 | Jacob Chen
5b7445d109
Merge pull request #16 from kgoger/buildfixes
macos/openbsd fixes
2017-11-28 15:42:20 +08:00
liuyi
ae4252f085 wl to support sparse image
Signed-off-by: liuyi <liuyi@rock-chips.com>
2017-11-15 12:01:30 +08:00
Klaus Goger
06ea143e09 cast emUsbType to uint when compared with uint
uiSupportType is type uint. emUsbType defaults to int.
A logical OR will result in a uint. Therefore cast emUsbType
to uint to prevent following error with clang on OpenBSD

cc1plus: warnings being treated as errors
main.cpp: In function 'bool check_device_type(STRUCT_RKDEVICE_DESC&, UINT)':
main.cpp:835: warning: comparison between signed and unsigned integer expressions
*** Error 1 in . (Makefile:461 'main.o')
*** Error 1 in /root/rkdeveloptool (Makefile:506 'all-recursive')

Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2017-10-10 17:05:15 +02:00
Klaus Goger
08c0d21888 use strncmp to compare string literal
Fixes build error with Apple LLVM version 8.1.0 (clang-802.0.42)

main.cpp:1160:18: error: result of comparison against a string literal
is unspecified (use strncmp instead) [-Werror,-Wstring-compare]
                if (configPath == (char*)DEF_CONFIG_FILE) {
		                                 ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2017-09-18 21:33:34 +02:00
liuyi
3dc7e3ce82 add pgpt command to list gpt info
Signed-off-by: liuyi <liuyi@rock-chips.com>
2017-08-08 09:09:09 +08:00
liuyi
6502326d4d solve the issue that erase flash doesn't work
Signed-off-by: liuyi <liuyi@rock-chips.com>
2017-08-07 17:43:59 +08:00
liuyi
6ae612bebc 1.add "wlx" command support flash image by name
2.flash sparse image by wlx command

Signed-off-by: liuyi <liuyi@rock-chips.com>
2017-08-07 14:39:06 +08:00
liuyi
c29e5f0fb3 1.correct grow partition size error
2.correct backup gpt error
3.add set fixed partition uuid function with parameter_gpt.txt

Signed-off-by: liuyi <liuyi@rock-chips.com>
2017-08-04 16:34:22 +08:00
liuyi
b38fe5fc11 1. idblock support rc4flag in ul handler
2. cut off reset device in ul handler

Signed-off-by: liuyi <liuyi@rock-chips.com>
2017-08-02 10:06:45 +08:00
Eddie Cai
2404a38a33 Merge pull request #11 from afaerber/normal-color
Fix NORMAL_COLOR_ATTR definition
2017-05-16 09:09:56 +08:00
Andreas Färber
9bc231bd38 Show usage on invalid command
Instead of instructing to re-run with -h, just show the usage help.

Signed-off-by: Andreas Färber <afaerber@suse.de>
2017-05-14 19:51:28 +02:00
Andreas Färber
32268622d4 Tweak text output
Add space after comma or colon and before parenthesis and collapse
duplicate space. Don't use parenthesis for progress messages.

Use progressive forms of verbs where suitable.

While at it, replace repetition of function names with macro and rename
one variable.

Signed-off-by: Andreas Färber <afaerber@suse.de>
2017-05-14 19:51:14 +02:00
Andreas Färber
3601cc0888 Fix NORMAL_COLOR_ATTR definition
NORMAL_COLOR_ATTR hardcoded white-on-black text. Fix this to reset to
the actual user-controlled defaults.

This resolves white-on-black text after errors on a black-on-white
terminal (issue #10).

Signed-off-by: Andreas Färber <afaerber@suse.de>
2017-05-14 18:11:47 +02:00
liuyi
e5ee8cc01e main: fix print 'failed to stat config.ini'error
Signed-off-by: liuyi <liuyi@rock-chips.com>
2017-04-25 09:20:40 +08:00
Eddie Cai
d71e8c2048 main: add tag u-boot spl command
Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
2017-04-18 11:12:05 +08:00
Kever Yang
055958c9e7 main: Do not reset device after ul command success
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-04-18 10:25:58 +08:00
Eddie Cai
641cfa16d6 main: pack command support relative path
Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
2017-04-18 10:15:19 +08:00
Eddie Cai
78884ef4ba main: add pack and unpack boot loader support
pack and unpack boot loader is very helpful when debug boot loader.
we should support it in rkdeveloptool.

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
2017-04-17 18:42:08 +08:00
Eddie Cai
154ee062ef main: modify usage
modify usage to make it more readable

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
2017-04-16 21:42:59 +08:00
Eddie Cai
8df2d64a80 main: support lower case command
people use lower case more than upper case. so we should support
lower case command

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
2017-04-16 21:39:58 +08:00
Kever Yang
c30d921c26 main: update to version 1.2
- add gpt command to write gpt table
- add ul command, need run db first

Signed-off-by: Liu Yi <liuyi@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Kever Yang <kever.yang@rock-chips.com>
2017-04-11 18:21:54 +08:00
Trevor Woerner
3af06dfb26 main.cpp: take version information from autotool configuration
The autotool configuration needs to know the version of the project, so
instead of forcing the developer to maintain two version strings and keep them
synchronized, allow the code to take the version string from the autotool
configuration automatically. Hence, only one version needs to be maintained
which is shared between the autotool configuration and the code.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2017-03-24 11:00:36 -04:00
Eddie Cai
9908df895e main: fix write_lba fail
the input file of write lba command may not 128 aligned. that may cause write
lba command fail. remove the judge to fix this issue.

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
2017-03-15 10:12:30 +08:00
liuyi
76af099afc rkDevelopTool: initial commit
Signed-off-by: liuyi <liuyi@rock-chips.com>
2017-03-07 16:12:52 +08:00