xref: /openbmc/linux/scripts/mkuboot.sh (revision b2441318)
11da177e4SLinus Torvalds#!/bin/bash
2b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
31da177e4SLinus Torvalds
41da177e4SLinus Torvalds#
51da177e4SLinus Torvalds# Build U-Boot image when `mkimage' tool is available.
61da177e4SLinus Torvalds#
71da177e4SLinus Torvalds
8f03e1666SUwe kleine-KönigMKIMAGE=$(type -path "${CROSS_COMPILE}mkimage")
91da177e4SLinus Torvalds
101da177e4SLinus Torvaldsif [ -z "${MKIMAGE}" ]; then
118c7e4498SMike Frysinger	MKIMAGE=$(type -path mkimage)
128c7e4498SMike Frysinger	if [ -z "${MKIMAGE}" ]; then
131da177e4SLinus Torvalds		# Doesn't exist
141da177e4SLinus Torvalds		echo '"mkimage" command not found - U-Boot images will not be built' >&2
15bc91c9f3SRoland Stigge		exit 1;
161da177e4SLinus Torvalds	fi
178c7e4498SMike Frysingerfi
181da177e4SLinus Torvalds
191da177e4SLinus Torvalds# Call "mkimage" to create U-Boot image
201da177e4SLinus Torvalds${MKIMAGE} "$@"
21