blob: 42772776869a1eeef1cfca9de6e46095c24ff4fd [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
4 start ueventd
Todd Poynor2f2c9882013-06-04 13:11:44 -07005 start healthd
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -08006
7on init
Doug Zongker075ef322014-01-14 09:50:35 -08008 export PATH /sbin:/system/bin
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -08009 export ANDROID_ROOT /system
10 export ANDROID_DATA /data
11 export EXTERNAL_STORAGE /sdcard
12
13 symlink /system/etc /etc
14
15 mkdir /sdcard
16 mkdir /system
17 mkdir /data
18 mkdir /cache
Doug Zongker075ad802014-06-26 15:35:51 -070019 mkdir /sideload
Doug Zongker075ef322014-01-14 09:50:35 -080020 mount tmpfs tmpfs /tmp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080021
Doug Zongker703ed152012-03-19 15:52:03 -070022 chown root shell /tmp
23 chmod 0775 /tmp
24
Colin Cross22bcf972014-06-24 13:43:39 -070025 write /proc/sys/kernel/panic_on_oops 1
Jesse Zhao5bf74b22015-01-08 15:59:23 -080026 write /proc/sys/vm/max_map_count 1000000
Colin Cross22bcf972014-06-24 13:43:39 -070027
Benoit Goby1b964112014-02-19 17:41:02 -080028on fs
29 mkdir /dev/usb-ffs 0770 shell shell
30 mkdir /dev/usb-ffs/adb 0770 shell shell
31 mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
32
Doug Zongker66392482012-01-10 12:16:04 -080033 write /sys/class/android_usb/android0/enable 0
34 write /sys/class/android_usb/android0/idVendor 18D1
35 write /sys/class/android_usb/android0/idProduct D001
Benoit Goby1b964112014-02-19 17:41:02 -080036 write /sys/class/android_usb/android0/f_ffs/aliases adb
Doug Zongker66392482012-01-10 12:16:04 -080037 write /sys/class/android_usb/android0/functions adb
38 write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
39 write /sys/class/android_usb/android0/iProduct ${ro.product.model}
40 write /sys/class/android_usb/android0/iSerial ${ro.serialno}
41
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080042on boot
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080043 ifup lo
44 hostname localhost
45 domainname localdomain
46
47 class_start default
48
Riley Andrewse739d7e2014-06-24 16:29:16 -070049# Load properties from /system/ + /factory after fs mount.
Paul Lawrence90c75b02015-07-06 10:44:33 -070050on load_system_props_action
51 load_system_props
Riley Andrewse739d7e2014-06-24 16:29:16 -070052
JP Abgrall9eb8c8b2014-10-20 20:02:57 -070053on firmware_mounts_complete
54 rm /dev/.booting
55
Riley Andrewse739d7e2014-06-24 16:29:16 -070056# Mount filesystems and start core system services.
57on late-init
58 trigger early-fs
59 trigger fs
60 trigger post-fs
61 trigger post-fs-data
62
63 # Load properties from /system/ + /factory after fs mount. Place
64 # this in another action so that the load will be scheduled after the prior
65 # issued fs triggers have completed.
Paul Lawrence90c75b02015-07-06 10:44:33 -070066 trigger load_system_props_action
Riley Andrewse739d7e2014-06-24 16:29:16 -070067
JP Abgrall9eb8c8b2014-10-20 20:02:57 -070068 # Remove a file to wake up anything waiting for firmware
69 trigger firmware_mounts_complete
70
Riley Andrewse739d7e2014-06-24 16:29:16 -070071 trigger early-boot
72 trigger boot
73
Doug Zongker77ea71d2013-08-30 12:20:16 -070074on property:sys.powerctl=*
75 powerctl ${sys.powerctl}
76
Colin Crossdd6a0412010-05-14 13:42:20 -070077service ueventd /sbin/ueventd
78 critical
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050079 seclabel u:r:ueventd:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080080
Todd Poynorbe968092013-09-13 16:34:12 -070081service healthd /sbin/healthd -r
Todd Poynor2f2c9882013-06-04 13:11:44 -070082 critical
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050083 seclabel u:r:healthd:s0
Todd Poynor2f2c9882013-06-04 13:11:44 -070084
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080085service recovery /sbin/recovery
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050086 seclabel u:r:recovery:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080087
Nick Kralevichc52c5b82014-01-18 09:22:50 -080088service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery
Kenny Rootecc76ba2010-06-28 09:01:22 -070089 disabled
Doug Zongkercc2958f2013-09-11 13:24:32 -070090 socket adbd stream 660 system system
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050091 seclabel u:r:adbd:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080092
Mike Lockwood718a2f72011-06-29 10:22:04 -040093# Always start adbd on userdebug and eng builds
94on property:ro.debuggable=1
Mike Lockwood7e58b652011-06-19 02:52:01 -040095 write /sys/class/android_usb/android0/enable 1
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080096 start adbd
97
Mike Lockwood718a2f72011-06-29 10:22:04 -040098# Restart adbd so it can run as root
Doug Zongkerfb04b872011-06-23 15:30:34 -070099on property:service.adb.root=1
100 write /sys/class/android_usb/android0/enable 0
101 restart adbd
102 write /sys/class/android_usb/android0/enable 1