Merge pull request #1162 from kinvolk/jepio/amazon-ssm-agent-xcompile

amazon-ssm-agent: re-add dependency to oem-ec2-compat
This commit is contained in:
Jeremi Piotrowski 2021-08-04 10:20:15 +02:00 committed by GitHub
commit 7cf88348f3
3 changed files with 34 additions and 12 deletions

View File

@ -28,23 +28,25 @@ src_prepare() {
} }
src_compile() { src_compile() {
go_export
# this is replication of commands from the vendor makefile # this is replication of commands from the vendor makefile
# but without network activity during build phase # but without network activity during build phase
local GO_LDFLAGS="-s -w -extldflags=-Wl,-z,now,-z,relro,-z,defs" local GO_LDFLAGS="-s -w -extldflags=-Wl,-z,now,-z,relro,-z,defs"
export GOPATH="${WORKDIR}/${PN}-${PV}" export GOPATH="${WORKDIR}/${PN}-${PV}"
export GO111MODULE="off" export GO111MODULE="off"
# set agent release version # set agent release version
BRAZIL_PACKAGE_VERSION=${PV} go run ./agent/version/versiongenerator/version-gen.go BRAZIL_PACKAGE_VERSION=${PV} ${EGO} run ./agent/version/versiongenerator/version-gen.go
# build all the tools # build all the tools
go build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ ${EGO} build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \
-o bin/amazon-ssm-agent ./agent || die -o bin/amazon-ssm-agent ./agent || die
go build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ ${EGO} build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \
-o bin/ssm-cli ./agent/cli-main || die -o bin/ssm-cli ./agent/cli-main || die
go build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ ${EGO} build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \
-o bin/ssm-document-worker ./agent/framework/processor/executer/outofproc/worker || die -o bin/ssm-document-worker ./agent/framework/processor/executer/outofproc/worker || die
go build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ ${EGO} build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \
-o bin/ssm-session-logger ./agent/session/logging || die -o bin/ssm-session-logger ./agent/session/logging || die
go build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ ${EGO} build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \
-o bin/ssm-session-worker ./agent/framework/processor/executer/outofproc/sessionworker || die -o bin/ssm-session-worker ./agent/framework/processor/executer/outofproc/sessionworker || die
} }

View File

@ -7,6 +7,31 @@
{ {
"name": "coreos-metadata-sshkeys@.service", "name": "coreos-metadata-sshkeys@.service",
"enabled": true "enabled": true
},
{
"name": "amazon-ssm-agent.service",
"enabled": true,
"contents": "[Unit]\nDescription=amazon-ssm-agent\nAfter=network-online.target\n\n[Service]\nType=simple\nWorkingDirectory=/usr/share/oem\nExecStart=/usr/share/oem/amazon-ssm-agent\nKillMode=process\nRestart=on-failure\nRestartForceExitStatus=SIGPIPE\nRestartSec=15min\n\n[Install]\nWantedBy=multi-user.target\n"
}
]
},
"storage": {
"files": [
{
"filesystem": "root",
"path": "/etc/amazon/ssm/amazon-ssm-agent.json",
"contents": {
"source": "oem:///ssm/amazon-ssm-agent.json.template"
},
"mode": 292
},
{
"filesystem": "root",
"path": "/etc/amazon/ssm/seelog.xml",
"contents": {
"source": "oem:///ssm/seelog.xml.template"
},
"mode": 292
} }
] ]
} }

View File

@ -13,13 +13,8 @@ KEYWORDS="amd64 arm64 x86"
IUSE="ec2 openstack brightbox aws_pro" IUSE="ec2 openstack brightbox aws_pro"
REQUIRED_USE="^^ ( ec2 openstack brightbox aws_pro )" REQUIRED_USE="^^ ( ec2 openstack brightbox aws_pro )"
# TODO: The AWS SSM Agent is currently too big for the OEM partition
# but if it fits, uncomment the following and revert
# b6abb59c544be13e923a3e7240b5c9395c281fca
#RDEPEND="
# ec2? ( app-emulation/amazon-ssm-agent )
#"
RDEPEND=" RDEPEND="
ec2? ( app-emulation/amazon-ssm-agent )
aws_pro? ( aws_pro? (
coreos-base/flatcar-eks coreos-base/flatcar-eks
x11-drivers/nvidia-drivers x11-drivers/nvidia-drivers