diff options
author | Phelip Etienne <etienne.phelip@savoirfairelinux.com> | 2017-03-29 10:51:17 -0400 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-04-01 15:50:22 +0200 |
commit | c9062dcdf6079b89cfb2a737eddabd6878141fb6 (patch) | |
tree | 1a6e78235d39b33b623f466240086c4fb0fe67ac /support/scripts/genimage.sh | |
parent | 5d05319c1b6931e81c4aa07ffe2f2f11699227fc (diff) | |
download | buildroot-c9062dcdf6079b89cfb2a737eddabd6878141fb6.tar.gz buildroot-c9062dcdf6079b89cfb2a737eddabd6878141fb6.zip |
support/scripts: add generic genimage script
This script is a wrapper for the genimage tool used by most boards.
The board postimage script can now call this script instead of invoking
genimage command themselves.
Signed-off-by: Etienne Phelip <etienne.phelip@savoirfairelinux.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'support/scripts/genimage.sh')
-rwxr-xr-x | support/scripts/genimage.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/support/scripts/genimage.sh b/support/scripts/genimage.sh new file mode 100755 index 0000000000..0ed0e8bcc2 --- /dev/null +++ b/support/scripts/genimage.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +die() { + echo "Error: $@" >&2 + exit 1 +} + +GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" + +while getopts c: OPT ; do + case "${OPT}" in + c) GENIMAGE_CFG="${OPTARG}";; + :) die "option '${OPTARG}' expects a mandatory argument\n";; + \?) die "unknown option '${OPTARG}'\n";; + esac +done + +[ -n "${GENIMAGE_CFG}" ] || die "Missing argument" + +rm -rf "${GENIMAGE_TMP}" + +genimage \ + --rootpath "${TARGET_DIR}" \ + --tmppath "${GENIMAGE_TMP}" \ + --inputpath "${BINARIES_DIR}" \ + --outputpath "${BINARIES_DIR}" \ + --config "${GENIMAGE_CFG}" |