xref: /linux/scripts/mkuboot.sh (revision ae22a94997b8a03dcb3c922857c203246711f9d4)
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3
4#
5# Build U-Boot image when `mkimage' tool is available.
6#
7
8MKIMAGE=$(type -path "${CROSS_COMPILE}mkimage")
9
10if [ -z "${MKIMAGE}" ]; then
11	MKIMAGE=$(type -path mkimage)
12	if [ -z "${MKIMAGE}" ]; then
13		# Doesn't exist
14		echo '"mkimage" command not found - U-Boot images will not be built' >&2
15		exit 1;
16	fi
17fi
18
19# Call "mkimage" to create U-Boot image
20${MKIMAGE} "$@"
21