From 8a7c2dc2944f63e1bc266c354e67ea099e7748e8 Mon Sep 17 00:00:00 2001 From: George Angel Date: Wed, 30 Aug 2023 17:20:53 +1000 Subject: [PATCH] Update default sentinel file location (#26) * Update default sentinel file location Uses current Kured location * Don't run GoReleaser on branches Where is it going to push the binary? * Keep /run location --- .github/workflows/goreleaser.yaml | 5 +---- go.mod | 2 +- update_engine.go | 3 ++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml index a2cf52a..854291e 100644 --- a/.github/workflows/goreleaser.yaml +++ b/.github/workflows/goreleaser.yaml @@ -4,9 +4,6 @@ on: push: tags: - "v*" - pull_request: - branches: - - "master" permissions: contents: write @@ -22,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" - name: Install test dependencies run: go get . - name: Test diff --git a/go.mod b/go.mod index f28c2e3..65b849a 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/utilitywarehouse/flatcar-pxe-update-engine -go 1.20 +go 1.21 require ( github.com/godbus/dbus/v5 v5.1.0 diff --git a/update_engine.go b/update_engine.go index f48fbaa..b87c33a 100644 --- a/update_engine.go +++ b/update_engine.go @@ -34,6 +34,7 @@ const ( var ( // Flag file location for kured: // https://github.com/flatcar-linux/update_engine/commit/93f6cdddd46e9fba6c336c1db3baa6c89d85979b + // https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s13.html kuredReleasePath = "/run/reboot-required" ) @@ -257,7 +258,7 @@ func touchFile(fileName string) error { // fuzzDuration adds a random jitter to a given duration. It's adapted from the // equivalent method in the original update_engine: -// - https://github.com/kinvolk/update_engine/blob/v0.4.10/src/update_engine/utils.cc#L510-L515 +// - https://github.com/kinvolk/update_engine/blob/v0.4.10/src/update_engine/utils.cc#L510-L515 func fuzzDuration(r *rand.Rand, value time.Duration, fuzz time.Duration) time.Duration { min := int64(value.Nanoseconds() - (fuzz.Nanoseconds() / 2)) max := int64(value.Nanoseconds() + (fuzz.Nanoseconds() / 2))