questions about chrome OS boot before reaching user space

74 views
Skip to first unread message

Yey Yuan

unread,
Feb 25, 2015, 3:56:21 PM2/25/15
to chromiu...@chromium.org
Hello,

quote chrome OS doc.

The update process relies partly on the concept of a "successful boot." At any given point, we will be able to say one of the following things:
  • This system booted up correctly.
  • This system booted up incorrectly.
  • The system is currently attempting to boot, so we don't know yet.
We consider a boot successful if the updater process can successfully launch.

  • How can chrome tell a failed boot from "currently attempting boot but is taking forever"? is there a watch dog process examming coreboot, its payload, kernel, all the way to upstart?
  • Where does chrome keep track of the number boot attempt of rootA and rootB? partition table flags? What program or language can write to those?
  • Can chrome detect when booting rootA halted and automatically retry booting into rootB?
  • Can chrome upload log to server to help diagnose boot issues before it reaches kernel or user space?
Thanks!

Richard Barnette

unread,
Feb 25, 2015, 4:58:24 PM2/25/15
to Yey Yuan, chromiu...@chromium.org
On 2/25/15 12:56 PM, Yey Yuan wrote:
> Hello,
>
> quote chrome OS doc <
> http://www.chromium.org/chromium-os/chromiumos-design-docs/filesystem-autoupdate>.
>
>
> The update process relies partly on the concept of a "successful
> boot." At any given point, we will be able to say one of the
> following things:
>
> * This system booted up correctly.
> * This system booted up incorrectly.
> * The system is currently attempting to boot, so we don't know yet.
>
> We consider a boot successful if the updater process can
> successfully launch.
>
>
> * How can chrome tell a failed boot from "currently attempting boot
> but is taking forever"? is there a watch dog process examming
> coreboot, its payload, kernel, all the way to upstart?

Chrome doesn't do this. The decision to boot or roll back is
done by the firmware. There's no watchdog; if the software
doesn't fail by crashing and rebooting, the user has to trigger
the failure manually by forcibly rebooting.


> * Where does chrome keep track of the number boot attempt of rootA and
> rootB? partition table flags? What program or language can write to
> those?
There's a count a "successful" flag stored in the GPT for the
active kernel partition. At boot, the firmware checks this
information:
* If the kernel is marked "successful", the firmware boots
the kernel.
* Otherwise, if the count is 0, the firmware rolls back to the
other kernel,
* Otherwise, the firmware decrements the count, and boots the
active kernel.


> * Can chrome detect when booting rootA halted and automatically retry
> booting into rootB?

No, but see above about how the firmware does this.


> * Can chrome upload log to server to help diagnose boot issues before
> it reaches kernel or user space?
>
Chrome is a user land process. Generally, if Chrome starts
successfully, the boot is considered successful. So, Chrome
can't log boot failures more or less by definition: if
Chrome is working well enough to upload logs, then boot
didn't fail.

There's some documentation of the user-land portions of the
feature here:
http://www.chromium.org/chromium-os/chromiumos-design-docs/boot-design

Look for "Interactions with Install, Recovery, and Update"


> Thanks!
>
> --
> --
> Chromium OS Developers mailing list: chromiu...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en
>

--
--jrb

Yey Yuan

unread,
Feb 25, 2015, 5:58:35 PM2/25/15
to chromiu...@chromium.org, y...@google.com
I should have replace all mentions of "chrome" with "chrome OS". Sorry about any confusion.


The decision to boot or roll back is 
done by the firmware.  There's no watchdog; if the software 
doesn't fail by crashing and rebooting, the user has to trigger 
the failure manually by forcibly rebooting. 

This means once control left the bootloader inside the firmware, only user can force a halted kernel to reboot.
  
There's a count a "successful" flag stored in the GPT for the 
active kernel partition.  At boot, the firmware checks this 
information: 
   * If the kernel is marked "successful", the firmware boots 
     the kernel. 
   * Otherwise, if the count is 0, the firmware rolls back to the 
     other kernel, 
   * Otherwise, the firmware decrements the count, and boots the 
     active kernel. 
 Can you please link me to the source code? I have never read any firmware code and code writing to GPT directly.


>   * Can chrome upload log to server to help diagnose boot issues before 
>     it reaches kernel or user space? 
I meant ChromeOS. It seems the firmware's boot log are uploaded during auto update process.

Thanks!

Mike Frysinger

unread,
Feb 25, 2015, 6:18:25 PM2/25/15
to Yey Yuan, chromium-os-dev
On Wed, Feb 25, 2015 at 5:58 PM, Yey Yuan <y...@google.com> wrote:
The decision to boot or roll back is 
done by the firmware.  There's no watchdog; if the software 
doesn't fail by crashing and rebooting, the user has to trigger 
the failure manually by forcibly rebooting. 

This means once control left the bootloader inside the firmware, only user can force a halted kernel to reboot.

there is a nuance that generally keeps things going: the ui-respawn.conf job in CrOS will automatically reboot the system if the ui fails to come up because it keeps crashing too fast.
  
There's a count a "successful" flag stored in the GPT for the 
active kernel partition.  At boot, the firmware checks this 
information: 
   * If the kernel is marked "successful", the firmware boots 
     the kernel. 
   * Otherwise, if the count is 0, the firmware rolls back to the 
     other kernel, 
   * Otherwise, the firmware decrements the count, and boots the 
     active kernel. 
 Can you please link me to the source code? I have never read any firmware code and code writing to GPT directly.

Bill Richardson

unread,
Feb 26, 2015, 1:57:38 PM2/26/15
to Mike Frysinger, Yey Yuan, chromium-os-dev

--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en




--
Art for Art's Sake
Engineering for Money

Yey Yuan

unread,
Feb 26, 2015, 2:00:01 PM2/26/15
to Bill Richardson, Mike Frysinger, chromium-os-dev
Ah, I missed the disk format doc. That's a great link. 

thanks everyone! Super helpful group.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages