Add firstboot systemd service file
[adaptation/system-plugin-ia-generic.git] / etc / rc.d / rc.firstboot
1 #!/bin/sh
2
3 #/sbin/ldconfig -f /opt/etc/ld.so.conf -C /opt/etc/ld.so.cache
4 /sbin/ldconfig
5
6 # Check 3-touchkey firmware
7 /lib/firmware/firmware_upgrade_touchkey.sh
8
9 #Check machine is P1P2
10 MACHINE=`grep Hardware /proc/cpuinfo|cut -d ":" -f 2|tr -d " "`
11 if [ $MACHINE == "P1P2" ];then
12         ln -s /opt/etc/X11/xorg.conf.d.p1p2 /opt/etc/X11/xorg.conf.d
13         # motor sensor has not been implemented yet
14         rm -f /usr/driver/tspdrv.ko             
15 else
16         ln -s /opt/etc/X11/xorg.conf.d.default /opt/etc/X11/xorg.conf.d
17 fi
18
19 # Copy alsa scenario file for sound temporary
20 if [ ! -e /opt/etc/sound ]; then
21         mkdir -p /opt/etc/sound
22 fi
23
24 if [ $MACHINE == "F1" ]; then                                   
25         cp -r /usr/share/ascenario/mc1n2 /opt/etc/sound/default
26         cp -r /usr/share/ascenario/mc1n2.conf /opt/etc/sound/default.conf
27 else                                                                
28         cp -r /usr/share/ascenario/wm8994 /opt/etc/sound/default
29         cp -r /usr/share/ascenario/wm8994.conf /opt/etc/sound/default.conf
30 fi
31
32 chown root:soundpath  /opt/etc/sound/default.conf
33 chown -R root:soundpath  /opt/etc/sound/default
34
35 # Generate new wifi mac address
36 /usr/sbin/wlan_prov
37
38 if [ -e /opt/system/csc/.factoryreset ]; then
39         rm -f /opt/system/csc/.factoryreset
40 fi
41
42 touch /opt/etc/.firstboot
43 sync