Skip to content

spec: Enable bootloader-update.service on boot - #1180

Open
Johan-Liebert1 wants to merge 1 commit into
coreos:mainfrom
Johan-Liebert1:service-fix
Open

Johan-Liebert1 wants to merge 1 commit into
coreos:mainfrom
Johan-Liebert1:service-fix

Conversation

@Johan-Liebert1

Copy link
Copy Markdown
Member

Installing the RPM shipped the unit but never enabled it, so bootloader-update.service did not run on boot

Ship a systemd preset that enables the service and wire up the standard scriptlets to apply it

Also, order the unit after /sysroot is mounted

Installing the RPM shipped the unit but never enabled it, so
bootloader-update.service did not run on boot

Ship a systemd preset that enables the service and wire up the
standard scriptlets to apply it

Also, order the unit after /sysroot is mounted

Signed-off-by: Pragyan Poudyal <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Walkthrough

The systemd preset enables bootloader-update.service. The service requires /sysroot to be mounted before it starts. The Makefile and RPM package install the preset, and RPM scriptlets invoke systemd lifecycle macros for the service.

Changes: Boot-time service activation

Layer / File(s) Summary
Configure boot-time service activation
systemd/bootloader-update.service, systemd/70-bootupd.preset
The service unit adds RequiresMountsFor=/sysroot. The preset enables bootloader-update.service and describes its boot-time role.
Install and package the preset
Makefile, contrib/packaging/bootupd.spec
The Makefile installs the preset under the system preset directory. The RPM package includes the preset and invokes systemd post-install, pre-uninstall, and post-uninstall macros for the service.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • coreos/bootupd#1163: Adds a skip path for systems without a block device backing /boot or /sysroot; its smoke test checks the service behavior when it runs at boot.

Suggested reviewers: cgwalters

Merge Risk: Minimal · up to 8c23e

This change enables the bootloader update service at boot through a shipped preset and standard RPM scriptlets, and orders it after /sysroot is mounted. In the repository's supported image-based deployments the service is enabled on a fresh install. An in-place RPM upgrade of an existing disabled service would not be re-enabled, but nothing shows that this is a supported path. No concrete merge-blocking risk remains.

Pre-merge checks: Passed 5 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Commit Message Convention Warning The only non-merge commit is spec: Enable bootloader-update.service on boot. The spec subsystem is acceptable, and Enable is imperative, but the description starts with uppercase E, not a lowe… Amend the commit subject to spec: enable bootloader-update.service on boot with no trailing period.
Passed Passed checks: 5 passed
Check name Status Explanation
Title check Passed The title "spec: Enable bootloader-update.service on boot" follows the subsystem-prefixed, lowercase-after-colon format and describes the main change. The PR enables the service at boot through a ship…
Description check Passed The description states the problem: installing the RPM shipped the unit but did not enable it, so bootloader-update.service did not run on boot. It also says the PR ships a systemd preset and wires up…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "spec: Enable bootloader-update.service on boot" follows the subsystem-prefixed, lowercase-after-colon format and describes the main change. The PR enables the service at boot through a shipped systemd preset and the RPM scriptlets, and the spec file change is part of that work. The title is a little narrow because it names only the spec file, while the changeset also touches the Makefile, the preset, and the unit file. It still clearly summarizes the main objective.

Full details: Description check

Explanation

The description states the problem: installing the RPM shipped the unit but did not enable it, so bootloader-update.service did not run on boot. It also says the PR ships a systemd preset and wires up the standard scriptlets, and it notes the unit ordering change after /sysroot is mounted. All of these match the changeset.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (4 skipped: 4 unsupported.)

Full details: Commit Message Convention

Explanation

The only non-merge commit is spec: Enable bootloader-update.service on boot. The spec subsystem is acceptable, and Enable is imperative, but the description starts with uppercase E, not a lowercase letter.

Resolution

Amend the commit subject to spec: enable bootloader-update.service on boot with no trailing period.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔇 Additional comments: 1
contrib/packaging/bootupd.spec-79-79: 1

