Merge "Ensure all init commands are documented."
This commit is contained in:
commit
bf684148e2
1 changed files with 77 additions and 30 deletions
107
init/readme.txt
107
init/readme.txt
|
|
@ -137,32 +137,9 @@ boot
|
||||||
Commands
|
Commands
|
||||||
--------
|
--------
|
||||||
|
|
||||||
exec [ <seclabel> [ <user> [ <group> ]* ] ] -- <command> [ <argument> ]*
|
bootchart_init
|
||||||
Fork and execute command with the given arguments. The command starts
|
Start bootcharting if configured (see below).
|
||||||
after "--" so that an optional security context, user, and supplementary
|
This is included in the default init.rc.
|
||||||
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.
|
|
||||||
|
|
||||||
chmod <octal-mode> <path>
|
chmod <octal-mode> <path>
|
||||||
Change file access permissions.
|
Change file access permissions.
|
||||||
|
|
@ -175,9 +152,18 @@ class_start <serviceclass>
|
||||||
not already running.
|
not already running.
|
||||||
|
|
||||||
class_stop <serviceclass>
|
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.
|
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>
|
domainname <name>
|
||||||
Set the domain name.
|
Set the domain name.
|
||||||
|
|
||||||
|
|
@ -190,9 +176,41 @@ enable <servicename>
|
||||||
on property:ro.boot.myfancyhardware=1
|
on property:ro.boot.myfancyhardware=1
|
||||||
enable my_fancy_service_for_my_fancy_hardware
|
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>
|
insmod <path>
|
||||||
Install the module at <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>
|
loglevel <level>
|
||||||
Sets the kernel log level to level. Properties are expanded within <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
|
owned by the root user and root group. If provided, the mode, owner and group
|
||||||
will be updated if the directory exists already.
|
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>]
|
mount <type> <device> <dir> [ <flag> ]* [<options>]
|
||||||
Attempt to mount the named device at the directory <dir>
|
Attempt to mount the named device at the directory <dir>
|
||||||
<device> may be of the form mtd@name to specify a mtd block
|
<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
|
<options> include "barrier=1", "noauto_da_alloc", "discard", ... as
|
||||||
a comma separated string, eg: barrier=1,noauto_da_alloc
|
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> ]*
|
restorecon <path> [ <path> ]*
|
||||||
Restore the file named by <path> to the security context specified
|
Restore the file named by <path> to the security context specified
|
||||||
in the file_contexts configuration.
|
in the file_contexts configuration.
|
||||||
|
|
@ -220,6 +248,14 @@ restorecon_recursive <path> [ <path> ]*
|
||||||
Recursively restore the directory tree named by <path> to the
|
Recursively restore the directory tree named by <path> to the
|
||||||
security contexts specified in the file_contexts configuration.
|
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>
|
setcon <seclabel>
|
||||||
Set the current process security context to the specified string.
|
Set the current process security context to the specified string.
|
||||||
This is typically only used from early-init to set the init context
|
This is typically only used from early-init to set the init context
|
||||||
|
|
@ -238,6 +274,9 @@ start <service>
|
||||||
stop <service>
|
stop <service>
|
||||||
Stop a service from running if it is currently running.
|
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>
|
symlink <target> <path>
|
||||||
Create a symbolic link at <path> with the value <target>
|
Create a symbolic link at <path> with the value <target>
|
||||||
|
|
||||||
|
|
@ -248,10 +287,18 @@ trigger <event>
|
||||||
Trigger an event. Used to queue an action from another
|
Trigger an event. Used to queue an action from another
|
||||||
action.
|
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> ]
|
wait <path> [ <timeout> ]
|
||||||
Poll for the existence of the given file and return when found,
|
Poll for the existence of the given file and return when found,
|
||||||
or the timeout has been reached. If timeout is not specified it
|
or the timeout has been reached. If timeout is not specified it
|
||||||
currently defaults to five seconds.
|
currently defaults to five seconds.
|
||||||
|
|
||||||
write <path> <content>
|
write <path> <content>
|
||||||
Open the file at <path> and write a string to it with write(2).
|
Open the file at <path> and write a string to it with write(2).
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue