Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91a3be54 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Ensure all init commands are documented.

Change-Id: I21ef4d88b33337093396e14d792e1ff1fe0bfa17
parent b721e8f4
Loading
Loading
Loading
Loading
+77 −30
Original line number Diff line number Diff line
@@ -137,32 +137,9 @@ boot
Commands
--------

exec [ <seclabel> [ <user> [ <group> ]* ] ] -- <command> [ <argument> ]*
   Fork and execute command with the given arguments. The command starts
   after "--" so that an optional security context, user, and supplementary
   groups can be provided. No other commands will be run until this one
   finishes.

execonce <path> [ <argument> ]*
   Fork and execute a program (<path>).  This will block until
   the program completes execution.  This command can be run at most
   once during init's lifetime. Subsequent invocations are ignored.
   It is best to avoid execonce as unlike the builtin commands, it runs
   the risk of getting init "stuck".

export <name> <value>
   Set the environment variable <name> equal to <value> in the
   global environment (which will be inherited by all processes
   started after this command is executed)

ifup <interface>
   Bring the network interface <interface> online.

import <filename>
   Parse an init config file, extending the current configuration.

hostname <name>
   Set the host name.
bootchart_init
   Start bootcharting if configured (see below).
   This is included in the default init.rc.

chmod <octal-mode> <path>
   Change file access permissions.
@@ -175,9 +152,18 @@ class_start <serviceclass>
   not already running.

class_stop <serviceclass>
   Stop all services of the specified class if they are
   Stop and disable all services of the specified class if they are
   currently running.

class_reset <serviceclass>
   Stop all services of the specified class if they are
   currently running, without disabling them. They can be restarted
   later using class_start.

copy <src> <dst>
   Copies a file. Similar to write, but useful for binary/large
   amounts of data.

domainname <name>
   Set the domain name.

@@ -190,9 +176,41 @@ enable <servicename>
     on property:ro.boot.myfancyhardware=1
        enable my_fancy_service_for_my_fancy_hardware

exec [ <seclabel> [ <user> [ <group> ]* ] ] -- <command> [ <argument> ]*
   Fork and execute command with the given arguments. The command starts
   after "--" so that an optional security context, user, and supplementary
   groups can be provided. No other commands will be run until this one
   finishes.

execonce <path> [ <argument> ]*
   Use exec instead. This command will be removed after existing callers have
   moved to exec.

export <name> <value>
   Set the environment variable <name> equal to <value> in the
   global environment (which will be inherited by all processes
   started after this command is executed)

hostname <name>
   Set the host name.

ifup <interface>
   Bring the network interface <interface> online.

import <filename>
   Parse an init config file, extending the current configuration.

insmod <path>
   Install the module at <path>

load_all_props
   Loads properties from /system, /vendor, et cetera.
   This is included in the default init.rc.

load_persist_props
   Loads persistent properties when /data has been decrypted.
   This is included in the default init.rc.

loglevel <level>
   Sets the kernel log level to level. Properties are expanded within <level>.

@@ -202,6 +220,9 @@ mkdir <path> [mode] [owner] [group]
   owned by the root user and root group. If provided, the mode, owner and group
   will be updated if the directory exists already.

mount_all <fstab>
   Calls fs_mgr_mount_all on the given fs_mgr-format fstab.

mount <type> <device> <dir> [ <flag> ]* [<options>]
   Attempt to mount the named device at the directory <dir>
   <device> may be of the form mtd@name to specify a mtd block
@@ -210,6 +231,13 @@ mount <type> <device> <dir> [ <flag> ]* [<options>]
   <options> include "barrier=1", "noauto_da_alloc", "discard", ... as
   a comma separated string, eg: barrier=1,noauto_da_alloc

powerctl
   Internal implementation detail used to respond to changes to the
   "sys.powerctl" system property, used to implement rebooting.

restart <service>
   Like stop, but doesn't disable the service.

restorecon <path> [ <path> ]*
   Restore the file named by <path> to the security context specified
   in the file_contexts configuration.
@@ -220,6 +248,14 @@ restorecon_recursive <path> [ <path> ]*
   Recursively restore the directory tree named by <path> to the
   security contexts specified in the file_contexts configuration.

rm <path>
   Calls unlink(2) on the given path. You might want to
   use "exec -- rm ..." instead (provided the system partition is
   already mounted).

rmdir <path>
   Calls rmdir(2) on the given path.

setcon <seclabel>
   Set the current process security context to the specified string.
   This is typically only used from early-init to set the init context
@@ -238,6 +274,9 @@ start <service>
stop <service>
   Stop a service from running if it is currently running.

swapon_all <fstab>
   Calls fs_mgr_swapon_all on the given fstab file.

symlink <target> <path>
   Create a symbolic link at <path> with the value <target>

@@ -248,6 +287,14 @@ trigger <event>
   Trigger an event.  Used to queue an action from another
   action.

verity_load_state
   Internal implementation detail used to load dm-verity state.

verity_update_state <mount_point>
   Internal implementation detail used to update dm-verity state and
   set the partition.<mount_point>.verified properties used by adb remount
   because fs_mgr can't set them directly itself.

wait <path> [ <timeout> ]
   Poll for the existence of the given file and return when found,
   or the timeout has been reached. If timeout is not specified it