mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-10 22:46:58 +02:00
This shortens the standard boilerplate for finding and sourcing shell function libraries for build_image, mod_image_for_test.sh and mod_image_for_recovery.sh. As a side effect of the change, both mod_image_for_test.sh and mod_image_for_recovery.sh will now restart inside the chroot if invoked from outside; this is consistent with the pre-existing behavior of build_image. BUG=None TEST=run the three scripts, from both inside and outside the chroot Change-Id: Idd91cbee323346a871b49deea31a76875f5ee3c4 Reviewed-on: http://gerrit.chromium.org/gerrit/4675 Tested-by: Richard Barnette <jrbarnette@chromium.org> Reviewed-by: Vince Laviano <vlaviano@chromium.org>
22 lines
754 B
Bash
22 lines
754 B
Bash
# 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.
|
|
|
|
# Common library file to be sourced by build_image,
|
|
# mod_image_for_test.sh, and mod_image_for_recovery.sh. This
|
|
# file ensures that library source files needed by all the scripts
|
|
# are included once, and also takes care of certain bookeeping tasks
|
|
# common to all the scripts.
|
|
|
|
# SCRIPT_ROOT must be set prior to sourcing this file
|
|
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
|
|
|
# All scripts using this file must be run inside the chroot.
|
|
restart_in_chroot_if_needed "$@"
|
|
|
|
INSTALLER_ROOT=/usr/lib/installer
|
|
. "${INSTALLER_ROOT}/chromeos-common.sh" || exit 1
|
|
|
|
locate_gpt
|
|
get_default_board
|