blob: 3cf5d4c1dae1a0477594ff34e104f65d1133c61d [file] [log] [blame]
Matt Mowerec009e82015-01-30 13:00:49 -06001import /init.recovery.usb.rc
Matt Mower556411f2013-02-17 16:52:44 -06002import /init.recovery.${ro.hardware}.rc
3
Colin Crossdd6a0412010-05-14 13:42:20 -07004on early-init
5 start ueventd
Todd Poynor2f2c9882013-06-04 13:11:44 -07006 start healthd
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -08007
Ethan Yonkerc798c9c2015-10-09 11:15:26 -05008service set_permissive /sbin/permissive.sh
Ethan Yonker6cb35aa2014-12-16 14:21:42 -06009 oneshot
10 seclabel u:r:recovery:s0
11
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080012on init
Doug Zongker55d65422014-01-14 09:50:35 -080013 export PATH /sbin:/system/bin
Dees_Troy51a0e822012-09-05 15:24:24 -040014 export LD_LIBRARY_PATH .:/sbin
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080015 export ANDROID_ROOT /system
16 export ANDROID_DATA /data
17 export EXTERNAL_STORAGE /sdcard
18
Matt Mower556411f2013-02-17 16:52:44 -060019 mkdir /boot
20 mkdir /recovery
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080021 mkdir /system
22 mkdir /data
23 mkdir /cache
Doug Zongker075ad802014-06-26 15:35:51 -070024 mkdir /sideload
Doug Zongker55d65422014-01-14 09:50:35 -080025 mount tmpfs tmpfs /tmp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080026
Matt Mower556411f2013-02-17 16:52:44 -060027 chown root shell /tmp
28 chmod 0775 /tmp
29
Colin Cross22bcf972014-06-24 13:43:39 -070030 write /proc/sys/kernel/panic_on_oops 1
Jesse Zhao5bf74b22015-01-08 15:59:23 -080031 write /proc/sys/vm/max_map_count 1000000
Colin Cross22bcf972014-06-24 13:43:39 -070032
Benoit Goby689e06b2014-02-19 17:41:02 -080033on fs
Vojtech Bocek05ec1d42015-03-08 16:32:41 +010034 mount pstore pstore /sys/fs/pstore
35
Benoit Goby689e06b2014-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
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080040on boot
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080041 ifup lo
42 hostname localhost
43 domainname localdomain
44
45 class_start default
46
Riley Andrewse739d7e2014-06-24 16:29:16 -070047# Load properties from /system/ + /factory after fs mount.
48on load_all_props_action
49 load_all_props
50
JP Abgrall9eb8c8b2014-10-20 20:02:57 -070051on firmware_mounts_complete
52 rm /dev/.booting
53
Riley Andrewse739d7e2014-06-24 16:29:16 -070054# Mount filesystems and start core system services.
55on late-init
56 trigger early-fs
57 trigger fs
58 trigger post-fs
59 trigger post-fs-data
60
61 # Load properties from /system/ + /factory after fs mount. Place
62 # this in another action so that the load will be scheduled after the prior
63 # issued fs triggers have completed.
64 trigger load_all_props_action
65
JP Abgrall9eb8c8b2014-10-20 20:02:57 -070066 # Remove a file to wake up anything waiting for firmware
67 trigger firmware_mounts_complete
68
Riley Andrewse739d7e2014-06-24 16:29:16 -070069 trigger early-boot
70 trigger boot
71
Doug Zongker77ea71d2013-08-30 12:20:16 -070072on property:sys.powerctl=*
73 powerctl ${sys.powerctl}
74
Colin Crossdd6a0412010-05-14 13:42:20 -070075service ueventd /sbin/ueventd
76 critical
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050077 seclabel u:r:ueventd:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080078
Todd Poynorbe968092013-09-13 16:34:12 -070079service healthd /sbin/healthd -r
Todd Poynor2f2c9882013-06-04 13:11:44 -070080 critical
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050081 seclabel u:r:healthd:s0
Todd Poynor2f2c9882013-06-04 13:11:44 -070082
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080083service recovery /sbin/recovery
84
Nick Kralevichc52c5b82014-01-18 09:22:50 -080085service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery
Kenny Rootecc76ba2010-06-28 09:01:22 -070086 disabled
Doug Zongkercc2958f2013-09-11 13:24:32 -070087 socket adbd stream 660 system system
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050088 seclabel u:r:adbd:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080089
Mike Lockwood718a2f72011-06-29 10:22:04 -040090# Always start adbd on userdebug and eng builds
91on property:ro.debuggable=1
Dees_Troy0cd4cc22013-06-09 20:56:38 +000092 #write /sys/class/android_usb/android0/enable 1
93 #start adbd
Dees_Troy51a0e822012-09-05 15:24:24 -040094 setprop service.adb.root 1
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080095
Mike Lockwood718a2f72011-06-29 10:22:04 -040096# Restart adbd so it can run as root
Doug Zongkerfb04b872011-06-23 15:30:34 -070097on property:service.adb.root=1
98 write /sys/class/android_usb/android0/enable 0
99 restart adbd
Benoit Goby689e06b2014-02-19 17:41:02 -0800100 write /sys/class/android_usb/android0/enable 1