The CalledProcessError can only come from the append-initrd-secrets
script, so catching it in the generic write loop and then asserting
on the writer type to reach back into its `source` is the wrong
layer. Move the catch, the pristine-initrd fallback and the warning
into InitrdWithSecretsWriter itself, and pass `critical` through the
writer protocol so it can decide between aborting and falling back.
The writer carries the generation number so the warning can still
name the affected generation. write_boot_files no longer knows
anything about secrets and the isinstance assertion is gone.
Suggested-by: Will Fancher <elvishjerricco@gmail.com>
Whether a write failure must be fatal is a property of the destination
path (is it needed by the configuration we are switching to?), not of
the particular BootFile instance that happened to survive
deduplication. Compute the set of critical paths up front and look it
up in write_boot_files, so the dedup loop no longer needs to pick the
"right" instance and becomes a plain order-preserving seen-set walk.
This leaves BootFile.current unused.
Suggested-by: Will Fancher <elvishjerricco@gmail.com>
This guarantees the descriptor is closed even when copyfileobj raises,
matching the other writer implementations. The append-initrd-secrets
script reopens the file by path, so flush() is enough before invoking
it and the explicit close() is no longer needed.
Tell the user what actually happens (the old secrets stay in place) and
how to get rid of the warning, instead of just saying it is "normal".
Suggested-by: Will Fancher <elvishjerricco@gmail.com>
Shared kernels and initrds appear once per generation in boot_files, so
InitrdWithSecretsWriter rebuilt the same file repeatedly. Prefer the
current configuration's entry so its failures stay fatal.
has_gc_root() iterated the entire BootFileList for every file on the
ESP, giving O(files * roots) comparisons. Build the set of kept paths
once and use O(1) membership tests instead.
After removing or renaming a file in boot.initrd.secrets, older
generations' append scripts start failing. Aborting on that blocks
deploying the new configuration, so only treat a failure as fatal when
it belongs to the configuration being switched to.
Appending to the existing file made it grow on every rebuild and a
failed script could leave it half-written. Always rebuild from the
pristine initrd into a temp file and rename into place.
dbus-broker (now the default since #512050) calls
sd_id128_get_machine() which returns -ENOMEDIUM for an
all-zero machine-id, causing it to crash-loop and the test
to hang on multi-user.target.
The substitution in melpa-packages.nix rewrote `"mozc_emacs_helper"` in
`mozc.el` to `${pkgs.ibus-engines.mozc}/lib/mozc/mozc_emacs_helper`,
but that path no longer exists.
Since the Bazel-based rewrite and the optional ibus split in #483843,
`mozc_emacs_helper` is installed at `$out/bin/` of the base `mozc` package,
while `$out/lib/mozc/` only contains `mozc_server`,
`mozc_renderer`, and `mozc_tool`.
As a result, `mozc.el` invoked a non-existent helper and `mozc-mode` failed to start with
> 変換エンジンプログラムの起動に失敗しました。
Switch the reference to `pkgs.mozc` so it points at the actual binary
location and avoids pulling in the IBus front-end for Emacs users.
Assisted-by: Claude Code (claude-opus-4-7)