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

Issue 711200 link

Starred by 1 user

Issue metadata

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

Blocking:
issue 707172



Sign in to add a comment

factory: stable device ID.

Project Member Reported by hungte@chromium.org, Apr 13 2017

Issue description

Currently the device Id in ChromeOS factory software is a mess, especially that when partner has duplicated eMMC, there'll be lots of problems. We want to revise device ID & reimage id implementation, and get a stable & trusted identifier.

reference: go/cros-factory-device-id
 

Comment 1 by hungte@chromium.org, Apr 13 2017

Works here:

- Create a 'device_id' script that can generate ID.
- The script must be shell script so we can run it in factory installer
- device ID should probably still live in /var/factory
- Revise how Instalog and Testlog finds device ID so they use same approach
- In dut_upload, generate the folder structure, so /var/log is synced by device id, while /var/factory should be synced to device_id/reimage_id.
     dut_upload/${device_id}/log
     dut_upload/${device_id}/${reimage_id}/factory
- Add a service so we can do something, for example clearing cache files, or prompt to re-setup station when device id is changed.

Comment 2 by hungte@chromium.org, Apr 13 2017

plus one, we may need a new "device name" as readable name on Overlord (and any other places).

Comment 3 by hungte@chromium.org, Apr 13 2017

and review which location is better for device ID - /var/factory/.device_id, or LOG_ROOT/device_id, and the relation between reimageid and installation id (from testlog).

Comment 4 by hungte@chromium.org, Apr 13 2017

some related CL here - https://chromium-review.googlesource.com/#/c/476454/


Comment 5 by hungte@chromium.org, Apr 13 2017

currently toolkit installer also will try to write device_id. We should change that to write to a different file - which should be the device name file (since device id should be always automatically generated).

Comment 6 by hungte@chromium.org, Apr 13 2017

Cc: youcheng@chromium.org yhong@chromium.org
chuntsen/yhong/youcheng,

Any one of you is available and interested in working on this? May need a doc to clarify and define all device ids.

Comment 7 by hungte@chromium.org, Apr 13 2017

Blocking: 707172
We might want to use the same value for Testlog's "stationName" and Overlord's "device name".

Comment 9 by hungte@chromium.org, Apr 19 2017

Should we just use whatever the storage SN provides, or should we use a better uniformed format, for example md5sum(storage SN)?

Comment 10 by yhong@chromium.org, Apr 19 2017

Currently I am working on probe framework integration with HWID and AVL so I don't think I am free to help this bug now.
Project Member

Comment 11 by bugdroid1@chromium.org, Jun 15 2017

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

commit 0b2375dae212e28edc8ba8f30f8bec625246986d
Author: Hung-Te Lin <hungte@chromium.org>
Date: Thu Jun 15 14:07:39 2017

bin: Add 'device_id' to abstract device id generation.

The first step to create stable device ID.

BUG= chromium:711200 
TEST=device_id

Change-Id: I63f62822b8feead8e4c56354ef411cad83f6e7ce
Reviewed-on: https://chromium-review.googlesource.com/476454
Commit-Ready: Pi-Hsun Shih <pihsun@chromium.org>
Tested-by: Pi-Hsun Shih <pihsun@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[add] https://crrev.com/0b2375dae212e28edc8ba8f30f8bec625246986d/bin/device_id
[add] https://crrev.com/0b2375dae212e28edc8ba8f30f8bec625246986d/sh/device_id.sh

Project Member

Comment 12 by bugdroid1@chromium.org, Jun 16 2017

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

commit fe2215893a4faa5b655d50da6f3a43adb08cdee6
Author: Peter Shih <pihsun@chromium.org>
Date: Fri Jun 16 08:49:26 2017

installer: Remove --device-id.

Since the device_id is now a unique id that is generated on every boot,
manually override device_id doesn't work anymore. We may replace this by
a "device label" in the future.

BUG= chromium:711200 
TEST=make test

Change-Id: I53c904652d770afb085ade00a67bfd35c3fe5c57
Reviewed-on: https://chromium-review.googlesource.com/536557
Commit-Ready: Pi-Hsun Shih <pihsun@chromium.org>
Tested-by: Pi-Hsun Shih <pihsun@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/fe2215893a4faa5b655d50da6f3a43adb08cdee6/py/toolkit/installer.py

Project Member

Comment 13 by bugdroid1@chromium.org, Jun 26 2017

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

commit c3b4e0d8dce4688578f81e677e3fa6f90471266e
Author: Hung-Te Lin <hungte@chromium.org>
Date: Mon Jun 26 07:17:41 2017

init: Add a goofy.d/device service 'device_id.sh'

A new service that will track and provision right device ID when system
reboots.

BUG= chromium:711200 , chromium:711118 
TEST=manually booted on device.

Change-Id: I0dfaa45bce50a48b9f70d199a422e570b3043cba
Reviewed-on: https://chromium-review.googlesource.com/476455
Commit-Ready: Pi-Hsun Shih <pihsun@chromium.org>
Tested-by: Pi-Hsun Shih <pihsun@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[add] https://crrev.com/c3b4e0d8dce4688578f81e677e3fa6f90471266e/init/goofy.d/device/device_id/README.md
[add] https://crrev.com/c3b4e0d8dce4688578f81e677e3fa6f90471266e/init/goofy.d/device/device_id/cr50-cache.sh
[add] https://crrev.com/c3b4e0d8dce4688578f81e677e3fa6f90471266e/init/goofy.d/device/device_id.sh

