SlideShare a Scribd company logo
Timings of Init 
Android Ramdisks 
for the practical hacker 
Big Android BBQ - October 2014 
Oceus Networks Inc. Internal
Who Am I? 
Stacy Wylie (Devino) 
Username: childofthehorn 
(Rootzwiki / XDA-developers / IRC / Github) 
27 years old, soon to be 28 Yay! 
Principal Software Engineer at Oceus Networks 
Partner of OpenBrite LLC, an OSHW / OSS 
company, creators of the LEDgoes / BriteBlox 
product line 
Oceus Networks Inc. 
2
What is it and where? 
Boot Image or Recovery Image 
(boot.img / recovery.img) contains 
two pieces: 
 
Kernel (zImage) 
Ramdisk / Bootdisk / Rootdisk 
Without it, the kernel doesn't know 
what to do or how to start the OS. 
Oceus Networks Inc. 
3
Ramdisk / Init in the Boot Sequence 
Oceus Networks Inc. 
4 
CHIP BOOT 
BOOTLOADER / UBOOT 
KERNEL 
RAMDISK / BOOTDISK 
Chip Supplier and 
Vendor controlled code 
(usually) 
$$$
Android vs. Linux Ramdisks 
 Most Linux Distros use initrd (vs. custom initd in 
Android) 
 Linux kills off its ramdisk after main OS boot; 
 Android keeps the ramdisk active in memory (will 
appear in / at runtime) 
 Android core services continue running, controlled 
by the init.rc scripts 
 Android Ramdisk + Kernel makes its own mini OS 
(see Team Win Recovery Project or Clockwork Mod) 
Oceus Networks Inc. 
5
FROM 
HELL ! 
Oceus Networks Inc. 
*devil wears no pants
What was the Problem? 
The current state of init.rc scripts did not account 
for larger encryption keys or decryption that would 
take longer. 
This was a problem because the current state of 
initialization had the system and radios initializing 
separately with no checks. THIS IS NORMAL! 
Fixing required lots of time and careful monitoring 
of kernel messages and such from the serial 
terminal 
Oceus Networks Inc. 
7
Nexus 5 Ramdisk Example (CM) 
Body text here 
Oceus Networks Inc. 
8
Key Init binary starts 
 Init binary controls startup plus some other embedded 
functions like helping “vold” and in Android 4.3+, turning 
SEpolicy to “enforcing”. Vendors like Samsung and LG may 
incorporate custom initializations and checks prior to booting 
certain code. 
 
 Init starts the basic init.rc file which includes the imports for 
the next stage “.rc” files. Upon import (which may be 
chained through multiple “.rc” files), it immediately has the 
same startup and capabilities as the base init.rc. 
 How is this relevant? If having issues with init.rc or trouble 
finding something which is starting up, it might be in the Init 
binary and not in the runtime scripts. 
Oceus Networks Inc. 
9
Directories 
 SBIN – Dedicated SBIN for binaries that may need to exist 
early in boot sequence or outside of the OS reach (usually 
executables) 
 
 BIN – Maps and links to “/system/bin”. Good place to put .ko 
files for insmod and .sh files that shouldn't go in “/” of the 
ramdisk. 
 
 “/” - Maps to “/” and contains init.rc files plus .sh files 
critical to bring-up (usually proprietary bits and radios). Most 
modern versions put this now in “/system/etc” in the normal 
system.img of the OS. In Android 4.3+, Sepolicy files used 
at startup are here (usually OK for most security as /system, 
boot-up, /proc, /dev, etc. files are what you care about at this 
point). 
Oceus Networks Inc. 
10
Key Init binary starts 
 Init binary controls startup plus some other embedded 
functions like helping “vold” and in Android 4.3+, turning 
SEpolicy to “enforcing”. Vendors like Samsung and LG may 
incorporate custom initializations and checks prior to booting 
certain code. 
 
 Init starts the basic init.rc file which includes the imports for 
the next stage “.rc” files. Upon import (which may be 
chained through multiple “.rc” files), it immediately has the 
same startup and capabilities as the base init.rc. 
 How is this relevant? If having issues with init.rc or trouble 
