From: Ed Bartosh Date: Mon, 28 Jan 2013 08:31:26 +0000 (+0200) Subject: Included udev rules into packages X-Git-Tag: submit/tizen_2.1/20130425.000057^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ab196fe48a1fb4d816303df8f76fbdd36717d2c;p=tools%2Flthor.git Included udev rules into packages 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 --- diff --git a/99-lthor.rules b/99-lthor.rules new file mode 100644 index 0000000..97440fe --- /dev/null +++ b/99-lthor.rules @@ -0,0 +1 @@ +SUBSYSTEM=="tty", KERNEL=="ttyACM0", MODE="0666" diff --git a/CMakeLists.txt b/CMakeLists.txt index 25d7c8f..076aff3 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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/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/packaging/lthor.spec b/packaging/lthor.spec index 8410a4e..313f0d4 100644 --- a/packaging/lthor.spec +++ b/packaging/lthor.spec @@ -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