diff mbox

[RFC,1/4] support/scripts: add generic genimage script

Message ID 20170329145120.11863-2-etienne.phelip@savoirfairelinux.com
State Accepted
Headers show

Commit Message

Phelip Etienne March 29, 2017, 2:51 p.m. UTC
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>
---
 support/scripts/genimage.sh | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100755 support/scripts/genimage.sh

Comments

Arnout Vandecappelle March 30, 2017, 10:51 p.m. UTC | #1
On 29-03-17 16:51, Etienne Phelip wrote:
> 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>

 Regards,
 Arnout

> ---
>  support/scripts/genimage.sh | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>  create mode 100755 support/scripts/genimage.sh
> 
> diff --git a/support/scripts/genimage.sh b/support/scripts/genimage.sh
> new file mode 100755
> index 0000000..0ed0e8b
> --- /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}"
>
Thomas Petazzoni April 1, 2017, 1:50 p.m. UTC | #2
Hello,

On Wed, 29 Mar 2017 10:51:17 -0400, Etienne Phelip wrote:
> 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>
> ---
>  support/scripts/genimage.sh | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>  create mode 100755 support/scripts/genimage.sh

Applied to master, thanks.

Thomas
diff mbox

Patch

diff --git a/support/scripts/genimage.sh b/support/scripts/genimage.sh
new file mode 100755
index 0000000..0ed0e8b
--- /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}"