snapd.service: skip device registration; drone: no pull_request builds#6
Merged
Conversation
Syncloud runs no serial vault, so snapd's default device registration always fails, leaving a perpetual 'Initialize device' error in snap changes (the trusted-baked account-key clashes with the ancillary account-key streamed during the serial request). Create the upstream /run/snapd/noregister marker in ExecStartPre so ensureOperational() skips registration entirely. Config-only: keeps the asserts/devicestate code fully upstream and supersedes the fix-device-serial-trusted-clash fork patch (PR #3), which only silenced the clash while still attempting registration. Verified on an arm64 device: with the marker present a snapd restart no longer spawns a new errored Initialize device change.
pull_request builds are red anyway: the artifact step uses the artifact_key secret, which drone withholds from pull_request events, so every PR build fails at that step even though build/test pass. Drop the pull_request trigger so the pipeline runs only on push and tag.
cyberb
added a commit
that referenced
this pull request
Jul 17, 2026
…ter) (#8) canAutoRefresh only returns true early when ensureOperationalAttempts >= 3 ("we tried to get a serial for a while, allow refresh anyway"); otherwise it requires a serial. Syncloud has no serial vault, so before PR #6 snapd kept attempting registration, failed, and after 3 attempts that fallback enabled auto-refresh — the perpetual "Initialize device" error was ugly but it is what kept auto-refresh alive. PR #6 (snapd 666) added the /run/snapd/noregister marker so ensureOperational returns before ever attempting registration. That removed the error but left ensureOperationalAttempts at 0, so the >= 3 fallback never fires and, with no serial, canAutoRefresh returns false permanently. Every device that upgraded to snapd 666 stopped auto-refreshing (snap refresh --time shows next: n/a); a reboot does not help because the marker is recreated each boot and attempts stays 0. Treat the noregister marker as an explicit opt-out of registration that should still permit auto-refresh, mirroring the marker check in ensureOperational.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small fork-shrinking / CI changes.
1. Skip device registration (config, replaces closed #3)
Syncloud runs no serial vault, so snapd's default registration always fails, leaving a perpetual "Initialize device" error in
snap changes. Add oneExecStartPreto the shippedsnapd.servicethat creates the upstream/run/snapd/noregistermarker before snapd starts:ensureOperational()already honours that marker and skips registration — a built-in upstream feature, so no forked Go code (unlike the closed #3 which patcheddevicestate). Verified on an arm64 device: the marker stops new errored "Initialize device" changes on restart.2. Drone: don't build on pull_request
Every
pull_requestbuild was red — theartifactstep needs theartifact_keysecret, which drone withholds from PR events. Droppull_requestfrom the trigger (run only onpush/tag). Validated withdrone lint. (This also means this PR gets a clean green push build instead of a red PR build.)