-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathchecksum-markdown.sh
executable file
·94 lines (67 loc) · 2.88 KB
/
checksum-markdown.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env bash
set -euo pipefail
##
# YOU. YEAH, YOU.
# This script is not for you.
##
##
# This file will generate checksums of the BIOS files. It requires modern Bash,
# newer than what Apple ships (because of the GPLv3 license). Requires packages
# installed from Homebrew.
#
# RUN THIS FROM YOUR BIOS DIRECTORY!
#
# curl -sSLf https://github.com/skyzyx/rg35xx-garlicos-macos-instructions/raw/main/checksum-markdown.sh | /opt/homebrew/bin/bash | pbcopy
#
# PRINTS TO STANDARD OUT (stdout)! This means you can pipe the output to
# `pbcopy` to copy it to your clipboard.
##
# Available in Bash 4+.
shopt -s globstar
# Cleanup .DS_Store files first
# shellcheck disable=SC2038
gfind . -type f -name .DS_Store | gxargs -I% grm -f "%"
# shellcheck disable=SC2016
cat << EOF
# Appendix: BIOS Checksums
> **IMPORTANT:** These checksums are for the BIOS files only. They do not include the \`scummvm\` directory (which comes with Garlic OS), nor the \`Databases/\` and \`Machines/\` directories that are required for Microsoft MSX emulation.
Most of the BIOS files used for emulation go into this root \`BIOS/\` directory.
These are sorted the way that Bash sorts things — numbers, then UPPER alpha, then lower alpha.
## How to verify checksums
1. With [Homebrew] installed, install the \`coreutils\` package. This will give you the \`md5sum\` command.
\`\`\`bash
brew install coreutils
\`\`\`
1. Download the [bios.md5] file, and save it into the \`BIOS/\` directory. (Run this whole command at once.)
\`\`\`bash
curl --silent --show-error --location --fail \\
https://github.com/skyzyx/rg35xx-garlicos-macos-instructions/raw/main/bios.md5 \\
--output /Volumes/ROMS/BIOS/bios.md5
\`\`\`
1. Then you can validate the checksums. If everything is OK, there will be no output. There will only be output if there is a problem.
\`\`\`bash
cd /Volumes/ROMS/BIOS/ && \\
md5sum --ignore-missing --quiet --check bios.md5
\`\`\`
## \`BIOS/\`
| File | MD5 Checksum |
|------|--------------|
$(md5sum --tag -- * 2> /dev/null | gsed 's/MD5 (/| `/g' | gsed 's/) = /` | `/g' | gsed 's/$/` |/g')
## \`BIOS/keropi/\`
Used for _Sharp X68000_ emulation.
| File | MD5 Checksum |
|------|--------------|
$(md5sum --tag -- keropi/* 2> /dev/null | gsed 's/MD5 (/| `/g' | gsed 's/) = /` | `/g' | gsed 's/$/` |/g')
## \`BIOS/np2/\`
Used for _NEC PC-9800 (PC-98) series_ emulation.
| File | MD5 Checksum |
|------|--------------|
$(md5sum --tag -- np2/* 2> /dev/null | gsed 's/MD5 (/| `/g' | gsed 's/) = /` | `/g' | gsed 's/$/` |/g')
## \`BIOS/xmil/\`
Used for _Sharp X1_ emulation.
| File | MD5 Checksum |
|------|--------------|
$(md5sum --tag -- xmil/* 2> /dev/null | gsed 's/MD5 (/| `/g' | gsed 's/) = /` | `/g' | gsed 's/$/` |/g')
[bios.md5]: https://github.com/skyzyx/rg35xx-garlicos-macos-instructions/raw/main/bios.md5
[Homebrew]: https://mac.install.guide/homebrew/index.html
EOF