blob: 8ace1941ebf50c1bdafabdcdcf9e5ae10de7645f [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#!/usr/bin/env bash
2#
3# Licensed under the terms of the GNU GPL License version 2 or later.
4# Author: David Bauer <mail@david-bauer.net>, based on mkits-zyxel-factory.sh.
5
6usage() {
7 echo "Usage: `basename $0` output file compat-models"
8 exit 1
9}
10
11# We need at least 3 arguments
12[ "$#" -lt 3 ] && usage
13
14# Target output file
15OUTPUT="$1"; shift
16FILE="$1"; shift
17MODELS="$1"; shift
18
19# Create a default, fully populated DTS file
20echo "\
21/dts-v1/;
22
23/ {
24 description = \"Zyxel FIT (Flattened Image Tree)\";
25 compat-models = [${MODELS}];
26 #address-cells = <1>;
27
28 images {
29 firmware {
30 data = /incbin/(\"${FILE}\");
31 type = \"firmware\";
32 compression = \"none\";
33 hash@1 {
34 algo = \"sha1\";
35 };
36 };
37 };
38};" > ${OUTPUT}