-
Notifications
You must be signed in to change notification settings - Fork 50
/
set_official
executable file
·37 lines (28 loc) · 1.04 KB
/
set_official
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Copyright (c) 2014 The CoreOS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
SCRIPT_ROOT=$(dirname $(readlink -f "$0"))
. "${SCRIPT_ROOT}/common.sh" || exit 1
# Script must run inside the chroot
assert_inside_chroot
assert_not_root_user
DEFINE_string board "${DEFAULT_BOARD}" \
"The board to update."
DEFINE_boolean official ${FLAGS_TRUE} \
"Enable (or disable) official key."
# Parse flags
FLAGS "$@" || exit 1
eval set -- "${FLAGS_ARGV}"
switch_to_strict_mode
# set BOARD and BOARD_ROOT
. "${BUILD_LIBRARY_DIR}/toolchain_util.sh"
. "${BUILD_LIBRARY_DIR}/board_options.sh"
if [[ ${FLAGS_official} -eq ${FLAGS_TRUE} ]]; then
sudo mkdir -p "${BOARD_ROOT}/etc/portage/package.use"
sudo_clobber "${BOARD_ROOT}/etc/portage/package.use/official" \
<<<"coreos-base/coreos-au-key official"
else
sudo rm -f "${BOARD_ROOT}/etc/portage/package.use/official"
fi
emerge-${BOARD} --verbose --quiet-build=y --nospinner coreos-base/coreos-au-key