finding something which is starting up, it might be in the Init 
binary and not in the runtime scripts. 
Oceus Networks Inc. 
11
Basic Timing functions in init.rc 
import – pulls in the other init.xxx.rc files that will be run/running to control 
startup 
on early-init - start ueventd and any forks 
on init - startup actions like /sys properties, partition mounts, and symlinks 
on fs - partition mounts, chmod operations, yaffs handling in older devices 
on post-fs - chmod and chown of proc and cache 
on post-fs-data - permissions for sensors, radios, GPS, NFC, etc. 
on boot - first actions (permissions for /sys and /dev files, setprops) 
on post-boot - not normally used, but items that happen 
on nonencrypted - data is mountable and things relying on /data can now 
begin startup once it is mounted. 
on charger - starts the service for the charging binary 
 
*encryption timings – next slide* 
on property: - normal system properties as triggers. They can be used to 
start scripts, continue running scripts, binaries, or change port functions 
(init.usb.rc files and adbd related services are good examples of this) 
Oceus Networks Inc. 
12
Service classes of Init 
 class core – Always started first and cannot be shut down 
without serious consequences in most cases 
 class main – Responsible for services like telephony, radios, 
critical sensors. Many can be restarted or paused at certain 
times, but only if absolutely required 
 class late-start – Happens right before the full system 
boots and starts becoming available to the user. Stuff that 
relies on /data will usually have to start here to avoid issues 
on encryption 
Oceus Networks Inc. 
13
Service Properties of Init 
oneshot - runs once and turns off. This is 
especially used for shell scripts. 
disabled - only can be directly called. It will not 
be started when the class it belongs to is started. 
user - uid such as root, shell, system to be run as 
or that it belongs to 
group - gid, usually shell, system, root, log 
Oceus Networks Inc. 
14
Decryption and my friend Vold 
 Encryption “on” property timings and recognition is controlled by vold and its 
interaction with the Init binary. 
 
 After vold has done the mountings for system, boot, etc. then, init tells it to 
mount /data. Vold sees that /data is encrypted and then starts the decryption 
sequence 
 
 Decryption in Android is somewhat unique, a fake /data partition is mounted and 
only class main and class core services are run during this time – more on that in 
later slides. 
 
 That fake /data partition allows a “mini system boot” and a special mode to pop 
up asking for those keys. It then uses keystore and some functions to verify your 
pin/password, which then releases the encryption keys to be used for decryption. 
Most of the time, these are at the end of the data partition, but can be inside of 
media abstracted disks like in the Nexus devices. 
 Vold gets the action and performs the decryption while the Init binary causes 
another small boot where some of class main gets restarted and a half-reboot 
occurs (see boot animation again, but shorter). Basically, restarting where “on 
nonencrypted” left off. 
Oceus Networks Inc. 
15
Encryption properties and Timings 
USED IN DECRYPTION 
ro.crypto.state = "encrypted" => was unable to mount data, now usually there is a 
system flag to indicate this in more modern android versions. 
vold.decrypt = 1 => framework begins booting a tmpfs /data disk 
CRYPTO_ENCRYPTION_IN_PROGRESS flag from cryptfs ran by vold = 0 
"cryptfs cryptocomplete" result to vold command listener 
"cryptfs checkpw" result to vold command listener 
ro.crypto.fs_crypto_blkdev = 0 => success in decryption 
vold.decrypt=trigger_reset_main => restarts all services in main 
vold.post_fs_data_done = 0 => start post_fs-data 
vold.decrypt=trigger_load_persist_props => loads props 
vold.decrypt=trigger_post_fs_data => sets on post-fs-data 
vold.post_fs_data_done = 1 => all is well on mounting the proper /data image 
vold.decrypt=trigger_restart_framework => starts class main and late_start 
USED IN ENCRYPTION 
vold.decrypt=trigger_shutdown_framework => reset class late_start and main 
unmounts /data 
vold.decrypt=trigger_restart_min_framework => starts class main services 
vold.encrypt_progress = 0 => starting to encrypt and 
CRYPT_ENCRYPTION_IN_PROGRESS 0x2 
vold.encrypt_progress = 1 => encryption is done and system will be rebooted 
Oceus Networks Inc. 
16
17 Oceus Networks Inc.
Run a Script on Boot 
on property:dev.bootcomplete=1 
start bootstart 
service bootstart /system/bin/sh /system/bin/bootscript.sh 
class late_start 
user root 
group root 
disabled 
oneshot 
Oceus Networks Inc. 
18
Write your own init.rc 
Top of init.cm.rc 
import init.su.rc 
Full init.superuser.rc 
# su daemon 
service su_daemon /system/xbin/su --daemon 
oneshot 
on property:persist.sys.root_access=0 
stop su_daemon 
on property:persist.sys.root_access=2 
stop su_daemon 
on property:persist.sys.root_access=1 
start su_daemon 
on property:persist.sys.root_access=3 
start su_daemon 
Oceus Networks Inc. 
19
Tools 
Android Kitchen (linux) 
Lots of tools, but has auto-split and reassemble 
with correct memory spots. 
https://github.com/dsixda/Android-Kitchen 
Perl and Python scripts (linux) 
Check goo.im/devs/childofthehorn/tools 
AOSP (tree) in /device/vendor/rootdir 
Be sure to modify your “.mk” make files to include 
any new “.rc” files 
Oceus Networks Inc. 
20
Special Thanks!!! 
Dees Troy – Ethan 
CyanogenMod 
source.android.com 
Oceus Networks Inc. Internal

