New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 717887 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

factory: Verify GPT records before shutdown / reboot.

Project Member Reported by hungte@chromium.org, May 3 2017

Issue description

For issues like b/37881360, sometimes it's confusing for why the device failed to boot with GPT entries becoming zero.

I think maybe we should add a param for Reboot/Shutdown tests as "check_gpt" default to True.

If check_gpt is true, check if the GPT records on internal storage (or rootdev -s) still looks bootable (prio > 0), maybe also log pri/try/success entries.
 

Comment 1 by hungte@chromium.org, May 18 2017

Owner: petershih@chromium.org
Status: Assigned (was: Untriaged)
Assign shen-en as some random starting issues.

Comment 2 by hungte@chromium.org, Jul 14 2017

Cc: -youcheng@chromium.org -yhong@chromium.org -phoenixshen@chromium.org chromeos-factory-eng@google.com
Chromium OS supports three ways to boot to kernel:

1. x86 legacy BIOS
   --> read MBR of each driver, and execute it
2. x86 EFI BIOS
   --> find EFI System Partition, and run bootx64.efi
3. Chrome OS Devices
   --> find GPT partitions with ChromeOS Kernel Type GUID
   --> should only have two kernels with this type
   --> boot to the recent/valid one

We're focusing only on the third way. And there are several reasons causing a boot failure in this way:
1. Invalid GPT table
2. Wrong GPT partitions:
   * Kernel partitions should be with ChromeOS Kernel Type GUID
   * Should have more than 1 kernel partitions
   * Priority/Success/Tries attributes should be correct.
3. dmverity error
4. firmware/kernel/driver error

It would be good if we can catch 1~3 errors automatically. However, the dmverity error is hard (or impossible?) to be tackled when running under that kernel. Since when we're reading that block, dmverity will block it and halt/reboot the machine.

So, we're focusing on the GPT-related errors. Several things we can do here:
1. Check GPT table is valid
2. Check there're more than one ChromeOS kernel partitions
3. Exactly one of the kernel partition is with successful=1. This is the active kernel partition.

In most cases, we're not changing active kernel, so we can do one more check:
4. Check the active kernel partition is with the highest priority

These checks can be implemented in 'shutdown' pytest, as a pre-shutdown check.
Project Member

Comment 4 by bugdroid1@chromium.org, Sep 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/b0b7aee5e34a88b3c7a92734cfbe54a4f91d9131

commit b0b7aee5e34a88b3c7a92734cfbe54a4f91d9131
Author: Shen-En Shih <petershih@chromium.org>
Date: Fri Sep 22 05:36:24 2017

shutdown: Check partition layout before shutdown

Check if the partition layout looks good for the next boot
before shutdown or reboot.

BUG= chromium:717887 
TEST=make test
TEST=manually test

Change-Id: I82fdedb25bdf3a33b3e5d4bf1dc37b2e261588ee
Reviewed-on: https://chromium-review.googlesource.com/674585
Commit-Ready: Shen-En Shih <petershih@chromium.org>
Tested-by: Shen-En Shih <petershih@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/b0b7aee5e34a88b3c7a92734cfbe54a4f91d9131/py/test/pytests/shutdown/shutdown.py
[modify] https://crrev.com/b0b7aee5e34a88b3c7a92734cfbe54a4f91d9131/py/utils/sys_utils.py

Status: Fixed (was: Assigned)

Comment 6 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Comment 7 by dchan@chromium.org, Jan 23 2018

Status: Fixed (was: Archived)

Sign in to add a comment