-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Yocto recipe for Kanto Update Manager (kirkstone branch) (#62)
[#60] Yocto recipe for Kanto Update Manager Signed-off-by: Stoyan Zoubev <[email protected]>
- Loading branch information
1 parent
79769e1
commit 2d6fdb5
Showing
5 changed files
with
110 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
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,13 @@ | ||
{ | ||
"log": { | ||
"logFile": "@UM_LOG_DD@/update-manager/update-manager.log" | ||
}, | ||
"domain": "device", | ||
"agents": { | ||
"containers": { | ||
"name": "containers", | ||
"rebootRequired": false, | ||
"readTimeout": "30s" | ||
} | ||
} | ||
} |
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,14 @@ | ||
[Unit] | ||
Description=Eclipse Kanto - Update Manager | ||
Documentation=https://eclipse.org/kanto/docs/ | ||
After=network.target mosquitto.service | ||
Requires=network.target | ||
Requires=mosquitto.service | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=@UM_BIN_DD@/update-manager -configFile @UM_CFG_DD@/update-manager/config.json | ||
Restart=always | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
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,10 @@ | ||
# Common configuration variables to set the binaries and resources allocation directories for Eclipse Kanto update manager component | ||
# The destination directory where the required configuration files for the proper connectivity establishment of the update manager will be placed | ||
UM_CFG_DD ?= "${sysconfdir}" | ||
# The destination directory where the generated service file will be placed | ||
UM_SYSUNIT_DD ?= "${systemd_unitdir}/system" | ||
# The destination directory where the update manager binaries will be placed | ||
UM_BIN_DD ?= "${bindir}" | ||
# The destination directory where the update manager logs will be placed | ||
UM_LOG_DD ?= "${localstatedir}/log" | ||
|
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,69 @@ | ||
DESCRIPTION = "Eclipse Kanto - Update Manager" | ||
|
||
LICENSE = "EPL-2.0 | Apache-2.0" | ||
LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=54cd967551e55d39f55006d3344c22fc" | ||
|
||
SRC_URI = "git://github.com/eclipse-kanto/update-manager;protocol=https;branch=main \ | ||
file://config.json \ | ||
file://service.template \ | ||
" | ||
|
||
SRCREV = "${AUTOREV}" | ||
|
||
PV = "0.1.0-git${SRCPV}" | ||
|
||
GO_IMPORT = "github.com/eclipse-kanto/update-manager" | ||
GO_INSTALL = "${GO_IMPORT}/cmd/update-manager" | ||
|
||
require update-manager.inc | ||
|
||
inherit go-mod | ||
inherit systemd | ||
|
||
SYSTEMD_AUTO_ENABLE = "enable" | ||
SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" | ||
SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','update-manager.service','',d)}" | ||
|
||
# workaround for network issue | ||
do_compile[network] = "1" | ||
|
||
FILES:${PN} += "${UM_SYSUNIT_DD}/update-manager.service" | ||
FILES:${PN} += "${UM_BIN_DD}/update-manager" | ||
# ensure all additional resources are properly packed in the resulting package if provided | ||
FILES:${PN} += "${UM_CFG_DD}/update-manager/config.json" | ||
|
||
RDEPENDS:${PN} += "mosquitto" | ||
|
||
PROVIDES:${PN} += "kanto/update-manager" | ||
RPROVIDES:${PN} += "kanto/update-manager" | ||
|
||
# BUILD_VERSION = "0.1.0-M2" | ||
# export GO_EXTRA_LDFLAGS="-X main.version=${BUILD_VERSION}" | ||
|
||
do_install() { | ||
install -d "${D}/${UM_BIN_DD}" | ||
|
||
install -m 0755 "${GO_BUILD_BINDIR}/update-manager" "${D}${UM_BIN_DD}/update-manager" | ||
|
||
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | ||
install -d ${D}${UM_SYSUNIT_DD} | ||
|
||
# update-manager | ||
install -d ${D}${UM_CFG_DD}/update-manager | ||
|
||
# config.json | ||
install -m 0644 ${WORKDIR}/config.json ${D}${UM_CFG_DD}/update-manager | ||
|
||
# service.template as service | ||
install -m 0644 ${WORKDIR}/service.template ${D}${UM_SYSUNIT_DD}/update-manager.service | ||
|
||
# fill in the update-manager systemd service template with the custom configs provided | ||
sed -e 's,@UM_BIN_DD@,${UM_BIN_DD},g' \ | ||
-e 's,@UM_CFG_DD@,${UM_CFG_DD},g' \ | ||
-i ${D}${UM_SYSUNIT_DD}/update-manager.service | ||
|
||
# fill in the config.json template with the custom configs provided | ||
sed -e 's,@UM_LOG_DD@,${UM_LOG_DD},g' \ | ||
-i ${D}${UM_CFG_DD}/update-manager/config.json | ||
fi | ||
} |