Files
opu/docs/analysis/usb-layout.md
T
yann64andClaude Opus 5.5 9a24c2eb61
CI / Linux arm64 (push) Waiting to run
CI / Linux x86_64 (push) Waiting to run
CI / ASan + UBSan (push) Waiting to run
docs: translate docs/analysis to English
- API.md, workflow.md and usb-layout.md translated
- usb-layout.md: describe the formatting that OpenPU actually performs
  on Linux (UDisks2) and Haiku (one transaction per step)
- API.md: restore the = / & escaping example lost earlier

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDASLCiN764v685boRVYar
2026-11-28 23:50:13 +01:00

51 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Preparing the USB stick
## Formatting
- File system: **FAT32**, MBR partition table (macOS: `diskutil eraseDisk FAT32 <LABEL> MBR`).
- Label: the stick's current label, sanitised with `replace(/[^a-zA-Z0-9_]+/g,'')`, truncated to 11
characters and upper-cased. Default: `NEW`.
- Windows:
- up to 32 GiB: `format X: /q /fs:FAT32 /v:LABEL`;
- above, or on failure: `chkdsk X: & timeout 20 & echo y | fat32format X: & label X: LABEL`, with
elevated privileges.
- Linux (code present in the app but never shipped): `umount <mnt> && mkfs.vfat -n LABEL
/dev/disk/by-uuid/<uuid>`. Only the volume is reformatted, not the partition table.
OpenPU equivalents:
- Linux: UDisks2 `org.freedesktop.UDisks2.Block.Format("dos")` on the whole block device, then
`PartitionTable.CreatePartitionAndFormat` (type `0x0c` at 1 MiB, `vfat` with the label), through
polkit, without root.
- Haiku: Storage Kit disk device API (`BDiskDevice` / `BPartition`, as DriveSetup), MBR ("intel")
with one "FAT 32-bit, LBA-mapped" partition at 1 MiB, formatted with the "fat" disk system.
On Haiku R1/beta6 each step must be its own transaction (erase foreign content, delete old
partitions, create the partition, format): combined transactions fail or hang, and
`Uninitialize()` on an existing MBR hangs the disk device manager.
## Minimum size
```
needed = (firmware size + license size + map size) × 1.1
usbMin = 2 GB; while usbMin × 10^9 < needed: usbMin ×= 2
choices = mounted USB drives larger than needed
```
## Resulting tree
```
<USB>/
├── license/
│ └── <license name> # license_<UIN>.key or licenses_<id>_<ts>.tar, copied as is
├── rcc_update/… # content of the RCC firmware tar (the name depends on the head unit)
└── … # content of the map tar, extracted at the root
```
### Real RCC firmware archive (6_0432_23-2I44-1, 8,391,587,840 bytes)
- Standard **ustar** format (magic `ustar\000`), 16 entries, only regular files and directories.
- First member: `UpdateInfo.xml` (root), then `rcc_update/…`.
- Largest files: `rcc_update/stc.A2.bsh.tar.bin` (2.70 GB), `stc.A1…` (2.68 GB) and
`rfs.A2.wml.fp.tar.bin` (1.0 GB). Everything fits under the 4 GiB FAT32 per-file limit. To be
checked for NAC maps (10.5 GB).
- Any file whose *basename* is `UpdateInfo.xml` is skipped during extraction.
- The tar may lack the "magic number" (`allowUnknownFormat` in the original app), so a tolerant tar
reader is needed (libarchive's tar reader accepts V7 archives without magic).
- A preliminary "dry-run" extraction checks the integrity of the tar.