From patchwork Wed Jul 31 16:15:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Walkes X-Patchwork-Id: 1967198 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=sFB2q7op; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::33c; helo=mail-ot1-x33c.google.com; envelope-from=swupdate+bncbcwltgh224mbbpggvg2qmgqehwclxuq@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-ot1-x33c.google.com (mail-ot1-x33c.google.com [IPv6:2607:f8b0:4864:20::33c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WYxzN5Hk0z1ybX for ; Thu, 1 Aug 2024 02:15:59 +1000 (AEST) Received: by mail-ot1-x33c.google.com with SMTP id 46e09a7af769-7093d32519esf7180003a34.0 for ; Wed, 31 Jul 2024 09:15:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1722442557; cv=pass; d=google.com; s=arc-20160816; b=O7NBhMGJ4TZxJHNVYWLMDBEOLo0qfCqx+36MOVVsngf7M+CZZWPqc0q5cvrN997Y77 ni7Efd24eZoJq8xdHGh3ygdnhtgia29sXaG84itSNvD8G5yQ2gAfGsvwWr5vZEwFx9Je lYJooq2c13IsIQinzAIJrUi2Fk+ixJomkLOcQrV3whbisoimQy2ozcqzTfnmzT3wMjEl MAe9HH7drIKhUnB891daPIlieTf2wP/UWWDZFueZPM+QFlYybu5JcFMEj+HnCDxBrkdX oCKpIQwEBkBQ7Wvu2UR8juyISFTUt/asGiHtc/dTtcevR+3ra3QMaei3taQtv7adBcNH bOtA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=KnEhAzBoNvjm2rz2BZtZqupYOktwOKjHkT3bY/Ogjio=; fh=4YCXSUc8fH+QasEVKTfK5427T6Ot/iC4zDmNuPr+OAg=; b=t/ZffanepSWDczhtawf4/dmG8/vBVCO5nQT/VtRnwTIUpAtDoycuoI+SrUd/XdjGp/ bod+KOKhxL2ny5/vyhoRZfKKwiOM5aSJirAteMzvOfm3tinaCDmlhYmK7wD1Ats3EM/E w7WtUYeEhXYobIVp5VlF9kGQyvDYCtzLfHalViJHTtntcTry5T03hTMqzZaKncKYB4u3 /rTUcHPFLtOFQQEwFw6XHUji6zpAhMtHl1EnnL7JFtI36SitmuxqXbDacNZiAy8aPHyT ks227dvyw0uw+vgnq08rKOpSYklQIF9hFS4DyQLsGFKKcTUAnzPU6f7pHBD0qBkBtNxN 0oCw==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@trellis-logic-com.20230601.gappssmtp.com header.s=20230601 header.b=WtTZ2Ify; spf=neutral (google.com: 2607:f8b0:4864:20::136 is neither permitted nor denied by best guess record for domain of danwalkes@trellis-logic.com) smtp.mailfrom=danwalkes@trellis-logic.com; dara=pass header.i=@googlegroups.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1722442557; x=1723047357; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:content-transfer-encoding:mime-version:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=KnEhAzBoNvjm2rz2BZtZqupYOktwOKjHkT3bY/Ogjio=; b=sFB2q7opTp98C4F0vpmM6LxL52rkPOewOepUpVtnMTWGrshWc1FV8BBov6/LfRyhnd 01848hskomVy5P7MVAu1WV5fErwS0Qn0PpxbZvAmxkFSaUOdxkq4pBQYnkbG0/8gOgul PIP95ob6iHJOkE/CnPqJE2ewRgU9o5Je2nBhCl3qjI2P0b9ejElJsbSGv0rKZYnY3LyX 5riO9FCyV81vgvuAMvHR0I2sPhpXbtOdXxDcPnN6pgt6OuB5yDqgU5p9ySeJ8GmpzKmO QvM/T2xydKQH7rn5XvMqmF7RW2IPzPPWZ4FM1nAGggPUztc+7yCgDKEUWGDFdQTfWovh 0wIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722442557; x=1723047357; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-beenthere:x-gm-message-state:sender:from:to:cc:subject :date:message-id:reply-to; bh=KnEhAzBoNvjm2rz2BZtZqupYOktwOKjHkT3bY/Ogjio=; b=JCVJus0OKrdKrw+IMuVUb1Cc+VFVAVjVOWpnw+bsUwM1h//ANfxD5X/puRAlaSomfR Lli+cM2R02uBjV17H+xYkVtNKZ9QuzrKW4NBGhI7lIdCME0+UPCEc1zOILUEWXIJavbX +EZV6v14TkUy+GqNkOEw+SbPGUG1rOnBsIqNUG6jTCX9p1vNzsaM+OHJ+U9CIwQG0cUN K/nEQWxRP4wbxEptwlAzCQTyV84BlsFKSWWJ22PX4butUuzMa/b9hoiehubJ1uNgFTY4 vq6cRvOKGUt1M7LyTLNruIXlPXYFTFmO1K7mOjd3hDn9vB0EdC9AADgjGIp90B8w/6K1 ohyQ== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCUPEDbiSY/EWtgehQLqrxvqJaMT518tJvDRM3rPqKlo/GbPJp5hnfU5JPxC6YyxxSEMip8EaAaDtqHo/mgADC66N1hKa1NbRVDKrV2Tow== X-Gm-Message-State: AOJu0YwSXb8G3kU2Q8mTcgMtQyzjrpQLDA0DIk0/qeSEMAjo8qDhzQ7u mc1w6MR5YXLNwuyPAjCMENOZnUZR8q82oJVdmxefH0jmKVyr+iBE X-Google-Smtp-Source: AGHT+IHBcIDBX3bDTbZLZjJY29imXsqwPJskkG9CvGXTOLgAJMfUi6xU65jcC+whkBg50zjtmnrMxA== X-Received: by 2002:a05:6830:c41:b0:708:e969:e0d9 with SMTP id 46e09a7af769-70940c150a2mr11662590a34.17.1722442556720; Wed, 31 Jul 2024 09:15:56 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a4a:de4b:0:b0:5d5:d941:e3f8 with SMTP id 006d021491bc7-5d5d941e7cdls3585852eaf.0.-pod-prod-06-us; Wed, 31 Jul 2024 09:15:55 -0700 (PDT) X-Received: by 2002:a05:6830:2909:b0:703:7a77:d7d7 with SMTP id 46e09a7af769-70940c62ee6mr14466898a34.28.1722442555313; Wed, 31 Jul 2024 09:15:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1722442555; cv=none; d=google.com; s=arc-20160816; b=yHxuxH2WzxS2R+YiZaR0g18Kh39yfnMjfmY6neSe3IOsnuWRpUG2J0c+9mMhcZ4fQo 5zpxulPkCwhVCpitlqfrMSUjyO0us3UMuaiGjd4dDFFsHyR/b1b1Rx97/kVhTxHG9iI/ SL9KTIDZK2wKYHnE/cTji8udKspR0xNNlo+7vEmcpeMB1RGwzf59b++xzRfN08wSn9xd 5c6aEtVg+KvS56aoKGRPKgGFfBRlZd48Fvwj2CEwzkuxVNshLbdOcy1ZK+CE1hrOJNyy SCXUuMC/vXubvmfbwAn2K9PMQYBrnJEH2VIQhMfgLVbK2lvMcGNWAFoUElHzhofyPSlh PlNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=DEPxG9/iwD/5ttj8aiRbAveJgmTtgkOJour3Q4gZm0Y=; fh=CPPy5SrA2Xeg3agvV+7qgllTb4Osr3SZWuzMNAf7F0A=; b=p8QjcJvctCVfwIu3/6rOqlB6LyKvo9kjzrMRYnoN5FyeZM13lalGAHhzspPKAB/BJ0 RyBf9bm00zP9/SnauuZJsiu7gC4twj9ZXicwSoHZ8bhagl95wPa6MpfZO9X+V9+G31SM p81pNnxPD4rDdjGl1hcs9iiF0GC7vvM/3s/hBeorMIv3fUcCk3LfM1QVICS7j6Rdk+Ho twI7WzmOJB5yj9tywnv9Q9TlSsVIuQaGsTM/SlS/5mmAl2c03t00dJP8rVuz0HgV5LhA Ss3oAW1ucx4LwAOV0B2rtwKT7YO0yKtM1eMYq/KkLvxVteo+i6XPEP7W1rGpSesj+V3Y UW2Q==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@trellis-logic-com.20230601.gappssmtp.com header.s=20230601 header.b=WtTZ2Ify; spf=neutral (google.com: 2607:f8b0:4864:20::136 is neither permitted nor denied by best guess record for domain of danwalkes@trellis-logic.com) smtp.mailfrom=danwalkes@trellis-logic.com; dara=pass header.i=@googlegroups.com Received: from mail-il1-x136.google.com (mail-il1-x136.google.com. [2607:f8b0:4864:20::136]) by gmr-mx.google.com with ESMTPS id 46e09a7af769-7095aeaf651si220566a34.3.2024.07.31.09.15.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 Jul 2024 09:15:55 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:4864:20::136 is neither permitted nor denied by best guess record for domain of danwalkes@trellis-logic.com) client-ip=2607:f8b0:4864:20::136; Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-381f24d6bc4so24112465ab.2 for ; Wed, 31 Jul 2024 09:15:55 -0700 (PDT) X-Received: by 2002:a05:6e02:1d99:b0:375:c473:4a78 with SMTP id e9e14a558f8ab-39aec4125b8mr191972495ab.23.1722442554175; Wed, 31 Jul 2024 09:15:54 -0700 (PDT) Received: from dan-tr.. (c-98-245-195-12.hsd1.co.comcast.net. [98.245.195.12]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-39ae814b4b6sm46143175ab.37.2024.07.31.09.15.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 09:15:53 -0700 (PDT) From: Dan Walkes To: swupdate@googlegroups.com Cc: Dan Walkes Subject: [swupdate] [meta-swupdate][PATCH] styhead migration fixes Date: Wed, 31 Jul 2024 10:15:44 -0600 Message-Id: <20240731161544.4175303-1-danwalkes@trellis-logic.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Original-Sender: danwalkes@trellis-logic.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@trellis-logic-com.20230601.gappssmtp.com header.s=20230601 header.b=WtTZ2Ify; spf=neutral (google.com: 2607:f8b0:4864:20::136 is neither permitted nor denied by best guess record for domain of danwalkes@trellis-logic.com) smtp.mailfrom=danwalkes@trellis-logic.com; dara=pass header.i=@googlegroups.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Based on the guidance from [1], resolve build errors on styhead. This resolves 3 issues with styhead as found with the integration at [2] and testing of branch at [3], as referenced at [4]: ```` DEBUG: Executing shell function do_configure cat: /home/dan/trellis/oe4t/tegra-demo-distro/build-master/tmp/work/armv8a-oe4t-linux/swupdate/2024.05/defconfig: No such file or directory WARNING: exit code 1 from a shell command. ``` This error occurs due to the swupdate.inc recipe usage of WORKDIR instead of UNPACKDIR. Resolved by replacing most references of WORKDIR to UNPACKDIR as suggested in [1] for swupdate.inc ``` WARNING: swupdate-image-tegra-1.0-r0 do_unpack: swupdate-image-tegra: the directory ${WORKDIR}/${PN} (/home/dan/trellis/oe4t/tegra-demo-distro/build-master/tmp/work/jetson_orin_nano_devkit_nvme-oe4t-linux/swupdate-image-tegra/1.0/swupdate-image-tegra) pointed to by the S variable doesn't exist - please set S within the recipe to point to where the source has been unpacked to ``` This warning is printed due to the setting of S based on WORKDIR in swupdate.bbclass and the fact that the S directory is no longer automatically created as discussed in [1]. To resolve, use the guidance in [1] to set S and UNPACKDIR for recipes which only use file:// sources. ``` ERROR: swupdate-image-tegra-1.0-r0 do_swuimage: Error executing a python function in exec_func_python() autogenerated: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_func_python() autogenerated', lineno: 2, function: 0001: *** 0002:do_swuimage(d) 0003: File: '/home/dan/trellis/oe4t/tegra-demo-distro/build-master/../layers/meta-swupdate/classes-recipe/swupdate-common.bbclass', lineno: 325, function: do_swuimage 0321: list_for_cpio = ["sw-description"] 0322: workdir = d.getVar('WORKDIR') 0323: s = d.getVar('S') 0324: imgdeploydir = d.getVar('SWUDEPLOYDIR') *** 0325: shutil.copyfile(os.path.join(workdir, "sw-description"), os.path.join(s, "sw-description")) 0326: ... File: '/usr/lib/python3.10/shutil.py', lineno: 254, function: copyfile 0250: 0253: else: *** 0254: with open(src, 'rb') as fsrc: ``` This error occurs due to the use of WORKDIR as the location of files instead of UNPACKDIR. When using the guidance in [1] to set UNPACKDIR there is no longer a need to copy from WORKDIR to UNPACKDIR since S is UNPACKDIR, so both the workdir reference and shutil copy can be removed. 1: https://docs.yoctoproject.org/next/migration-guides/migration-5.1.html 2: https://github.com/OE4T/tegra-demo-distro/blob/master/layers/meta-tegrademo/dynamic-layers/meta-swupdate/README.md 3: https://github.com/Trellis-Logic/tegra-demo-distro/blob/scarthgap%2Bkas/layers/meta-tegrademo/dynamic-layers/meta-swupdate/README.md 4: https://groups.google.com/g/swupdate/c/E2h_qgHvJuk Signed-off-by: Dan Walkes Reviewed-by: Stefano Babic --- classes-recipe/swupdate-common.bbclass | 2 -- classes-recipe/swupdate-image.bbclass | 3 ++- classes-recipe/swupdate.bbclass | 3 ++- recipes-support/swupdate/swupdate.inc | 26 +++++++++++++------------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/classes-recipe/swupdate-common.bbclass b/classes-recipe/swupdate-common.bbclass index 0367f81..647222d 100644 --- a/classes-recipe/swupdate-common.bbclass +++ b/classes-recipe/swupdate-common.bbclass @@ -319,10 +319,8 @@ python do_swuimage () { import shutil list_for_cpio = ["sw-description"] - workdir = d.getVar('WORKDIR') s = d.getVar('S') imgdeploydir = d.getVar('SWUDEPLOYDIR') - shutil.copyfile(os.path.join(workdir, "sw-description"), os.path.join(s, "sw-description")) if d.getVar('SWUPDATE_SIGNING'): list_for_cpio.append('sw-description.sig') diff --git a/classes-recipe/swupdate-image.bbclass b/classes-recipe/swupdate-image.bbclass index 175fc4e..62ef19d 100644 --- a/classes-recipe/swupdate-image.bbclass +++ b/classes-recipe/swupdate-image.bbclass @@ -13,7 +13,8 @@ inherit swupdate-common inherit image-artifact-names -S = "${WORKDIR}/${PN}" +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" SRC_URI += "file://sw-description" SWUPDATE_IMAGES += "${IMAGE_LINK_NAME}" diff --git a/classes-recipe/swupdate.bbclass b/classes-recipe/swupdate.bbclass index 3656b1c..ae00085 100644 --- a/classes-recipe/swupdate.bbclass +++ b/classes-recipe/swupdate.bbclass @@ -36,7 +36,8 @@ inherit swupdate-common inherit image-artifact-names -S = "${WORKDIR}/${PN}" +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" IMAGE_DEPENDS ?= "" diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc index 188c25c..1b14f66 100644 --- a/recipes-support/swupdate/swupdate.inc +++ b/recipes-support/swupdate/swupdate.inc @@ -245,13 +245,13 @@ python () { } do_configure () { - cat > ${WORKDIR}/.config < ${UNPACKDIR}/.config <> ${WORKDIR}/.config + cat ${UNPACKDIR}/defconfig >> ${UNPACKDIR}/.config - merge_config.sh -O ${B} -m ${WORKDIR}/.config ${@" ".join(find_cfgs(d))} + merge_config.sh -O ${B} -m ${UNPACKDIR}/.config ${@" ".join(find_cfgs(d))} (cd ${S} && cml1_do_configure) } @@ -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 ${UNPACKDIR}/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}/swupdate-usb@.service ${D}${systemd_system_unitdir} - install -m 644 ${WORKDIR}/swupdate-progress.service ${D}${systemd_system_unitdir} + install -m 644 ${UNPACKDIR}/swupdate-usb@.service ${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 }