generic: 6.1, 6.6: replace Airoha EN8811H PHY driver with upstream
[openwrt/openwrt.git] / scripts / mkits-zyxel-fit.sh
1 #!/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
6 usage() {
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
15 OUTPUT="$1"; shift
16 FILE="$1"; shift
17 MODELS="$1"; shift
18
19 # Create a default, fully populated DTS file
20 echo "\
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}