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