More Related Content

PPT
Android booting sequece and setup and debugging
PPT
Learning AOSP - Android Linux Device Driver
PDF
Jagan Teki - U-boot from scratch
PDF
Explore Android Internals
PPT
Learning AOSP - Android Booting Process
PDF
Android Storage - Vold
PDF
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
PPTX
Android service, aidl - day 1
Android booting sequece and setup and debugging
Learning AOSP - Android Linux Device Driver
Jagan Teki - U-boot from scratch
Explore Android Internals
Learning AOSP - Android Booting Process
Android Storage - Vold
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
Android service, aidl - day 1

What's hot (20)

PPTX
Why Progressive Web Apps For WordPress - WordCamp Finland
PDF
Low Level View of Android System Architecture
PDF
Android's HIDL: Treble in the HAL
PDF
Scheduling in Android
PDF
Camera2 API, SHIM, and HAL 3.2 in Android 5.1
PDF
Android Binder IPC for Linux
PDF
Introduction to Android Window System
PDF
Embedded Android : System Development - Part IV (Android System Services)
ODP
Inter-process communication of Android
PDF
Embedded Android : System Development - Part IV
PDF
Android for Embedded Linux Developers
PDF
Embedded Android : System Development - Part II (Linux device drivers)
PDF
Introduction to Kotlin coroutines
PDF
Understanding the Android System Server
ODP
Q4.11: Porting Android to new Platforms
PDF
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
ODP
Android crash debugging
PDF
Embedded Android : System Development - Part I
PDF
eBPF Trace from Kernel to Userspace
PPTX
Android bootup process
Why Progressive Web Apps For WordPress - WordCamp Finland
Low Level View of Android System Architecture
Android's HIDL: Treble in the HAL
Scheduling in Android
Camera2 API, SHIM, and HAL 3.2 in Android 5.1
Android Binder IPC for Linux
Introduction to Android Window System
Embedded Android : System Development - Part IV (Android System Services)
Inter-process communication of Android
Embedded Android : System Development - Part IV
Android for Embedded Linux Developers
Embedded Android : System Development - Part II (Linux device drivers)
Introduction to Kotlin coroutines
Understanding the Android System Server
Q4.11: Porting Android to new Platforms
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Android crash debugging
Embedded Android : System Development - Part I
eBPF Trace from Kernel to Userspace
Android bootup process

Viewers also liked (7)

