Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Set the app version #61

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ jobs:
sbsigntool
pip install virt-firmware
run: |
git config --global --add safe.directory /home/runner/work/trust/trust
pwd
git describe --always --dirty
go version
make
make test
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
all: trust

MAIN_VERSION ?= $(shell git describe --always --dirty || echo no-git)
ifeq ($(MAIN_VERSION),$(filter $(MAIN_VERSION), "", no-git))
$(error "Bad value for MAIN_VERSION: '$(MAIN_VERSION)'")
endif

VERSION_LDFLAGS=-X github.com/project-machine/trust/pkg/trust.Version=$(MAIN_VERSION)
trust: cmd/trust/*.go pkg/trust/*.go pkg/printdirtree/*.go
go build -buildvcs=false -o trust ./cmd/trust/
go build -buildvcs=false -ldflags "$(VERSION_LDFLAGS)" -o trust ./cmd/trust/

clean:
rm -f trust
Expand Down
7 changes: 2 additions & 5 deletions cmd/trust/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,19 @@ import (
"os"

"github.com/apex/log"
"github.com/project-machine/trust/pkg/trust"
"github.com/urfave/cli"
)

// provision - dangerous
// boot - read data from tpm, extend pcr7
// intrd-setup - create new luks key, extend pcr7


// Version of trust
const Version = "0.01"

func main() {
app := cli.NewApp()
app.Name = "trust"
app.Usage = "Manage the trustroot"
app.Version = Version
app.Version = trust.Version
app.Commands = []cli.Command{
initrdSetupCmd,
preInstallCmd,
Expand Down
2 changes: 2 additions & 0 deletions pkg/trust/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ var SBFPartitionTypeID = [16]byte{
0x9f, 0xe1, 0xa3, 0x01, 0xea, 0x9f, 0x47, 0xed, 0x92, 0xc2, 0xe7, 0x56, 0x39, 0xff, 0x56, 0x02}

const MiB, GiB = uint64(1024 * 1024), uint64(1024 * 1024 * 1024)

var Version string
Loading