summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-12-19Fix segmentation fault during network tranferDongwoo Lee1-0/+2
Since 'chunk' which is unit of transfer is not initialized, aio_read() is failed with invalid argument error. Moreover, in this case, chunk.nh is even NULL, so chunk->nh->sock_fd cause segmentation fault. Thus, this patch fixes to initialize chunk properly, and make chunk.nh have network handler pointer. Change-Id: I322a01ca99829eb928f26488a341cdaee1c4d9e2 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2018-05-31Bump version to 3.0 supporting THOR protocol 5.0 and network modeSeung-Woo Kim3-2/+9
The lthor 3.0 supports THOR protocol 5.0 which can send file more than 4GB and supports flashing via network. Change-Id: I7c8429d01488281b2ae4c59f7846da78ee1a80e7 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2018-05-31Add support for asynchronous transfer on network transportDongwoo Lee2-44/+225
To improve performance of network transfer, add asynchronous transfer with AIO APIs to network transport. Change-Id: I91dbf1161aeebc03af2bccdbe4ed0e20a322949d Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2018-05-31Add network transport for image transferDongwoo Lee6-2/+277
This patch adds network transport which can transfer image via tcp layer. If the option "--net=<ip[:port]>" is passed, lthor tries to connect the target with given ip and port, or else, it just try to connect via usb. When the port nubmer is not provided for network option, it uses default port. Change-Id: I14bea3523d01e3a4f547e41d40d353790a870460 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2018-05-31Re-structure lthor to extend its transfer methodsDongwoo Lee9-664/+863
Currently, thor has very specific code structure for considering only usb transfer, thus it is too hard to add other transfer methods. This patch makes lthor to be extendable by just implementing few operations: open, close, send, recv, and send_data. Change-Id: If455a9d7a5c7fd86cf6e8808f29c643456e80166 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2018-05-31Add packed attribute to message protocol structSeung-Woo Kim1-3/+3
The structures for message should be packed for communication. Add explict packed attribute to the message struct. Change-Id: I33ec2986a5caedf0dfa248b2e04c51ee75ae1520 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2018-05-31Fix wrong opt usage for pidSeung-Woo Kim1-1/+1
The opt '--product-id' should be set in pid, but it is set to vid. Fix wrong opt usage for pid. Change-Id: I360cacdade6dd81cd3250013c68a561ebfbdc008 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2018-05-18Fix to check protocol version before refusing large fileSeung-Woo Kim3-14/+42
From protocol version 5.0, it will be supported large file size with 64bit value. Fix to check protocol version before resuing large file. Change-Id: Ie2b76d5e857c143289332e543bb65254ac522081 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2018-05-18Update for THOR 5.0 supportSeung-Woo Kim3-8/+14
Until THOR 4.0, it uses only 32bit to send file size. From THOR 5.0, it starts to use two 32bit variables for the file size. Update for the THOR 5.0 protocol support. Change-Id: I3569d51179bb75b034a62f902e8640a1232d6ed3 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2018-05-18Fix overflow of filenameSeung-Woo Kim2-2/+24
In thor protocol, only filename with 32 characters is allowed to send but there was overflow of filename more than 32 and it is crashed with 193 or longer length filename. Fix the overflow of filename. Note: ARTIK530 and ARTIK710 already misuse overflowed 33 length dtb filename, and exact modification as thor protocol breaks flashing on the boards. So fix with extention for the ARTIK borads by appending more 32 bytes in rqt_pkt.str_data[1] as artik u-boot expects. Change-Id: I4081024cafa276617497091e00cbb6fbc21348b7 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2018-05-18Fix wrong close for negative file descriptorDongwoo Lee1-1/+2
There is an issue which negative file descriptor can be attempt to close in static analysis tool result. This patch fixes to skip close on that case. Change-Id: Ic68803bc96ab6e3737d1bcc4779b8e3c58c7ef71 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2018-05-18Fix uninitialized data in error ret valueSeung-Woo Kim1-1/+3
There is uninitialized data issue in static analysis tool result. Fix the uninitialized data in error ret value. Change-Id: I7e5e0f6fa372c125c5ce6eb8df321cb08919b9cf Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2018-05-18Fix use of deprecated libarchive function callsDongwoo Lee1-5/+5
To get rid of build warning about deprecated funcations of libarchive, this patch replaces those function calls with alternative ones. Change-Id: I164c60243e20fcbbdad2185a14534fe7a4daf9d8 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2017-04-10Fix progress report for larger than 2GB fileSeung-Woo Kim2-6/+7
Currently, progress report function has 32bit signed value for its send and left parameters, so it causes negative value progress. This fixes the parameters as unsigned 32bit type to report properly. Change-Id: I1d291c1507170c57b025d4fbd91098b48a97cdd0 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2016-09-05Fix description for short version of paramsrelease-20160930Krzysztof Opasiak1-3/+3
Change-Id: I8a06e7c231f1134d2892dade182fec2b313bc630 Reported-by: Donghoon Shin <dhs.shin@samsung.com> Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-09-05Fix busid param parsingKrzysztof Opasiak1-0/+2
Change-Id: Ia3e6047ccd9f07d1a834c4eb58408d0afca1c8c3 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-09-02Fix memleak of entry nameKrzysztof Opasiak1-0/+1
Change-Id: I57fe94546759888697871fa716e865771801b00b Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-09-02Fix file testingKrzysztof Opasiak2-0/+5
Change-Id: Ide8250910005c37a6ecadcb81d4d3b8e1e646bda Reported-by: Tomasz Wozniak <t.wozniak@samsung.com> Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-09-02Fix double free on error conditionKrzysztof Opasiak1-1/+4
Change-Id: I41224563de4d6176e60a5f4c893560e3dcf96b86 Reported-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-09-02Fix memleak of entries arrayKrzysztof Opasiak1-0/+1
Change-Id: I39259e1bdd48fc2a75cdb6652e918cef2775774c Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Update package build configurationrelease-20160808Krzysztof Opasiak4-4/+14
Based on initial work by Seung-Woo Kim <sw0312.kim@samsung.com>. Change-Id: I8eaa2e5d726aff359de221d1bce203439bcacd05 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Bump lthor version to 2.0Krzysztof Opasiak3-7/+26
Due to major changes in lthor implementation let's bump version to 2.0 Change-Id: I7b39080031c499a7e9f0899b32918d682d5f7497 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Allow to print also content of tar fileKrzysztof Opasiak4-14/+100
Old implementation of lthor was printing not only name of tar file and it's size but also name of each entry and it's size. This patch allows also new implementation to do this. Change-Id: I05c12fb5368bcaaaeeb93a3116d9322ecc4349b1 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Add support for large filesKrzysztof Opasiak8-38/+58
Currently session size is send over USB as integer 32b. So max size of all files is 2GB. Some fixed uboot versions treat this value as unsigned integer 32b. So there max size of all files is 4GB. Let's provide initial support for large files in lthor by counting all size using off_t which thanks to define is 64b on all platforms. This patch also add a suitable warning if image is larger than 2GB and reports an error if image is larger than 4GB. Change-Id: I402b3684fa96c7531edb580e38f109ecc8a5ebd0 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Improve colors handling in terminalKrzysztof Opasiak1-8/+14
Instead of repeating magick strings in many places let's use a suitable defines for them to make the code more readable. Change-Id: I7b4935bd459e375be39d1dd223d20c71635670cc Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Use asynchronous API to improve performanceKrzysztof Opasiak3-47/+381
Change-Id: I18f0aa14778d06751e7005e4b555c6c68f2839d4 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Start using new implementation of thor protocolKrzysztof Opasiak4-1161/+321
Drop all legacy stuff which used cdc-acm kernel driver and start using new implementation provided by libthor. Change-Id: If3ee224b4905778d39c8b049f38353f499cd9f9f Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Add core file with thor communication protocolKrzysztof Opasiak1-0/+340
Add main file of libthor with implementation of API and thor communication protocol. Change-Id: Ic6e4c13ad89eef8080f955af5a71c11cd201ad78 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Add cdc-acm related implementation of thor protocolKrzysztof Opasiak2-0/+115
Thor protocol "emulates" cdc-acm class. This commit adds some helper functions which are required to properly setup communication on cdc-acm protocol level. Change-Id: Iffb79c813f97bc3f3c4260f6fd713d0ea4d99353 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Add libusb backend for thor protocolKrzysztof Opasiak2-0/+590
Add implementation of functions used for communication with tharget on USB level via libusb. Change-Id: I59603b3bb05570e8f13c8ca3e4f48fabf2fc03c0 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Add code for accessing tar archivesKrzysztof Opasiak2-0/+204
Add implementation of data source for accessing tar files. This is needed to flash tar.gz file using lthor. Change-Id: Id5abbf258d41f37c569c65753bb8866bb9a84b6a Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Add code for accessing raw file by liblthorKrzysztof Opasiak2-0/+131
Implement a data source for accessing standard file. This type of access is used for reading PIT file. Change-Id: Icc9de3718e1234e0758c27f4721f3072d3d538f9 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Add headers with API for new implementation of thor protocolKrzysztof Opasiak3-0/+227
Add new headers with: - API for accessing new implementation of thor protocol - Internal data structure which will be used by libthor Copy also header with definitions of messages used by thor protocol. Change-Id: I0e6901a45737e3711f9328f757f76de96b88bdd3 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Use getopt_long() to parse cmd lineKrzysztof Opasiak1-45/+53
Use a standard linux way of parsing cmd line arguments to avoid unnecessary code. Change-Id: I64325e7804048c1abce013f78df5163ee4af85c8 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Add gitignoreKrzysztof Opasiak1-0/+8
Change-Id: I4126d7a25a29414dc92f776da7c2d34c731e2fa9 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Update lthor versionJaewon Kim3-2/+8
This patch update lthor version to 1.5 Change-Id: Ie25e95b6fd5e4a601c64bdf8c4a3d66f0ed64005 Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
2016-07-25Add to pass abnormal fileJaewon Kim1-11/+19
When trying abnormal file(not matched with pit) download, lthor pass this file. Change-Id: Ib3c46fdd2f82a4299dfbfcaa9ad64f4b30accb56 Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
2016-07-25Add ttyACM check for lthorJaewon Kim1-68/+92
This patch add ttyACM check to find correct port for lthor even if there are several ttyACM port. Change-Id: Icb87a9ebbabec2e5fa7c3312efff972488dbc3d1 Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
2016-07-25Remove vendor and product match codeJaewon Kim1-60/+16
This patch remove vendor and product ID checking code to support various boards Change-Id: I6e1bca14e504a072f93d661666a9c623802ef472 Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
2016-07-25Update URL in spec fileGaurav Kalra1-1/+1
Change-Id: I6913146ba412e2514b0e99c50908a2441f4c9fd0
2016-07-25Correcting usage help for check protocolGaurav Kalra1-1/+1
Change-Id: If17ad57e29b50f01011c3435c81fb8f522eaa0b4
2013-12-08Increased version in debian/changelogrelease-test-20150810release-test-0.1release-20160615release-20160531release-20160411release-20160315Ed Bartosh1-0/+6
Change-Id: Ic49555ddc4d72ed837e78b6a953293c412394a34 Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2013-10-28Support MAC OS X 10.7,10.8jaehoon.you5-4/+34
On OS X the serial device must be opened with O_NONBLOCK flag. Later this flag must be cleared before write operations otherwise only small chunks data can be written at once. Tested on OS X (10.8.4). Author : Piotr Wilczek <p.wilczek@samsung.com> Change-Id: I2b77cf16aacd491af9c94203fe7dfc49ce361516 Signed-off-by: jaehoon.you <jaehoon.you@samsung.com>
2013-10-28Fixed packagingEd Bartosh2-29/+0
No need in Makefile and .dsc file as we're using git-buildpackage service in Jenkins job. Change-Id: Ie417a54693dd9ab4a6b5c372c8563b66a4a6d801 Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2013-04-25Fixed OpenSUSE 1.23 buildEd Bartosh2-2/+4
Change-Id: I462628a57597e2cc8892bd705fdbf426361cf024 Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2013-04-25Fixed deb packaging issues found by lintianEd Bartosh2-5/+14
The following changes have been made: - removed libc6-dev from the list of build dependencies as it is build essential - Used real Standard-Version - Used misc:Depends macro - Updated short description - Added long description - Updated package version Change-Id: Ifa1a52d4e2f109255aa4d1ecb68dc166b57ffa42 Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2013-04-02Change AUTHORSjaehoon.you2-5/+2
Change-Id: Ib2991a1a6844e5a1827268f0fb4a8303c18f8269 Signed-off-by: jaehoon.you <jaehoon.you@samsung.com>
2013-04-02Fix and Add some error messagejaehoon.you1-5/+9
1. In some cases, lthor needs enough memory (Reported by Vyacheslav Barinov in SRR) So, notify message added. 2. fix print format about error message. Change-Id: I42fcea8c21d4183e8909293d2101cebd19ef9dc5 Signed-off-by: jaehoon.you <jaehoon.you@samsung.com>
2013-04-02Add udev rules for supporting Ubuntu 12.10jaehoon.you3-3/+4
In Ubuntu 12.10, modem-manager interrupt and close Tizen device. so, add exceptional udev rules for ttyACM connection. lthor Version 1.2 -> 1.3 Change-Id: I0c88084a8ff0f2e2f39d2b76e6568a81cf1a3e87 Signed-off-by: jaehoon.you <jaehoon.you@samsung.com>
2013-01-30Included udev rules into packagesEd Bartosh6-1/+36
Udev rules set device mode to 0666 in order to give flashing permissions to everyone. This is handy for developers to being able to flash devices from user account. Change-Id: Ibb3ccb6b54c3f3c56df66ad0d17772806f622129 Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>