PDF
Big Trouble in Little Networks
PDF
Init of Android
PDF
Booting Android: bootloaders, fastboot and boot images
PDF
An Introduction to Android Internals
PPTX
Fast-paced Introduction to Android Internals
PDF
Embedded Android Workshop with Nougat
PDF
안드로이드 스터디 Jni 발표 자료 Rev05 송형주
Big Trouble in Little Networks
Init of Android
Booting Android: bootloaders, fastboot and boot images
An Introduction to Android Internals
Fast-paced Introduction to Android Internals
Embedded Android Workshop with Nougat
안드로이드 스터디 Jni 발표 자료 Rev05 송형주

Similar to Timings of Init : Android Ramdisks for the Practical Hacker (20)

ODP
Joxean Koret - Database Security Paradise [Rooted CON 2011]
PPTX
Android Booting Sequence
KEY
the NML project
PPT
Joanna Rutkowska Subverting Vista Kernel
PDF
Your first dive into systemd!
PPT
Ch04 system administration
PPTX
Linux startup
PDF
Android_Malware_IOAsis_2014_Analysis.pdf
PDF
snortinstallguide
PDF
Android memory analysis Debug slides.pdf
PDF
Linux kernel booting
PPT
Slim Server Theory
PPTX
Hands-On iOS Application Penetraion Testing.pptx
ODP
System Imager.20051215
PPTX
Teensy Programming for Everyone
DOCX
Backtrack Manual Part4
PPT
Linux Kernel Development
PDF
Hardening solaris
PPTX
introduction to computer Linux essential.pptx
Joxean Koret - Database Security Paradise [Rooted CON 2011]
Android Booting Sequence
the NML project
Joanna Rutkowska Subverting Vista Kernel
Your first dive into systemd!
Ch04 system administration
Linux startup
Android_Malware_IOAsis_2014_Analysis.pdf
snortinstallguide
Android memory analysis Debug slides.pdf
Linux kernel booting
Slim Server Theory
Hands-On iOS Application Penetraion Testing.pptx
System Imager.20051215
Teensy Programming for Everyone
Backtrack Manual Part4
Linux Kernel Development
Hardening solaris
introduction to computer Linux essential.pptx

More from Stacy Devino (7)

PDF
IoT with Firebase : IoT DevFest Phoenix 2018
PDF
Beautiful text spread your wings with Spannables
PPTX
Async task, threads, pools, and executors oh my!
PPTX
Intro to Android : Making your first App!
PDF
RetroFit by Square - GDG Dallas 06/09/16
PDF
Big Trouble in Little Networks, new and improved
PPTX
WWC 3D printing basics with stacy devino
IoT with Firebase : IoT DevFest Phoenix 2018
Beautiful text spread your wings with Spannables
Async task, threads, pools, and executors oh my!
Intro to Android : Making your first App!
RetroFit by Square - GDG Dallas 06/09/16
Big Trouble in Little Networks, new and improved
WWC 3D printing basics with stacy devino

Recently uploaded (20)

PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Welding lecture in detail for understanding
PPTX
Geodesy 1.pptx...............................................
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
Digital Logic Computer Design lecture notes
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
DOCX
573137875-Attendance-Management-System-original
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
Foundation to blockchain - A guide to Blockchain Tech
Welding lecture in detail for understanding
Geodesy 1.pptx...............................................
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Model Code of Practice - Construction Work - 21102022 .pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Operating System & Kernel Study Guide-1 - converted.pdf
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Lecture Notes Electrical Wiring System Components
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Digital Logic Computer Design lecture notes
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Strings in CPP - Strings in C++ are sequences of characters used to store and...
573137875-Attendance-Management-System-original
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Arduino robotics embedded978-1-4302-3184-4.pdf
UNIT 4 Total Quality Management .pptx
bas. eng. economics group 4 presentation 1.pptx

