forked from 96boards/android_device_linaro_hikey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.hikey.rc
208 lines (165 loc) · 6.8 KB
/
init.hikey.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
on init
# mount debugfs
mount debugfs /sys/kernel/debug /sys/kernel/debug
setprop wifi.interface wlan0
# Set this property so AdvancedWifiSettings would show the checkbox
# for Enable/Disable Active Roaming
setprop ro.wifi.active_roaming.enable true
# disable transparent huge pages
write /sys/kernel/mm/transparent_hugepage/enabled "never"
# See storage config details at http://source.android.com/tech/storage/
mkdir /mnt/shell/emulated 0700 shell shell
mkdir /storage/emulated 0555 root root
mkdir /mnt/media_rw/sdcard1 0700 media_rw media_rw
mkdir /mnt/media_rw/usbdisk 0700 media_rw media_rw
mkdir /storage/sdcard1 0700 root root
mkdir /storage/usbdisk 0700 root root
export EXTERNAL_STORAGE /storage/emulated/legacy
export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
export EMULATED_STORAGE_TARGET /storage/emulated
export SECONDARY_STORAGE /storage/sdcard1
# Support legacy paths
symlink /storage/emulated/legacy /sdcard
symlink /storage/emulated/legacy /mnt/sdcard
symlink /storage/emulated/legacy /storage/sdcard0
symlink /mnt/shell/emulated/0 /storage/emulated/legacy
symlink /storage/usbdisk /usbdisk
symlink /storage/usbdisk /mnt/usbdisk
# Disabled virtual memory randomization
# (if randomization is enabled the AEM-JIT will have a lower cache hit rate)
write /proc/sys/kernel/randomize_va_space 0
#bluetooth
#UART device
chmod 0660 /dev/ttyAMA1
chown bluetooth net_bt_stack /dev/ttyAMA1
on fs
mount_all /fstab.hikey
setprop ro.crypto.fuse_sdcard false
mount configfs none /sys/kernel/config
mkdir /sys/kernel/config/usb_gadget/g1
mkdir /sys/kernel/config/usb_gadget/g1/functions/ffs.adb
mkdir /dev/usb-ffs 0770 shell shell
mkdir /dev/usb-ffs/adb 0770 shell shell
mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
write /sys/kernel/config/usb_gadget/g1/idVendor 0x12d1
write /sys/kernel/config/usb_gadget/g1/idProduct 0x103a
mkdir /sys/kernel/config/usb_gadget/g1/strings/0x409
write /sys/kernel/config/usb_gadget/g1/strings/0x409/serialnumber "0123456789"
write /sys/kernel/config/usb_gadget/g1/strings/0x409/manufacturer "HISILICON"
write /sys/kernel/config/usb_gadget/g1/strings/0x409/product "ADB Gadget"
mkdir /sys/kernel/config/usb_gadget/g1/configs/c.1
mkdir /sys/kernel/config/usb_gadget/g1/configs/c.1/strings/0x409
write /sys/kernel/config/usb_gadget/g1/configs/c.1/strings/0x409/configuration "Conf 1"
symlink /sys/kernel/config/usb_gadget/g1/functions/ffs.adb /sys/kernel/config/usb_gadget/g1/configs/c.1/ffs.adb
start adbd
on post-fs-data
mkdir /data/media 0770 media_rw media_rw
mkdir /data/misc/gatord 0700 root root
mkdir /data/misc/wireless 0771 system system
mkdir /data/misc/wifi 0771 wifi wifi
mkdir /data/misc/wifi/sockets 0771 wifi wifi
mkdir /data/misc/wifi/wapi_certs 0777 wifi wifi
mkdir /data/misc/dhcp 0770 dhcp dhcp
# Set SELinux security contexts for files used by lava.
restorecon_recursive /data/local/tmp/lava
on post-fs
# insert WiFi Modules
insmod /system/modules/rfkill.ko
insmod /system/modules/wifi/compat.ko
insmod /system/modules/wifi/cfg80211.ko
insmod /system/modules/wifi/mac80211.ko
insmod /system/modules/wifi/wlcore.ko
insmod /system/modules/wifi/wl18xx.ko
insmod /system/modules/wifi/wlcore_sdio.ko
# Insert BT modules
insmod /system/modules/bluetooth.ko
insmod /system/modules/bnep.ko
insmod /system/modules/hidp.ko
insmod /system/modules/rfcomm.ko
insmod /system/modules/st_drv.ko
insmod /system/modules/tty_hci.ko
insmod /system/modules/btwilink.ko
# insert gator kernel module for DS-5/Streamline
insmod /system/modules/gator.ko
# insert mali gpu module
insmod /system/modules/mali.ko mali_debug_level=2
# BT LED sysfs entry
write /sys/devices/leds/leds/bt_active/trigger "hci1rx"
chmod 0666 /dev/ump
chmod 0666 /dev/ion
chmod 0666 /dev/mali
chown system.graphics /dev/mali
chmod 0666 /dev/graphics/fb0
on boot
setprop ARGH ARGH
setprop ro.radio.use-ppp no
setprop ro.build.product generic
setprop ro.product.device generic
# fake some battery state
setprop status.battery.state Slow
setprop status.battery.level 5
setprop status.battery.level_raw 50
setprop status.battery.level_scale 9
# Set Display density
setprop ro.sf.lcd_density 160
# Set supported opengles version
setprop ro.opengles.version 196608
# change permissions for process groups
# https://bugs.launchpad.net/bugs/1037611
chmod 0660 /dev/cpuctl
# enable Google-specific location features,
# like NetworkLocationProvider and LocationCollector
setprop ro.com.google.locationfeatures 1
# enable test harness
setprop ro.test_harness true
# Setup paths used for socket communication with the dhcp daemon (dhcpd)
mkdir /data/misc/dhcp 0770 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp
service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated
class late_start
service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1
class late_start
disabled
service fuse_usbdisk /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/usbdisk /storage/usbdisk
class late_start
disabled
on property:sys.usb.config=adb
write /sys/kernel/config/usb_gadget/g1/UDC "f72c0000.usb"
write /sys/class/udc/f72c0000.usb/soft_connect "disconnect"
write /sys/class/udc/f72c0000.usb/soft_connect "connect"
setprop sys.usb.state ${sys.usb.config}
# FIXME: we need to bind the driver while adbd is restarted. We need delay else bind fails. Need to investigate
on property:init.svc.adbd=running
wait /dev/socket/hack 1
write /sys/kernel/config/usb_gadget/g1/UDC "f72c0000.usb"
write /sys/class/udc/f72c0000.usb/soft_connect "disconnect"
write /sys/class/udc/f72c0000.usb/soft_connect "connect"
setprop sys.usb.state ${sys.usb.config}
on property:usb_speed.switch=high
write /sys/kernel/debug/f72c0000.usb/config "0"
on property:usb_speed.switch=full
write /sys/kernel/debug/f72c0000.usb/config "1"
#userspace daemon needed for bluetooth
service uim /system/bin/uim
class main
user root
oneshot
service wpa_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
-e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
socket wpa_wlan0 dgram 660 wifi wifi
class main
disabled
oneshot
service dhcpcd_wlan0 /system/bin/dhcpcd -dABKL
group dhcp
disabled
oneshot
service dhcpcd_eth0 /system/bin/dhcpcd -dABKL
group dhcp
disabled
oneshot
service dhcpcd_bt-pan /system/bin/dhcpcd -dABKL
group dhcp
disabled
oneshot