Skip to content

Commit

Permalink
Merge pull request #46 from smoser/fix/get-build-working
Browse files Browse the repository at this point in the history
Fix/get build working
  • Loading branch information
hallyn authored Sep 12, 2023
2 parents dece082 + 406b74e commit 5a8e35f
Show file tree
Hide file tree
Showing 26 changed files with 35 additions and 33 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ jobs:
https://github.com/project-machine/trust/releases/download/v0.0.9/trust-linux-amd64
sudo chmod 755 /usr/bin/trust
trust keyset add snakeoil
- name: build bootkit
- name: build golang
run: |
make go-stacker-build
- name: build layers
run: |
make STACKER_COMMON_OPTS=--debug
- name: Publish zot
Expand Down
15 changes: 7 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ COMMANDS = pkg/bkcust pkg/oci-boot
include subs.mk
include common.mk

.PHONY: build
build:
.PHONY: layers
layers:
$(STACKER_RBUILD)

custom: pkg/bkcust
Expand All @@ -14,15 +14,14 @@ custom: pkg/bkcust
bin: $(COMMANDS)

$(COMMANDS): $(ALL_GO_FILES)
@$(call pkg_build,./cmd/$(notdir $@))
@$(call go_build,./cmd/$(notdir $@))

.PHONY: pkg-build
pkg-build:
cd pkg && $(STACKER_BUILD)
.PHONY: go-stacker-build
go-stacker-build:
cd go && $(STACKER_BUILD)

go-build: $(ALL_GO_FILES) $(COMMANDS)
@$(call pkg_build,./... ./cmd/*)

@$(call go_build,./...)

LAYERS := $(shell cd $(TOP_D)/layers && \
for d in *; do [ -f "$$d/stacker.yaml" ] && echo "$$d"; done )
Expand Down
8 changes: 4 additions & 4 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ STACKER_PUBLISH = stacker $(STACKER_OPTS) publish \
# [ -n "value-of-$VARNAME" ] || { echo "rule-name ...VARNAME"; exit 1; }
required_var = [ -n "$(value $1)" ] || { echo "$@ requires environment variable $1"; exit 1; }

ALL_GO_FILES := $(wildcard pkg/*.go pkg/*/*.go pkg/*/*/*.go)
ALL_GO_FILES := $(wildcard go/*/*.go go/*/*/*.go)

pkg_build = vr() { echo "$$@" 1>&2; "$$@"; } ; \
go_build = vr() { echo "$$@" 1>&2; "$$@"; } ; \
build() { for f in "$$@"; do \
vr go build -buildmode=exe -tags containers_image_openpgp "$$f" || break; done; } ; \
vr cd pkg && export GO_BIN=. && build $(1)
vr go build -buildmode=exe -tags containers_image_openpgp "$$f" || return; done; } ; \
vr cd go && export GO_BIN=. && build $(1)
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/bkcust/initrd.go → go/cmd/bkcust/initrd.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"compress/gzip"

"github.com/project-machine/bootkit/pkg/initrd"
"github.com/project-machine/bootkit/go/pkg/initrd"
cli "github.com/urfave/cli/v2"
)

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions cmd/bkcust/shim.go → go/cmd/bkcust/shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strings"

efi "github.com/canonical/go-efilib"
"github.com/project-machine/bootkit/pkg/cert"
"github.com/project-machine/bootkit/pkg/shim"
"github.com/project-machine/bootkit/pkg/util"
"github.com/project-machine/bootkit/go/pkg/cert"
"github.com/project-machine/bootkit/go/pkg/shim"
"github.com/project-machine/bootkit/go/pkg/util"
cli "github.com/urfave/cli/v2"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/bkcust/signefi.go → go/cmd/bkcust/signefi.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/foxboron/go-uefi/efi/pecoff"
"github.com/project-machine/bootkit/pkg/cert"
"github.com/project-machine/bootkit/go/pkg/cert"
cli "github.com/urfave/cli/v2"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/bkcust/stubby.go → go/cmd/bkcust/stubby.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"os"

"github.com/project-machine/bootkit/pkg/stubby"
"github.com/project-machine/bootkit/go/pkg/stubby"
cli "github.com/urfave/cli/v2"
)

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions cmd/bkcust/virtfw.go → go/cmd/bkcust/virtfw.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strings"

efi "github.com/canonical/go-efilib"
"github.com/project-machine/bootkit/pkg/cert"
"github.com/project-machine/bootkit/pkg/firmware"
"github.com/project-machine/bootkit/pkg/util"
"github.com/project-machine/bootkit/go/pkg/cert"
"github.com/project-machine/bootkit/go/pkg/firmware"
"github.com/project-machine/bootkit/go/pkg/util"
cli "github.com/urfave/cli/v2"
)

Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions go.mod → go/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/project-machine/bootkit
module github.com/project-machine/bootkit/go

go 1.21
go 1.20

require (
github.com/anuvu/disko v0.0.11
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/cert/cert_test.go → go/pkg/cert/cert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"

efi "github.com/canonical/go-efilib"
. "github.com/project-machine/bootkit/pkg/cert"
. "github.com/project-machine/bootkit/go/pkg/cert"
)

var uefiDBPEM = []byte(`-----BEGIN CERTIFICATE-----
Expand Down
4 changes: 2 additions & 2 deletions pkg/firmware/ovmf.go → go/pkg/firmware/ovmf.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"os"

"github.com/project-machine/bootkit/pkg/cert"
"github.com/project-machine/bootkit/pkg/run"
"github.com/project-machine/bootkit/go/pkg/cert"
"github.com/project-machine/bootkit/go/pkg/run"

efi "github.com/canonical/go-efilib"
)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/obj/update.go → go/pkg/obj/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package obj
import (
"fmt"

"github.com/project-machine/bootkit/pkg/run"
"github.com/project-machine/bootkit/go/pkg/run"
)

type SectionInput struct {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/shim/shim.go → go/pkg/shim/shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"unsafe"

efi "github.com/canonical/go-efilib"
"github.com/project-machine/bootkit/pkg/obj"
"github.com/project-machine/bootkit/go/pkg/obj"
)

var nativeEndian binary.ByteOrder
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions pkg/stubby/stubby.go → go/pkg/stubby/stubby.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"os"

"github.com/project-machine/bootkit/pkg/obj"
"github.com/project-machine/bootkit/pkg/util"
"github.com/project-machine/bootkit/go/pkg/obj"
"github.com/project-machine/bootkit/go/pkg/util"
)

// Smoosh - create unified kernel image 'uki' from stubby 'stubEfi'
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions pkg/stacker.yaml → go/stacker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildenv-pkg:
type: built
tag: minbase
import:
- https://go.dev/dl/go1.19.4.linux-amd64.tar.gz
- https://go.dev/dl/go1.20.8.linux-amd64.tar.gz
run: |
pkgtool install gcc git libc6-dev make pkg-config \
libcap-dev libacl1-dev libsquashfs-dev libdevmapper-dev \
Expand Down Expand Up @@ -51,7 +51,7 @@ build-pkg:
binds:
- ${{TOP_D}} -> /build/bootkit
run: |
cd /build/bootkit/pkg
cd /build/bootkit/
export GOPATH=/build/bootkit/.go
export GOCACHE=$GOPATH/cache
Expand Down

0 comments on commit 5a8e35f

Please sign in to comment.