forked from openembedded/meta-openembedded
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Investigating the potential use of etcd within an OpenBMC distribution to manage data sharing and leader election in a multi-BMC system. Start off with a basic recipe to build the package. Signed-off-by: Andrew Geissler <[email protected]>
- Loading branch information
1 parent
c5f330b
commit 6fa5a87
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
DESCRIPTION = "etcd is a distributed key-value store for distributed systems" | ||
HOMEPAGE = "https://etcd.io/" | ||
|
||
LICENSE = "Apache-2.0" | ||
LIC_FILES_CHKSUM = "file://${S}/${GO_INSTALL}/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" | ||
|
||
SRC_URI = "git://github.com/etcd-io/etcd;branch=release-3.5;protocol=https" | ||
SRCREV = "215b53cf3b48ee761f4c40908b3874b2e5e95e9f" | ||
UPSTREAM_CHECK_COMMITS = "1" | ||
|
||
GO_IMPORT = "go.etcd.io/etcd/v3" | ||
GO_INSTALL = "src/${GO_IMPORT}/" | ||
|
||
RDEPENDS:${PN}-dev = " \ | ||
bash \ | ||
" | ||
|
||
export GO111MODULE="on" | ||
|
||
inherit go | ||
|
||
# Go based binaries do not handle being stripped | ||
INHIBIT_PACKAGE_STRIP = "1" | ||
INHIBIT_SYSROOT_STRIP = "1" | ||
|
||
# network is required by go to get dependent packages | ||
do_compile[network] = "1" | ||
|
||
# Need to build etcd out of where it is extracted to | ||
# Need to directly call build script vs. "make build" | ||
# because "make build" executes the generated binaries | ||
# at the end of the build which do not run correctly | ||
# when cross compiling for another machine | ||
go_do_compile:prepend() { | ||
cd ${GO_INSTALL} | ||
./build.sh | ||
|
||
# Lots of discussion in go community about how it sets packages to | ||
# read-only by default -> https://github.com/golang/go/issues/31481 | ||
# etcd is going to need some upstream work to support it. | ||
# For now, set the packages which are read-only back to | ||
# writeable so things like "bitbake -c cleanall etcd" will work. | ||
chmod u+w -R ${S}/src/github.com/myitcv/gobin | ||
chmod u+w -R ${WORKDIR}/build/pkg/mod | ||
|
||
} | ||
|
||
do_install:append() { | ||
install -d ${D}${bindir}/ | ||
install -m 0755 ${D}/usr/lib/go/src/go.etcd.io/etcd/v3/bin/etcd ${D}${bindir} | ||
install -m 0755 ${D}/usr/lib/go/src/go.etcd.io/etcd/v3/bin/etcdctl ${D}${bindir} | ||
install -m 0755 ${D}/usr/lib/go/src/go.etcd.io/etcd/v3/bin/etcdutl ${D}${bindir} | ||
} | ||
|