Gunnar Mills | e822190 | 2017-02-03 15:59:06 -0600 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | help=$'Generate SquashFS image Script |
| 4 | |
| 5 | Generates a SquashFS image from the PNOR image |
| 6 | |
| 7 | usage: generate-squashfs [OPTION] |
| 8 | |
| 9 | Options: |
| 10 | -h, --help Display this help text and exit. |
| 11 | ' |
| 12 | |
Gunnar Mills | 18f7cdb | 2017-02-07 16:44:19 -0600 | [diff] [blame^] | 13 | declare -a partitions=( |
| 14 | "HBB" |
| 15 | "HBEL" |
| 16 | "GUARD" |
| 17 | "HBD" |
| 18 | "DJVPD" |
| 19 | "MVPD" |
| 20 | "CVPD" |
| 21 | "HBI" |
| 22 | "SBE" |
| 23 | "HCODE" |
| 24 | "HBRT" |
| 25 | "PAYLOAD" |
| 26 | "TEST" |
| 27 | "TESTRO" |
| 28 | "HBBL" |
| 29 | "GLOBAL" |
| 30 | "RINGOVD" |
| 31 | "SBKT" |
| 32 | "OCC" |
| 33 | ) |
| 34 | |
Gunnar Mills | e822190 | 2017-02-03 15:59:06 -0600 | [diff] [blame] | 35 | while [[ $# -gt 0 ]]; do |
| 36 | key="$1" |
| 37 | case $key in |
| 38 | -h|--help) |
| 39 | echo "$help" |
| 40 | exit |
| 41 | ;; |
| 42 | *) |
| 43 | echo "Unknown option $1. Display available options with -h or --help" |
| 44 | exit |
| 45 | ;; |
| 46 | esac |
| 47 | done |
Gunnar Mills | 18f7cdb | 2017-02-07 16:44:19 -0600 | [diff] [blame^] | 48 | |
| 49 | for partition in "${partitions[@]}"; do |
| 50 | echo "Reading ${partition}..." |
| 51 | pflash_cmd="pflash --partition=${partition} --read=/tmp/${partition}" |
| 52 | ${pflash_cmd} || exit 1 |
| 53 | done |