blob: 9ec14af2855e0c5ffcaa8a1dd94a11d9c7b175a7 [file] [log] [blame]
Baruch Eruchimovitch499ef322013-01-11 15:01:00 +02001#!/system/bin/sh
Ravit Dennis59e450e2014-02-02 09:35:18 +02002# Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
Baruch Eruchimovitch499ef322013-01-11 15:01:00 +02003#
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 Barenboim3cca90d2014-06-09 14:32:39 +030031clean_copy_dir=/system/etc/usf
Baruch Eruchimovitch499ef322013-01-11 15:01:00 +020032dir0=/data/usf
33h_dir=$dir0/hovering
34g_dir=$dir0/gesture
35t_dir=$dir0/tester
36e_dir=$dir0/epos
37p2p_dir=$dir0/p2p
38prox_dir=$dir0/proximity
Ravit Dennis74eaef72013-12-10 10:30:36 +020039pairing_dir=$dir0/pairing
Ravit Dennisdd59b652014-05-27 15:03:04 +030040sw_calib_dir=$dir0/sw_calib
Baruch Eruchimovitch499ef322013-01-11 15:01:00 +020041ucm_dir=$dir0/ucm
Baruch Eruchimovitch3e468ed2013-11-04 10:30:56 +020042mixer_dir=/persist/usf/mixer
Ravit Dennis59e450e2014-02-02 09:35:18 +020043epos_dir=/persist/usf/epos
Baruch Eruchimovitch499ef322013-01-11 15:01:00 +020044
45trigger_file=$dir0/form_factor.cfg
46
47if [ ! -e $trigger_file ]; then
48 # Configurations select upon the current platform
Baruch Eruchimovitch8afb9c22013-02-06 15:44:44 +020049 platform=`cat /sys/devices/soc0/hw_platform`
Baruch Eruchimovitch499ef322013-01-11 15:01:00 +020050 type=""
51
52 case $platform in
53 "Liquid")
54 type="liquid"
55 ;;
56 "Fluid")
57 type="fluid"
58 ;;
59 "MTP")
60 type="mtp"
61 ;;
Baruch Eruchimovitch4f827e42013-07-23 13:22:18 +030062 "Dragon")
63 type="dragon"
64 ;;
Baruch Eruchimovitch499ef322013-01-11 15:01:00 +020065 esac
66
Lior Barenboim3cca90d2014-06-09 14:32:39 +030067 cp -r $clean_copy_dir $dir0
68
Baruch Eruchimovitch499ef322013-01-11 15:01:00 +020069 ln -s $dir0/form_factor_"$type".cfg $dir0/form_factor.cfg
70 ln -s $t_dir/cfg_"$type" $t_dir/cfg
71 ln -s $e_dir/cfg_"$type" $e_dir/cfg
72 ln -s $h_dir/cfg_"$type" $h_dir/cfg
73 ln -s $p2p_dir/cfg_"$type" $p2p_dir/cfg
74 ln -s $g_dir/cfg_"$type" $g_dir/cfg
75 ln -s $prox_dir/cfg_"$type" $prox_dir/cfg
Ravit Dennis74eaef72013-12-10 10:30:36 +020076 ln -s $pairing_dir/cfg_"$type" $pairing_dir/cfg
Ravit Dennisdd59b652014-05-27 15:03:04 +030077 ln -s $sw_calib_dir/cfg_"$type" $sw_calib_dir/cfg
Baruch Eruchimovitch499ef322013-01-11 15:01:00 +020078
79 ln -s $e_dir/cfg/usf_epos_"$type".cfg $e_dir/usf_epos.cfg
80 ln -s $t_dir/cfg/usf_tester_epos_"$type".cfg $t_dir/usf_tester.cfg
81 ln -s $h_dir/cfg/usf_hovering_"$type".cfg $h_dir/usf_hovering.cfg
82 ln -s $p2p_dir/cfg/usf_p2p_"$type".cfg $p2p_dir/usf_p2p.cfg
83 ln -s $g_dir/cfg/usf_gesture_"$type".cfg $g_dir/usf_gesture.cfg
84 ln -s $prox_dir/cfg/usf_proximity_"$type".cfg $prox_dir/usf_proximity.cfg
Ravit Dennis74eaef72013-12-10 10:30:36 +020085 ln -s $pairing_dir/cfg/usf_pairing_"$type".cfg $pairing_dir/usf_pairing.cfg
Ravit Dennisdd59b652014-05-27 15:03:04 +030086 ln -s $sw_calib_dir/cfg/usf_sw_calib_"$type".cfg $sw_calib_dir/usf_sw_calib.cfg
Baruch Eruchimovitch499ef322013-01-11 15:01:00 +020087
Ravit Dennis59e450e2014-02-02 09:35:18 +020088 ln -s $e_dir/cfg/service_settings_"$type".xml $e_dir/service_settings.xml
89
Baruch Eruchimovitch3e468ed2013-11-04 10:30:56 +020090 ln -s $mixer_dir/mixer_paths_"$type".xml $mixer_dir/mixer_paths.xml
Baruch Eruchimovitch499ef322013-01-11 15:01:00 +020091
Ravit Dennis59e450e2014-02-02 09:35:18 +020092 ln -s $epos_dir/product_calib_"$type".dat $epos_dir/product_calib.dat
93 ln -s $epos_dir/unit_calib_"$type".dat $epos_dir/unit_calib.dat
94
Baruch Eruchimovitch499ef322013-01-11 15:01:00 +020095 # The USF based calculators have system permissions
Lior Barenboim3cca90d2014-06-09 14:32:39 +030096 chown system $dir0
Baruch Eruchimovitch499ef322013-01-11 15:01:00 +020097 chown system $dir0/*
98 chown system $dir0/*/*
99 chown system $dir0/*/*/*
100fi
101
102chown system /dev/usf1
Ravit Dennis59e450e2014-02-02 09:35:18 +0200103
104# Set enabled properties for daemon
105setprop ro.qc.sdk.us.digitalpen 1