162306a36Sopenharmony_ci#!/bin/bash
262306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
362306a36Sopenharmony_ci
462306a36Sopenharmony_ci#
562306a36Sopenharmony_ci# Build U-Boot image when `mkimage' tool is available.
662306a36Sopenharmony_ci#
762306a36Sopenharmony_ci
862306a36Sopenharmony_ciMKIMAGE=$(type -path "${CROSS_COMPILE}mkimage")
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ciif [ -z "${MKIMAGE}" ]; then
1162306a36Sopenharmony_ci	MKIMAGE=$(type -path mkimage)
1262306a36Sopenharmony_ci	if [ -z "${MKIMAGE}" ]; then
1362306a36Sopenharmony_ci		# Doesn't exist
1462306a36Sopenharmony_ci		echo '"mkimage" command not found - U-Boot images will not be built' >&2
1562306a36Sopenharmony_ci		exit 1;
1662306a36Sopenharmony_ci	fi
1762306a36Sopenharmony_cifi
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci# Call "mkimage" to create U-Boot image
2062306a36Sopenharmony_ci${MKIMAGE} "$@"
21