aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mkits-zyxel-fit.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mkits-zyxel-fit.sh')
-rwxr-xr-xscripts/mkits-zyxel-fit.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/mkits-zyxel-fit.sh b/scripts/mkits-zyxel-fit.sh
new file mode 100755
index 0000000000..8ace1941eb
--- /dev/null
+++ b/scripts/mkits-zyxel-fit.sh
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+#
+# Licensed under the terms of the GNU GPL License version 2 or later.
+# Author: David Bauer <mail@david-bauer.net>, based on mkits-zyxel-factory.sh.
+
+usage() {
+ echo "Usage: `basename $0` output file compat-models"
+ exit 1
+}
+
+# We need at least 3 arguments
+[ "$#" -lt 3 ] && usage
+
+# Target output file
+OUTPUT="$1"; shift
+FILE="$1"; shift
+MODELS="$1"; shift
+
+# Create a default, fully populated DTS file
+echo "\
+/dts-v1/;
+
+/ {
+ description = \"Zyxel FIT (Flattened Image Tree)\";
+ compat-models = [${MODELS}];
+ #address-cells = <1>;
+
+ images {
+ firmware {
+ data = /incbin/(\"${FILE}\");
+ type = \"firmware\";
+ compression = \"none\";
+ hash@1 {
+ algo = \"sha1\";
+ };
+ };
+ };
+};" > ${OUTPUT}