mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 22:16:58 +02:00
fix(test_build_root): Switch to using test_image_content
Start using the more complete test_image_content test for the build root and add the test to the end of build_packages.
This commit is contained in:
parent
b4b7a2e2f8
commit
241d135126
@ -103,7 +103,8 @@ fi
|
|||||||
|
|
||||||
# Check that the build root is sane.
|
# Check that the build root is sane.
|
||||||
if [[ ${skip_test_build_root} -ne 1 ]]; then
|
if [[ ${skip_test_build_root} -ne 1 ]]; then
|
||||||
"${BUILD_LIBRARY_DIR}/test_build_root" --root="${BOARD_ROOT}"
|
info "Checking build root"
|
||||||
|
test_image_content "${BOARD_ROOT}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Hack to fix bug where x86_64 CHOST line gets incorrectly added.
|
# Hack to fix bug where x86_64 CHOST line gets incorrectly added.
|
||||||
|
@ -6,12 +6,13 @@
|
|||||||
|
|
||||||
SCRIPT_ROOT=$(readlink -f $(dirname "$0")/..)
|
SCRIPT_ROOT=$(readlink -f $(dirname "$0")/..)
|
||||||
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
||||||
|
. "${BUILD_LIBRARY_DIR}/test_image_content.sh" || exit 1
|
||||||
|
|
||||||
# We're invoked only by build_image, which runs in the chroot
|
# We're invoked only by build_image, which runs in the chroot
|
||||||
assert_inside_chroot
|
assert_inside_chroot
|
||||||
|
|
||||||
# Flags
|
# Flags
|
||||||
DEFINE_string root "" \
|
DEFINE_string root "${DEFAULT_BOARD+/build/${DEFAULT_BOARD}}" \
|
||||||
"The root file system to check."
|
"The root file system to check."
|
||||||
|
|
||||||
# Parse command line
|
# Parse command line
|
||||||
@ -21,26 +22,8 @@ eval set -- "${FLAGS_ARGV}"
|
|||||||
# Die on any errors
|
# Die on any errors
|
||||||
switch_to_strict_mode
|
switch_to_strict_mode
|
||||||
|
|
||||||
# Check all parts of a pipe
|
if [[ ! -d "$FLAGS_root" ]]; then
|
||||||
set -o pipefail
|
die_notrace "Root FS does not exist ($FLAGS_root)"
|
||||||
|
|
||||||
ROOT="$FLAGS_root"
|
|
||||||
if [[ ! -d "$ROOT" ]]; then
|
|
||||||
die_notrace "Root FS does not exist ($ROOT)"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ROOT_BINARIES=(
|
test_image_content "$FLAGS_root"
|
||||||
/boot/vmlinuz
|
|
||||||
/bin/sed
|
|
||||||
)
|
|
||||||
|
|
||||||
EXITCODE=0
|
|
||||||
for i in "${BINARIES[@]}"; do
|
|
||||||
i="${ROOT}${i}"
|
|
||||||
if ! [[ -f $i ]]; then
|
|
||||||
error "cannot find $i"
|
|
||||||
EXITCODE=1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
exit $EXITCODE
|
|
||||||
|
@ -128,6 +128,7 @@ fi
|
|||||||
# set BOARD and BOARD_ROOT
|
# set BOARD and BOARD_ROOT
|
||||||
. "${BUILD_LIBRARY_DIR}/toolchain_util.sh" || exit 1
|
. "${BUILD_LIBRARY_DIR}/toolchain_util.sh" || exit 1
|
||||||
. "${BUILD_LIBRARY_DIR}/board_options.sh" || exit 1
|
. "${BUILD_LIBRARY_DIR}/board_options.sh" || exit 1
|
||||||
|
. "${BUILD_LIBRARY_DIR}/test_image_content.sh" || exit 1
|
||||||
|
|
||||||
# Setup all the emerge command/flags.
|
# Setup all the emerge command/flags.
|
||||||
EMERGE_FLAGS=( -uDNv --backtrack=30 --select )
|
EMERGE_FLAGS=( -uDNv --backtrack=30 --select )
|
||||||
@ -209,9 +210,11 @@ fi
|
|||||||
info "Merging board packages now"
|
info "Merging board packages now"
|
||||||
sudo -E "${EMERGE_CMD[@]}" "${EMERGE_FLAGS[@]}" "${PACKAGES[@]}"
|
sudo -E "${EMERGE_CMD[@]}" "${EMERGE_FLAGS[@]}" "${PACKAGES[@]}"
|
||||||
|
|
||||||
|
info "Checking build root"
|
||||||
|
test_image_content "${BOARD_ROOT}"
|
||||||
|
|
||||||
# upload packages if enabled
|
# upload packages if enabled
|
||||||
upload_packages
|
upload_packages
|
||||||
|
|
||||||
echo "Builds complete"
|
info "Builds complete"
|
||||||
command_completed
|
command_completed
|
||||||
echo "Done"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user