blob: 3821eb6a8068f4cc35fa3730f07e95ee9bf749cc [file] [log] [blame]
Colin Crossf510f062012-08-08 13:06:26 -07001import /init.recovery.${ro.hardware}.rc
2
Colin Crossdd6a0412010-05-14 13:42:20 -07003on early-init
Alex Deymo6bcc8af2016-03-02 14:21:02 -08004 # Set the security context of /postinstall if present.
5 restorecon /postinstall
6
Colin Crossdd6a0412010-05-14 13:42:20 -07007 start ueventd
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -08008
9on init
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080010 export ANDROID_ROOT /system
11 export ANDROID_DATA /data
12 export EXTERNAL_STORAGE /sdcard
13
Elliott Hughes4dca6f12017-12-06 08:41:50 -080014 symlink /system/bin /bin
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080015 symlink /system/etc /etc
16
Elliott Hughes48ebb072016-06-15 15:15:15 -070017 mount cgroup none /acct cpuacct
18 mkdir /acct/uid
19
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080020 mkdir /sdcard
21 mkdir /system
22 mkdir /data
23 mkdir /cache
Doug Zongker075ad802014-06-26 15:35:51 -070024 mkdir /sideload
Jiyong Park8b7af4c2018-06-01 11:58:54 +090025 mkdir /mnt/system
Doug Zongker075ef322014-01-14 09:50:35 -080026 mount tmpfs tmpfs /tmp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080027
Doug Zongker703ed152012-03-19 15:52:03 -070028 chown root shell /tmp
29 chmod 0775 /tmp
30
Colin Cross22bcf972014-06-24 13:43:39 -070031 write /proc/sys/kernel/panic_on_oops 1
Jesse Zhao5bf74b22015-01-08 15:59:23 -080032 write /proc/sys/vm/max_map_count 1000000
Colin Cross22bcf972014-06-24 13:43:39 -070033
Benoit Goby1b964112014-02-19 17:41:02 -080034on fs
Jerry Zhange66f8612017-01-04 10:30:32 -080035 write /sys/class/android_usb/android0/f_ffs/aliases adb
Benoit Goby1b964112014-02-19 17:41:02 -080036 mkdir /dev/usb-ffs 0770 shell shell
37 mkdir /dev/usb-ffs/adb 0770 shell shell
38 mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
39
Doug Zongker66392482012-01-10 12:16:04 -080040 write /sys/class/android_usb/android0/enable 0
41 write /sys/class/android_usb/android0/idVendor 18D1
42 write /sys/class/android_usb/android0/idProduct D001
43 write /sys/class/android_usb/android0/functions adb
44 write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
45 write /sys/class/android_usb/android0/iProduct ${ro.product.model}
46 write /sys/class/android_usb/android0/iSerial ${ro.serialno}
47
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080048on boot
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080049 ifup lo
50 hostname localhost
51 domainname localdomain
52
53 class_start default
54
Riley Andrewse739d7e2014-06-24 16:29:16 -070055# Load properties from /system/ + /factory after fs mount.
Paul Lawrence90c75b02015-07-06 10:44:33 -070056on load_system_props_action
57 load_system_props
Riley Andrewse739d7e2014-06-24 16:29:16 -070058
JP Abgrall9eb8c8b2014-10-20 20:02:57 -070059on firmware_mounts_complete
60 rm /dev/.booting
61
Riley Andrewse739d7e2014-06-24 16:29:16 -070062# Mount filesystems and start core system services.
63on late-init
64 trigger early-fs
65 trigger fs
66 trigger post-fs
67 trigger post-fs-data
68
69 # Load properties from /system/ + /factory after fs mount. Place
70 # this in another action so that the load will be scheduled after the prior
71 # issued fs triggers have completed.
Paul Lawrence90c75b02015-07-06 10:44:33 -070072 trigger load_system_props_action
Riley Andrewse739d7e2014-06-24 16:29:16 -070073
JP Abgrall9eb8c8b2014-10-20 20:02:57 -070074 # Remove a file to wake up anything waiting for firmware
75 trigger firmware_mounts_complete
76
Riley Andrewse739d7e2014-06-24 16:29:16 -070077 trigger early-boot
78 trigger boot
79
Tom Cherryb2fd1682018-07-24 15:58:29 -070080service ueventd /system/bin/ueventd
Colin Crossdd6a0412010-05-14 13:42:20 -070081 critical
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050082 seclabel u:r:ueventd:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080083
Sandeep Patilc4b381c2016-11-01 08:49:51 -070084service charger /charger -r
Todd Poynor2f2c9882013-06-04 13:11:44 -070085 critical
Sandeep Patilc4b381c2016-11-01 08:49:51 -070086 seclabel u:r:charger:s0
Todd Poynor2f2c9882013-06-04 13:11:44 -070087
Hridya Valsarajucfb3c922018-07-26 13:04:06 -070088service recovery /system/bin/recovery
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050089 seclabel u:r:recovery:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080090
Jiyong Park8b7af4c2018-06-01 11:58:54 +090091service adbd /system/bin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery
Kenny Rootecc76ba2010-06-28 09:01:22 -070092 disabled
Doug Zongkercc2958f2013-09-11 13:24:32 -070093 socket adbd stream 660 system system
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050094 seclabel u:r:adbd:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080095
Mike Lockwood718a2f72011-06-29 10:22:04 -040096# Always start adbd on userdebug and eng builds
97on property:ro.debuggable=1
Mike Lockwood7e58b652011-06-19 02:52:01 -040098 write /sys/class/android_usb/android0/enable 1
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080099 start adbd
100
Mike Lockwood718a2f72011-06-29 10:22:04 -0400101# Restart adbd so it can run as root
Doug Zongkerfb04b872011-06-23 15:30:34 -0700102on property:service.adb.root=1
103 write /sys/class/android_usb/android0/enable 0
104 restart adbd
105 write /sys/class/android_usb/android0/enable 1