3 # This script creates the h100sums.h and h300sums.h files for fwpatcher.
5 # It expects a file tree with scrambled and descrambled
20 # It also expects the bootloader binaries in the current directory:
25 $orig_path = "~/orig-firmware";
34 open FILE
, ">h${model}sums.h" or die "Can't open h${model}sums.h";
36 print FILE
"/* Checksums of firmwares for ihp_$model */\n";
37 print FILE
"/* order: unpatched, patched */\n\n";
40 foreach("1.63eu","1.63k", "1.63us", "1.65eu","1.65k", "1.65us",
41 "1.66eu", "1.66k", "1.66us", "1.66jp") {
42 `../mkboot $orig_path/h1xx/$_/ihp_$model.bin bootloader-h$model.bin ihp_$model.bin`;
43 `../scramble -iriver ihp_$model.bin ihp_$model.hex`;
44 $origsum = `md5sum $orig_path/h1xx/$_/ihp_$model.hex`;
46 ($os, $or) = split / /, $origsum;
47 $sum = `md5sum ihp_$model.hex`;
49 ($s, $r) = split / /, $sum;
50 print FILE
"/* $_ */\n";
51 print FILE
"{\"$os\", \"$s\"},\n";
54 foreach("1.28eu", "1.28k", "1.28jp", "1.29eu", "1.29k", "1.29jp",
56 `../mkboot -h300 $orig_path/h3xx/$_/H$model.bin bootloader-h$model.bin H$model.bin`;
57 `../scramble -iriver H$model.bin H$model.hex`;
58 $origsum = `md5sum $orig_path/h3xx/$_/H$model.hex`;
60 ($os, $or) = split / /, $origsum;
61 $sum = `md5sum H$model.hex`;
63 ($s, $r) = split / /, $sum;
64 print FILE
"/* $_ */\n";
65 print FILE
"{\"$os\", \"$s\"},\n";