summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaehoon.you <jaehoon.you@samsung.com>2013-04-05 17:35:52 +0900
committerjaehoon.you <jaehoon.you@samsung.com>2013-04-05 17:35:52 +0900
commit6a68a17e3d95f56a924dfbbd3ef28feb721284e4 (patch)
tree2d93a14fd34f976c62d41d417e51280ee172f023
parent10614a3b974b89b68a0b9d8e5d400d69294f2025 (diff)
parentd08c38ea461fcb36125e626fac1bf12d0fde6a9d (diff)
downloadlthor-6a68a17e3d95f56a924dfbbd3ef28feb721284e4.tar.gz
lthor-6a68a17e3d95f56a924dfbbd3ef28feb721284e4.tar.bz2
lthor-6a68a17e3d95f56a924dfbbd3ef28feb721284e4.zip
Conflicts: AUTHORS CMakeLists.txt debian/control lthor.c packaging/lthor.spec Change-Id: Ic566170d83b2319cbcfd3db5813bd9f09e9b2534 Signed-off-by: jaehoon.you <jaehoon.you@samsung.com>
-rw-r--r--99-lthor.rules2
-rw-r--r--AUTHORS4
-rwxr-xr-xCMakeLists.txt5
-rw-r--r--debian/control2
-rw-r--r--debian/copyright21
-rw-r--r--debian/postinst9
-rw-r--r--debian/postrm9
-rwxr-xr-xlthor.c17
-rw-r--r--packaging/lthor.spec17
9 files changed, 72 insertions, 14 deletions
diff --git a/99-lthor.rules b/99-lthor.rules
new file mode 100644
index 0000000..dcd694d
--- /dev/null
+++ b/99-lthor.rules
@@ -0,0 +1,2 @@
+SUBSYSTEM=="tty", KERNEL=="ttyACM*", MODE="0666"
+SUBSYSTEM=="tty", KERNEL=="ttyACM*", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="685d", ENV{ID_MM_CANDIDATE}="null"
diff --git a/AUTHORS b/AUTHORS
index bab8cca..1a1d5ef 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,5 +1,3 @@
-YoungJin Lee <yj0701.lee@samsung.com>
-Wonil Choi <wonil22.choi@samsung.com>
+Jaehoon You <jaehoon.you@samsung.com>
Karol Lewandowski <k.lewandowsk@samsung.com>
Rafal Krypa <r.krypa@samsung.com>
-Jaehoon You <jaehoon.you@samsung.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 25d7c8f..5bd246e 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,7 @@ SET(PKGNAME "${PACKAGE}")
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(BINDIR "${PREFIX}/bin")
-SET(PACKAGE_VERSION "1.2")
+SET(PACKAGE_VERSION "1.3")
IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
@@ -50,3 +50,6 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
+INSTALL(FILES 99-lthor.rules
+ DESTINATION "/etc/udev/rules.d"
+ COMPONENT "udev")
diff --git a/debian/control b/debian/control
index c1c09bc..62b24ec 100644
--- a/debian/control
+++ b/debian/control
@@ -7,6 +7,6 @@ Standards-Version: 0.0.1
Package: lthor
Architecture: any
-Depends: ${shlibs:Depends}
+Depends: ${shlibs:Depends}, udev
Description: Flashing tool for Tizen lunchbox
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..9e1db49
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,21 @@
+This package was debianized by Ed Bartosh <eduard.bartosh@intel.com>
+on Mon, 12 Nov 2012 19:08:56 +0200
+
+Copyright:
+ Copyright (C) 2012 Intel Inc
+
+License:
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ On Debian systems, the full text of the Apache License version 2.0
+ can be found in the file /usr/share/common-licenses/Apache-2.0
+
+Packaging:
+ Copyright (C) 2012 Intel Inc by Ed Bartosh <eduard.bartosh@intel.com>
+ released under GPLv2
+
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..09b6e27
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Reload udev rules
+[ -x /sbin/udevadm ] && /sbin/udevadm control --reload-rules
+
+#DEBHELPER#
+
+exit 0
+
diff --git a/debian/postrm b/debian/postrm
new file mode 100644
index 0000000..09b6e27
--- /dev/null
+++ b/debian/postrm
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Reload udev rules
+[ -x /sbin/udevadm ] && /sbin/udevadm control --reload-rules
+
+#DEBHELPER#
+
+exit 0
+
diff --git a/lthor.c b/lthor.c
index 27df43d..d97e2df 100755
--- a/lthor.c
+++ b/lthor.c
@@ -897,6 +897,7 @@ int download_pitfile(int fd, const char *pitfile)
if (r < 0) {
fprintf(stderr, "line %d: failed to download %s\n", __LINE__,
pitfile);
+ filedata_close(&filedata);
return r;
}
@@ -927,9 +928,12 @@ int download_single_tarfile(int fd, const char *tarfile)
printf("[\x1b[0;32;1m%s\x1b[0m]\n", filename);
r = download_single_file(fd, &tardata.src, BINARY_TYPE_NORMAL);
if (r < 0) {
- fprintf(stderr, "line %d: failed to download %s\n",
- __LINE__, filename);
- break;
+ fprintf(stderr, "line %d: failed to download %s\n", __LINE__, filename);
+ fprintf(stderr, "\nIn some cases, lthor needs enough memory\n");
+ fprintf(stderr, "Please check free memory in your Host PC ");
+ fprintf(stderr, "and unload some heavy applications\n");
+ tardata_close(&tardata);
+ return r;
}
}
@@ -1001,7 +1005,7 @@ int process_download(const char *portname, const char *pitfile, char **tarfileli
fprintf(stderr, "\nDownload PIT file : %s\n\n", pitfile);
r = download_pitfile(fd, pitfile);
if (r < 0) {
- fprintf(stderr, "failed to download %s\n", pitfile);
+ fprintf(stderr, "\nfailed to download %s\n", pitfile);
close(fd);
return r;
}
@@ -1011,7 +1015,7 @@ int process_download(const char *portname, const char *pitfile, char **tarfileli
fprintf(stderr, "\nDownload files from %s\n\n", *tarfilelist);
r = download_single_tarfile(fd, *tarfilelist);
if (r < 0) {
- fprintf(stderr, "failed to download %s\n", *tarfilelist);
+ fprintf(stderr, "\nfailed to download %s\n", *tarfilelist);
close(fd);
return r;
}
@@ -1190,8 +1194,7 @@ int main(int argc, char **argv)
printf("\n");
printf("Linux Thor downloader, version %s \n", PACKAGE_VERSION);
- printf("Authors: YoungJin Lee <yj0701.lee@samsung.com>, "
- "Jaehoon You <jaehoon.you@samsung.com>\n\n");
+ printf("Authors: Jaehoon You <jaehoon.you@samsung.com>\n\n");
while (opt < argc) {
/* check if we're verbose */
diff --git a/packaging/lthor.spec b/packaging/lthor.spec
index 3873610..ff239a9 100644
--- a/packaging/lthor.spec
+++ b/packaging/lthor.spec
@@ -3,10 +3,10 @@
#
Name: lthor
Summary: Flashing tool for Tizen lunchbox
-Version: 1.0
+Version: 1.3
Release: 1
Group: Development/Tools/Other
-License: Samsung reserved
+License: Apache
URL: https://download.tizendev.org/tools/lthor/
Source0: %{name}_%{version}.tar.gz
@@ -14,6 +14,8 @@ BuildRequires: libarchive-devel
BuildRequires: cmake
BuildRequires: pkg-config
+Requires: udev
+
%description
Tool for downloading binaries from a Linux host PC to a target phone.
It uses a USB cable as a physical communication medium.
@@ -35,10 +37,21 @@ make install DESTDIR=$RPM_BUILD_ROOT
rm -rf %{buildroot}
%post
+if [ -x /sbin/udevadm ] ; then
+ alias udevcontrol="udevadm control"
+fi
+udevcontrol reload_rules ||:
+
+%postun
+if [ -x /sbin/udevadm ] ; then
+ alias udevcontrol="udevadm control"
+fi
+udevcontrol --reload-rules ||:
%files
%defattr(-,root,root)
%{_bindir}/%{name}
+%config %{_sysconfdir}/udev/rules.d/*.rules
%changelog