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

Fix swupdate-enc class #29

Open
wants to merge 3 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
6 changes: 4 additions & 2 deletions classes-recipe/swupdate-common.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,12 @@ python do_swuimage () {
import shutil

list_for_cpio = ["sw-description"]
workdir = d.getVar('WORKDIR', True)
unpackdir = d.getVar('UNPACKDIR', True)
s = d.getVar('S', True)
imgdeploydir = d.getVar('SWUDEPLOYDIR', True)
shutil.copyfile(os.path.join(workdir, "sw-description"), os.path.join(s, "sw-description"))
if not os.path.exists(s):
os.makedirs(s)
shutil.copyfile(os.path.join(unpackdir, "sw-description"), os.path.join(s, "sw-description"))

if d.getVar('SWUPDATE_SIGNING', True):
list_for_cpio.append('sw-description.sig')
Expand Down
3 changes: 2 additions & 1 deletion classes-recipe/swupdate-enc.bbclass
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
inherit image_types
#
# The key must be generated as described in doc
# with
Expand All @@ -20,4 +21,4 @@ swu_encrypt_file() {
CONVERSIONTYPES += "enc"

CONVERSION_DEPENDS_enc = "openssl-native coreutils-native"
CONVERSION_CMD:enc="swu_encrypt_file ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.enc"
CONVERSION_CMD:enc="swu_encrypt_file ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.enc"
20 changes: 10 additions & 10 deletions recipes-support/swupdate/swupdate.inc
Original file line number Diff line number Diff line change
Expand Up @@ -271,34 +271,34 @@ do_install () {
fi

install -d ${D}${sysconfdir}/init.d
install -m 755 ${WORKDIR}/swupdate ${D}${sysconfdir}/init.d
install -m 755 ${B}/swupdate ${D}${sysconfdir}/init.d
sed -i -e "s|/usr/lib/|${libdir}/|" ${D}${sysconfdir}/init.d/swupdate

# shell based configuration loader allows to place code snippets into this folder
install -d ${D}${libdir}/swupdate/conf.d
install -m 755 ${WORKDIR}/swupdate.sh ${D}${libdir}/swupdate
install -m 755 ${UNPACKDIR}/swupdate.sh ${D}${libdir}/swupdate
sed -i 's#@LIBDIR@#${libdir}#g' ${D}${libdir}/swupdate/swupdate.sh
if ${SWUPDATE_MONGOOSE}; then
install -m 644 ${WORKDIR}/10-mongoose-args ${D}${libdir}/swupdate/conf.d/
install -m 644 ${UNPACKDIR}/10-mongoose-args ${D}${libdir}/swupdate/conf.d/
fi
install -d ${D}${systemd_unitdir}/system
install -m 644 ${WORKDIR}/swupdate.service ${D}${systemd_system_unitdir}
install -m 644 ${UNPACKDIR}/swupdate.service ${D}${systemd_system_unitdir}
sed -i 's#@LIBDIR@#${libdir}#' ${D}${systemd_system_unitdir}/swupdate.service
install -m 644 ${WORKDIR}/swupdate.socket.tmpl ${D}${systemd_system_unitdir}/swupdate.socket
install -m 644 ${UNPACKDIR}/swupdate.socket.tmpl ${D}${systemd_system_unitdir}/swupdate.socket
sed -e "s,@@SWUPDATE_SOCKET_CTRL_PATH@@,${SWUPDATE_SOCKET_CTRL_PATH},g" \
-e "s,@@SWUPDATE_SOCKET_PROGRESS_PATH@@,${SWUPDATE_SOCKET_PROGRESS_PATH},g" \
-i ${D}${systemd_system_unitdir}/swupdate.socket
install -m 644 ${WORKDIR}/[email protected] ${D}${systemd_system_unitdir}
install -m 644 ${WORKDIR}/swupdate-progress.service ${D}${systemd_system_unitdir}
install -m 644 ${UNPACKDIR}/[email protected] ${D}${systemd_system_unitdir}
install -m 644 ${UNPACKDIR}/swupdate-progress.service ${D}${systemd_system_unitdir}

if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -d ${D}${nonarch_libdir}/tmpfiles.d
install -m 0644 ${WORKDIR}/tmpfiles-swupdate.conf ${D}${nonarch_libdir}/tmpfiles.d/swupdate.conf
install -m 0644 ${UNPACKDIR}/tmpfiles-swupdate.conf ${D}${nonarch_libdir}/tmpfiles.d/swupdate.conf
install -d ${D}${sysconfdir}/udev/rules.d
install -m 0644 ${WORKDIR}/swupdate-usb.rules ${D}${sysconfdir}/udev/rules.d/
install -m 0644 ${UNPACKDIR}/swupdate-usb.rules ${D}${sysconfdir}/udev/rules.d/
else
# in case of systemd there is a service file, for sysv init we need to start it as well
install -m 0644 ${WORKDIR}/90-start-progress ${D}${libdir}/swupdate/conf.d/
install -m 0644 ${UNPACKDIR}/90-start-progress ${D}${libdir}/swupdate/conf.d/
fi
}

Expand Down