From patchwork Tue Dec 2 11:15:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshul Dalal X-Patchwork-Id: 75715 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 949CECFD2F6 for ; Tue, 2 Dec 2025 11:16:20 +0000 (UTC) Received: from PH8PR06CU001.outbound.protection.outlook.com (PH8PR06CU001.outbound.protection.outlook.com [40.107.209.51]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.5553.1764674176967399902 for ; Tue, 02 Dec 2025 03:16:17 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ti.com header.s=selector1 header.b=dTy6dd29; spf=permerror, err=parse error for token &{10 18 spf.protection.outlook.com}: limit exceeded (domain: ti.com, ip: 40.107.209.51, mailfrom: anshuld@ti.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JddPL8EomRIXHRDv5Nowsw9qxKFAwiABXF7sRJvvQRejF0Gk1javADCpe/0KA1ibTn+Tfsu21JEDEiznUoK7PFPjK7kn+TQ+tcfLa3RTJyh18PC6zRoAcSHSQFs9S0WjHTh5hOJY/plieS3MSwlZJZ5rNTHu5+q1T412Vrr2FU+J6IxoEQ8dAFuazyCMOwPyFm9ALr5vvK24hmJVoO43/6UcdAM6jGDFj6tMe2IMAwzc2jb5FJ9x/kM5ZavYTKwYELs+SHkCNXKaZ6tV17TC3RBn05pYPAU6xd94TVS8F0b0we8PNtYNWq5CGmc8rfsyMjCxsVCtsPJm3QtJLHqCgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=doKhlZPXTH9FKcYSa88Q/KK2s4rAyh9rDGX2F0p+sME=; b=u6omLMgBBEuPfZvkM+nXm1KlIXL3P07B+3X0Kb7TQrEANoYyXZLVXnRfSRrT6CjVF3DlS4lpXgcyqLIitc61T7VQZXOFuLVA/8WflWw/kOyR6cXtNo5c0yQfxgVvHxgtQ01taN0S+w2xufJsn7lF42tADpgxUXD0HqbPusnh1zoLVpsWOQeHbXJwN7+5JhqCTRuDo50Qo0d/8TCyxYZbEmzrT2xVKaoslswr/Dc9cA9CnE4HFeutA1ohUQH+MpQPlWX3EcgcrTq8TRA9FrhvGz6aCaGrXFRlsNCvFJL+7bS2SIetqxd8sbxf0Uxa/ylEClrMgvh26ph27NQE9pK/GA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.23.195) smtp.rcpttodomain=konsulko.com smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=doKhlZPXTH9FKcYSa88Q/KK2s4rAyh9rDGX2F0p+sME=; b=dTy6dd29rQ5KdloZB/zvzzlRIgddvMJYPnvMvewEN2P03ztvxcY7kWTh7FObX97SnBosFRtkozSnh2u+1IujNslbUIaioxmm5ZrjNAyzsP/kOzddKnXbIvC0921JnQ93GQ/0PuiGDUq0foDZeC7vfEFLC9OZApTc+X72jRuqsOM= Received: from BN9PR03CA0285.namprd03.prod.outlook.com (2603:10b6:408:f5::20) by PH0PR10MB4582.namprd10.prod.outlook.com (2603:10b6:510:39::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9388.9; Tue, 2 Dec 2025 11:16:14 +0000 Received: from BN1PEPF00006000.namprd05.prod.outlook.com (2603:10b6:408:f5:cafe::ba) by BN9PR03CA0285.outlook.office365.com (2603:10b6:408:f5::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9366.17 via Frontend Transport; Tue, 2 Dec 2025 11:16:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.23.195) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.23.195 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.23.195; helo=lewvzet201.ext.ti.com; pr=C Received: from lewvzet201.ext.ti.com (198.47.23.195) by BN1PEPF00006000.mail.protection.outlook.com (10.167.243.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9388.8 via Frontend Transport; Tue, 2 Dec 2025 11:16:13 +0000 Received: from DLEE201.ent.ti.com (157.170.170.76) by lewvzet201.ext.ti.com (10.4.14.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 2 Dec 2025 05:16:11 -0600 Received: from DLEE214.ent.ti.com (157.170.170.117) by DLEE201.ent.ti.com (157.170.170.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 2 Dec 2025 05:16:11 -0600 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DLEE214.ent.ti.com (157.170.170.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Tue, 2 Dec 2025 05:16:10 -0600 Received: from localhost (dhcp-172-24-233-105.dhcp.ti.com [172.24.233.105]) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 5B2BG9lF2143130; Tue, 2 Dec 2025 05:16:10 -0600 From: Anshul Dalal To: CC: Anshul Dalal , , , Subject: [meta-arago][scarthgap][PATCH RFC 1/4] swupdate: add systemd service to rootfs Date: Tue, 2 Dec 2025 16:45:58 +0530 Message-ID: <20251202111603.1616989-2-anshuld@ti.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251202111603.1616989-1-anshuld@ti.com> References: <20251202111603.1616989-1-anshuld@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00006000:EE_|PH0PR10MB4582:EE_ X-MS-Office365-Filtering-Correlation-Id: 8b648865-aa91-4deb-c86e-08de31943457 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: lgajpNTzkT4awyM+koInP4/TTS79L79uErCOB3Lw0olZIlVgM2tyaFQ7+ao2POCA/RVYOsHW4reDZII3iAPoZp3kj+lblr485d2Lwt+Tg326CHm49yXeD6C/JDuEGDXKnVoiWU+1BVaUB2GGpUzXT/qKSmH+Y1KYFGXCapVzdOa+xjDlvD4kzvPIH00KOlgIx9dEFxjH+S3zEkBZb4ASPQHQfhb2bUOagAWcw8uYthKHlSrqfRd6m2pC2gvJSmkoBIfqFb/fu4SyKn5vCN+9til+ZlbQMXs5a2YUmlMCYb5TK9EP8rapfL2lJuQnHI0gjP9m0qkYwKlRp+B5vy/tKVvrH5jH4czt62XHz9n0NNgXyZxxsDSVvhMiG81IVMetEfLG3mOVBrXVqDbBnwyZlwBTptcwro0/EdYzmyMrmTPyED9J46Tu54LzzAOnJauLuzFCyWnZ/Ldiwhqass0ZSiRXLSZ12ryqxSKbqsRfjp2EVZ7uy/voosn95xY0915t6VEHmtR7SCvYzhVUZ0DBfijqkCKxr0m1ckbwhJtt1df8YQjxDJW3so1xq0vYLeubiG6uRqW1NCxIjKPNcy8RTwNR0xM/KjHj+Y9e0nr7cT0/Sm9RIQAWVrAJ+Mi4TmwuPqSYNPnLP47jEWM4a/7qpWWC3LFxvegejksryjidJmsRS6oTtTps9ux0/Wxa9A6PudsZRknKFrLdwVPJGzJnqM3+LHHzBvFYRN8eOWB1Dzh/XbbvA4cc57jwNhkRaRW1Iw1pfdlmbIaCWy7J4uWbJyHcTio0eCUMARDikP3MERDxrMmak8X1lpKV2i2KMzQc1039ehD77NhSSBHg9kYxuv/synkb908zxxpHUFlXdI5G4MvXUlPofyxIbzDnmHziexxoJPbKeoVK6mt7N30L889dv17t6GHA9TmzbCE20NOjr4xnBpec77eOY083ingJKRHvwl7eWD3RVzGQVDDxHd3uL4M+1+OwIghXuq8GeSkoeAMlqx51g1/IBO7UXO0GJK0aCmgIhbDbEYUWEQUkptpTBqMPG9ekk1ZjEZwM1QQfiklncnOKDcnt123JCFFkxDoiVCDjzUDSE8HIjMgfz921Wb3Ehr58r20pgihwNDGjZss4roVEmSvDINaHMuHW+6MgtJslwhRwbHiRGryESY/8N17RTjf6do7Phl0urtn7OfKUFTaaMpQY8fnPqXRk13pS6Hhe8dD0YlvJvO54D/aoHlREckg6oe3+xQ4gEbNrQp8mudPUdu0UnJHcSKHp5f13jsr1RMxs8k/D9XVVTli8y5qTIGAF8PzkfO/Z6LCQFHcB4fNWBpPZLoheEtnlIszOdBvoHpHEh1rlU4cX8kpEcgZkv9MFRs13MVS39kXu4fXk7ZcEdXbX+9TGvt60eWAxrwwHrm828B4pjZJOlu+iLXkfdjNGUIxkcMGy62LUSFnaJXz5oISGWaodVaa1z0J9dGvNg2sLwZPxMs7tZ3/5L/pwMjU6WSFWpMTzdIfivI8y5a4Dw/lcF74TiCW0 X-Forefront-Antispam-Report: CIP:198.47.23.195;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:lewvzet201.ext.ti.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2025 11:16:13.5058 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8b648865-aa91-4deb-c86e-08de31943457 X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.23.195];Helo=[lewvzet201.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00006000.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4582 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 02 Dec 2025 11:16:20 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/16847 This patch adds basic support for A/B dual update mechanism where the rootfs is duplicated to provide redundancy in case of an update failure. The bbappend adds the modifications required to make SWUpdate suitable for our use case. The new swupdate systemd service invokes swupdate.sh on startup which starts an update server on the target platform. The "ti-swupdate" override is used to selectively enable SWUpdate support to the final tisdk image. Signed-off-by: Anshul Dalal --- meta-arago-distro/conf/distro/arago.conf | 1 + .../recipes-swupdate/swupdate/files/defconfig | 9 ++++++ .../swupdate/files/swupdate.cfg | 13 +++++++++ .../swupdate/files/swupdate.sh | 11 ++++++++ .../swupdate/swupdate_%.bbappend | 28 +++++++++++++++++++ .../wic/sdimage-2part-swupdate.wks | 6 ++++ 6 files changed, 68 insertions(+) create mode 100644 meta-arago-distro/recipes-swupdate/swupdate/files/defconfig create mode 100644 meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.cfg create mode 100644 meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.sh create mode 100644 meta-arago-distro/recipes-swupdate/swupdate/swupdate_%.bbappend create mode 100644 meta-arago-distro/wic/sdimage-2part-swupdate.wks diff --git a/meta-arago-distro/conf/distro/arago.conf b/meta-arago-distro/conf/distro/arago.conf index abbe4faf..d8630718 100644 --- a/meta-arago-distro/conf/distro/arago.conf +++ b/meta-arago-distro/conf/distro/arago.conf @@ -34,6 +34,7 @@ IMAGE_FSTYPES += "tar.xz.md5sum" # Extra boot files for WIC images do_image_wic[depends] += "tisdk-uenv:do_deploy" +WKS_FILE:ti-swupdate = "sdimage-2part-swupdate.wks" IMAGE_BOOT_FILES += "uEnv.txt" # Mask any broken recipes (currently none) diff --git a/meta-arago-distro/recipes-swupdate/swupdate/files/defconfig b/meta-arago-distro/recipes-swupdate/swupdate/files/defconfig new file mode 100644 index 00000000..b1362eaa --- /dev/null +++ b/meta-arago-distro/recipes-swupdate/swupdate/files/defconfig @@ -0,0 +1,9 @@ +CONFIG_HW_COMPATIBILITY=y +# CONFIG_LUA is not set +# CONFIG_BOOTLOADER_NONE is not set +CONFIG_SYSTEMD=y +CONFIG_WEBSERVER=y +CONFIG_CFI=y +CONFIG_EMMC_HANDLER=y +CONFIG_RAW=y +CONFIG_SHELLSCRIPTHANDLER=y diff --git a/meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.cfg b/meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.cfg new file mode 100644 index 00000000..5cb04b0c --- /dev/null +++ b/meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.cfg @@ -0,0 +1,13 @@ +globals : +{ + verbose = true; + loglevel = 5; + syslog = true; +}; + +webserver : +{ + document_root = "/www"; + userid = 0; + groupid = 0; +}; diff --git a/meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.sh b/meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.sh new file mode 100644 index 00000000..bb3a3593 --- /dev/null +++ b/meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +rootfs=$(swupdate -g) + +if [ $rootfs == '/dev/mmcblk0p2' ];then + SELECTION="-e stable,copy1" +else + SELECTION="-e stable,copy2" +fi + +swupdate -H @MACHINE@:1.0 ${SELECTION} -p 'reboot' -f /etc/swupdate.cfg -w "-r /www -p 8080" diff --git a/meta-arago-distro/recipes-swupdate/swupdate/swupdate_%.bbappend b/meta-arago-distro/recipes-swupdate/swupdate/swupdate_%.bbappend new file mode 100644 index 00000000..0ce763f9 --- /dev/null +++ b/meta-arago-distro/recipes-swupdate/swupdate/swupdate_%.bbappend @@ -0,0 +1,28 @@ +inherit swupdate-lib + +FILESEXTRAPATHS:append := "${THISDIR}/files:" + +FILES:${PN} += " \ + ${SWUPDATE_HW_COMPATIBILITY_FILE} \ +" + +SRC_URI += " \ + file://defconfig \ + file://swupdate.sh \ + file://swupdate.cfg \ + " + +do_install:append () { + install -d ${D} + echo "${MACHINE} 1.0" > ${D}/${@d.getVar("SWUPDATE_HW_COMPATIBILITY_FILE")} + + # We don't make use of conf.d in our swupdate.sh + rm -rf ${D}${libdir}/swupdate/conf.d + + install -m 0755 ${WORKDIR}/swupdate.sh ${D}${libdir}/swupdate/ + sed -i "s#@MACHINE@#${MACHINE}#g" ${D}${libdir}/swupdate/swupdate.sh + + install -d ${D}${sysconfdir} + install -m 644 ${WORKDIR}/swupdate.cfg ${D}${sysconfdir} + sed -i "s#@MACHINE@#${MACHINE}#g" ${D}${sysconfdir}/swupdate.cfg +} diff --git a/meta-arago-distro/wic/sdimage-2part-swupdate.wks b/meta-arago-distro/wic/sdimage-2part-swupdate.wks new file mode 100644 index 00000000..cf3b6f03 --- /dev/null +++ b/meta-arago-distro/wic/sdimage-2part-swupdate.wks @@ -0,0 +1,6 @@ +# short-description: Create SD card image with A/B partitions for SWUpdate +# long-description: Creates a partitioned SD card image for TI platforms with SWUpdate support. +# Check https://sbabic.github.io/swupdate/scenarios.html#double-copy-with-fall-back + +part / --source rootfs --fstype=ext4 --label rootfs_1 --align 1024 --use-uuid +part / --source rootfs --fstype=ext4 --label rootfs_2 --align 1024 --use-uuid From patchwork Tue Dec 2 11:15:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshul Dalal X-Patchwork-Id: 75716 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A500CFD376 for ; Tue, 2 Dec 2025 11:16:30 +0000 (UTC) Received: from SJ2PR03CU001.outbound.protection.outlook.com (SJ2PR03CU001.outbound.protection.outlook.com [52.101.43.62]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.5555.1764674181970658513 for ; Tue, 02 Dec 2025 03:16:22 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ti.com header.s=selector1 header.b=uXk5f+49; spf=permerror, err=parse error for token &{10 18 spf.protection.outlook.com}: limit exceeded (domain: ti.com, ip: 52.101.43.62, mailfrom: anshuld@ti.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=joUPLQ01yDl/FVSs6xuOEbjygw789OtvjXqaVLdqznJun1EC4Ds8jQdmmZqgAj9j1Kxa9BkYyotwvVgdPKhRy/Hjv1wFv+gEpu+hFvKCIIrhRMCJjl/i1WT4jmemDAh/FxRF7d4AU6XVLgfJj6edZcxqMweDtuv0gOHkQn4vc05e4gWpDC2P9JAjZ9NZdP8wP4r+khVAk1yQ70DS/L4/CRM2RQ5M+h1F+aE9ul2oO6nTe6W+fSjkrNf2li2fcUwG7xJexw8ZPphxo3EsPNu6CoMjVR93l9F842+ssovyu4BFv2tRUr4v1KjPv+ZMIFrWJXFozOecfuYlYx+1kACGUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bsOhTvSRxr4mRqW7sv3OA4t2KRSOlrUw1DHOAw8huZ0=; b=w00Wd0ptnbwMW4leNVQpvRkKPNhMx6alYomwpNP7r68irwtrYL6YIgGxqoSzfd1quF1Bvav1zEK+oDA4Y5JD8CQx2GPVtpTrUbnAKKCYPzqhPwDvcnfohz7+Ld9KmCLmdFzST0ybz8GlBvT0pgUfpbpPm8W9lvFm5Eata0zPV4KmvmgI/P25y3zGkc+KCaYbjqWm1A8i514ZSFwsIXba5ISkjrMr8X3gYorGEEWDIsNbYOYfCMxMzjsOyEm0iXZlQCn3BqObmf+hVG0ieH4TyD2wjzLebgTDQ8vxqlbEZKNNLQfCowldmBpQmfMe0YTtV0b/MTbVdhDiHj9UHo08lw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.23.195) smtp.rcpttodomain=konsulko.com smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bsOhTvSRxr4mRqW7sv3OA4t2KRSOlrUw1DHOAw8huZ0=; b=uXk5f+49kl3zt7hhd3rmZOiBMNj+0CbwKtiC9nNHN1FdY1TT2JoSpZ+bFkUphTqmqQzO6viErArxY3/b4QP4brEoZXNfeZ57LsujkbDOGprWDLrmmLmGBFWghsimFQt/HZUzwWo5biaBZAOCCw0tgF+s2jy4m7sqcCHT52BPg6M= Received: from BN0PR04CA0064.namprd04.prod.outlook.com (2603:10b6:408:ea::9) by MW4PR10MB6535.namprd10.prod.outlook.com (2603:10b6:303:225::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9298.12; Tue, 2 Dec 2025 11:16:18 +0000 Received: from BN1PEPF00005FFE.namprd05.prod.outlook.com (2603:10b6:408:ea:cafe::58) by BN0PR04CA0064.outlook.office365.com (2603:10b6:408:ea::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9366.17 via Frontend Transport; Tue, 2 Dec 2025 11:16:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.23.195) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.23.195 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.23.195; helo=lewvzet201.ext.ti.com; pr=C Received: from lewvzet201.ext.ti.com (198.47.23.195) by BN1PEPF00005FFE.mail.protection.outlook.com (10.167.243.230) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9388.8 via Frontend Transport; Tue, 2 Dec 2025 11:16:16 +0000 Received: from DLEE214.ent.ti.com (157.170.170.117) by lewvzet201.ext.ti.com (10.4.14.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 2 Dec 2025 05:16:12 -0600 Received: from DLEE202.ent.ti.com (157.170.170.77) by DLEE214.ent.ti.com (157.170.170.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 2 Dec 2025 05:16:12 -0600 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DLEE202.ent.ti.com (157.170.170.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Tue, 2 Dec 2025 05:16:12 -0600 Received: from localhost (dhcp-172-24-233-105.dhcp.ti.com [172.24.233.105]) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 5B2BGB712143148; Tue, 2 Dec 2025 05:16:12 -0600 From: Anshul Dalal To: CC: Anshul Dalal , , , Subject: [meta-arago][scarthgap][PATCH RFC 2/4] swupdate: add creation of update image Date: Tue, 2 Dec 2025 16:45:59 +0530 Message-ID: <20251202111603.1616989-3-anshuld@ti.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251202111603.1616989-1-anshuld@ti.com> References: <20251202111603.1616989-1-anshuld@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00005FFE:EE_|MW4PR10MB6535:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c63f78e-982c-4a08-6437-08de31943632 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: aXCZwMFbzE6t/klS35l8Tgh3xBDEnFf+PgpF3Ghq/6e3kY7Chp1jdt7xTkF+YbpKDJskojNlCe5H6RYVRPfa+DpalIGigo4HmzsxPruCHraib0iB94IruUrOyeCh1FSeMnCojXgT5Q7p2XxCXEdHPo5On7GHf3sehiNFlnC6RVf9N7SWQztoWtTWe1dXQdOLf00giQU75emCpmEWdmxb3euHta3UioXe6rvSf9pSyt1LgXZUmMSvOq2CjOB12Zti73BQ3W4UL4qUIy28FDC+5tdRlRsb3H+HP545agfwDxpqS/G3fWtDF2JqcfDTJ8T52sgHOzlm8u0poE9hmd+pDfCXk4X7Aerov62cdKkaQLtCR6Q3CknjCQp1KVssvDrDk1u/SbXRAp7p06nhX4vmmORt0N5W7TbH+SMefucIQ6e1+IzBnLkwC4ax0Ujplv+Y83Yobgi8iyZdjHL8hHlzSNpYjhZRE8Ch6MWL3eKthox8yYlhtQ63i2OyWl7zYy+bIbzMYCczdaGM6kOLwdgdVIkc1yZoN+yCnOrdFp/DGJ45S22iJsvarGN/APnym2VhaoqjCFXaEe921XPQUav7JqdgTmzpzVpH2TFooUv+0E/oUzPr9IS7eeII2IE5xV9KSAKsJPgchVV+bVGvHdNXs94jLxzrJqcidr8/MH6edoX2uP1FEy5jUX+QWgsQ3WugKLqxLUbZeT7u38zNAqkEBn6gH1KZGnlDUAMz622OO+717G9ghGuQvTenuPernKm2ZFIsah0Uy8teDgRj0nW/RMvRnZCXLJawu7QY0l1YrRyas/UdJbseeJLfulJE4dK2jCb+bmQQBmolbAhZVs/J0p7xGKExC0FQvKsjc/jXm6952PASG5gXb+8QDSNj9lqFHnVJYjqYETUJdTzXJczVCNqMDlgfi9eUUD8VY+RY80gsqsIh1WCUozlDV6qeG/VI4992XBjSMmLn4WDu4sBIli9tq4MyAy+kSPocrJrqWz9R5S/SpgOv3zAJeDFtLfHynYl9hdxVRP932d/eVhVhQJWdNkYfsvXsz2ih04MLvylUiaRjPyLV4X9GxIaJwWODu1+hf3rwZUp9yJyZb9TBCoXuWZ21kN3k8xdPbRbLy3Ks4qAXNgh3YWYP76iRp2haDFPTpQ/s//VkOHLmi4+Jwi1KjtNaS6rVZex0w08iBldTzQKMANONJz1DP7hjtk8wmdPaQzc7PkhHVZHpUVLb4nGeqlYQpb0PWvkhNllgm0VYGodhkuywhjDLvMjGpVGFewhpQLZbOAJqDUjaGL5jWDLdD0E1S1yEdGG1X3ufAkIg30iWWtj7hCYbr6O0ieX6u8mWUIkQpr76AfaD8IHTeaxHvE7HE7cKGMdTtH2HUosz6GOMhkEBh83tOLDligToKfx0uLdhEyQtPCk9eouO2+ga5ITblruCO0NC3MiXU/1vXWkYUZK9IYoH6TgQatqLYZqorr241pRDD6qxNgeAKEPuvuMjEJZJPWYLgwlktDcEM1Py7rQPAVaR4CTNUT5lW59cha/gZuIzpVN7zi9Ocz7ano98hZpbPz6LZXFFkc4= X-Forefront-Antispam-Report: CIP:198.47.23.195;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:lewvzet201.ext.ti.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2025 11:16:16.6216 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c63f78e-982c-4a08-6437-08de31943632 X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.23.195];Helo=[lewvzet201.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00005FFE.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR10MB6535 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 02 Dec 2025 11:16:30 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/16848 SWUpdate makes use of a CPIO archive with a sw-description header that contains the metadata for the update image. This patch adds a new update-image recipe which enables creation of such image based on what the user sets IMAGE_BASENAME to. Signed-off-by: Anshul Dalal --- meta-arago-distro/conf/distro/arago.conf | 2 ++ .../images/files/sw-description | 32 +++++++++++++++++++ .../recipes-swupdate/images/update-image.bb | 23 +++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 meta-arago-distro/recipes-swupdate/images/files/sw-description create mode 100644 meta-arago-distro/recipes-swupdate/images/update-image.bb diff --git a/meta-arago-distro/conf/distro/arago.conf b/meta-arago-distro/conf/distro/arago.conf index d8630718..42124577 100644 --- a/meta-arago-distro/conf/distro/arago.conf +++ b/meta-arago-distro/conf/distro/arago.conf @@ -31,6 +31,8 @@ SDK_NAME = "${SDK_NAME_PREFIX}-${SDK_VERSION}" SDKPATHINSTALL = "/opt/${SDK_NAME}" IMAGE_FSTYPES += "tar.xz.md5sum" +IMAGE_FSTYPES:append:ti-swupdate = " ext4.gz" +IMAGE_INSTALL:append:ti-swupdate = " swupdate swupdate-www" # Extra boot files for WIC images do_image_wic[depends] += "tisdk-uenv:do_deploy" diff --git a/meta-arago-distro/recipes-swupdate/images/files/sw-description b/meta-arago-distro/recipes-swupdate/images/files/sw-description new file mode 100644 index 00000000..8dc4e2b2 --- /dev/null +++ b/meta-arago-distro/recipes-swupdate/images/files/sw-description @@ -0,0 +1,32 @@ +software = +{ + version = "0.1.0"; + + @@MACHINE@@ = { + hardware-compatibility: [ "1.0"]; + stable : { + + copy1 : { + images: ( + { + filename = "@@IMAGE_BASENAME@@-@@MACHINE@@.rootfs.ext4.gz"; + device = "/dev/mmcblk0p1"; + type = "raw"; + compressed = "zlib"; + }, + ); + }; + + copy2 : { + images: ( + { + filename = "@@IMAGE_BASENAME@@-@@MACHINE@@.rootfs.ext4.gz"; + device = "/dev/mmcblk0p2"; + type = "raw"; + compressed = "zlib"; + }, + ); + }; + }; + } +} diff --git a/meta-arago-distro/recipes-swupdate/images/update-image.bb b/meta-arago-distro/recipes-swupdate/images/update-image.bb new file mode 100644 index 00000000..33b0b74c --- /dev/null +++ b/meta-arago-distro/recipes-swupdate/images/update-image.bb @@ -0,0 +1,23 @@ +inherit swupdate + +IMAGE_BASENAME ?= "tisdk-default-image" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = "\ + file://sw-description \ +" + +# images to build before building swupdate image +IMAGE_DEPENDS = "${IMAGE_BASENAME}" + +SWUPDATE_IMAGES = "${IMAGE_BASENAME}" + +SWUPDATE_IMAGES_FSTYPES[tisdk-base-image] = ".rootfs.ext4.gz" +SWUPDATE_IMAGES_FSTYPES[tisdk-tiny-image] = ".rootfs.ext4.gz" +SWUPDATE_IMAGES_FSTYPES[tisdk-default-image] = ".rootfs.ext4.gz" +SWUPDATE_IMAGES_FSTYPES[tisdk-bootstrap-image] = ".rootfs.ext4.gz" +SWUPDATE_IMAGES_FSTYPES[tisdk-jailhouse-image] = ".rootfs.ext4.gz" +SWUPDATE_IMAGES_FSTYPES[tisdk-thinlinux-image] = ".rootfs.ext4.gz" +SWUPDATE_IMAGES_FSTYPES[tisdk-bootstrap-base-image] = ".rootfs.ext4.gz" From patchwork Tue Dec 2 11:16:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshul Dalal X-Patchwork-Id: 75717 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71868CFD2F6 for ; Tue, 2 Dec 2025 11:16:30 +0000 (UTC) Received: from PH8PR06CU001.outbound.protection.outlook.com (PH8PR06CU001.outbound.protection.outlook.com [40.107.209.15]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.5557.1764674184738931973 for ; Tue, 02 Dec 2025 03:16:24 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ti.com header.s=selector1 header.b=mt11VNcC; spf=permerror, err=parse error for token &{10 18 spf.protection.outlook.com}: limit exceeded (domain: ti.com, ip: 40.107.209.15, mailfrom: anshuld@ti.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dGxSzrOKobl2aGLXL6XSDS855rq7e4/piUKP+omPDpTy5AF4fjIQOCOyf15JlJMJErqvGpUAHaCSlVgs++F+g9w5n3lFfUWJ4ML7G1/MUOL4YFtKKuGinnaoftsvdWxn+pd8bH26axzbh2xKPuVFTDTsV7Iwj/XEsvPpFKOQN8TlUuvO4ZRN0e3j4cD/uoHtE4VqTVkzxT4k6Xa8xOQAL63pcJje/UyFT7TbFakmDRMT5MaK078xvYFmINPgTCaN8RTL7PYGm67tojqJvISCflLnLOlg+MMB8Zt7DdT0Anr9ksucM4ZOLy4NtQ6Fkk5bSw9xpW+sKLIHILU5USptoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Fe+XXqzVMz6s30tIooQrFnG0ojrC6Wkt36kWGi5HvSI=; b=YUB933CiqcvOaNpjw0hK4T9gsA5Aqh7oWTuiXK45UuzFObVN3sDoykaiJP7sznMWAIrGde6Lycm4bLQtGS2sEZd6IiNk70WpzJv0tW/N+m/PzW50XLaollnxOPkQxaKktv3/PdCNNqNW2RpsxAZIOJrCLnU8Fz0gNchfBaz352k2PbS3arZeSqqr0SAVWU/KJn40H1L5KEuZurIJRaqv5kxKafXUy9RR+XD33ncM73cuP6BiuMnm36MmIfs/oFWemwNzzfv1aOS0D/hqg+TK4wcRNEc4BSofxcEnH3qlUBbjOQc8qVHkM3F6+HaTFhU5JkZ9MJGb9XxNMfyJl2E5IA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.21.195) smtp.rcpttodomain=konsulko.com smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Fe+XXqzVMz6s30tIooQrFnG0ojrC6Wkt36kWGi5HvSI=; b=mt11VNcCWTAnvjZDKepbyVGUJDLDw6garC2rkg3p37xHxQpVBsnjzKA2ai7CarMMcCi1NGfTqMnZu9cvH5/B+9M/Tuk00Lrj0akdG9a9AwFoeC889B7QXqAfSAbmjObChmoRiiTj6jYkbuy4QuxHVOWRIW1N8aMC2giGlEU1s7M= Received: from PH8PR15CA0010.namprd15.prod.outlook.com (2603:10b6:510:2d2::6) by CH2PR10MB4311.namprd10.prod.outlook.com (2603:10b6:610:79::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9388.9; Tue, 2 Dec 2025 11:16:21 +0000 Received: from CY4PEPF0000E9D1.namprd03.prod.outlook.com (2603:10b6:510:2d2:cafe::70) by PH8PR15CA0010.outlook.office365.com (2603:10b6:510:2d2::6) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9388.9 via Frontend Transport; Tue, 2 Dec 2025 11:16:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.21.195) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.21.195 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.21.195; helo=flwvzet201.ext.ti.com; pr=C Received: from flwvzet201.ext.ti.com (198.47.21.195) by CY4PEPF0000E9D1.mail.protection.outlook.com (10.167.241.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9388.8 via Frontend Transport; Tue, 2 Dec 2025 11:16:18 +0000 Received: from DFLE202.ent.ti.com (10.64.6.60) by flwvzet201.ext.ti.com (10.248.192.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 2 Dec 2025 05:16:14 -0600 Received: from DFLE210.ent.ti.com (10.64.6.68) by DFLE202.ent.ti.com (10.64.6.60) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 2 Dec 2025 05:16:14 -0600 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DFLE210.ent.ti.com (10.64.6.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Tue, 2 Dec 2025 05:16:14 -0600 Received: from localhost (dhcp-172-24-233-105.dhcp.ti.com [172.24.233.105]) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 5B2BGDkC2143174; Tue, 2 Dec 2025 05:16:14 -0600 From: Anshul Dalal To: CC: Anshul Dalal , , , Subject: [meta-arago][scarthgap][PATCH RFC 3/4] swupdate: add bootloader support Date: Tue, 2 Dec 2025 16:46:00 +0530 Message-ID: <20251202111603.1616989-4-anshuld@ti.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251202111603.1616989-1-anshuld@ti.com> References: <20251202111603.1616989-1-anshuld@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D1:EE_|CH2PR10MB4311:EE_ X-MS-Office365-Filtering-Correlation-Id: db541d6f-97fc-4c0c-791e-08de31943731 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: ida3BK7nrOSSgnvflVMy6Y1m3ivPpzC2cHgcyuj6KleD5poqT13hpC3wotboS1nTb4s+8DqvPI69cM16WbRgqP8ZrfouKY9KgYv4r4Iids4hECwzf8A2gdYbEJ1CTS5pYTOhzTPq86dZivUA2mrOo0JuJnh5V4/wlwIQdHfti33lleaReeLd7lNO7eRFUtu77rsPjbPfg1YJ35zBxPmf4GN+BCkx7UH4fNj0Rj5EO5ixpjRu2qycPk3duDwmo8hCVZM4QLqd3qhZljmeMDy9WZXln0B3PrwZQu0ZEmlB5msUZXnffmcRALcRKfMVqCoeXZrMaSVydhwCV4UNTPkcoAF4QsNh3jGjzkAr8UhZahn2oEYMMSHW6wJkTJk/CEw9R0GL7wo1QtaeFOtlXFnyDluwxbah7NRqe39IeCVTNK+56Q7g6NTx7furl6SUvlkuqdjzJ7s0V3/ovpsmiyMekieb0Z7ILKIlPdTYOih3VYcmvF0w7uIX0SxBWsWi+J/Gz1AU70shp9F0c3iArpeGRstvfz87rUVZT8rhDdOSNAkvzC68JRHo0ALxSH8Mk4gvKWAiilL8J3XN2wCkpRONzse3q7wUG6CFN5rVhs4cvIbGB5+kPXWrkDvyGF5BccyPuTj6Zkgx6iCZFg2CpbbLgRq+DU8eGahD3a1IIy2EFYpzvzvBNs66aYMyUyFH3VEwWXmZG4KaN0SL6HBnTrxlqR4at1pLW5KfSXwAcN3uYs5iAFdGxgYjvA3jEiUm+bgWvxE0On9Iz6iQCcqaonSRtZgq6cVeSI9ZYkqFTwSZGRQ2Qr4VC+s6ekrqgMAxTi3whG7F9cZqeV0KBlq0CUndZJgRa3B3tP3F36G2t03Jj1Ju7UfaaTajetIN4BUsJN5k2U34ogd7IgfQF8yTbg89Qw9/dDAhNByPzE8RADF41YoUANVn0WQEYWvvyJ3f1vMSn5Xl1eRz0f7E0v5ss+3XgRSLl4h8T1mbWPb7PPjLBe8ujlfRUnb1aigJtGAILnuZaClL1ipd8j7HufG0Psdyhaq/vxA/MpurgLv+wXnyH+zDeRqLEOdBrFLNJUu40bK9P1NN/6Dr5WSazw8QbCpy8xkcEFr6+te7KhoEDqc0xjtWsACZxj5Se5sKmdSsSqPdKZYpK81x9XJITFxxt6l0hwzFqWC47vEFVQHcfgYSOAIywvX9yJP3QwejdT4kM/wOtKV//GT1L9RAdS0y52Jd8+jHf2vlWqKtHX55KZBZvmTMcaRgjOyGyfn2qEEZS/u8UiI5/4MP0kOL714cqnboU8h7qKnsZD2t/IWhaEcJaM2lHH2XcpNfzoZl/cs9+x9hF9DTJvqxqW0RrG8M0fBnsqlAxh0Z1qCSk5Knm95fTnzK25XWUtk8NYt8hEKr7+FkVtHdPp1ZIf0DEPmlfAjXl7N8xH4N7X1p0rYpFCi2bhaiN+tEO8zJjT5ZdSFWkuMTyyiK2ACm1MD4lPEGccKU8OVrZCcr2VWRGGcZs3sjFWg= X-Forefront-Antispam-Report: CIP:198.47.21.195;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet201.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(36860700013)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2025 11:16:18.3669 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db541d6f-97fc-4c0c-791e-08de31943731 X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.195];Helo=[flwvzet201.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9D1.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR10MB4311 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 02 Dec 2025 11:16:30 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/16850 U-Boot uses the 'bootpart' env variable to configure the rootfs for the kernel at boot. The BACKUP_REG0 MMR is also used to store bootcount as per U-Boot requirements[1]. After each reset, U-Boot increments the bootcount and it's reset to 0 by the swupdate service indicating a successful boot. If the kernel panics however (eg. if the update failed), the bootcount is never reset and keeps on getting incremented by U-Boot until it reaches certain threshold after which U-Boot switches to the other non-updated partition to ensure a successful boot. This patch adds support for the same to the final .swu image generated by the update-image recipe. [1]: https://docs.u-boot.org/en/latest/api/bootcount.html Signed-off-by: Anshul Dalal --- .../recipes-swupdate/images/files/sw-description | 12 ++++++++++++ .../recipes-swupdate/libubootenv/files/fw_env.config | 5 +++++ .../libubootenv/libubootenv_%.bbappend | 10 ++++++++++ .../recipes-swupdate/swupdate/files/defconfig | 2 ++ .../recipes-swupdate/swupdate/files/swupdate.sh | 4 ++++ .../recipes-swupdate/swupdate/swupdate_%.bbappend | 2 ++ 6 files changed, 35 insertions(+) create mode 100644 meta-arago-distro/recipes-swupdate/libubootenv/files/fw_env.config create mode 100644 meta-arago-distro/recipes-swupdate/libubootenv/libubootenv_%.bbappend diff --git a/meta-arago-distro/recipes-swupdate/images/files/sw-description b/meta-arago-distro/recipes-swupdate/images/files/sw-description index 8dc4e2b2..241bc95c 100644 --- a/meta-arago-distro/recipes-swupdate/images/files/sw-description +++ b/meta-arago-distro/recipes-swupdate/images/files/sw-description @@ -15,6 +15,12 @@ software = compressed = "zlib"; }, ); + uboot: ( + { + name = "bootpart"; + value = "0:1"; + }, + ); }; copy2 : { @@ -26,6 +32,12 @@ software = compressed = "zlib"; }, ); + uboot: ( + { + name = "bootpart"; + value = "0:2"; + }, + ); }; }; } diff --git a/meta-arago-distro/recipes-swupdate/libubootenv/files/fw_env.config b/meta-arago-distro/recipes-swupdate/libubootenv/files/fw_env.config new file mode 100644 index 00000000..57eec5fc --- /dev/null +++ b/meta-arago-distro/recipes-swupdate/libubootenv/files/fw_env.config @@ -0,0 +1,5 @@ +# Describes the env location for U-Boot in the hw partition +# Second entry indicates redundant env +# Boot dev Offset Size +/dev/mmcblk0boot0 0x680000 0x20000 +/dev/mmcblk0boot0 0x6a0000 0x20000 diff --git a/meta-arago-distro/recipes-swupdate/libubootenv/libubootenv_%.bbappend b/meta-arago-distro/recipes-swupdate/libubootenv/libubootenv_%.bbappend new file mode 100644 index 00000000..e3d142f2 --- /dev/null +++ b/meta-arago-distro/recipes-swupdate/libubootenv/libubootenv_%.bbappend @@ -0,0 +1,10 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +SRC_URI:append = " file://fw_env.config" + +do_install:append() { + install -d ${D}${sysconfdir} + install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir} +} + +FILES:${PN}:append = " ${sysconfdir}" diff --git a/meta-arago-distro/recipes-swupdate/swupdate/files/defconfig b/meta-arago-distro/recipes-swupdate/swupdate/files/defconfig index b1362eaa..4a2d78c0 100644 --- a/meta-arago-distro/recipes-swupdate/swupdate/files/defconfig +++ b/meta-arago-distro/recipes-swupdate/swupdate/files/defconfig @@ -1,8 +1,10 @@ CONFIG_HW_COMPATIBILITY=y # CONFIG_LUA is not set # CONFIG_BOOTLOADER_NONE is not set +CONFIG_UBOOT=y CONFIG_SYSTEMD=y CONFIG_WEBSERVER=y +CONFIG_BOOTLOADERHANDLER=y CONFIG_CFI=y CONFIG_EMMC_HANDLER=y CONFIG_RAW=y diff --git a/meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.sh b/meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.sh index bb3a3593..2083062e 100644 --- a/meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.sh +++ b/meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.sh @@ -8,4 +8,8 @@ else SELECTION="-e stable,copy2" fi +# BACKUP_REG0 MMR on AM62x +UBOOT_BOOTCOUNT_ADDR=0x4301c100 + +devmem2 $UBOOT_BOOTCOUNT_ADDR w 0 swupdate -H @MACHINE@:1.0 ${SELECTION} -p 'reboot' -f /etc/swupdate.cfg -w "-r /www -p 8080" diff --git a/meta-arago-distro/recipes-swupdate/swupdate/swupdate_%.bbappend b/meta-arago-distro/recipes-swupdate/swupdate/swupdate_%.bbappend index 0ce763f9..20f87435 100644 --- a/meta-arago-distro/recipes-swupdate/swupdate/swupdate_%.bbappend +++ b/meta-arago-distro/recipes-swupdate/swupdate/swupdate_%.bbappend @@ -2,6 +2,8 @@ inherit swupdate-lib FILESEXTRAPATHS:append := "${THISDIR}/files:" +RDEPENDS:${PN} += "devmem2" + FILES:${PN} += " \ ${SWUPDATE_HW_COMPATIBILITY_FILE} \ " From patchwork Tue Dec 2 11:16:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshul Dalal X-Patchwork-Id: 75718 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B389CFD2F6 for ; Tue, 2 Dec 2025 11:16:40 +0000 (UTC) Received: from MW6PR02CU001.outbound.protection.outlook.com (MW6PR02CU001.outbound.protection.outlook.com [52.101.48.28]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.5399.1764674195680188578 for ; Tue, 02 Dec 2025 03:16:35 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ti.com header.s=selector1 header.b=l6aoj3R0; spf=permerror, err=parse error for token &{10 18 spf.protection.outlook.com}: limit exceeded (domain: ti.com, ip: 52.101.48.28, mailfrom: anshuld@ti.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qYHpCBsOjmEaJqi2hKai48gaQuJGV3rYfGC9C3JO+1Rm0wfV9PZm5JuY2OkCHL+E4PKtAzIXAsZJjVuHIOJpsUXk04Yj9zTqqp45fFMYsYfBdUDJMROyV8743ly0/ac4+GPhJyl+i6BZWxoEECnHSnMGCkeEPKHB+t11eywPM1UrlYWntYiNlhF9EpGzRBt4ots+wlqG4rmvAj+ZUn0xp0ZOJNtj2hdiC0WRPrGkaSrILNg6zWacEfLpz0MK/8sRgHAn8NepDhH+2X+jkJH2AuJSW5zajgi7CC9RKdjtdn7Gx725fvFxFj9FjINjnbgvn6VUd/VJxP5sosfuvvM7DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1WEb0hjAHw1S29+fPzJPTJBgHnf+lC4vM+KW3XQj8lU=; b=eQ7hbHvm99z5XND4J4SuIo1MYqo0MrLelPu7ekw4gD9aDdzkjKD6V5zZA21i7OOHHP0PLSupLRg5BrwagZvRgE4ZA7LRIPFaiXd61U/uGQcQXhj5eKRvQogWxIrlLLME3W0o9yZPn8/XPL8W/isFwrbY4osSo3Otitth3Nn1Z6o/HVHlnSYuNGsp5KkJPIwYz1TEyIlWPVbsTXtDxC1AjqDWgig9WY9wTWv4UavrQ2/ZBtd/Qf5nB2BBxIBXNifG7BZC1dz+p7idwaf1XYnSolPyLzLk1jrOsrCKJ2JBkfQgBU71xn4hnrXSrjWHyDHZkgQU8Q8kS6BF+r+I1dKAYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.21.194) smtp.rcpttodomain=konsulko.com smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1WEb0hjAHw1S29+fPzJPTJBgHnf+lC4vM+KW3XQj8lU=; b=l6aoj3R0omx7pFdQeCNoNOAmUf/Y7e4gbEtHxJ7CnojgfXgTf+e73NzfJm7yhWZRSYWwnTpN/vdyp6z54hPvx8B396c3dCOa5652BT6LYb7iUiIwim1Z77VNHYXhoKED3pi6X4o/aZBCSNxx9dz3L/H1xX8MP096IqkKYp2Sf1E= Received: from SJ0PR13CA0184.namprd13.prod.outlook.com (2603:10b6:a03:2c3::9) by SN4PR10MB5543.namprd10.prod.outlook.com (2603:10b6:806:1ea::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9366.17; Tue, 2 Dec 2025 11:16:33 +0000 Received: from BY1PEPF0001AE19.namprd04.prod.outlook.com (2603:10b6:a03:2c3:cafe::40) by SJ0PR13CA0184.outlook.office365.com (2603:10b6:a03:2c3::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9388.9 via Frontend Transport; Tue, 2 Dec 2025 11:16:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.21.194) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.21.194 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.21.194; helo=flwvzet200.ext.ti.com; pr=C Received: from flwvzet200.ext.ti.com (198.47.21.194) by BY1PEPF0001AE19.mail.protection.outlook.com (10.167.242.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9388.8 via Frontend Transport; Tue, 2 Dec 2025 11:16:31 +0000 Received: from DFLE214.ent.ti.com (10.64.6.72) by flwvzet200.ext.ti.com (10.248.192.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 2 Dec 2025 05:16:16 -0600 Received: from DFLE206.ent.ti.com (10.64.6.64) by DFLE214.ent.ti.com (10.64.6.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 2 Dec 2025 05:16:16 -0600 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DFLE206.ent.ti.com (10.64.6.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Tue, 2 Dec 2025 05:16:16 -0600 Received: from localhost (dhcp-172-24-233-105.dhcp.ti.com [172.24.233.105]) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 5B2BGF8X2143193; Tue, 2 Dec 2025 05:16:15 -0600 From: Anshul Dalal To: CC: Anshul Dalal , , , Subject: [meta-arago][scarthgap][PATCH RFC 4/4] swupdate: enable authentication for update image Date: Tue, 2 Dec 2025 16:46:01 +0530 Message-ID: <20251202111603.1616989-5-anshuld@ti.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251202111603.1616989-1-anshuld@ti.com> References: <20251202111603.1616989-1-anshuld@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY1PEPF0001AE19:EE_|SN4PR10MB5543:EE_ X-MS-Office365-Filtering-Correlation-Id: fad0e943-c4a9-49be-b426-08de31943f4b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: pwlMhDZSN++EXIQG4WgEvtA6sRJIM0AR8iDR5+3UM4SiOSXZrMkicvX7U5YlgV1obNLxfOzyMLjzNRdcGM/yNn/YS3686eovtYtjF5owcWuAMkXXiJjhgqU0BgSFfSgT7sExd03g9/8zj/fP3/MHpZ8OR4KH3BgkNugli4OOmiEqyRMr49qLLKn/Aly9Gs11uLlRlegLYgdLzsp3eCjyw3K+HlcyTtjW2WhilX+EuKPLmdo4F6/zfSKk4xRI8Y41G6E1aoORTyiOL11L4bINspTpbLT0NtzLe24DBPDTQZ1CbQCMZw7wMdokr3t3QOVed70wXxp7b9/PSttrqftgOINrgwkz5BcjkZbFWZb/ZiTLCa8VR6xpIOFrJEA1s8VjBZNb+QDjlrZ5n4GKSZtrVOH700M5RmlaXAMYbpNV/1T/5JQD115jzw4B44JlR8xH01vkpNf4gpu4PkegraQ9QXBtMpodhQwhPEGnLYQu+NqcbGyelvgDCAw2gBoFNxTMi055IgXY6kmBrHJaoQYm/tyMIdj8XmcpykLCC4DmBSxK9YLgUO7Nv0wH7IU4+FTeB+80TGu0OQGbfWEyc1XveAgQAZ3Q6iD3i2fqHWrJfBA3xo3MMcP1mBsrpljhn1bvnA3Qj/ly2otXlwQjNbopB+QT3+gfDhVkk2oK5c4x/iLsrTwENDRYonFwmXILijpphQOB0EsK6NlkF8qcH9IYYfMz+1dlq+ufOx+lvCL2pydNJK/1DD9M7VL4QXR2D9sbPxoWcKI2mRJAqOt84pM/dLKYKEfhONEsGA16bs7ux2PV8tG3caV3OK48P2du7poxj0Pqg3hV8xNoNS3VZLViZVHSjjfsemRflyjWTXSGFpLiYUJX2EVxEFLrc6lKquKrpJJuEvo4TdRhafv7s5l0Or55z58SHjO0MNY8HTWamOsdru6kke6BEy7XvZtyaUExAveLLfKjpghtHlAXHFRYf7lSmxzkkhMfu45hqcUJoAz0SmYFy33tdV+g8YHZLBUtb81dmpnxsFqcJDH/jh5Sxam4uE/KCIIOVD9eyEHbs+AUD4m4EQfsC85AJHzZqUu++YIGjVNJYEwQDvXSuT8eg+SHo2IRNBWmk8XAwHhvEADAaKaQTWpaH6pSAzOuPCwf5dEEf2tEnYa9f3jJ1UN7bIAWvixFrITPGZ630yb8G6eiDh6V+X+B0m23S4xXIS43pwmB8Xsxjo8mbXujF8JDssFvA2zT/6AE1gZZMzAIftbbvZcbMiQilVp2dPC7Y5/fESBdSrDH1ztWoN7/tySnn9RHBNZQKvlBwN7KebTWJUm3pEa9h+m8sIqJTBEkrVXPr07vwMK2mQzkb4zSmyB5NuJqHjWKX+jGTkKyxgT1phEJYa9txEbY4etayiQXHLOtp9yeY5Ip2nNTZkmjRzewm1K1Df8YOfD/nTE+dr7Glws0a5jUxY4YfOZ6mtEjKcrqVwN0ralDrLJzTcHDupkX5YvY5eCT0by8oDmnTDCSu/+vTIQfccDjH2hD430pQmI7PdVul/Bsy9du1YvlSP4ps7DCUJc4RXenwZHWJiXkU7s= X-Forefront-Antispam-Report: CIP:198.47.21.194;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet200.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2025 11:16:31.8823 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fad0e943-c4a9-49be-b426-08de31943f4b X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.194];Helo=[flwvzet200.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: BY1PEPF0001AE19.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5543 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 02 Dec 2025 11:16:40 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/16851 To ensure the platform can only be updated from an authorised source, this patch adds signing to the .swu update image using the pre-existing custMpk keys from ti-secdev. Signed-off-by: Anshul Dalal --- .../recipes-swupdate/images/files/sw-description | 2 ++ meta-arago-distro/recipes-swupdate/images/update-image.bb | 4 ++++ meta-arago-distro/recipes-swupdate/swupdate/files/defconfig | 1 + .../recipes-swupdate/swupdate/files/swupdate.sh | 2 +- .../recipes-swupdate/swupdate/swupdate_%.bbappend | 5 +++++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/meta-arago-distro/recipes-swupdate/images/files/sw-description b/meta-arago-distro/recipes-swupdate/images/files/sw-description index 241bc95c..8a7e5f4d 100644 --- a/meta-arago-distro/recipes-swupdate/images/files/sw-description +++ b/meta-arago-distro/recipes-swupdate/images/files/sw-description @@ -13,6 +13,7 @@ software = device = "/dev/mmcblk0p1"; type = "raw"; compressed = "zlib"; + sha256 = "$swupdate_get_sha256(@@IMAGE_BASENAME@@-@@MACHINE@@.rootfs.ext4.gz)"; }, ); uboot: ( @@ -30,6 +31,7 @@ software = device = "/dev/mmcblk0p2"; type = "raw"; compressed = "zlib"; + sha256 = "$swupdate_get_sha256(@@IMAGE_BASENAME@@-@@MACHINE@@.rootfs.ext4.gz)"; }, ); uboot: ( diff --git a/meta-arago-distro/recipes-swupdate/images/update-image.bb b/meta-arago-distro/recipes-swupdate/images/update-image.bb index 33b0b74c..6176e5a6 100644 --- a/meta-arago-distro/recipes-swupdate/images/update-image.bb +++ b/meta-arago-distro/recipes-swupdate/images/update-image.bb @@ -1,4 +1,5 @@ inherit swupdate +inherit ti-secdev IMAGE_BASENAME ?= "tisdk-default-image" @@ -21,3 +22,6 @@ SWUPDATE_IMAGES_FSTYPES[tisdk-bootstrap-image] = ".rootfs.ext4.gz" SWUPDATE_IMAGES_FSTYPES[tisdk-jailhouse-image] = ".rootfs.ext4.gz" SWUPDATE_IMAGES_FSTYPES[tisdk-thinlinux-image] = ".rootfs.ext4.gz" SWUPDATE_IMAGES_FSTYPES[tisdk-bootstrap-base-image] = ".rootfs.ext4.gz" + +SWUPDATE_SIGNING = "RSA" +SWUPDATE_PRIVATE_KEY = "${TI_SECURE_DEV_PKG}/keys/custMpk.key" diff --git a/meta-arago-distro/recipes-swupdate/swupdate/files/defconfig b/meta-arago-distro/recipes-swupdate/swupdate/files/defconfig index 4a2d78c0..0bf605f7 100644 --- a/meta-arago-distro/recipes-swupdate/swupdate/files/defconfig +++ b/meta-arago-distro/recipes-swupdate/swupdate/files/defconfig @@ -4,6 +4,7 @@ CONFIG_HW_COMPATIBILITY=y CONFIG_UBOOT=y CONFIG_SYSTEMD=y CONFIG_WEBSERVER=y +CONFIG_SIGNED_IMAGES=y CONFIG_BOOTLOADERHANDLER=y CONFIG_CFI=y CONFIG_EMMC_HANDLER=y diff --git a/meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.sh b/meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.sh index 2083062e..fc32e4cf 100644 --- a/meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.sh +++ b/meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.sh @@ -12,4 +12,4 @@ fi UBOOT_BOOTCOUNT_ADDR=0x4301c100 devmem2 $UBOOT_BOOTCOUNT_ADDR w 0 -swupdate -H @MACHINE@:1.0 ${SELECTION} -p 'reboot' -f /etc/swupdate.cfg -w "-r /www -p 8080" +swupdate -H @MACHINE@:1.0 ${SELECTION} -p 'reboot' -f /etc/swupdate.cfg -w "-r /www -p 8080" -k /etc/custMpk.pub diff --git a/meta-arago-distro/recipes-swupdate/swupdate/swupdate_%.bbappend b/meta-arago-distro/recipes-swupdate/swupdate/swupdate_%.bbappend index 20f87435..bff44926 100644 --- a/meta-arago-distro/recipes-swupdate/swupdate/swupdate_%.bbappend +++ b/meta-arago-distro/recipes-swupdate/swupdate/swupdate_%.bbappend @@ -1,4 +1,5 @@ inherit swupdate-lib +inherit ti-secdev FILESEXTRAPATHS:append := "${THISDIR}/files:" @@ -8,6 +9,8 @@ FILES:${PN} += " \ ${SWUPDATE_HW_COMPATIBILITY_FILE} \ " +DEPENDS += "openssl-native" + SRC_URI += " \ file://defconfig \ file://swupdate.sh \ @@ -27,4 +30,6 @@ do_install:append () { install -d ${D}${sysconfdir} install -m 644 ${WORKDIR}/swupdate.cfg ${D}${sysconfdir} sed -i "s#@MACHINE@#${MACHINE}#g" ${D}${sysconfdir}/swupdate.cfg + + openssl rsa -in ${TI_SECURE_DEV_PKG}/keys/custMpk.key -pubout -out ${D}/etc/custMpk.pub }