blob: b0498895c9b2a56b35fb18916f8bcd0a6b3a0f13 [file] [log] [blame]
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
description "Extract Chrome OS machine info for Enterprise enrollment"
author "chromium-os-dev@chromium.org"
# /tmp/machine-info contains the serial number and other information that may
# identify the device. This information is required by OOBE and enterprise
# enrollment, but we don't want it around otherwise for privacy reasons. Thus,
# we generate as long as /home/.shadow/install_attributes.pb is not present.
# That file is created by cryptohome once the device has been
# enterprise-enrolled or been claimed by a local user.
#
# Old versions of Chromium OS (11 and earlier) didn't have the code generating
# install_attributes.pb in cryptohome when claiming the device, so the check
# would fail for users upgrading from devices that have been setup originally
# on these versions. Our best-effort attmept at catching this is to also check
# for /var/lib/whitelist/owner.key. Note that this may not work perfectly once
# we have support for transitioning ownership.
start on starting boot-services
# This is a pre-start so that this task will run before the "start" stanza
# of the "starting" task that triggers it.
pre-start script
if [ -e /var/lib/enterprise_serial_number_recovery -o \
\( ! -e /home/.shadow/install_attributes.pb -a \
! -e /var/lib/whitelist/owner.key \) ]; then
MACHINE_INFO=/tmp/machine-info
touch $MACHINE_INFO
chmod 0644 $MACHINE_INFO
# We need serial numbers for enterprise enrollment process.
# Dump full information in the VPD.
dump_vpd_log --full --stdout >> $MACHINE_INFO
fi
end script