mkits-zyxel-fit-filogic.sh 780 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. usage() {
  6. echo "Usage: `basename $0` output file compat-models"
  7. exit 1
  8. }
  9. # We need at least 3 arguments
  10. [ "$#" -lt 3 ] && usage
  11. # Target output file
  12. OUTPUT="$1"; shift
  13. FILE="$1"; shift
  14. MODELS="$1"; shift
  15. # Create a default, fully populated DTS file
  16. echo "\
  17. /dts-v1/;
  18. / {
  19. timestamp = <0x684090B4>;
  20. description = \"Zyxel FIT (Flattened Image Tree)\";
  21. compat-models = [${MODELS}];
  22. fw_version = \"9.99(###.1)\";
  23. #address-cells = <1>;
  24. images {
  25. ubi {
  26. data = /incbin/(\"${FILE}\");
  27. type = \"firmware\";
  28. compression = \"none\";
  29. hash {
  30. algo = \"sha256\";
  31. };
  32. };
  33. };
  34. };" > ${OUTPUT}