79-79: Major · Functional Correctness · Heavy lift

⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Apply the preset when upgrading existing installations.

%systemd_post applies the preset only on initial installation. An upgrade from the previous RPM leaves an existing disabled service disabled, so bootloader updates still do not run at boot. (raw.githubusercontent.com)

Add a one-time upgrade migration that respects administrator preset policy and masked units.


Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between a100a09 and 8c23ec0.

Files selected for processing: 4
  • Makefile
  • contrib/packaging/bootupd.spec
  • systemd/70-bootupd.preset
  • systemd/bootloader-update.service

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Review details
Context from checks skipped due to timeout: 20
  • GitHub Check: testing-farm:fedora-rawhide-x86_64
  • GitHub Check: testing-farm:centos-stream-10-x86_64
  • GitHub Check: rpm-build:fedora-rawhide-x86_64
  • GitHub Check: rpm-build:centos-stream-10-x86_64
  • GitHub Check: CodeRabbit
  • GitHub Check: bootc-e2e (ubuntu-24.04-arm, 0, 10)
  • GitHub Check: bootc-e2e (ubuntu-24.04-arm, 1)
  • GitHub Check: Tests (release), minimum supported toolchain
  • GitHub Check: bootc-e2e (ubuntu-24.04, 0, 9)
  • GitHub Check: bootc-e2e (ubuntu-24.04, 1)
  • GitHub Check: bootc-e2e (ubuntu-24.04, 0, 10)
  • GitHub Check: Tests, unstable toolchain (nightly)
  • GitHub Check: Tests (release), stable toolchain
  • GitHub Check: Lints, pinned toolchain
  • GitHub Check: Tests, unstable toolchain (beta)
  • GitHub Check: tmt-tests
  • GitHub Check: bootc-e2e (ubuntu-24.04-arm, 0, 9)
  • GitHub Check: Tests, stable toolchain
  • GitHub Check: Build on s390x
  • GitHub Check: Build on ppc64le
Additional context used
Path-based instructions: 1
Unit changes affect boot ordering and privilege boundaries.

CodeRabbit configuration file

Files:

  • systemd/70-bootupd.preset
  • systemd/bootloader-update.service
Additional comments: 2
systemd/bootloader-update.service: 1

4-4: LGTM!

systemd/70-bootupd.preset: 1

1-2: LGTM!

[Unit]
Description=Update bootloader on boot
Documentation=https://github.com/coreos/bootupd
RequiresMountsFor=/sysroot

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't bootupd supposed to work for non image-mode systems as well ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, you're right. I guess we can remove this. Added this because of the Exec condition we have below

Comment thread systemd/70-bootupd.preset

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel that's something that is up to the distribution to enable. So for FCOS that would live in https://github.com/coreos/fedora-coreos-config/blob/testing-devel/overlay.d/05core/usr/lib/systemd/system-preset/40-coreos.preset .

BTW preset files are only evaluated during first boot IIRC

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it makes sense to put it in fcos config? We can do that if that's what's we've been doing.

BTW preset files are only evaluated during first boot IIRC

should be okay. Since systemd creates a symlink on evaluation which is how it would continue for subsequent boots

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if you want to turn it in RHCOS we'd want a preset file in rhel-coreos-config

@Rolv-Apneseth Rolv-Apneseth Oct 28, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is indeed enabled on FCOS, though we manually disable it for ppc64le and s390x at the moment. Maybe https://github.com/coreos/fedora-coreos-config/blob/testing-devel/tests/kola/boot/bootupd could use a check for whether the service is actually active on x86_64 and aarhc64 to make sure we don't face any regressions there, but currently we only check they're disabled on the other arches.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's actually active on fcos. I don't see it being enabled in the fcos repo

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's actually active on fcos. I don't see it being enabled in the fcos repo

See my comment above

@jbtrystram jbtrystram left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments but i an not 100% sure about, worth investigating a bit more.

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.

3 participants