From feb896d363d212c95feb67a0e0de24e88104a708 Mon Sep 17 00:00:00 2001 From: Matt Tennant Date: Tue, 13 Sep 2011 15:01:29 -0700 Subject: [PATCH] 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//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 Tested-by: Matt Tennant --- chroot_version_hooks.d/9_board_makeconf_setup | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 chroot_version_hooks.d/9_board_makeconf_setup diff --git a/chroot_version_hooks.d/9_board_makeconf_setup b/chroot_version_hooks.d/9_board_makeconf_setup new file mode 100644 index 0000000000..c8b724727b --- /dev/null +++ b/chroot_version_hooks.d/9_board_makeconf_setup @@ -0,0 +1,24 @@ +# 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-. + 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 +