Create initialized journaled ext4 image files #10

Open
opened 2026-10-24 14:34:36 +02:00 by erikinkinen · 1 comment
Owner

Problem and motivation

Image construction still relies on imported ext filesystem tools. A native image-file initializer needs explicit geometry and metadata choices, complete initialization and journaling support before it can become part of a self-hosted image recipe.

Proposed behavior and scope

Add a pure ext4 plan and an ext4-create command that writes an ordinary initialized filesystem image containing root and lost+found. Define a new explicit feature profile, including internal JBD2 journaling and metadata checksums. Stream metadata and zeros through the existing host/native assembly publisher. Full file population and product recipe replacement follow separately; this profile does not claim equivalence with an imported formatter's defaults.

Authority, security and reliability

The caller supplies geometry, identities, labels, seeds, ownership, modes and timestamps. Preparation performs no file discovery, account lookup, device access, mounting, clock or random-source request. Empty initialization needs one output publication and response streams, with no input-file grant. Preserve bounded scratch, original publication custody, first failures and independent cleanup through partial writes, synchronization and commit uncertainty.

Acceptance criteria

  • Validate explicit profile, group/block/inode geometry, capacity and format widths before publication; use fallible metadata storage without a volume-sized buffer.
  • Initialize all group descriptors, tables, bitmaps, free summaries, sparse backups and root/lost+found metadata with matching checksums.
  • Encode a complete internal journal and its explicit JBD2 dialect, UUID and sequence; do not infer prior history or silently omit journaling.
  • Share the original prepared assembly and host/native publication owner, preserving scratch checks, partial progress, error precedence and once-only retirement.
  • Add independent E2fsd mount, mutation and reopen controls, format vectors and meaningful capacity, corruption and publication-failure coverage.
  • Update CLI/technical documentation and selected tool/source provenance, keeping product population, imported fixture overlays and full guest builds explicit.

Alternatives and tradeoffs

A journal-free image is smaller in scope but leaves an essential product migration requirement unresolved. Importing a formatter still requires a declared configuration, source/runtime closure and guest port. A native initializer provides an independently reviewable format path; complete typed population must also preserve hard links, symlinks, special-file metadata and executable identities before replacing product construction.

Tracking and rollout

Build on GPT assembly and FAT32 creation. Tracked by Phase 6 completion. Keep current product and advanced-fixture tools until their complete entry and persistence contracts have replacements.

## Problem and motivation Image construction still relies on imported ext filesystem tools. A native image-file initializer needs explicit geometry and metadata choices, complete initialization and journaling support before it can become part of a self-hosted image recipe. ## Proposed behavior and scope Add a pure ext4 plan and an ext4-create command that writes an ordinary initialized filesystem image containing root and lost+found. Define a new explicit feature profile, including internal JBD2 journaling and metadata checksums. Stream metadata and zeros through the existing host/native assembly publisher. Full file population and product recipe replacement follow separately; this profile does not claim equivalence with an imported formatter's defaults. ## Authority, security and reliability The caller supplies geometry, identities, labels, seeds, ownership, modes and timestamps. Preparation performs no file discovery, account lookup, device access, mounting, clock or random-source request. Empty initialization needs one output publication and response streams, with no input-file grant. Preserve bounded scratch, original publication custody, first failures and independent cleanup through partial writes, synchronization and commit uncertainty. ## Acceptance criteria - [ ] Validate explicit profile, group/block/inode geometry, capacity and format widths before publication; use fallible metadata storage without a volume-sized buffer. - [ ] Initialize all group descriptors, tables, bitmaps, free summaries, sparse backups and root/lost+found metadata with matching checksums. - [ ] Encode a complete internal journal and its explicit JBD2 dialect, UUID and sequence; do not infer prior history or silently omit journaling. - [ ] Share the original prepared assembly and host/native publication owner, preserving scratch checks, partial progress, error precedence and once-only retirement. - [ ] Add independent E2fsd mount, mutation and reopen controls, format vectors and meaningful capacity, corruption and publication-failure coverage. - [ ] Update CLI/technical documentation and selected tool/source provenance, keeping product population, imported fixture overlays and full guest builds explicit. ## Alternatives and tradeoffs A journal-free image is smaller in scope but leaves an essential product migration requirement unresolved. Importing a formatter still requires a declared configuration, source/runtime closure and guest port. A native initializer provides an independently reviewable format path; complete typed population must also preserve hard links, symlinks, special-file metadata and executable identities before replacing product construction. ## Tracking and rollout Build on [GPT assembly](https://git.erikinkinen.fi/erix/boot-tool/issues/8) and [FAT32 creation](https://git.erikinkinen.fi/erix/boot-tool/issues/9). Tracked by [Phase 6 completion](https://git.erikinkinen.fi/erix/integration/issues/65). Keep current product and advanced-fixture tools until their complete entry and persistence contracts have replacements.
Author
Owner

ext4-create is implemented in signed local commits. It initializes root and lost+found, group metadata, sparse backups and an internal journal from explicit format choices. Metadata emission shares FAT32’s batched publication path. Typed product-file population is next; the product recipe still uses its imported ext4 construction.

`ext4-create` is implemented in signed local commits. It initializes root and lost+found, group metadata, sparse backups and an internal journal from explicit format choices. Metadata emission shares FAT32’s batched publication path. Typed product-file population is next; the product recipe still uses its imported ext4 construction.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:33:34 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/boot-tool#10
No description provided.