Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 1 | on early-init |
| 2 | # loglevel 8 |
| 3 | symlink /sdcard /storage/sdcard0 |
| 4 | mkdir /var/run 0755 root root |
| 5 | mkdir /var/run/media 0755 media root |
| 6 | mkdir /var/run/system 0755 system root |
| 7 | mkdir /dev/gce 0750 |
| 8 | chown system system /dev/gce |
| 9 | |
Alistair Delva | 079e660 | 2020-01-28 16:08:48 -0800 | [diff] [blame] | 10 | mount tracefs tracefs /sys/kernel/tracing |
| 11 | |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 12 | setprop ro.sf.lcd_density ${ro.boot.lcd_density} |
Greg Hartman | 0434299 | 2019-04-03 15:11:24 -0700 | [diff] [blame] | 13 | setprop ro.hardware.egl ${ro.boot.hardware.egl} |
Greg Hartman | aa974fe | 2019-04-01 15:41:40 -0700 | [diff] [blame] | 14 | setprop ro.hardware.gralloc ${ro.boot.hardware.gralloc} |
| 15 | setprop ro.hardware.hwcomposer ${ro.boot.hardware.hwcomposer} |
Jason Macnak | bd6a582 | 2019-10-29 16:54:59 -0700 | [diff] [blame] | 16 | setprop ro.hardware.vulkan ${ro.boot.hardware.vulkan} |
Jorge E. Moreira | 6482c4a | 2019-04-01 16:13:32 -0700 | [diff] [blame] | 17 | |
Ram Muthiah | 901c804 | 2019-07-24 17:04:03 -0700 | [diff] [blame] | 18 | # start module load in the background |
| 19 | start vendor.insmod_sh |
| 20 | |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 21 | on init |
| 22 | # ZRAM setup |
| 23 | write /sys/block/zram0/comp_algorithm lz4 |
Ram Muthiah | d5510d8 | 2019-11-27 15:32:45 -0800 | [diff] [blame] | 24 | # |
| 25 | # EAS uclamp interfaces |
| 26 | # |
| 27 | mkdir /dev/cpuctl/foreground |
| 28 | mkdir /dev/cpuctl/background |
| 29 | mkdir /dev/cpuctl/top-app |
| 30 | mkdir /dev/cpuctl/rt |
| 31 | chown system system /dev/cpuctl |
| 32 | chown system system /dev/cpuctl/foreground |
| 33 | chown system system /dev/cpuctl/background |
| 34 | chown system system /dev/cpuctl/top-app |
| 35 | chown system system /dev/cpuctl/rt |
| 36 | chown system system /dev/cpuctl/tasks |
| 37 | chown system system /dev/cpuctl/foreground/tasks |
| 38 | chown system system /dev/cpuctl/background/tasks |
| 39 | chown system system /dev/cpuctl/top-app/tasks |
| 40 | chown system system /dev/cpuctl/rt/tasks |
| 41 | chmod 0664 /dev/cpuctl/tasks |
| 42 | chmod 0664 /dev/cpuctl/foreground/tasks |
| 43 | chmod 0664 /dev/cpuctl/background/tasks |
| 44 | chmod 0664 /dev/cpuctl/top-app/tasks |
| 45 | chmod 0664 /dev/cpuctl/rt/tasks |
| 46 | write /dev/cpuctl/foreground/cpu.rt_runtime_us 950000 |
| 47 | write /dev/cpuctl/background/cpu.rt_runtime_us 950000 |
| 48 | write /dev/cpuctl/top-app/cpu.rt_runtime_us 950000 |
| 49 | write /dev/cpuctl/rt/cpu.rt_runtime_us 950000 |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 50 | |
| 51 | |
| 52 | on fs |
Alistair Delva | e58d623 | 2020-01-24 13:10:40 -0800 | [diff] [blame] | 53 | # Mount everything that does not require fsck |
| 54 | mount_all /vendor/etc/fstab.${ro.hardware} --early |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 55 | restorecon_recursive /vendor |
| 56 | |
| 57 | start setup_wifi |
| 58 | # works around framework netiface enumeration issue |
| 59 | start rename_eth1 |
| 60 | |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 61 | # TODO(ender): Find better way to talk to serial port. |
| 62 | chmod 622 /dev/kmsg |
| 63 | |
| 64 | # for GCE camera HAL |
| 65 | mkdir /var/media 0770 audio media |
| 66 | |
| 67 | chmod 0664 /sys/kernel/debug/ieee80211/phy1/hwsim/group |
| 68 | chmod 0664 /sys/kernel/debug/ieee80211/phy1/hwsim/ps |
| 69 | chmod 0664 /sys/kernel/debug/ieee80211/phy0/rc/fixed_rate_idx |
| 70 | chmod 0664 /sys/kernel/debug/ieee80211/phy0/hwsim/group |
| 71 | chmod 0664 /sys/kernel/debug/ieee80211/phy0/hwsim/ps |
| 72 | chmod 0664 /sys/kernel/debug/ieee80211/phy1/rc/fixed_rate_idx |
| 73 | |
Alistair Strachan | 948df85 | 2019-05-14 16:00:49 -0700 | [diff] [blame] | 74 | |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 75 | on post-fs |
Alistair Strachan | 948df85 | 2019-05-14 16:00:49 -0700 | [diff] [blame] | 76 | # set RLIMIT_MEMLOCK to 64MB |
| 77 | setrlimit 8 67108864 67108864 |
| 78 | |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 79 | |
| 80 | on post-fs-data |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 81 | start vport_trigger |
| 82 | |
Jorge E. Moreira | e70eceb | 2020-02-14 11:35:00 -0800 | [diff] [blame] | 83 | mkdir /data/vendor/modem_dump 0777 system system |
| 84 | mkdir /data/vendor/radio 0777 system system |
| 85 | |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 86 | |
| 87 | on late-fs |
Alistair Delva | e58d623 | 2020-01-24 13:10:40 -0800 | [diff] [blame] | 88 | # Wait for keymaster |
| 89 | exec_start wait_for_keymaster |
| 90 | |
| 91 | # Mount RW partitions which need run fsck |
| 92 | mount_all /vendor/etc/fstab.${ro.hardware} --late |
| 93 | |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 94 | write /dev/kmsg "GUEST_BUILD_FINGERPRINT: ${ro.build.fingerprint}" |
| 95 | |
| 96 | |
| 97 | on boot |
| 98 | chmod 0660 /dev/cpuctl |
| 99 | mkdir /data/vendor/wifi 0770 wifi wifi |
| 100 | mkdir /data/vendor/wifi/wpa 0770 wifi wifi |
| 101 | mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi |
| 102 | start socket_vsock_proxy |
| 103 | |
| 104 | |
| 105 | service setup_wifi /vendor/bin/setup_wifi |
| 106 | oneshot |
| 107 | |
| 108 | |
| 109 | service rename_eth1 /vendor/bin/rename_netiface eth1 rmnet0 |
| 110 | oneshot |
| 111 | |
| 112 | |
| 113 | on property:sys.boot_completed=1 |
| 114 | trigger sys-boot-completed-set |
| 115 | |
| 116 | |
| 117 | # We want one opportunity per boot to enable zram, so we |
| 118 | # use a trigger we fire from the above stanza. If |
| 119 | # persist.sys.zram_enabled becomes true after boot, |
| 120 | # we don't want to run swapon_all at that time. |
| 121 | on sys-boot-completed-set && property:persist.sys.zram_enabled=1 |
Cody Schuffelen | 994b817 | 2019-07-18 18:24:16 -0700 | [diff] [blame] | 122 | swapon_all /vendor/etc/${ro.boot.fstab_name}.${ro.hardware} |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 123 | |
Ram Muthiah | 901c804 | 2019-07-24 17:04:03 -0700 | [diff] [blame] | 124 | service vendor.insmod_sh /vendor/bin/init.insmod.sh |
| 125 | class main |
| 126 | user root |
| 127 | group root system |
| 128 | disabled |
| 129 | oneshot |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 130 | |
A. Cody Schuffelen | 36bce55 | 2020-02-06 16:02:30 -0800 | [diff] [blame] | 131 | service socket_vsock_proxy /vendor/bin/socket_vsock_proxy -server=vsock -tcp_port=5555 -vsock_port=6520 |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 132 | |
| 133 | |
| 134 | service vport_trigger /vendor/bin/vport_trigger |
| 135 | oneshot |
| 136 | |
| 137 | |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 138 | on property:vendor.ser.cf-logcat=* |
| 139 | symlink ${vendor.ser.cf-logcat} /dev/cf-logcat |
| 140 | enable seriallogging |
| 141 | |
| 142 | |
| 143 | service seriallogging /system/bin/logcat -b all -v threadtime -f /dev/cf-logcat *:V |
| 144 | class main |
Cody Schuffelen | c423e5d | 2019-09-16 19:49:45 +0000 | [diff] [blame] | 145 | user root |
| 146 | disabled |
| 147 | |
| 148 | |
| 149 | on property:ro.boot.vsock_logcat_port=* |
| 150 | enable vsock_logcat |
| 151 | |
| 152 | |
| 153 | service vsock_logcat /vendor/bin/vsock_logcat |
| 154 | class main |
| 155 | user root |
Jorge E. Moreira | 0cb7cac | 2019-02-15 17:05:20 -0800 | [diff] [blame] | 156 | disabled |
| 157 | |
Cody Schuffelen | 329b8de | 2019-11-04 15:11:06 -0800 | [diff] [blame] | 158 | service vsoc_input_service /vendor/bin/vsoc_input_service -touch_port=${ro.boot.vsock_touch_port} -keyboard_port=${ro.boot.vsock_keyboard_port} |
| 159 | group root uhid |
| 160 | disabled |
| 161 | |
| 162 | on early-boot && property:ro.boot.vsock_touch_port=* |
| 163 | enable vsoc_input_service |
Cody Schuffelen | 2c6179c | 2019-11-11 18:38:21 -0800 | [diff] [blame] | 164 | start vsoc_input_service |
Cody Schuffelen | 329b8de | 2019-11-04 15:11:06 -0800 | [diff] [blame] | 165 | |
| 166 | on early-boot && property:ro.boot.vsock_keyboard_port=* |
| 167 | enable vsoc_input_service |
Cody Schuffelen | 2c6179c | 2019-11-11 18:38:21 -0800 | [diff] [blame] | 168 | start vsoc_input_service |
Jorge E. Moreira | 0cb7cac | 2019-02-15 17:05:20 -0800 | [diff] [blame] | 169 | |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 170 | service wpa_supplicant /vendor/bin/hw/wpa_supplicant -g@android:wpa_wlan0 |
| 171 | interface android.hardware.wifi.supplicant@1.0::ISupplicant default |
| 172 | interface android.hardware.wifi.supplicant@1.1::ISupplicant default |
Alistair Strachan | 5fd2fa0 | 2019-04-04 02:15:00 -0700 | [diff] [blame] | 173 | interface android.hardware.wifi.supplicant@1.2::ISupplicant default |
Jimmy Chen | 8493160 | 2019-08-02 01:26:51 +0800 | [diff] [blame] | 174 | interface android.hardware.wifi.supplicant@1.3::ISupplicant default |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 175 | socket wpa_wlan0 dgram 660 wifi wifi |
| 176 | group system wifi inet |
| 177 | disabled |
| 178 | oneshot |
| 179 | |
| 180 | |
Abhijeet Kaur | 0e2fa8b | 2019-08-29 10:44:49 +0100 | [diff] [blame] | 181 | service bugreport /system/bin/dumpstate -d -p -z |
Jorge E. Moreira | 9084cc4 | 2019-02-01 14:43:40 -0800 | [diff] [blame] | 182 | class main |
| 183 | disabled |
| 184 | oneshot |
| 185 | keycodes 30 48 |