mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-21 21:51:57 +02:00
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>
This commit is contained in:
parent
4460ea782f
commit
feb896d363
24
chroot_version_hooks.d/9_board_makeconf_setup
Normal file
24
chroot_version_hooks.d/9_board_makeconf_setup
Normal file
@ -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-<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
|
||||
|
Loading…
x
Reference in New Issue
Block a user