Skip to content

Commit

Permalink
Update readme, fix misspelling and run shellcheck on build script
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Boettger <[email protected]>
  • Loading branch information
bttger committed Oct 23, 2022
1 parent 21cfb2f commit 94369e8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion consul/GNUmakefile.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
< CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) go build -o ./pkg/bin/linux_$(GOARCH) -ldflags "$(GOLDFLAGS)" -tags "$(GOTAGS)"
---
> GOLDFLAGS="$(GOLDFLAGS) -linkmode external -extldflags '-static-pie'"
> CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) go build -o ./pkg/bin/linux_$(GOARCH) -buildmode=pie -ldflags "$(GOLDFLAGS)" -tags "$(GOTAGS)"
> CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) go build -o ./pkg/bin -buildmode=pie -ldflags "$(GOLDFLAGS)" -tags "$(GOTAGS)"
14 changes: 13 additions & 1 deletion consul/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Build the consul server as a static PIE ELF running on Linux.
Make sure the following packages are installed:
* go >= 1.17
* unzip
* apply
* patch

## Build
Expand All @@ -18,3 +17,16 @@ If you want to rebuild it, run:
```
$ ./build.sh
```

## Run

You can run the executable natively on Linux:

```
$ ./consul-1.13.3/pkg/bin/consul version
```

Or with [run-elfloader](https://github.com/unikraft/run-app-elfloader) on Unikraft:
```
$ ./run_elfloader ../static-pie-apps/consul/consul-1.13.3/pkg/bin/consul [args]
```
6 changes: 3 additions & 3 deletions consul/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ echo "Unpacking consul source code..."
unzip v1.13.3.zip

echo "Building consul... "
cd consul-1.13.3
patch GNUMakefile ../GNUMakefile.patch
make dev
cd consul-1.13.3 || exit
patch GNUmakefile ../GNUmakefile.patch
make linux
echo ""

0 comments on commit 94369e8

Please sign in to comment.