Consistently use SI-compliant notation for file sizes (B/KiB/MiB/GiB/TiB) where appropriate. (#855)

This commit is contained in:
Daniel Markstedt 2022-09-25 14:37:36 -07:00 committed by GitHub
parent e513af694b
commit 12b61ada84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 28 deletions

View File

@ -99,7 +99,7 @@ Launch RaSCSI with an Apple hard drive image as ID 0 and a CD-ROM as ID 2
Launch RaSCSI with a removable SCSI drive image as ID 0 and the raw device file /dev/hdb (e.g. a USB stick) and a DaynaPort network adapter as ID 6: Launch RaSCSI with a removable SCSI drive image as ID 0 and the raw device file /dev/hdb (e.g. a USB stick) and a DaynaPort network adapter as ID 6:
rascsi -ID0 -t scrm /dev/hdb -ID6 -t scdp daynaport rascsi -ID0 -t scrm /dev/hdb -ID6 -t scdp daynaport
To create an empty, 100MB HD image, use the following command: To create an empty, 100MiB HD image, use the following command:
dd if=/dev/zero of=/path/to/newimage.hda bs=512 count=204800 dd if=/dev/zero of=/path/to/newimage.hda bs=512 count=204800
In case the fallocate command is available a much faster alternative to the dd command is: In case the fallocate command is available a much faster alternative to the dd command is:

View File

@ -128,7 +128,7 @@ EXAMPLES
as ID 6: as ID 6:
rascsi -ID0 -t scrm /dev/hdb -ID6 -t scdp daynaport rascsi -ID0 -t scrm /dev/hdb -ID6 -t scdp daynaport
To create an empty, 100MB HD image, use the following command: To create an empty, 100MiB HD image, use the following command:
dd if=/dev/zero of=/path/to/newimage.hda bs=512 count=204800 dd if=/dev/zero of=/path/to/newimage.hda bs=512 count=204800
In case the fallocate command is available a much faster alternative to In case the fallocate command is available a much faster alternative to

View File

@ -567,7 +567,7 @@ function showMacproxyStatus() {
} }
# Creates a drive image file with specific parameters # Creates a drive image file with specific parameters
function createDrive600MB() { function createDrive600M() {
createDrive 600 "HD600" createDrive 600 "HD600"
} }
@ -575,7 +575,7 @@ function createDrive600MB() {
function createDriveCustom() { function createDriveCustom() {
driveSize=-1 driveSize=-1
until [ $driveSize -ge "10" ] && [ $driveSize -le "4000" ]; do until [ $driveSize -ge "10" ] && [ $driveSize -le "4000" ]; do
echo "What drive size would you like (in MB) (10-4000)" echo "What drive size would you like (in MiB) (10-4000)"
read driveSize read driveSize
echo "How would you like to name that drive?" echo "How would you like to name that drive?"
@ -666,10 +666,10 @@ function createDrive() {
driveSize=$1 driveSize=$1
driveName=$2 driveName=$2
mkdir -p "$VIRTUAL_DRIVER_PATH" mkdir -p "$VIRTUAL_DRIVER_PATH"
drivePath="${VIRTUAL_DRIVER_PATH}/${driveSize}MB.hda" drivePath="${VIRTUAL_DRIVER_PATH}/${driveSize}M.hda"
if [ ! -f "$drivePath" ]; then if [ ! -f "$drivePath" ]; then
echo "Creating a ${driveSize}MB Drive" echo "Creating a ${driveSize}MiB Drive"
truncate --size "${driveSize}m" "$drivePath" truncate --size "${driveSize}m" "$drivePath"
echo "Formatting drive with HFS" echo "Formatting drive with HFS"
@ -1190,9 +1190,9 @@ function runChoice() {
echo "Installing / Updating RaSCSI OLED Screen - Complete!" echo "Installing / Updating RaSCSI OLED Screen - Complete!"
;; ;;
4) 4)
echo "Creating an HFS formatted 600MB drive image with LIDO driver" echo "Creating an HFS formatted 600 MiB drive image with LIDO driver"
createDrive600MB createDrive600M
echo "Creating an HFS formatted 600MB drive image with LIDO driver - Complete!" echo "Creating an HFS formatted 600 MiB drive image with LIDO driver - Complete!"
;; ;;
5) 5)
echo "Creating an HFS formatted drive image with LIDO driver" echo "Creating an HFS formatted drive image with LIDO driver"
@ -1316,8 +1316,8 @@ function showMenu() {
echo " 3) install or update RaSCSI OLED Screen (requires hardware)" echo " 3) install or update RaSCSI OLED Screen (requires hardware)"
echo "CREATE HFS FORMATTED (MAC) IMAGE WITH LIDO DRIVERS" echo "CREATE HFS FORMATTED (MAC) IMAGE WITH LIDO DRIVERS"
echo "** For the Mac Plus, it's better to create an image through the Web Interface **" echo "** For the Mac Plus, it's better to create an image through the Web Interface **"
echo " 4) 600MB drive (suggested size)" echo " 4) 600 MiB drive (suggested size)"
echo " 5) custom drive size (up to 4000MB)" echo " 5) custom drive size (up to 4000 MiB)"
echo "NETWORK BRIDGE ASSISTANT" echo "NETWORK BRIDGE ASSISTANT"
echo " 6) configure network bridge for Ethernet (DHCP)" echo " 6) configure network bridge for Ethernet (DHCP)"
echo " 7) configure network bridge for WiFi (static IP + NAT)" echo " 7) configure network bridge for WiFi (static IP + NAT)"

View File

@ -10,7 +10,7 @@
<tbody> <tbody>
<tr> <tr>
<td><b>{{ _("Name") }}</b></td> <td><b>{{ _("Name") }}</b></td>
<td><b>{{ _("Size (MB)") }}</b></td> <td><b>{{ _("Size (MiB)") }}</b></td>
<td><b>{{ _("Description") }}</b></td> <td><b>{{ _("Description") }}</b></td>
<td><b>{{ _("Ref.") }}</b></td> <td><b>{{ _("Ref.") }}</b></td>
<td><b>{{ _("Action") }}</b></td> <td><b>{{ _("Action") }}</b></td>
@ -54,7 +54,7 @@
<tbody> <tbody>
<tr> <tr>
<td><b>{{ _("Name") }}</b></td> <td><b>{{ _("Name") }}</b></td>
<td><b>{{ _("Size (MB)") }}</b></td> <td><b>{{ _("Size (MiB)") }}</b></td>
<td><b>{{ _("Description") }}</b></td> <td><b>{{ _("Description") }}</b></td>
<td><b>{{ _("Ref.") }}</b></td> <td><b>{{ _("Ref.") }}</b></td>
<td><b>{{ _("Action") }}</b></td> <td><b>{{ _("Action") }}</b></td>
@ -100,7 +100,7 @@
<tbody> <tbody>
<tr> <tr>
<td><b>{{ _("Name") }}</b></td> <td><b>{{ _("Name") }}</b></td>
<td><b>{{ _("Size (MB)") }}</b></td> <td><b>{{ _("Size (MiB)") }}</b></td>
<td><b>{{ _("Description") }}</b></td> <td><b>{{ _("Description") }}</b></td>
<td><b>{{ _("Ref.") }}</b></td> <td><b>{{ _("Ref.") }}</b></td>
<td><b>{{ _("Action") }}</b></td> <td><b>{{ _("Action") }}</b></td>
@ -135,7 +135,7 @@
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
<p><small>{{ _("%(disk_space)s MB disk space remaining on the Pi", disk_space=free_disk) }}</small></p> <p><small>{{ _("%(disk_space)s MiB disk space remaining on the Pi", disk_space=free_disk) }}</small></p>
<p><a href="/">{{ _("Cancel") }}</a></p> <p><a href="/">{{ _("Cancel") }}</a></p>
{% endblock content %} {% endblock content %}

View File

@ -231,7 +231,7 @@
<td style="text-align:center"> <td style="text-align:center">
<form action="/files/download" method="post"> <form action="/files/download" method="post">
<input name="file" type="hidden" value="{{ base_dir }}/{{ file['name'] }}"> <input name="file" type="hidden" value="{{ base_dir }}/{{ file['name'] }}">
<input type="submit" value="{{ file['size_mb'] }} {{ _("MB") }} &#8595;"> <input type="submit" value="{{ file['size_mb'] }} {{ _("MiB") }} &#8595;">
</form> </form>
</td> </td>
<td> <td>
@ -301,7 +301,7 @@
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
<p><small>{{ _("%(disk_space)s MB disk space remaining on the Pi", disk_space=free_disk) }}</small></p> <p><small>{{ _("%(disk_space)s MiB disk space remaining on the Pi", disk_space=free_disk) }}</small></p>
<hr/> <hr/>
<details> <details>
@ -381,7 +381,7 @@
</summary> </summary>
<ul> <ul>
<li>{{ _("Files are uploaded to <tt>%(directory)s</tt>.", directory=base_dir) }}</li> <li>{{ _("Files are uploaded to <tt>%(directory)s</tt>.", directory=base_dir) }}</li>
<li>{{ _("The largest file size accepted in this form is %(max_file_size)s MB. Use other file transfer means for larger files.", max_file_size=max_file_size) }}</li> <li>{{ _("The largest file size accepted in this form is %(max_file_size)s MiB. Use other file transfer means for larger files.", max_file_size=max_file_size) }}</li>
<li>{{ _("File uploads will progress only if you stay on this page. If you navigate away before the transfer is completed, you will end up with an incomplete file.") }}</li> <li>{{ _("File uploads will progress only if you stay on this page. If you navigate away before the transfer is completed, you will end up with an incomplete file.") }}</li>
</ul> </ul>
</details> </details>
@ -399,12 +399,12 @@
chunking: true, chunking: true,
forceChunking: true, forceChunking: true,
url: '/files/upload', url: '/files/upload',
maxFilesize: {{ max_file_size }}, // MB maxFilesize: {{ max_file_size }}, // MiB
chunkSize: 1000000, // bytes chunkSize: 1000000, // bytes
dictDefaultMessage: "{{ _("Drop files here to upload") }}", dictDefaultMessage: "{{ _("Drop files here to upload") }}",
dictFallbackMessage: "{{ _("Your browser does not support drag'n'drop file uploads.") }}", dictFallbackMessage: "{{ _("Your browser does not support drag'n'drop file uploads.") }}",
dictFallbackText: "{{ _("Please use the fallback form below to upload your files like in the olden days.") }}", dictFallbackText: "{{ _("Please use the fallback form below to upload your files like in the olden days.") }}",
dictFileTooBig: "{{ _("File is too big: {{filesize}}MB. Max filesize: {{maxFilesize}}MB.") }}", dictFileTooBig: "{{ _("File is too big: {{filesize}}MiB. Max filesize: {{maxFilesize}}MiB.") }}",
dictInvalidFileType: "{{ _("You can't upload files of this type.") }}", dictInvalidFileType: "{{ _("You can't upload files of this type.") }}",
dictResponseError: "{{ _("Server responded with code: {{statusCode}}") }}", dictResponseError: "{{ _("Server responded with code: {{statusCode}}") }}",
dictCancelUpload:" {{ _("Cancel upload") }}", dictCancelUpload:" {{ _("Cancel upload") }}",
@ -413,10 +413,10 @@
dictRemoveFile: "{{ _("Remove file") }}", dictRemoveFile: "{{ _("Remove file") }}",
dictMaxFilesExceeded: "{{ _("You can not upload any more files.") }}", dictMaxFilesExceeded: "{{ _("You can not upload any more files.") }}",
dictFileSizeUnits: { dictFileSizeUnits: {
tb: "{{ _("TB") }}", tb: "{{ _("TiB") }}",
gb: "{{ _("GB") }}", gb: "{{ _("GiB") }}",
mb: "{{ _("MB") }}", mb: "{{ _("MiB") }}",
kb: "{{ _("KB") }}", kb: "{{ _("KiB") }}",
b: "{{ _("B") }}" b: "{{ _("B") }}"
} }
} }
@ -565,7 +565,7 @@
{% endfor %} {% endfor %}
</select> </select>
<label for="size">{{ _("Size:") }}</label> <label for="size">{{ _("Size:") }}</label>
<input name="size" type="number" placeholder="{{ _("MB") }}" min="1" max="262144" required> <input name="size" type="number" placeholder="{{ _("MiB") }}" min="1" max="262144" required>
<input type="submit" value="{{ _("Create") }}"> <input type="submit" value="{{ _("Create") }}">
</form> </form>
</td> </td>

View File

@ -908,15 +908,15 @@ int main(int argc, char* argv[])
(buffer[2] << 8) | buffer[3]; (buffer[2] << 8) | buffer[3];
bnum++; bnum++;
printf("Number of blocks : %d Blocks\n", (int)bnum); printf("Number of blocks : %d Blocks\n", (int)bnum);
printf("Block length : %d Bytes\n", (int)bsiz); printf("Block length : %d B\n", (int)bsiz);
printf("Unit Capacity : %d MBytes %d Bytes\n", printf("Unit Capacity : %d MiB %d B\n",
(int)(bsiz * bnum / 1024 / 1024), (int)(bsiz * bnum / 1024 / 1024),
(int)(bsiz * bnum)); (int)(bsiz * bnum));
// Get the restore file size // Get the restore file size
if (restore) { if (restore) {
size = fio.GetFileSize(); size = fio.GetFileSize();
printf("Restore file size : %d bytes", (int)size); printf("Restore file size : %d B", (int)size);
if (size > (off_t)(bsiz * bnum)) { if (size > (off_t)(bsiz * bnum)) {
printf("(WARNING : File size is larger than disk size)"); printf("(WARNING : File size is larger than disk size)");
} else if (size < (off_t)(bsiz * bnum)) { } else if (size < (off_t)(bsiz * bnum)) {