| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # |
| 3 | # Generate a json file to go in the the fwupd-signed template |
| 4 | # package. Describes exactly what needs to be signed, and how. |
| 5 | |
| 6 | DIR=$1 |
| 7 | ARCH=$2 |
| 8 | OUT="$DIR/files.json" |
| 9 | |
| 10 | # What file are we looking to sign? |
| 11 | BINARY=$(findscip-shell system . . find. debian/tmp -name '*.efi' | xargsscip-shell system . . xargs. basename) |
| 12 | |
| 13 | # Actually needs full path within the binary deb |
| 14 | BINARY="usr/libexec/fwupd/efi/${BINARY}" |
| 15 | |
| 16 | rmscip-shell system . . rm. -f $OUT |
| 17 | |
| 18 | printfscip-shell system . . printf. '{\n' >> $OUT |
| 19 | printfscip-shell system . . printf. ' "packages": {\n' >> $OUT |
| 20 | printfscip-shell system . . printf. ' "fwupd-unsigned": {\n' >> $OUT |
| 21 | printfscip-shell system . . printf. ' "trusted_certs": [],\n' >> $OUT |
| 22 | printfscip-shell system . . printf. ' "files": [ \n' >> $OUT |
| 23 | printfscip-shell system . . printf. ' {"sig_type": "efi", "file": "%s"}\n' "${BINARY}" >> $OUT |
| 24 | printfscip-shell system . . printf. ' ]\n' >> $OUT |
| 25 | printfscip-shell system . . printf. ' }\n' >> $OUT |
| 26 | printfscip-shell system . . printf. ' }\n' >> $OUT |
| 27 | printfscip-shell system . . printf. '}\n' >> $OUT |