[Android][HTC]HTC Android Reboot Command Options

HTC Android Reboot Command Options

 

        Due to a need that came up for us, and since it turned out, at least on IRC, that other people are also looking for an answer, I am documenting the various reboot options available in Android, and in particular, on HTC (and in particular, on the HTC Magic). As far as I can tell, at least some of what iswwritten here will apply to broader audience than just the HTC Magic users, but this is the platform I have tested this on.

How to Reboot the HTC Magic from a Shell Command Line

        The basic command to reboot the device is called "reboot". Merely writing reboot will perform a restart of the device. The command will call "sync" before rebooting the device, but will not unmount the file systems. This is up to you. If a full system is running on the device, this might prove to be slightly difficult, and many people just reboot and hope for the best.

        Keep in mind that the core OS is stored on the system partition, which is typically mounted read only. This means that the worse data corruption that you could possibly inflict by this is fixable by doing a factory wipe of the device.

Power Off and Avoiding the Sync - All Android Devices

        The reboot command can accept two switches. The first is the "-n" switch, which means to not perform a sync before rebooting the device. Use at your own risk. The second switch is "-p", which means to power off the device rather than reboot it. As far as I could tell, if -p is given, the last argument is effectively ignored. Since it is not ignored by the Linux kernel, however, this may not be globally true for all devices.

Reboot Argument - Type of Reboot

        If reboot is run with no argument (with or without the options discussed above), it will simply shut down the Linux kernel, restart the device, and reload the operating system as if the device was just turned on. It is, however, possible to provide an additional argument to reboot, which causes the device to do something else. For the HTC

        Usage:reboot bootloader/recovery/eraseflash/oem-xx

        Magic, these are the available arguments:

Argument
Meaning
Boot Key Sequence
 
bootloader
 After restart, the device loads the bootloader in fastboot mode
 Power + Back
recovery After restart, the device loads the recovery partition
 Power + Home
 eraseflash During restart the device performs a factory wipe
 oem-XX XX are two hexadecimal digits. Special OEM code. Precise meaning unknown


Source for the Information

        The reboot command line is taken from the reboot command source for the open source version, at system/core/toolbox/reboot.c. The "-n" and "-p" options are handled there.

        The argument for reboot is transferred, as is, into the kernel. The meanings provided here are taken from the HTC Magic kernel sources (available from the HTC web site) at arch/arm/mach-msm/pm.c.

from:http://www.lingnu.com/en/android/68-htcandroidrebootoptions.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值