Timings of Init : Android Ramdisks for the Practical Hacker

  • 1. Timings of Init Android Ramdisks for the practical hacker Big Android BBQ - October 2014 Oceus Networks Inc. Internal
  • 2. Who Am I? Stacy Wylie (Devino) Username: childofthehorn (Rootzwiki / XDA-developers / IRC / Github) 27 years old, soon to be 28 Yay! Principal Software Engineer at Oceus Networks Partner of OpenBrite LLC, an OSHW / OSS company, creators of the LEDgoes / BriteBlox product line Oceus Networks Inc. 2
  • 3. What is it and where? Boot Image or Recovery Image (boot.img / recovery.img) contains two pieces:  Kernel (zImage) Ramdisk / Bootdisk / Rootdisk Without it, the kernel doesn't know what to do or how to start the OS. Oceus Networks Inc. 3
  • 4. Ramdisk / Init in the Boot Sequence Oceus Networks Inc. 4 CHIP BOOT BOOTLOADER / UBOOT KERNEL RAMDISK / BOOTDISK Chip Supplier and Vendor controlled code (usually) $$$
  • 5. Android vs. Linux Ramdisks  Most Linux Distros use initrd (vs. custom initd in Android)  Linux kills off its ramdisk after main OS boot;  Android keeps the ramdisk active in memory (will appear in / at runtime)  Android core services continue running, controlled by the init.rc scripts  Android Ramdisk + Kernel makes its own mini OS (see Team Win Recovery Project or Clockwork Mod) Oceus Networks Inc. 5
  • 6. FROM HELL ! Oceus Networks Inc. *devil wears no pants
  • 7. What was the Problem? The current state of init.rc scripts did not account for larger encryption keys or decryption that would take longer. This was a problem because the current state of initialization had the system and radios initializing separately with no checks. THIS IS NORMAL! Fixing required lots of time and careful monitoring of kernel messages and such from the serial terminal Oceus Networks Inc. 7
  • 8. Nexus 5 Ramdisk Example (CM) Body text here Oceus Networks Inc. 8
  • 9. Key Init binary starts  Init binary controls startup plus some other embedded functions like helping “vold” and in Android 4.3+, turning SEpolicy to “enforcing”. Vendors like Samsung and LG may incorporate custom initializations and checks prior to booting certain code.   Init starts the basic init.rc file which includes the imports for the next stage “.rc” files. Upon import (which may be chained through multiple “.rc” files), it immediately has the same startup and capabilities as the base init.rc.  How is this relevant? If having issues with init.rc or trouble finding something which is starting up, it might be in the Init binary and not in the runtime scripts. Oceus Networks Inc. 9
  • 10. Directories  SBIN – Dedicated SBIN for binaries that may need to exist early in boot sequence or outside of the OS reach (usually executables)   BIN – Maps and links to “/system/bin”. Good place to put .ko files for insmod and .sh files that shouldn't go in “/” of the ramdisk.   “/” - Maps to “/” and contains init.rc files plus .sh files critical to bring-up (usually proprietary bits and radios). Most modern versions put this now in “/system/etc” in the normal system.img of the OS. In Android 4.3+, Sepolicy files used at startup are here (usually OK for most security as /system, boot-up, /proc, /dev, etc. files are what you care about at this point). Oceus Networks Inc. 10
  • 11. Key Init binary starts  Init binary controls startup plus some other embedded functions like helping “vold” and in Android 4.3+, turning SEpolicy to “enforcing”. Vendors like Samsung and LG may incorporate custom initializations and checks prior to booting certain code.   Init starts the basic init.rc file which includes the imports for the next stage “.rc” files. Upon import (which may be chained through multiple “.rc” files), it immediately has the same startup and capabilities as the base init.rc.  How is this relevant? If having issues with init.rc or trouble finding something which is starting up, it might be in the Init binary and not in the runtime scripts. Oceus Networks Inc. 11
  • 12. Basic Timing functions in init.rc import – pulls in the other init.xxx.rc files that will be run/running to control startup on early-init - start ueventd and any forks on init - startup actions like /sys properties, partition mounts, and symlinks on fs - partition mounts, chmod operations, yaffs handling in older devices on post-fs - chmod and chown of proc and cache on post-fs-data - permissions for sensors, radios, GPS, NFC, etc. on boot - first actions (permissions for /sys and /dev files, setprops) on post-boot - not normally used, but items that happen on nonencrypted - data is mountable and things relying on /data can now begin startup once it is mounted. on charger - starts the service for the charging binary  *encryption timings – next slide* on property: - normal system properties as triggers. They can be used to start scripts, continue running scripts, binaries, or change port functions (init.usb.rc files and adbd related services are good examples of this) Oceus Networks Inc. 12
  • 13. Service classes of Init  class core – Always started first and cannot be shut down without serious consequences in most cases  class main – Responsible for services like telephony, radios, critical sensors. Many can be restarted or paused at certain times, but only if absolutely required  class late-start – Happens right before the full system boots and starts becoming available to the user. Stuff that relies on /data will usually have to start here to avoid issues on encryption Oceus Networks Inc. 13
  • 14. Service Properties of Init oneshot - runs once and turns off. This is especially used for shell scripts. disabled - only can be directly called. It will not be started when the class it belongs to is started. user - uid such as root, shell, system to be run as or that it belongs to group - gid, usually shell, system, root, log Oceus Networks Inc. 14
  • 15. Decryption and my friend Vold  Encryption “on” property timings and recognition is controlled by vold and its interaction with the Init binary.   After vold has done the mountings for system, boot, etc. then, init tells it to mount /data. Vold sees that /data is encrypted and then starts the decryption sequence   Decryption in Android is somewhat unique, a fake /data partition is mounted and only class main and class core services are run during this time – more on that in later slides.   That fake /data partition allows a “mini system boot” and a special mode to pop up asking for those keys. It then uses keystore and some functions to verify your pin/password, which then releases the encryption keys to be used for decryption. Most of the time, these are at the end of the data partition, but can be inside of media abstracted disks like in the Nexus devices.  Vold gets the action and performs the decryption while the Init binary causes another small boot where some of class main gets restarted and a half-reboot occurs (see boot animation again, but shorter). Basically, restarting where “on nonencrypted” left off. Oceus Networks Inc. 15
  • 16. Encryption properties and Timings USED IN DECRYPTION ro.crypto.state = "encrypted" => was unable to mount data, now usually there is a system flag to indicate this in more modern android versions. vold.decrypt = 1 => framework begins booting a tmpfs /data disk CRYPTO_ENCRYPTION_IN_PROGRESS flag from cryptfs ran by vold = 0 "cryptfs cryptocomplete" result to vold command listener "cryptfs checkpw" result to vold command listener ro.crypto.fs_crypto_blkdev = 0 => success in decryption vold.decrypt=trigger_reset_main => restarts all services in main vold.post_fs_data_done = 0 => start post_fs-data vold.decrypt=trigger_load_persist_props => loads props vold.decrypt=trigger_post_fs_data => sets on post-fs-data vold.post_fs_data_done = 1 => all is well on mounting the proper /data image vold.decrypt=trigger_restart_framework => starts class main and late_start USED IN ENCRYPTION vold.decrypt=trigger_shutdown_framework => reset class late_start and main unmounts /data vold.decrypt=trigger_restart_min_framework => starts class main services vold.encrypt_progress = 0 => starting to encrypt and CRYPT_ENCRYPTION_IN_PROGRESS 0x2 vold.encrypt_progress = 1 => encryption is done and system will be rebooted Oceus Networks Inc. 16
  • 18. Run a Script on Boot on property:dev.bootcomplete=1 start bootstart service bootstart /system/bin/sh /system/bin/bootscript.sh class late_start user root group root disabled oneshot Oceus Networks Inc. 18
  • 19. Write your own init.rc Top of init.cm.rc import init.su.rc Full init.superuser.rc # su daemon service su_daemon /system/xbin/su --daemon oneshot on property:persist.sys.root_access=0 stop su_daemon on property:persist.sys.root_access=2 stop su_daemon on property:persist.sys.root_access=1 start su_daemon on property:persist.sys.root_access=3 start su_daemon Oceus Networks Inc. 19
  • 20. Tools Android Kitchen (linux) Lots of tools, but has auto-split and reassemble with correct memory spots. https://github.com/dsixda/Android-Kitchen Perl and Python scripts (linux) Check goo.im/devs/childofthehorn/tools AOSP (tree) in /device/vendor/rootdir Be sure to modify your “.mk” make files to include any new “.rc” files Oceus Networks Inc. 20
  • 21. Special Thanks!!! Dees Troy – Ethan CyanogenMod source.android.com Oceus Networks Inc. Internal