Thanks a lot for your explanation. Do you have any pointer for where
in the source I should look for this functionality?
Specifically I have been looking at the source for adb which seems to
call the __reboot syscall with "recovery" as a parameter. But nowhere
in the Android Linux kernel can I see this information being stored
for use by the the bootloader. Also looking at the
bootable/bootloader/legacy, which I assume is the default bootloader,
I am unable to locate where the command to boot into recovery mode is
picked up. Can you point me in the right direction?
Thanks in advance.
/Bjarke
--
Bjarke Freund-Hansen <bjar...@gmail.com>
I was trying to figure out the answer to very similar question a while
back (September 2009, to be precise). I don't remember the precise
things I looked at, but I published it at
http://www.lingnu.com/en/android/68-htcandroidrebootoptions.html. From
the bottom of that page:
> 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.
>
I hope this helps.
Shachar
--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com
I think the thing you are missing is that the boot loader is not (as far
as I know) open source. There is (was - have not looked in quite a
while, and my info might be out of date) an implementation of the
fastboot protocol in the AOSP tree, but that's just the USB protocol for
talking between the boot loader and a PC through a USB cable, not the
boot loader itself.
As such, you can look at what the kernel does in order to leave the mark
for the boot loader to boot into recovery, but not what the boot loader
is doing with this info.
I hope this clears up the confusion (or, make someone correct me, so I
know better :-).