1
0

mkits-zyxel-fit.sh 727 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. description = \"Zyxel FIT (Flattened Image Tree)\";
  20. compat-models = [${MODELS}];
  21. #address-cells = <1>;
  22. images {
  23. firmware {
  24. data = /incbin/(\"${FILE}\");
  25. type = \"firmware\";
  26. compression = \"none\";
  27. hash@1 {
  28. algo = \"sha1\";
  29. };
  30. };
  31. };
  32. };" > ${OUTPUT}