Skip to content

desktops: disable DM in mode=build after install#862

Merged
igorpecovnik merged 1 commit intomainfrom
build-mode-disable-dm
Apr 16, 2026
Merged

desktops: disable DM in mode=build after install#862
igorpecovnik merged 1 commit intomainfrom
build-mode-disable-dm

Conversation

@igorpecovnik
Copy link
Copy Markdown
Member

Summary

DM package postinst (gdm3/lightdm/sddm) auto-enables the service on install. In mode=build this leaves the DM enabled in the cached rootfs, which would cause a headless login race on first boot before armbian-firstlogin has created the user.

Fix: disable both the specific DM and display-manager.service right after the DM install when mode=build.

if [[ "$mode" == "build" ]]; then
    systemctl disable "$DESKTOP_DM" 2>/dev/null || true
    systemctl disable display-manager 2>/dev/null || true
fi

Re-enablement on first boot

Verified in armbian-firstlogin:

  • lightdm: line 948 — creates symlink /etc/systemd/system/display-manager.servicelightdm.service
  • gdm3: line 977 — creates symlink → gdm3.service
  • sddm: line 1018 — systemctl enable --now sddm

All three paths run after user creation, so the DM starts only when a real user exists.

Test plan

  • Build a desktop image with mode=buildsystemctl is-enabled gdm3 shows disabled in the rootfs
  • First boot: armbian-firstlogin creates user, enables + starts the DM
  • No change to runtime module_desktops install (mode not set → DM stays enabled as before)

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

Warning

Rate limit exceeded

@igorpecovnik has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 45 minutes and 54 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 45 minutes and 54 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4816c220-e71a-41d9-84e9-77d2b98bf351

📥 Commits

Reviewing files that changed from the base of the PR and between 051cebf and dcfdcb8.

📒 Files selected for processing (1)
  • tools/modules/desktops/module_desktops.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch build-mode-disable-dm

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added size/medium PR with more then 50 and less then 250 lines 05 Milestone: Second quarter release labels Apr 16, 2026
@igorpecovnik igorpecovnik force-pushed the build-mode-disable-dm branch 3 times, most recently from f3fdf22 to f9b8207 Compare April 16, 2026 22:47
DM package postinst auto-enables the service. In build mode this
leaves the DM enabled in the cached rootfs, which would cause a
headless-login race on first boot before firstlogin has created
the user. Disable both the specific DM and display-manager.service
right after install when mode=build.

The firstlogin script re-enables the DM after user creation via
symlink creation (lightdm/gdm3) or systemctl enable (sddm).
@igorpecovnik igorpecovnik force-pushed the build-mode-disable-dm branch from f9b8207 to dcfdcb8 Compare April 16, 2026 22:49
@igorpecovnik igorpecovnik merged commit 9e565c0 into main Apr 16, 2026
12 checks passed
@igorpecovnik igorpecovnik deleted the build-mode-disable-dm branch April 16, 2026 22:49
@github-actions github-actions Bot added size/small PR with less then 50 lines and removed size/medium PR with more then 50 and less then 250 lines labels Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release size/small PR with less then 50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant