summaryrefslogtreecommitdiffstats
path: root/libcutils/android_reboot.c
Commit message (Collapse)AuthorAgeFilesLines
* libcutils: fix rw FS remount check issueHong-Mei Li2014-06-021-1/+1
| | | | | | | | | | | | | | | | In some condition, some of FS would set disable_roll_forward option. In this case, when we do power off or reboot, the power down progress would stuck at android_reboot for 360 sec. The reason is, remount_ro_done function check key word "rw" to determine whether all the read-write FS has been remounted as read-only FS. Unfortunately, it takes disable_roll_forward as a rw flag too by mistake, so the check would always fail, until reach 360 sec threshold. The patch would match "rw," from mount options, this can avoid the issue successfully. Change-Id: I409f9dc88c9ee5cf049615ea9dcccaf195b6bc5a Signed-off-by: Hong-Mei Li <a21834@motorola.com>
* libcutils: UNUSED argument warningsMark Salyzyn2014-01-271-1/+3
| | | | | | (cherry picked from commit ba02cd1e9bccee9b112ccbee06bc204381b5a215) Change-Id: Ie427d481298af8d911bb2b157ebba30954335354
* Merge commit '536dea9d61a032e64bbe584a97463c6638ead009' into HEADThe Android Open Source Project2013-11-221-5/+2
|\ | | | | | | Change-Id: I5c469a4b738629d99d721cad7ded02d6c35f56d5
| * Make init handle rebootsNick Kralevich2013-04-231-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Replace __reboot call with syscallPavel Chupin2013-11-211-1/+2
|/ | | | | | | __reboot is hidden for 64-bits and should be hidden on others Change-Id: Ib6435269aac7fa726e49cc02f8f76d2be2875bc6 Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
* Try to unmount writable filesystems when rebootingKen Sumrall2011-03-101-0/+134
Ext4 filesystems like to be unmounted before rebooting. The Android system doesn't have a traditional Linux init setup, and shutting down the system was not much more than calling sync(2) and reboot(2). This adds a new function to libcutils called android_reboot(). By default, it calls sync() and then remounts all writable filesystems as read-only and marks them clean. There is a flag parameter in which the caller can ask for sync() not to be called, or to not remount the filesystems as read-only. Then it will call reboot(2) as directed by the other parameters. This change also updates adb, init and toolbox to call the new android_reboot() function. Fixes bugs 3350709 and 3495575. Change-Id: I16d71ffce3134310d7a260f61ec6f4dd204124a7