From 94369e8969213f6b68411722d3fd854be2a7d72e Mon Sep 17 00:00:00 2001 From: Tom Boettger Date: Sun, 23 Oct 2022 23:51:49 +0200 Subject: [PATCH] Update readme, fix misspelling and run shellcheck on build script Signed-off-by: Tom Boettger --- consul/GNUmakefile.patch | 2 +- consul/README.md | 14 +++++++++++++- consul/build.sh | 6 +++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/consul/GNUmakefile.patch b/consul/GNUmakefile.patch index 47f79b2..ed3d1c3 100644 --- a/consul/GNUmakefile.patch +++ b/consul/GNUmakefile.patch @@ -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)" diff --git a/consul/README.md b/consul/README.md index 2033d95..624f51c 100644 --- a/consul/README.md +++ b/consul/README.md @@ -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 @@ -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] +``` diff --git a/consul/build.sh b/consul/build.sh index 32ace06..9a4764b 100755 --- a/consul/build.sh +++ b/consul/build.sh @@ -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 ""