5 FriiDump builds natively with GCC/CMake and uses Linux optical-drive packet
6 commands through the existing `dvd_drive` transport. Candidate21 makes the
7 Linux privilege boundary explicit and reproducible.
9 Candidate21 also corrects the Linux GDR-8050L software tray cycle. Linux may
10 lock an optical door while the device is open (`CDO_LOCK`). Before each required
11 Xbox media cycle, FriiDump now releases that lock with `CDROM_LOCKDOOR`, sends
12 the software eject/load sequence, waits for readiness, and restores the door
13 lock after a successful load. On a cycle failure it deliberately leaves the
14 door unlocked so the disc can be recovered without power-cycling the external
17 The Linux workflow uses two separate permissions:
19 1. **Device-node access** — the normal user must be able to open `/dev/sr*` and,
20 where applicable, the corresponding `/dev/sg*`. On Ubuntu this normally
21 comes from membership in the `cdrom` group.
22 2. **Vendor-command authorization** — GameCube/Wii memory-dump methods and Xbox
23 vendor-unlock paths issue commands outside Linux's ordinary unprivileged
24 SCSI allowlist. Those operations require effective `CAP_SYS_RAWIO`.
26 Membership in `cdrom` is necessary but does not replace `CAP_SYS_RAWIO`.
28 ## Candidate21 DMI and media-ID boundary
30 Candidate20 proved the Linux SG_IO handshake and XDVDFS data path but left the
31 media ID empty because its standard READ DVD STRUCTURE helper wrote Format to
32 CDB byte 11. Candidate21 uses byte 7, matching the copied Windows
33 `GetMediaID()` request. Live runs log `[XBOX-DVD-STRUCTURE]` PFI and DMI capture
34 results. The expected Red Faction II media ID is `TQ00501A`.
36 The step-9 sticky-descrambling transport result remains visible. Final READ
37 CAPACITY and readable XDVDFS data are authoritative for game-view success.
44 -DBUILD_STATIC_BINARY=ON \
45 -DBUILD_NATIVE_REPORT_TESTS=ON \
46 -DFRIIDUMP_BUILD_COMMIT="$(git rev-parse HEAD)"
47 cmake --build build --parallel
48 ./build/src/friidump-xbox-portable-metadata-test
49 ./build/src/friidump-linux-rawio-test
50 ./build/src/friidump --help
53 Linux configuration and the Candidate21 build validator print a warning that a
54 normal build does **not** install file capabilities. This is intentional: a
55 compiler invocation must not silently elevate its output or invoke `sudo`.
57 ## Install the minimum raw-I/O authority
59 Do not run FriiDump itself with `sudo`, and do not install it setuid-root. Grant
60 only `CAP_SYS_RAWIO` to the exact validated executable:
63 BIN="$(readlink -f ./build/src/friidump)"
64 sudo setcap cap_sys_rawio=ep "$BIN"
71 /path/to/friidump cap_sys_rawio=ep
74 The maintained helper performs identity checks, applies the capability, verifies
75 that the executable bytes did not change, and confirms the resulting xattr:
78 bash ./validation/friidump-linux-rawio-capability.sh install \
82 Status and removal operations are also available:
85 bash ./validation/friidump-linux-rawio-capability.sh status \
88 bash ./validation/friidump-linux-rawio-capability.sh remove \
92 The maintained release helper applies the capability only to the exact
96 bash ./validation/friidump-linux-rawio-capability.sh \
97 install ./build/src/friidump
100 ### Capability lifetime
102 Linux file capabilities are extended attributes. They are not reliably
103 preserved by ZIP extraction, ordinary copying, source packaging, or rebuilding.
104 Replacing or relinking the executable clears the capability. Reapply and verify
105 `cap_sys_rawio=ep` after every build that will be used for vendor-command
108 Never assume that a newer candidate inherited the capability from an older
109 binary. Candidate11 worked because its exact executable carried
110 `cap_sys_rawio=ep`; Candidate12 and Candidate13 initially did not.
114 Before a vendor-command path begins seed retrieval or Xbox unlock, Candidate21
115 checks the process's effective capability mask from `/proc/self/status`.
117 With the least-privilege configuration it prints:
120 Linux raw-I/O preflight: PASS (CAP_SYS_RAWIO effective; ...).
123 When the capability is absent, FriiDump refuses the vendor operation before
124 seed retrieval, prints exact `setcap` and `getcap` commands for the running
125 executable, writes the failure into the native report, and issues STOP UNIT.
126 This replaces the previous generic transport-level `EPERM` failure.
128 Candidate21 also refuses vendor-command work when the entire process is running
129 as root. Run it as the normal user with the file capability instead.
131 Standard readable-DVD operations that do not use vendor memory-dump or unlock
132 commands do not require `CAP_SYS_RAWIO`.
136 Identify the actual optical device dynamically. Do not assume the external
137 validation drive is `/dev/sr0`:
140 for dev in /sys/class/block/sr*; do
141 printf '%s: ' "/dev/${dev##*/}"
142 xargs < "$dev/device/vendor"
143 xargs < "$dev/device/model"
144 xargs < "$dev/device/rev"
148 Inspect permissions for the selected block and SCSI-generic device:
152 ls -l /dev/sr1 /dev/sg2
153 getcap "$(readlink -f ./build/src/friidump)"
156 Close media players and file managers, unmount any mounted filesystem from the
157 drive, and disable automatic media polling where practical. Linux currently
158 provides no FriiDump-exclusive optical-volume lock equivalent for this path.
163 ./build/src/friidump \
166 -X "Red Faction II [TQ00501A].xiso" \
167 --firmware-modified \
168 "GDR-8163B cross-flashed with modified GDR-8050L firmware; patched to allow 0xE7 memory dumps"
171 Omitting the XISO filename on a GDR-8050L derives `Title[MediaID].xiso` from the
172 unlocked XBE/DMI view on Linux.
174 ## Xbox redump-style ISO
177 ./build/src/friidump \
180 -i "Red Faction II [TQ00501A].iso" \
181 --firmware-modified \
182 "GDR-8163B cross-flashed with modified GDR-8050L firmware; patched to allow 0xE7 memory dumps"
185 ## Validation boundary
187 A Linux build is not considered ready for vendor-command hardware validation
188 until all of these are recorded:
190 - exact executable SHA-256;
191 - `getcap` output proving `cap_sys_rawio=ep` on that executable;
192 - normal-user process identity;
193 - device-node access through the intended group or ACL;
194 - runtime raw-I/O preflight PASS;
195 - hardware result, native report, and STOP UNIT result.
197 The `--xgd1-layout-probe` and `--xgd1-raw-id-probe` development probes remain
198 Windows-only in this candidate. Their Linux transport port is tracked
199 separately from ordinary ISO/XISO user-path parity.
201 ## Candidate21 GDR-8050L Windows-sequence parity
203 The portable Linux path follows the proven Windows state-aware order: readiness, entry capacity, direct `UnlockDrive()`, `RefreshVolume()`, a 2000 ms settle, readiness and capacity verification, with exactly one tray-cycle retry only if the direct handshake remains in the video view. It then sets maximum speed and proceeds to metadata. The same helper is used after video capture.
205 `RecoveryKick`, repeated synthetic LBA-zero reads, and generic automatic media-auth kicks are not part of this path. They belong only to a separate experimental modified-firmware campaign and are currently out of scope.
208 ## GDR-8050L Xbox handshake transport
210 Candidate21 keeps the proven Windows `UnlockDrive()` command sequence but sends
211 its Linux form with `SG_IO`, the direct Linux SCSI pass-through interface. This
212 preserves each 6-, 10-, and 12-byte CDB length, the Windows 120-second command
213 timeouts, the 10-second sticky-descrambling timeout, transfer direction, sense
214 data, host status, and driver status. Every handshake command emits an
215 `[XBOX-SGIO]` record to both the live console and persistent FriiDump log.
217 This is transport parity only. It does not add `RecoveryKick`, a generic media
218 authentication kick, synthetic LBA-zero reads, or any modified-firmware-only