New issue
Advanced search Search tips

Issue 609661 link

Starred by 4 users

Issue metadata

Status: Started
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 578069



Sign in to add a comment

chromeos-setgoodkernel should not open and read every block device

Project Member Reported by gwendal@chromium.org, May 6 2016

Issue description

At the end of boot, when update-engine assesses it is valid, it calls chromeos-setgoodkernel to mark the boot as valid.

chromeos-setgoodkernel call 'cgpt find' for finding the current boot device. [https://chromium.googlesource.com/chromiumos/platform2/+/master/installer/chromeos-setgoodkernel#36]

This opens all block devices including the weird ones, like mmcblk0bootX and mmcblk0rpmb. 

We could be smarter, like doing $(rootdev -s) using partition number - 1.
 
Now if weird block devices had weird names or some other way to highlight themselves, as opposed to disguising as regular block devices, then maybe we wouldn't have had thousands of these: https://www.google.com/search?q=mmcblk0rpmb+i%2Fo+error
Blocking: 578069
Project Member

Comment 3 by bugdroid1@chromium.org, May 11 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/7427641541259f4adb27fc0dd74d3f3d35f66707

commit 7427641541259f4adb27fc0dd74d3f3d35f66707
Author: Gwendal Grignou <gwendal@chromium.org>
Date: Fri May 06 04:05:10 2016

installer: Look for kernel partition in root device first.

To prevent reading mmcblk0rmpb or mmcblk0rootX (these are rather
expensive operation because we have to switch eMMC hardware partition),
check first if the kernel partition the machine booted from is part of
the root device. If not, try all the blocks are before.

While there, add "${...}" around variable names.

BUG=chromium:609661
TEST=Check with sh -x that the flow is correct.
Tamper rootdev and check that alternate patch is taken.

Change-Id: I7884441f5e06e7366bb698f5d8f7c5f31c5b1e68
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/342844
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/7427641541259f4adb27fc0dd74d3f3d35f66707/installer/chromeos-setgoodkernel

You started fixing this bug over two years ago. Are you still working on it? 

Sign in to add a comment