Reduce amount of scripts in root directory
This commit is contained in:
parent
d8fe1b211c
commit
acef5262eb
4 changed files with 23 additions and 9 deletions
13
scripts/fix-rom.sh
Executable file
13
scripts/fix-rom.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
setbyte() {
|
||||
printf "\x$3"|dd status=none seek="$2" bs=1 count=1 conv=notrunc of="$1"
|
||||
}
|
||||
|
||||
[ -n "$1" ] || exit 1
|
||||
|
||||
setbyte "$1" 2 $(stat -c "%s" "$1"|awk '{printf("%02x",$1/512)}')
|
||||
|
||||
setbyte "$1" 41 00
|
||||
checksum=$(xxd -p -c 1 "$1"|sed 's/^/0x/'|awk '{s+=$1} END {printf("%02x\n",256-s%256)}')
|
||||
setbyte "$1" 41 "$checksum"
|
Loading…
Add table
Add a link
Reference in a new issue