Skip to content

OPENSTEP support: open Sun-labelled NeXT CDs, expand .tar.bz2 on import - #86

Merged
danifunker merged 4 commits into
mainfrom
next-risc-cd
Sep 27, 2026
Merged

danifunker merged 4 commits into
mainfrom
next-risc-cd

Conversation

@danifunker

@danifunker danifunker commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Two changes from building the OPENSTEP CD-ROM set.

1. Open Sun-labelled NeXT CDs through their NeXT label

CDs that also boot on SPARC carry a Sun disklabel at block 0 (next to an HP-PA LIF header) and keep their NeXT dlV3 copies at 512-byte blocks 16 / 30 / 48 (bytes 8192 / 15360 / 24576). Partition detection checked for Sun first and returned on it, so rb-cli inspect showed "Partition table: Sun / No partitions detected" and the UFS could not be browsed or checked.

  • The NeXT label probe now runs ahead of the Sun check. A NeXT copy is checksummed, so it cannot match on a real Sun disk; plain Sun disks still detect as Sun.
  • The probe also looks at blocks 16 and 48. present_copies sees them too, so a label rewrite (restore resize, partition edits) updates every copy, not just the one at block 30.
  • write_copies keeps the dl_label_blkno those two copies record (4 and 12, in 2048-byte units), matching the real disc.

Checked by hand with the release binary (inspect, fsck IMG@1) on every NeXT CD image available:

Disc Layout Result
NeXTSTEP 3.3 CISC (68k + Intel) standard copies NeXT, fsck clean (14,820 files)
NeXTTIME standard copies NeXT, fsck clean
NeXTSTEP 3.3 RISC Sun + blocks 16/30/48 NeXT, fsck clean (13,629 files), was undetected before
OPENSTEP 4.2 Install Sun + blocks 16/30/48 NeXT, fsck clean (20,019 files), was undetected before

New test a_sun_labelled_multi_arch_disc_opens_through_its_next_label in next_cd_builder.rs reshapes a built disc into that layout and checks detection, the copy stamps, and that the UFS opens, takes a file and passes fsck. No real ISO is committed.

2. Expand .tar.bz2 archives on import

--expand-archives copied .tar.bz2 files in verbatim because tar detection only recognised gzip and zstd. The five copies of that magic-byte check in src/fs/tar_import.rs are now one open_tar_stream helper, which also recognises bzip2, including multi-stream files as pbzip2 writes them. .tbz joins the suffixes stripped from unpack folder names. The bzip2 crate was already a dependency (0.6, and 0.5.2 in the vintage manifest), so nothing new is added. New test a_multi_stream_tar_bz2_expands_into_its_own_folder; CLI help and docs/cli-reference.md updated.

Used for the OPENSTEP set: Developer/egcs-1.1.2-2.s.tar.bz2 now unpacks to 5,838 entries with its original dates.

Checks

scripts/preflight.sh passed on each change (release tests, MiSTer feature set, Rust 1.73 vintage build, doc parity, rb-regress); clippy and the affected tests pass on the combined branch.

🤖 Generated with Claude Code

danifunker and others added 4 commits September 27, 2026 07:18
…XT label

The OPENSTEP 4.2 Install CD boots on m68k, Intel and SPARC, so block 0 holds a
Sun label with no usable slices and detection stopped there: inspect showed no
partitions and nothing could be browsed. The NeXT probe now runs ahead of Sun
(its checksum cannot match by accident) and also looks at the copies these
discs keep at 512-byte blocks 16 and 48. A label rewrite updates those copies
too and keeps the block numbers they record in 2048-byte units.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…NeXT CDs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The OPENSTEP archive carries .tar.bz2 sources, which --expand-archives copied in
verbatim because tar detection only peeled gzip and zstd. The five copies of the
magic sniff collapse into one open_tar_stream helper that also recognises bzip2
(multi-stream, since pbzip2 writes one stream per block).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@danifunker danifunker changed the title Open Sun-labelled NeXT CDs (NeXTSTEP 3.3 RISC, OPENSTEP 4.2 Install) through their NeXT label OPENSTEP support: open Sun-labelled NeXT CDs, expand .tar.bz2 on import Sep 27, 2026
@danifunker
danifunker merged commit 29fce22 into main Sep 27, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant