Skip to content

Commit

Permalink
Repeatable iPXE build, update deps and build with go-1.19 (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 authored Sep 14, 2022
1 parent 96e5fed commit f583650
Show file tree
Hide file tree
Showing 1,870 changed files with 151 additions and 627,700 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
id: go

- name: Check out code into the Go module directory
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cmd/pixiecore/pixiecore
dhcp4/dhcp4.test
pcap/pcap.test
pixiecore/pixiecore.test
ipxe/ipxe
vendor/
build/
.vscode
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM golang:1.18-buster as builder
COPY . /work/
FROM golang:1.19-bullseye as builder
WORKDIR /work
RUN make
COPY . .
RUN apt update \
&& apt install --yes --no-install-recommends \
liblzma-dev \
&& make ipxe pixie

FROM alpine:3.16
RUN apk -U add ca-certificates
Expand Down
38 changes: 21 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ifneq ($(wildcard Makefile.defaults),)
include Makefile.defaults
endif

all: pixie
all: ipxe pixie

.PHONY: pixie
pixie: test
Expand All @@ -33,20 +33,24 @@ test:
lint:
$(GOMODULECMD) tool vet .

.PHONY: update-ipxe
update-ipxe:
# rm -rf third_party/ipxe
# (cd third_party && git clone git://git.ipxe.org/ipxe.git)
# (cd third_party/ipxe && git rev-parse HEAD >COMMIT-ID)
# rm -rf third_party/ipxe/.git
(cd third_party/ipxe/src &&\

IPXE_COMMIT_SHA := $(shell cat ipxe/IPXE_COMMIT_SHA)

# Note: requires liblzma-dev package installed
.PHONY: ipxe
ipxe:
rm -rf ipxe/ipxe
(cd ipxe \
&& git clone https://github.com/ipxe/ipxe.git \
&& cd ipxe \
&& git checkout $(IPXE_COMMIT_SHA) \
)
cp ipxe/branding.h ipxe/ipxe/src/config/local/branding.h
(cd ipxe/ipxe/src &&\
make bin/ipxe.pxe bin/undionly.kpxe bin-x86_64-efi/ipxe.efi bin-i386-efi/ipxe.efi EMBED=../../../pixiecore/boot.ipxe)
(rm -rf third_party/ipxe/bin && mkdir third_party/ipxe/bin)
mv -f third_party/ipxe/src/bin/ipxe.pxe third_party/ipxe/bin/ipxe.pxe
mv -f third_party/ipxe/src/bin/undionly.kpxe third_party/ipxe/bin/undionly.kpxe
mv -f third_party/ipxe/src/bin-x86_64-efi/ipxe.efi third_party/ipxe/bin/ipxe-x86_64.efi
mv -f third_party/ipxe/src/bin-i386-efi/ipxe.efi third_party/ipxe/bin/ipxe-i386.efi
go-bindata -o third_party/ipxe/ipxe-bin.go -pkg ipxe -nometadata -nomemcopy -prefix third_party/ipxe/bin/ third_party/ipxe/bin
gofmt -s -w third_party/ipxe/ipxe-bin.go
rm -rf third_party/ipxe/bin
(cd third_party/ipxe/src && make veryclean)
(rm -rf ipxe/ipxe/bin && mkdir ipxe/ipxe/bin)
mv -f ipxe/ipxe/src/bin/ipxe.pxe ipxe/ipxe/bin/ipxe.pxe
mv -f ipxe/ipxe/src/bin/undionly.kpxe ipxe/ipxe/bin/undionly.kpxe
mv -f ipxe/ipxe/src/bin-x86_64-efi/ipxe.efi ipxe/ipxe/bin/ipxe-x86_64.efi
mv -f ipxe/ipxe/src/bin-i386-efi/ipxe.efi ipxe/ipxe/bin/ipxe-i386.efi
(cd ipxe/ipxe/src && make veryclean)
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
package main

import (
"github.com/metal-stack/pixie/ipxe"
"github.com/metal-stack/pixie/pixiecore"
"github.com/metal-stack/pixie/pixiecore/cli"
"github.com/metal-stack/pixie/third_party/ipxe"
)

func main() {
Expand Down
42 changes: 21 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ module github.com/metal-stack/pixie
go 1.18

require (
github.com/metal-stack/metal-api v0.18.0
github.com/metal-stack/metal-api v0.21.1
github.com/metal-stack/v v1.0.3
github.com/pin/tftp v0.0.0-20210809155059-0161c5dd2e96
github.com/prometheus/client_golang v1.12.2
github.com/spf13/cobra v1.4.0
github.com/spf13/viper v1.12.0
github.com/stretchr/testify v1.7.2
go.uber.org/zap v1.21.0
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
golang.org/x/net v0.0.0-20220607020251-c690dde0001d
google.golang.org/grpc v1.47.0
github.com/pin/tftp/v3 v3.0.0
github.com/prometheus/client_golang v1.13.0
github.com/spf13/cobra v1.5.0
github.com/spf13/viper v1.13.0
github.com/stretchr/testify v1.8.0
go.uber.org/zap v1.23.0
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90
golang.org/x/net v0.0.0-20220909164309-bea034e7d591
google.golang.org/grpc v1.49.0
)

require (
Expand All @@ -24,28 +24,28 @@ require (
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.34.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.3.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
golang.org/x/sys v0.0.0-20220913175220-63ea55921009 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20220531173845-685668d2de03 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit f583650

Please sign in to comment.