flatcar-scripts/chroot_version_hooks.d/9_board_makeconf_setup
Matt Tennant feb896d363 Upgrade script to insert BOARD_USE into existing make.conf.board_setup files.
The setup_board script now inserts a BOARD_USE value into
/build/<board>/etc/make.conf.board_setup.  This only happens the first
time the board is setup, so this upgrade script inserts that value
for boards that were previously set up.

BUG=chromium-os:20341
TEST=Ran run_chroot_version_hooks in chroot, inspected make.conf.board_setup
files for boards that did and did not have BOARD_USE already set.

Change-Id: I333198a0434076a5e8e50db6affc81ea2076d301
Reviewed-on: http://gerrit.chromium.org/gerrit/7653
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Matt Tennant <mtennant@chromium.org>
2011-09-13 18:03:48 -07:00

25 lines
824 B
Plaintext

# Copyright (c) 2011 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.
# Make sure the BOARD_USE variable is set in make.conf.board_setup.
for board_root in /build/*; do
board=$(basename "${board_root}")
# Make sure this is a real board by looking for emerge-<board>.
emerge_board=$(which emerge-${board} 2>/dev/null || true)
if [ -x "${emerge_board}" ]; then
board_setup="/build/${board}/etc/make.conf.board_setup"
if [ -f "${board_setup}" ] && ! grep -q BOARD_USE "${board_setup}"; then
sudo_append "${board_setup}" << EOF
BOARD_USE="${board}"
EOF
info "Added BOARD_USE to ${board_setup}"
fi
fi
done
info "Chroot upgraded to version 9: Insert BOARD_USE in make.conf.board_setup"
exit 0