android_device_allwinner-full/tulip-chiphd/init.sun50iw1p1.rc

253 lines
8.6 KiB
Text
Raw Normal View History

2016-08-06 01:03:18 +00:00
import init.common.rc
import init.sun50iw1p1.usb.rc
import init.${ro.zygote}.rc
2016-09-02 12:17:20 +00:00
on early-init
setenforce 0
mount debugfs debugfs /sys/kernel/debug/ mode=755
2016-08-06 01:03:18 +00:00
2016-09-02 12:17:20 +00:00
on init
# Set permissions for persist partition
mkdir /persist 0771 system system
mkdir /firmware 0771 system system
2016-08-06 01:03:18 +00:00
# Support legacy paths
2016-09-02 12:17:20 +00:00
symlink /sdcard /mnt/sdcard
symlink /sdcard /storage/sdcard0
2016-08-06 01:03:18 +00:00
2016-09-02 12:17:20 +00:00
mkdir /oem 0550 system system
2016-08-06 01:03:18 +00:00
2016-09-02 12:17:20 +00:00
on early-fs
2016-08-06 01:03:18 +00:00
insmod nand.ko
2016-10-03 10:46:48 +00:00
exec u:r:su:s0 root -- /sbin/busybox sh /initialize_disk.sh
2016-08-06 01:03:18 +00:00
mount_all /fstab.sun50iw1p1
2016-09-02 12:17:20 +00:00
swapon_all /fstab.sun50iw1p1
restorecon_recursive /persist
#wait /dev/block/by-name/media_data
#mount vfat /dev/block/by-name/media_data /oem ro nosuid nodev utf8,context=u:object_r:oemfs:s0
on fs
2016-08-06 01:03:18 +00:00
insmod /system/vendor/modules/disp.ko
2016-09-02 12:17:20 +00:00
insmod /system/vendor/modules/sunxi_tr.ko
insmod /system/vendor/modules/hdmi.ko
insmod /system/vendor/modules/hdmi_cec.ko
2016-08-06 01:03:18 +00:00
2016-09-02 12:17:20 +00:00
# secure storage
insmod /system/vendor/modules/te_sec_storage.ko
2016-08-06 01:03:18 +00:00
2016-09-02 12:17:20 +00:00
# gpu
insmod /system/vendor/modules/mali.ko
2016-08-06 01:03:18 +00:00
2016-09-02 12:17:20 +00:00
# sw-keystore
2016-08-06 01:03:18 +00:00
mkdir /cache/HWML 0770 root system
insmod /system/vendor/modules/sunxi_schw.ko
chmod 0660 /dev/scdev
chown keystore keystore /dev/scdev
2016-09-02 12:17:20 +00:00
# sw-keyboard
2016-08-06 01:03:18 +00:00
insmod /system/vendor/modules/sunxi-keyboard.ko
2016-09-17 15:20:09 +00:00
insmod /system/vendor/modules/sw-device.ko
2016-08-06 01:03:18 +00:00
2016-09-02 12:17:20 +00:00
# csi module
2016-08-06 01:03:18 +00:00
insmod /system/vendor/modules/videobuf2-core.ko
insmod /system/vendor/modules/videobuf2-memops.ko
insmod /system/vendor/modules/videobuf2-dma-contig.ko
2016-09-17 15:20:09 +00:00
insmod /system/vendor/modules/videobuf2-vmalloc.ko
2016-08-06 01:03:18 +00:00
insmod /system/vendor/modules/vfe_io.ko
2016-09-02 12:17:20 +00:00
insmod /system/vendor/modules/gc0328c.ko
2016-09-17 15:20:09 +00:00
insmod /system/vendor/modules/hm5065.ko
insmod /system/vendor/modules/s5k4ec.ko
insmod /system/vendor/modules/gc2155.ko
2016-08-06 01:03:18 +00:00
insmod /system/vendor/modules/vfe_v4l2.ko
2016-09-02 12:17:20 +00:00
# network
2016-08-06 01:03:18 +00:00
insmod /system/vendor/modules/usbnet.ko
insmod /system/vendor/modules/asix.ko
insmod /system/vendor/modules/qf9700.ko
insmod /system/vendor/modules/mcs7830.ko
insmod /system/vendor/modules/rtl8150.ko
insmod /system/vendor/modules/cdc_ether.ko
2016-09-02 12:17:20 +00:00
insmod /system/vendor/modules/smsc75xx.ko
insmod /system/vendor/modules/smsc95xx.ko
2016-08-06 01:03:18 +00:00
2016-09-02 12:17:20 +00:00
# bluesleep
2016-08-06 01:03:18 +00:00
insmod /system/vendor/modules/rtl_btlpm.ko
2016-09-02 12:17:20 +00:00
# bluetooth
2016-08-06 01:03:18 +00:00
# UART device
chmod 0660 /dev/ttyS1
chown bluetooth net_bt_stack /dev/ttyS1
2016-09-02 12:17:20 +00:00
# power up/down interface
2016-08-06 01:03:18 +00:00
chmod 0660 /sys/class/rfkill/rfkill0/state
chmod 0660 /sys/class/rfkill/rfkill0/type
chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state
chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/type
# bluetooth LPM
chmod 0220 /proc/bluetooth/sleep/lpm
chmod 0220 /proc/bluetooth/sleep/btwrite
chown bluetooth net_bt_stack /proc/bluetooth/sleep/lpm
chown bluetooth net_bt_stack /proc/bluetooth/sleep/btwrite
write /proc/bluetooth/sleep/lpm 1
2016-09-02 12:17:20 +00:00
# to observe dnsmasq.leases file for dhcp information of soft ap.
chown dhcp system /data/misc/dhcp
# disable IPv6
write /proc/sys/net/ipv6/conf/all/disable_ipv6 1
2016-09-02 12:17:20 +00:00
#format_userdata /dev/block/mmcblk0p1 PRIVATE
#mkdir /mnt/private
#mount vfat /dev/block/mmcblk0p1 /mnt/private
2016-08-06 01:03:18 +00:00
2016-09-02 12:17:20 +00:00
on property:sys.boot_completed=1
chown system system /sys/devices/soc.0/1c2ac00.twi/i2c-0/0-0040/runtime_suspend
chmod 0660 /sys/devices/soc.0/1c2ac00.twi/i2c-0/0-0040/runtime_suspend
#start engsetmacaddr
#start engsetbtmacaddr
2016-08-06 01:03:18 +00:00
#uvc modules
insmod /system/vendor/modules/uvcvideo.ko
insmod /system/vendor/modules/gspca_main.ko
2016-10-03 09:43:37 +00:00
2016-09-02 12:17:20 +00:00
on post-fs-data
2016-09-17 10:34:29 +00:00
# change permissions for process groups
# https://bugs.launchpad.net/bugs/1037611
chmod 0660 /dev/cpuctl
2016-09-02 12:17:20 +00:00
mkdir /data/media 0770 media_rw media_rw
# bluetooth MAC address programming
chown bluetooth net_bt_stack ro.bt.bdaddr_path
chown bluetooth net_bt_stack /system/etc/bluetooth
chown bluetooth net_bt_stack /data/misc/bluetooth
setprop ro.bt.bdaddr_path "/data/misc/bluetooth/bdaddr"
# Set indication (checked by vold) that we have finished this action
setprop vold.post_fs_data_done 1
# to force to start sdcard
#class_start late_start
2016-08-06 01:03:18 +00:00
2016-09-02 12:17:20 +00:00
# This module write data to /data should insmod in post-fs-data
# due to encryption
2016-08-06 01:03:18 +00:00
2016-09-02 12:17:20 +00:00
on boot
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
2016-09-02 09:47:39 +00:00
2016-09-02 12:17:20 +00:00
chown system system /sys/kernel/debug/tracing
chmod 0755 /sys/kernel/debug/tracing
2016-08-06 01:03:18 +00:00
2016-09-02 12:17:20 +00:00
chown system system /sys/kernel/autohotplug/enable
chmod 0660 /sys/kernel/autohotplug/enable
2016-08-25 12:10:34 +00:00
2016-09-02 12:17:20 +00:00
chown system system /sys/devices/system/cpu/cpu0/cpufreq/boot_lock
chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/boot_lock
chown system system /sys/devices/soc.0/cpu_budget_cool.16/roomage
chmod 0660 /sys/devices/soc.0/cpu_budget_cool.16/roomage
2016-08-06 01:03:18 +00:00
2016-11-27 11:40:50 +00:00
chown system system /sys/devices/soc.0/cpu_budget_cool.17/roomage
chmod 0660 /sys/devices/soc.0/cpu_budget_cool.17/roomage
2016-09-02 12:17:20 +00:00
chown system system /sys/class/devfreq/dramfreq/adaptive/pause
chmod 0660 /sys/class/devfreq/dramfreq/adaptive/pause
2016-08-06 01:03:18 +00:00
2016-11-27 11:40:50 +00:00
chown system system /sys/devices/1c40000.gpu/dvfs/android
chmod 0660 /sys/devices/1c40000.gpu/dvfs/android
chown system system /sys/class/devfreq/dramfreq/cur_freq
chmod 0660 /sys/class/devfreq/dramfreq/cur_freq
write /dev/cpuset/foreground/cpus 0-3
write /dev/cpuset/foreground/boost/cpus 0-3
write /dev/cpuset/background/cpus 0
write /dev/cpuset/system-background/cpus 0-1
write /dev/cpuset/top-app/cpus 0-3
exec u:r:su:s0 root -- /sbin/busybox sh /system/bin/configure_system.sh
exec u:r:su:s0 root -- /sbin/busybox sh /bootloader/rc.local
2016-09-02 12:17:20 +00:00
on charger
insmod nand.ko
mount_all /fstab.sun50iw1p1
insmod /system/vendor/modules/disp.ko
2016-08-06 01:03:18 +00:00
2016-09-02 12:17:20 +00:00
class_start charger
write /sys/module/printk/parameters/console_suspend N
write /proc/sys/kernel/printk 0
write /sys/devices/system/cpu/cpu0/cpufreq/boot_lock 1
write /sys/devices/soc.0/cpu_budget_cool.16/roomage "0 4 0 0 1152000 4 0 0"
write /sys/class/devfreq/dramfreq/adaptive/pause 0
write /sys/devices/1c40000.gpu/dvfs/android 4
write /sys/kernel/autohotplug/enable 1
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor powersave
on property:dev.bootcomplete=1
write /sys/devices/system/cpu/cpu0/cpufreq/boot_lock 1 # AFTER_BOOT
write /sys/devices/soc.0/cpu_budget_cool.16/roomage "0 4 0 0 1152000 4 0 0" # SCALE_UP_TO_4_CPUS
write /sys/class/devfreq/dramfreq/adaptive/pause 1 # DISABLE_DRAM_CHANGE
write /sys/devices/1c40000.gpu/dvfs/android 4 # GPU_NORMAL
write /sys/kernel/autohotplug/enable 1 # AUTO DISCONNECT
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive # INTERACTIVE
2016-09-02 12:17:20 +00:00
ifeq ($(BOARD_WIDEVINE_OEMCRYPTO_LEVEL), 1)
service optee /system/bin/tee_supplicant
class core
user root
group root
endif
2016-08-06 01:03:18 +00:00
2016-09-02 12:17:20 +00:00
service watchdogd /sbin/watchdogd 60 20
class core
oneshot
seclabel u:r:watchdogd:s0
2016-08-06 01:03:18 +00:00
# 1. realtek & eagle wifi service
# 1.1 realtek & eagle wifi sta service
service wpa_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
-I/system/etc/wifi/wpa_supplicant_overlay.conf \
-O/data/misc/wifi/sockets \
-e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
# we will start as root and wpa_supplicant will switch to user wifi
# after setting up the capabilities required for WEXT
# user wifi
# group wifi inet keystore
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
# 1.2 realtek & eagle wifi sta p2p concurrent service
service p2p_supplicant /system/bin/wpa_supplicant \
-ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \
-e/data/misc/wifi/entropy.bin -N \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
-I/system/etc/wifi/wpa_supplicant_overlay.conf \
-O/data/misc/wifi/sockets \
-g@android:wpa_wlan0
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
2016-10-03 09:43:37 +00:00
on property:persist.net.eth0.speed=auto
exec u:r:su:s0 root -- /system/bin/ifconfig eth0 up
exec u:r:su:s0 root -- /system/bin/ethtool -s eth0 autoneg on
on property:persist.net.eth0.speed=1000
exec u:r:su:s0 root -- /system/bin/ifconfig eth0 up
exec u:r:su:s0 root -- /system/bin/ethtool -s eth0 speed 1000 duplex full
on property:persist.net.eth0.speed=100
exec u:r:su:s0 root -- /system/bin/ifconfig eth0 up
exec u:r:su:s0 root -- /system/bin/ethtool -s eth0 speed 100 duplex full
on property:persist.net.eth0.speed=10
exec u:r:su:s0 root -- /system/bin/ifconfig eth0 up
exec u:r:su:s0 root -- /system/bin/ethtool -s eth0 speed 10 duplex full