Temporary patch for RW updater SDB debugging in the device with SWITCH class and... 70/142570/1 accepted/tizen/unified/20170811.133005 submit/tizen/20170808.063544
authorKunhoon Baik <knhoon.baik@samsung.com>
Fri, 4 Aug 2017 08:39:07 +0000 (17:39 +0900)
committerKunhoon Baik <knhoon.baik@samsung.com>
Fri, 4 Aug 2017 09:24:56 +0000 (18:24 +0900)
At this moments, USB SDB debugging feature for RW updater is supported in the device with SWITCH class and SLP gadget.
Thus, we need to make a target specific package like system-rw-update-helper-for-XXXX.
For generic solution, mini-usb-manager using USB-client HAL should be created for USB SDB debugging feature for RW updater.

Anyway, at this moment, it will be created in all device if there are "no such SWITCH rule file" in the device.

Change-Id: I1d4dcbed238ca69c46f55162c2c521fcf1188c2c

make_upgrade_image.sh
packaging/system-rw-update.spec

index 8a0326c..c57e978 100755 (executable)
@@ -7,7 +7,6 @@
 # For sdb debugging
 
 sdb_debugging=1
-sdb_rule='SUBSYSTEM=="switch", ATTR{name}=="usb_cable", ATTR{state}=="1", RUN+="/usr/bin/direct_set_debug.sh --sdb-set"\nSUBSYSTEM=="switch", ATTR{name}=="usb_cable", ATTR{state}=="0", RUN+="/usr/bin/direct_set_debug.sh --sdb-unset"'
 
 # Back up data
 backup () {
@@ -70,16 +69,6 @@ mount rootfs.img ${tmp_root}
 cwd=`pwd`
 backup ${cwd}/${tmp_root} $2
 
-# For sdb debugging
-if [ ${sdb_debugging} -eq 1 ]
-then
-       echo "Install sdb rule file"
-       rule_file="99-sdb-switch.rules"
-       echo ${sdb_rule} > ${rule_file}
-       install -m 644 ${rule_file} ${tmp_root}/usr/lib/udev/rules.d
-       rm ${rule_file}
-fi
-
 sync
 umount ${tmp_root}
 
index 1674e84..53c6630 100644 (file)
@@ -31,14 +31,20 @@ ln -s ../getty.target %{buildroot}%{_unitdir}/system-update.target.wants
 ln -s ../cynara.socket %{buildroot}%{_unitdir}/system-update.target.wants
 
 # SDB debugging
-mkdir -p %{buildroot}%{_libdir}/udev/rules.d
-ln -s /opt/data/recovery/99-sdb-switch.rules %{buildroot}%{_libdir}/udev/rules.d
 install -m 644 units/udev-sdb-init.service %{buildroot}%{_unitdir}
 ln -s ../udev-sdb-init.service %{buildroot}%{_unitdir}/system-update.target.wants
 
 %clean
 rm -rf %{buildroot}
 
+%posttrans
+if [ -e %{_libdir}/udev/rules.d/99-sdb-switch.rules ]; then
+       echo "Exist 99-sdb-switch.rules, Skip!"
+else
+       mkdir -p %{_libdir}/udev/rules.d
+       ln -s /opt/data/recovery/99-sdb-switch.rules %{_libdir}/udev/rules.d
+fi
+
 %files
 %manifest %{name}.manifest
 %license LICENSE.Apache-2.0
@@ -47,4 +53,3 @@ rm -rf %{buildroot}
 %{_unitdir}/init-update.service
 %{_unitdir}/system-update.target.wants
 %{_unitdir}/udev-sdb-init.service
-%{_libdir}/udev/rules.d/*