summaryrefslogtreecommitdiffstats
path: root/init/builtins.c
Commit message (Collapse)AuthorAgeFilesLines
* Add swapon_all to init's builtin commandsKen Sumrall2013-07-091-0/+12
| | | | | | For enabling swap devices found in the fstab file Change-Id: Iec4fd4d208df3d7a161a90d95f8606e8b516334a
* am 372d668a: am 39021a48: am 83ada447: Merge changes Ib54f39fd,I7e36edd8Colin Cross2013-06-251-2/+1
|\ | | | | | | | | | | * commit '372d668a279934ff3b2ec2f07a76fe2f351789d5': init: Retain traditional restart behavior for critical and oneshot services. init: Safely restart services to avoid race conditions.
| * am 83ada447: Merge changes Ib54f39fd,I7e36edd8Colin Cross2013-06-241-2/+1
| |\ | | | | | | | | | | | | | | | * commit '83ada447aed69dfcd0a88e952eced8db1e4d6584': init: Retain traditional restart behavior for critical and oneshot services. init: Safely restart services to avoid race conditions.
| | * Merge changes Ib54f39fd,I7e36edd8Colin Cross2013-06-241-2/+1
| | |\ | | | | | | | | | | | | | | | | | | | | * changes: init: Retain traditional restart behavior for critical and oneshot services. init: Safely restart services to avoid race conditions.
| | | * init: Retain traditional restart behavior for critical and oneshot services.Mike Kasick2012-03-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds an SVC_RESTART state that's used for an explicit "restart" of a running service. This retains the traditional restart behavior for critical and oneshot services (previously altered by 7e36edd8), whereby these services are "simply restarted" instead of counting as a crash (for a critical serivce) or going into the disabled state (for a oneshot service).
* | | | am 43329bc1: am 8a387870: Revert "Reload policy after setting up the data ↵gcondra@google.com2013-05-201-6/+0
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | partition." * commit '43329bc1c99c0f5f3670a8aaab39e54df34819a1': Revert "Reload policy after setting up the data partition."
| * | | Revert "Reload policy after setting up the data partition."repo sync2013-05-171-6/+0
| | | | | | | | | | | | | | | | This reverts commit fee250d27a9c03af1ba439047b976d89563b1887.
* | | | am 63577d92: am fee250d2: Reload policy after setting up the data partition.gcondra@google.com2013-04-301-0/+6
|\ \ \ \ | |/ / / | | | | | | | | | | | | * commit '63577d9280e7919bfb7221030d211b833e66bb1e': Reload policy after setting up the data partition.
| * | | Reload policy after setting up the data partition.repo sync2013-04-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This forces a policy reload + fixcon to deal with dynamically delivered policy changing labels on device nodes. It's implemented as a new keyword in init. Bug: 8702843 Change-Id: I803cf1ecf6ff8318ce25dcc5cda4f292adc9738c
* | | | Make init handle rebootsNick Kralevich2013-04-231-0/+38
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the responsibility for rebooting the system from the reboot command to init. Init is in a better position to take actions to bring the system down cleanly, including making sure filesystems are mounted read-only. The only UIDs which can perform an init triggered reboot are root, system, and shell. Modify the reboot command so that it calls into init to perform the reboot. The reboot command no longer requires CAP_SYS_BOOT. Remove the -n reboot option and code which supports it. Anyone needing to do an unclean shutdown can just do a 'echo c > /proc/sysrq-trigger'. Modify adb so that it calls into init to perform a shutdown. Bug: 8646621 Change-Id: I84c0513acb549720cb0e8c9fcbda0050f5c396f5
* | | fs_mgr: support a unified fstab format.Ken Sumrall2013-02-191-1/+4
|/ / | | | | | | | | | | | | Update fs_mgr to support more flags needed to unify the 3 fstabs currently in android into one. Change-Id: Ie46cea61a5b19882c55098bdd70f39e78fb603be
* | Change setsebool syntax to be consistent with other init built-ins.Stephen Smalley2012-12-131-22/+17
| | | | | | | | | | | | | | | | | | | | Change setsebool syntax from name=value to name value. This is to make it consistent with setprop and similar commands. Update both the init built-in command and the toolbox command for consistency. Change-Id: I2c8e016ba26731c4a2ad4a49ae3b89362bf8f8a8 Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
* | am 7b88a90d: Merge "Remove HAVE_SELINUX guards"Kenny Root2012-10-171-8/+1
|\ \ | | | | | | | | | | | | * commit '7b88a90da2a27e347fc16c14fa577f4ae1ef07fd': Remove HAVE_SELINUX guards
| * | Remove HAVE_SELINUX guardsKenny Root2012-10-161-8/+1
| | | | | | | | | | | | Change-Id: I8272c573b3c5dc663203bafab68fad5e94d89364
* | | am 3af04b71: am 7c386a61: Merge "Extend and document the "wait" command"Jean-Baptiste Queru2012-08-201-2/+4
|\ \ \ | |/ / | | | | | | | | | * commit '3af04b71e51e89af02a1fe526e4fc32dce0100d3': Extend and document the "wait" command
| * | Merge "Extend and document the "wait" command"Jean-Baptiste Queru2012-08-201-2/+4
| |\ \
| | * | Extend and document the "wait" commandPatrick McCormick2012-07-241-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The wait command was currently implemented but undocumented and only used internally. This change adds a second option toi (optionally) override the default timeout of 5 seconds. The wait command can be used to wait for a file to appear during the boot process, for example a disk or other device, and is a better alternative than an unconditional sleep. Change-Id: Ia11d8419c0ea84deec0e1bf5adfca5bc76ff38b7 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
* | | | init: Fix mkdir command when using ISUID or ISGID bitBenoit Goby2012-08-141-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On first boot, the directory is created with root:root ownership and then chowned. chown clears the ISUID and ISGID bits, so we need to chmod the directory again after chown. Change-Id: I02dfe7a19a637678256b4e7cc09e6b5431e6f11e
* | | | Support shared-subtree and bind mount flags.Jeff Sharkey2012-08-141-0/+6
|/ / / | | | | | | | | | | | | Bug: 6925012 Change-Id: Id8d887d17c6b1b2f90cfd1a1de991ccaba730b7d
* | | Merge "Set the SELinux security label on new directories."Jean-Baptiste Queru2012-08-081-16/+2
|\ \ \ | |/ / |/| |
| * | Set the SELinux security label on new directories.Stephen Smalley2012-07-261-16/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Automatically set the SELinux security label on directories created by init.rc. This avoids the need to separately call restorecon on each such directory from the init.rc file. Also restorecon /dev and /dev/socket after initial policy load so that they are labeled correctly before any other dev nodes or sockets are created. Change-Id: If6af6c4887cdead949737cebdd673957e9273ead Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
| * | init: Fix chown and chmod for write-only filesBenoit Goby2012-05-041-2/+13
| | | | | | | | | | | | Change-Id: I570b631ced11ab104aafe7ebfe71bae4e380d8af
| * | init: make chmod/mkdir/chown not follow symlinksGeremy Condra2012-05-021-5/+51
| | | | | | | | | | | | | | | | | | | | | | | | This change brings init's do_chmod, mkdir, and do_chown into line with open's O_NOFOLLOW semantics, causing them to fail when the last element of their target path is a symlink. Change-Id: If00e1a25cfe17ef6f738af4bf0541abd0c1b084b
* | | am 0e9dd90a: Change init to use libfs_mgr to mount filesystems.Ken Sumrall2012-05-011-53/+54
|\ \ \ | | | | | | | | | | | | | | | | * commit '0e9dd90ac336278659477cad0b9e9f1004e2b338': Change init to use libfs_mgr to mount filesystems.
| * | | Change init to use libfs_mgr to mount filesystems.Ken Sumrall2012-05-011-53/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new fs_mgr library moves much of the knowledge of what filesystems to mount into a new fstab.<device> file, and just calls one function to mount all the filesystems. Change-Id: If3db37530a0676000cba3e679db27aca734227e5
* | | | am 64753635: am a02ff986: Merge "init: Add noexec mount option"Colin Cross2012-04-271-0/+1
|\ \ \ \ | |/ / / |/| / / | |/ / | | | * commit '647536359f8ea63330805cb77abbf2f101952daa': init: Add noexec mount option
| * | init: Add noexec mount optionLars Svensson2012-04-231-0/+1
| |/ | | | | | | Change-Id: Ic13d66797a86d38432e79af0c3387ce986d0a19f
* | init: Fix chown and chmod for write-only filesBenoit Goby2012-03-281-2/+13
| | | | | | | | Change-Id: I570b631ced11ab104aafe7ebfe71bae4e380d8af
* | init: make chmod/mkdir/chown not follow symlinksGeremy Condra2012-03-211-5/+51
|/ | | | | | | | This change brings init's do_chmod, mkdir, and do_chown into line with open's O_NOFOLLOW semantics, causing them to fail when the last element of their target path is a symlink. Change-Id: If00e1a25cfe17ef6f738af4bf0541abd0c1b084b
* Extend init and ueventd for SE Android.Stephen Smalley2012-02-011-0/+85
| | | | | | | | | | | | | | | Add SE Android support for init and ueventd. init: - Load policy at boot. - Set the security context for service daemons and their sockets. - New built-in commands: setcon, setenforce, restorecon, setsebool. - New option for services: seclabel. ueventd: - Set the security context for device directories and nodes. Change-Id: I98ed752cde503c94d99dfa5b5a47e3c33db16aac
* init: use init's property expansion code for setprop/writeDima Zavin2012-01-111-28/+16
| | | | | Change-Id: I3c284860cc8d5106ac2b086e62baeb6263873935 Signed-off-by: Dima Zavin <dima@android.com>
* init/cutils: move kernel logging interface to libcutils from initDima Zavin2011-09-021-1/+1
| | | | | Change-Id: Ia0f91b1fcd6cae69d76bf3dd841340958db938a8 Signed-off-by: Dima Zavin <dima@android.com>
* init: make "mkdir" work even when the directory already exists.Chia-chi Yeh2011-07-081-1/+7
| | | | | | | This allows us to change permissions and ownerships of directories in init scripts without adding additional commands. Change-Id: I1815d6015953035251b98f28c0f3efd3c7f25f80
* init: Add support for assigning system properties to system properties in ↵Mike Lockwood2011-06-091-3/+20
| | | | | | | | | | init.rc For example: setprop sys.usb.config $persist.sys.usb.config Change-Id: I7b4e1ed1335906b32621bd96a341b0f94bbee7f5 Signed-off-by: Mike Lockwood <lockwood@android.com>
* init: Fix the init.rc import commandMike Lockwood2011-06-091-5/+0
| | | | | Change-Id: I8a91c3f7d1ca31e137d9043bb7f56e4a44fb63df Signed-off-by: Mike Lockwood <lockwood@android.com>
* init: Add support for writing system property value to a file in init.rcMike Lockwood2011-06-091-1/+17
| | | | | | | | | | | | | | | The write command will write a property value if the value starts with a "$' For example: write /sys/class/android_usb/iSerial $ro.serialno Use double leading '$' if you need to write a string that starts with '$': write /data/foo $$hello to write "$hello" to /data/foo Change-Id: I55431ac7715a5347bb95c3a15aee97c575444dde
* Teach the mount command in init to not consider a wiped partition to be ↵Ken Sumrall2011-05-261-2/+5
| | | | | | encrypted. Change-Id: I3e989f0b81ec35084baddc04e014406f4d90ce04
* Load the persistent properties after decrypting the /data partitionKen Sumrall2011-03-101-1/+10
| | | | | | | | | | | | Fix for bug 3415286. The persistent properties are normally read early in the boot process after /data is mounted. However, for an encrypted system, at that point /data is a tmpfs ramdisk. This change adds a new command to init (load_persist_props) to read the persistent properties, and adds an action to init.rc to load the persistent properties. This action is triggered by setting a property in vold, but that's in a different CL. Change-Id: I74b3057974ee6029c29d956b76fef5566700d471
* Fix for bug 3379244, non-eMMC devices don't start all services.Ken Sumrall2011-02-171-9/+21
| | | | | | | Fix for non-eMMC based devices to properly start the "on nonencrypted" action. Change-Id: I5d2966db352b02f1a1724fb105e1cefc46037e42
* Add the commands rm and rmdir to init.Ken Sumrall2011-01-181-0/+10
| | | | | | | rm only removes a single non-directory directory entry (no -r support) rmdir removes a single empty directory Change-Id: I49702b02ba98a177027b126268c2c2846f968195
* Set a read-only property to indicate if the device is running encrypted.Ken Sumrall2011-01-141-0/+2
| | | | | | | The UI needs to know if the device is running with an encrypted filesystem or now. So set a read-only property at boot to let it know. Change-Id: I753de2d606c975bcbe9946d10fd47558cf357dac
* Changes to init to support encrypted filesystems.Ken Sumrall2010-12-181-1/+51
| | | | | | | | | These are the changes to init and init.rc necessary to support booting with and encrypted /data filesystem. A corresponding change to init.<device>.rc goes along with this change. Change-Id: I0c7e2cc39568358014a82e317735c0eae14dd683
* init: Move uevent handling to an external ueventd processColin Cross2010-04-211-27/+0
| | | | Change-Id: Iea6c56013062ade633a1754f7bcf8cf09b3dedc1
* init: Split parser into generic parser and init parserColin Cross2010-04-211-2/+2
| | | | Change-Id: I451ebc4ff12f2ac660eb533fa10ad561fa25c9dd
* init: Add wait command and mount wait flagColin Cross2010-04-211-3/+20
| | | | Change-Id: I6b4c10f8f246095a7fb7342388ec4f6ff97d5733
* init: Move list and log handling to list.h and log.hColin Cross2010-04-211-0/+1
| | | | Change-Id: I298f575c590d0f28b7ad78747f3ebdbba56b7a27
* init: Handle commands in event queue loopColin Cross2010-04-161-1/+0
| | | | Change-Id: I679059dae43143f3c8f16b68de5694539b699e50
* init: Move prototypes for util.c into util.hColin Cross2010-04-131-0/+1
| | | | Change-Id: I46a91849ce5297eb2597dd6134412f817564ec24
* init: Move parser prototypes to parser.hColin Cross2010-04-131-0/+1
| | | | Change-Id: I31db51eb8e8a33a0bd06b41206bc9f9147d16d41
* am 4833d9f4: init: builtins: trancate target file in do_copyTom Zhu2009-09-301-1/+1
|\ | | | | | | | | | | | | Merge commit '4833d9f4986d6dafacff841beb3bf93172c84bdc' into eclair-plus-aosp * commit '4833d9f4986d6dafacff841beb3bf93172c84bdc': init: builtins: trancate target file in do_copy