blob: ee88886424cb60aaf8067ded2882b47289520327 [file] [edit]
#!/bin/sh
# Copyright 2016 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
UI_MACHINE_INFO_FILE=/run/session_manager/machine-info
# Just continue if one of the commands below fails.
set +e
# Grab full VPD data from dump_vpd_log, which contains the machine
# serial number and echo group code.
dump_vpd_log --full --stdout > "${UI_MACHINE_INFO_FILE}"
# Grab the disk serial number from the udev database.
ROOTDEV=$(rootdev -s -d || true)
udevadm info --query=property --name="${ROOTDEV}" |
awk -F = '/^ID_SERIAL=/ { print "\"root_disk_serial_number\"=\"" $2 "\""}' \
>> "${UI_MACHINE_INFO_FILE}"