Project Member

Comment 14 by bugdroid1@chromium.org, Jun 26 2017

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

commit 7311aef4b7e959b8f2949cd4fc407c60fe70f903
Author: Peter Shih <pihsun@chromium.org>
Date: Mon Jun 26 07:17:41 2017

Change device_id used in event_log.

A stable device id is now generated by init/goofy.d/device/device_id.sh,
use it in event_log.

BUG= chromium:711200 
TEST=make test

Change-Id: Iad35635bb4e68e55f18558ba8f447796d956bf90
Reviewed-on: https://chromium-review.googlesource.com/518663
Commit-Ready: Pi-Hsun Shih <pihsun@chromium.org>
Tested-by: Pi-Hsun Shih <pihsun@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Chun-ta Lin <itspeter@chromium.org>

[modify] https://crrev.com/7311aef4b7e959b8f2949cd4fc407c60fe70f903/py/test/event_log.py
[modify] https://crrev.com/7311aef4b7e959b8f2949cd4fc407c60fe70f903/py/test/event_log_unittest.py

Project Member

Comment 15 by bugdroid1@chromium.org, Jun 26 2017

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

commit 5803ad64c5e680ed8cf3780615e9a7d99b52eb17
Author: Peter Shih <pihsun@chromium.org>
Date: Mon Jun 26 07:17:42 2017

Change device_id used in testlog.

A stable device id is now generated by init/goofy.d/device/device_id.sh,
use it in testlog.

Also remove event_log.GetDeviceId(), and replace all usage.

Also fix some lint errors.

BUG= chromium:711200 
TEST=make test

Change-Id: I0a18bfe8a5f95789cfd38c02cec7e5c90c400965
Reviewed-on: https://chromium-review.googlesource.com/538412
Commit-Ready: Pi-Hsun Shih <pihsun@chromium.org>
Tested-by: Pi-Hsun Shih <pihsun@chromium.org>
Reviewed-by: Chun-ta Lin <itspeter@chromium.org>

[modify] https://crrev.com/5803ad64c5e680ed8cf3780615e9a7d99b52eb17/py/test/event_log.py
[modify] https://crrev.com/5803ad64c5e680ed8cf3780615e9a7d99b52eb17/py/goofy/plugins/system_log_manager.py
[modify] https://crrev.com/5803ad64c5e680ed8cf3780615e9a7d99b52eb17/py/goofy/plugins/system_log_manager_unittest.py
[modify] https://crrev.com/5803ad64c5e680ed8cf3780615e9a7d99b52eb17/py/test/pytests/gps/gps.py
[modify] https://crrev.com/5803ad64c5e680ed8cf3780615e9a7d99b52eb17/py/test/event_log_unittest.py
[modify] https://crrev.com/5803ad64c5e680ed8cf3780615e9a7d99b52eb17/py/test/testlog_goofy_unittest.py
[modify] https://crrev.com/5803ad64c5e680ed8cf3780615e9a7d99b52eb17/py/test/pytests/bluetooth.py
[modify] https://crrev.com/5803ad64c5e680ed8cf3780615e9a7d99b52eb17/py/test/pytests/rf_radiated/rf_radiated.py
[modify] https://crrev.com/5803ad64c5e680ed8cf3780615e9a7d99b52eb17/py/test/testlog_goofy.py
[modify] https://crrev.com/5803ad64c5e680ed8cf3780615e9a7d99b52eb17/py/testlog/testlog.py
[modify] https://crrev.com/5803ad64c5e680ed8cf3780615e9a7d99b52eb17/py/test/pytests/wifi_throughput.py

Project Member

Comment 16 by bugdroid1@chromium.org, Jul 4 2017

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

commit df6ee85f6b6dc7f77bfbd4b65c6f73150dff3af6
Author: Peter Shih <pihsun@chromium.org>
Date: Tue Jul 04 04:44:34 2017

ghost.py: Fix device id.

Fix the device id for ghost.py is still from event_log.DEVICE_ID_PATH,
which is removed in CL:538412

BUG= chromium:711200 
TEST=manually

Change-Id: Ic8995610e1516e3bbba6bf9f662c88a1fa0fc94f
Reviewed-on: https://chromium-review.googlesource.com/558853
Commit-Ready: Pi-Hsun Shih <pihsun@chromium.org>
Tested-by: Pi-Hsun Shih <pihsun@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/df6ee85f6b6dc7f77bfbd4b65c6f73150dff3af6/py/tools/ghost.py

Cc: -youcheng@chromium.org -yhong@chromium.org -chuntsen@chromium.org -kitching@chromium.org -stimim@chromium.org -littlecvr@chromium.org chromeos-factory-eng@google.com
Owner: pihsun@chromium.org
Is this all done?
Status: Fixed (was: Untriaged)
Yes it is.
Description: Show this description

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

Status: Archived (was: Fixed)

Sign in to add a comment