Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add service to acquire hw information for swupdate #434

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions recipes-core/images/iot2050-image-swu-example.bb
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ IMAGE_INSTALL += "efibootguard"
IMAGE_INSTALL += "swupdate"
IMAGE_INSTALL += "swupdate-handler-roundrobin"
IMAGE_INSTALL += "swupdate-complete-update-helper"
IMAGE_INSTALL += "swupdate-hw-info-provider"
IMAGE_INSTALL += "iot2050-watchdog"
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ SRC_URI = "file://complete_update.sh"
DEBIAN_DEPENDS = "efibootguard"

do_install() {
# add board status led service
install -v -d ${D}/usr/bin
install -v -m 644 ${WORKDIR}/complete_update.sh ${D}/usr/bin/complete_update.sh
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Acquire hardware information for swupdate
Before=swupdate.service
ConditionPathExists=!/etc/hwrevision

[Service]
Type=oneshot
ExecStart=/bin/sh -c "echo SIMATIC-IOT2050 $(tr -d '\0' < /proc/device-tree/compatible | cut -d',' -f2) > /etc/hwrevision"
RemainAfterExit=true
StandardOutput=journal

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# Copyright (c) Siemens AG, 2023
#
# Authors:
# Felix Moessbauer <[email protected]>
#
# SPDX-License-Identifier: MIT
#
# Note: This service writes the second element from /proc/device-tree/compatible
# into /etc/hwrevision. For an IOT2050 Advanced PG2, this mapps to:
# "iot2050-advanced-pg2ti"

inherit dpkg
DESCRIPTION = "one-shot service to initialize hardware info for swupdate"

SRC_URI = "file://swupdate-hw-info-provider.service"
DPKG_ARCH = "all"

do_prepare_build[cleandirs] += "${S}/debian"
do_prepare_build() {
deb_debianize
cp ${WORKDIR}/swupdate-hw-info-provider.service ${S}/debian
}