Baruch Eruchimovitch | 499ef32 | 2013-01-11 15:01:00 +0200 | [diff] [blame] | 1 | #!/system/bin/sh |
Ravit Dennis | 59e450e | 2014-02-02 09:35:18 +0200 | [diff] [blame] | 2 | # Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. |
Baruch Eruchimovitch | 499ef32 | 2013-01-11 15:01:00 +0200 | [diff] [blame] | 3 | # |
| 4 | # Redistribution and use in source and binary forms, with or without |
| 5 | # modification, are permitted provided that the following conditions are |
| 6 | # met: |
| 7 | # * Redistributions of source code must retain the above copyright |
| 8 | # notice, this list of conditions and the following disclaimer. |
| 9 | # * Redistributions in binary form must reproduce the above |
| 10 | # copyright notice, this list of conditions and the following |
| 11 | # disclaimer in the documentation and/or other materials provided |
| 12 | # with the distribution. |
| 13 | # * Neither the name of The Linux Foundation nor the names of its |
| 14 | # contributors may be used to endorse or promote products derived |
| 15 | # from this software without specific prior written permission. |
| 16 | # |
| 17 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| 18 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| 21 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 24 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 26 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 27 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | # |
| 29 | # |
| 30 | |
Lior Barenboim | 3cca90d | 2014-06-09 14:32:39 +0300 | [diff] [blame] | 31 | clean_copy_dir=/system/etc/usf |
Baruch Eruchimovitch | 499ef32 | 2013-01-11 15:01:00 +0200 | [diff] [blame] | 32 | dir0=/data/usf |
| 33 | h_dir=$dir0/hovering |
| 34 | g_dir=$dir0/gesture |
Ravit Dennis | dc86e4b | 2013-09-15 09:19:52 +0300 | [diff] [blame] | 35 | sg_dir=$dir0/sync_gesture |
Baruch Eruchimovitch | 499ef32 | 2013-01-11 15:01:00 +0200 | [diff] [blame] | 36 | t_dir=$dir0/tester |
| 37 | e_dir=$dir0/epos |
| 38 | p2p_dir=$dir0/p2p |
| 39 | prox_dir=$dir0/proximity |
Ravit Dennis | 74eaef7 | 2013-12-10 10:30:36 +0200 | [diff] [blame] | 40 | pairing_dir=$dir0/pairing |
Ravit Dennis | dd59b65 | 2014-05-27 15:03:04 +0300 | [diff] [blame] | 41 | sw_calib_dir=$dir0/sw_calib |
Baruch Eruchimovitch | 499ef32 | 2013-01-11 15:01:00 +0200 | [diff] [blame] | 42 | ucm_dir=$dir0/ucm |
Baruch Eruchimovitch | 3e468ed | 2013-11-04 10:30:56 +0200 | [diff] [blame] | 43 | mixer_dir=/persist/usf/mixer |
Ravit Dennis | 59e450e | 2014-02-02 09:35:18 +0200 | [diff] [blame] | 44 | epos_dir=/persist/usf/epos |
Lior Barenboim | b438982 | 2014-07-02 15:56:51 +0300 | [diff] [blame] | 45 | p_dir=/persist/usf/pen_pairing |
| 46 | sc_dir=/persist/usf/sw_calib |
Baruch Eruchimovitch | 499ef32 | 2013-01-11 15:01:00 +0200 | [diff] [blame] | 47 | |
| 48 | trigger_file=$dir0/form_factor.cfg |
| 49 | |
| 50 | if [ ! -e $trigger_file ]; then |
| 51 | # Configurations select upon the current platform |
Baruch Eruchimovitch | 8afb9c2 | 2013-02-06 15:44:44 +0200 | [diff] [blame] | 52 | platform=`cat /sys/devices/soc0/hw_platform` |
Baruch Eruchimovitch | 499ef32 | 2013-01-11 15:01:00 +0200 | [diff] [blame] | 53 | type="" |
| 54 | |
| 55 | case $platform in |
| 56 | "Liquid") |
| 57 | type="liquid" |
| 58 | ;; |
| 59 | "Fluid") |
| 60 | type="fluid" |
| 61 | ;; |
| 62 | "MTP") |
| 63 | type="mtp" |
| 64 | ;; |
Baruch Eruchimovitch | 4f827e4 | 2013-07-23 13:22:18 +0300 | [diff] [blame] | 65 | "Dragon") |
| 66 | type="dragon" |
| 67 | ;; |
Baruch Eruchimovitch | 499ef32 | 2013-01-11 15:01:00 +0200 | [diff] [blame] | 68 | esac |
| 69 | |
Lior Barenboim | 4d67d7f | 2014-12-15 18:03:07 +0200 | [diff] [blame] | 70 | cp -r $clean_copy_dir/* $dir0 |
Lior Barenboim | 3cca90d | 2014-06-09 14:32:39 +0300 | [diff] [blame] | 71 | |
Lior Barenboim | c557ab5 | 2014-11-20 17:45:40 +0200 | [diff] [blame] | 72 | # The USF based calculators have system permissions |
| 73 | chown -R system $dir0 |
| 74 | |
Baruch Eruchimovitch | 499ef32 | 2013-01-11 15:01:00 +0200 | [diff] [blame] | 75 | ln -s $dir0/form_factor_"$type".cfg $dir0/form_factor.cfg |
| 76 | ln -s $t_dir/cfg_"$type" $t_dir/cfg |
| 77 | ln -s $e_dir/cfg_"$type" $e_dir/cfg |
| 78 | ln -s $h_dir/cfg_"$type" $h_dir/cfg |
| 79 | ln -s $p2p_dir/cfg_"$type" $p2p_dir/cfg |
| 80 | ln -s $g_dir/cfg_"$type" $g_dir/cfg |
Ravit Dennis | dc86e4b | 2013-09-15 09:19:52 +0300 | [diff] [blame] | 81 | ln -s $sg_dir/cfg_"$type" $sg_dir/cfg |
Baruch Eruchimovitch | 499ef32 | 2013-01-11 15:01:00 +0200 | [diff] [blame] | 82 | ln -s $prox_dir/cfg_"$type" $prox_dir/cfg |
Ravit Dennis | 74eaef7 | 2013-12-10 10:30:36 +0200 | [diff] [blame] | 83 | ln -s $pairing_dir/cfg_"$type" $pairing_dir/cfg |
Ravit Dennis | dd59b65 | 2014-05-27 15:03:04 +0300 | [diff] [blame] | 84 | ln -s $sw_calib_dir/cfg_"$type" $sw_calib_dir/cfg |
Baruch Eruchimovitch | 499ef32 | 2013-01-11 15:01:00 +0200 | [diff] [blame] | 85 | |
| 86 | ln -s $e_dir/cfg/usf_epos_"$type".cfg $e_dir/usf_epos.cfg |
| 87 | ln -s $t_dir/cfg/usf_tester_epos_"$type".cfg $t_dir/usf_tester.cfg |
| 88 | ln -s $h_dir/cfg/usf_hovering_"$type".cfg $h_dir/usf_hovering.cfg |
| 89 | ln -s $p2p_dir/cfg/usf_p2p_"$type".cfg $p2p_dir/usf_p2p.cfg |
| 90 | ln -s $g_dir/cfg/usf_gesture_"$type".cfg $g_dir/usf_gesture.cfg |
Ravit Dennis | dc86e4b | 2013-09-15 09:19:52 +0300 | [diff] [blame] | 91 | ln -s $sg_dir/cfg/usf_sync_gesture_"$type".cfg $sg_dir/usf_sync_gesture.cfg |
Baruch Eruchimovitch | 499ef32 | 2013-01-11 15:01:00 +0200 | [diff] [blame] | 92 | ln -s $prox_dir/cfg/usf_proximity_"$type".cfg $prox_dir/usf_proximity.cfg |
Ravit Dennis | 74eaef7 | 2013-12-10 10:30:36 +0200 | [diff] [blame] | 93 | ln -s $pairing_dir/cfg/usf_pairing_"$type".cfg $pairing_dir/usf_pairing.cfg |
Ravit Dennis | dd59b65 | 2014-05-27 15:03:04 +0300 | [diff] [blame] | 94 | ln -s $sw_calib_dir/cfg/usf_sw_calib_"$type".cfg $sw_calib_dir/usf_sw_calib.cfg |
Lior Barenboim | b438982 | 2014-07-02 15:56:51 +0300 | [diff] [blame] | 95 | ln -s $sw_calib_dir/cfg/usf_sw_calib_tester_"$type".cfg $sw_calib_dir/usf_sw_calib_tester.cfg |
Baruch Eruchimovitch | 499ef32 | 2013-01-11 15:01:00 +0200 | [diff] [blame] | 96 | |
Ravit Dennis | 59e450e | 2014-02-02 09:35:18 +0200 | [diff] [blame] | 97 | ln -s $e_dir/cfg/service_settings_"$type".xml $e_dir/service_settings.xml |
| 98 | |
Baruch Eruchimovitch | 3e468ed | 2013-11-04 10:30:56 +0200 | [diff] [blame] | 99 | ln -s $mixer_dir/mixer_paths_"$type".xml $mixer_dir/mixer_paths.xml |
Baruch Eruchimovitch | 499ef32 | 2013-01-11 15:01:00 +0200 | [diff] [blame] | 100 | |
Lior Barenboim | b438982 | 2014-07-02 15:56:51 +0300 | [diff] [blame] | 101 | ln -s $epos_dir/ref1/product_calib_"$type"_ref1.dat $epos_dir/product_calib_ref1.dat |
Lior Barenboim | 08b6104 | 2014-08-07 13:57:12 +0300 | [diff] [blame] | 102 | ln -s $epos_dir/ref2/product_calib_"$type"_ref2.dat $epos_dir/product_calib_ref2.dat |
Lior Barenboim | b438982 | 2014-07-02 15:56:51 +0300 | [diff] [blame] | 103 | ln -s $epos_dir/ref3/product_calib_"$type"_ref3.dat $epos_dir/product_calib_ref3.dat |
| 104 | ln -s $epos_dir/ref1/unit_calib_"$type"_ref1.dat $epos_dir/unit_calib_ref1.dat |
Lior Barenboim | 08b6104 | 2014-08-07 13:57:12 +0300 | [diff] [blame] | 105 | ln -s $epos_dir/ref2/unit_calib_"$type"_ref2.dat $epos_dir/unit_calib_ref2.dat |
Lior Barenboim | b438982 | 2014-07-02 15:56:51 +0300 | [diff] [blame] | 106 | ln -s $epos_dir/ref3/unit_calib_"$type"_ref3.dat $epos_dir/unit_calib_ref3.dat |
| 107 | |
| 108 | ln -s $sc_dir/sw_calib_"$type".dat $sc_dir/sw_calib.dat |
Baruch Eruchimovitch | 499ef32 | 2013-01-11 15:01:00 +0200 | [diff] [blame] | 109 | fi |
| 110 | |
| 111 | chown system /dev/usf1 |
Ravit Dennis | 59e450e | 2014-02-02 09:35:18 +0200 | [diff] [blame] | 112 | |
| 113 | # Set enabled properties for daemon |
| 114 | setprop ro.qc.sdk.us.digitalpen 1 |