From patchwork Tue Oct 17 14:06:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1850245 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=M6oz/IdH; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::53d; helo=mail-ed1-x53d.google.com; envelope-from=swupdate+bncbaabbbnkxkuqmgqenyofv7a@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-ed1-x53d.google.com (mail-ed1-x53d.google.com [IPv6:2a00:1450:4864:20::53d]) (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 4S8wlZ1nQ6z23k9 for ; Wed, 18 Oct 2023 01:07:05 +1100 (AEDT) Received: by mail-ed1-x53d.google.com with SMTP id 4fb4d7f45d1cf-53e02a0ebfdsf4243468a12.3 for ; Tue, 17 Oct 2023 07:07:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697551622; cv=pass; d=google.com; s=arc-20160816; b=yeQ7XHXSDmtJuoOViL7S18a8uV7N4L637MUA3tLBgU3IoweP0DwnPKZQFNJDSMvoFp AwFegYZXBOliI1+YvBbiL9GyWd39VLod/4YrOzdQBE94iVcJtSsqWKl7n2zv+XdKJA9U BycrZY8SDXYGNUbIe2+4THGejztZb8YTNwxEnrLnBvAbs56xkX0F1q5JrqlkSY+Y9MM9 qCYKOFTvSPKoaB0j1SuSJEJA9BfvakmBs8wDNw2aVMnijDWTcFyFYgz0irxqNMZFnG7e Nl2ooGc5SxUtWtAF3d05sMDojo9I3HwMDI8cVYBjyn8GJW3M2NfulP3Zp75VlgUm+YFl bh+Q== 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:ui-outboundreport :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:dkim-signature; bh=2j4bmpBA96MRpS+OqsbnvG8yRElZSAdbDuw8PyBsuag=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=mGCOJ9HAQMpLyM0W5NfoB7DTDI97fkh0cawwU0MrARFSXB9q4fYFNRyJd+sOE3yqEO 6UEBJmu9cXIY/QuSCRekotY9wuDZADEwFV4uo1mp5AMYsUHNXCkFwC8C5oyWtPHTVhZa 0RX8PiEm7au+Sim/1iwimEU6KMHfKZjQDScSI8j652QEFvUtAZMr/A6DVq7NQA9v8z1a OJhV7D/ytoMneKdxT1BJaicUoXzt0UyJ3xc00ZPS7is9sQZDE8iVWGshIwpriQdHlnAp 7Hr59PEjbvhotpmcTlw93S7mIo0JGWw4sVh3TZAFDpF6Ar59d8jB4Fq16DT8XM4rqCLg g8Gw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.10 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1697551622; x=1698156422; 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:ui-outboundreport:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:sender:from:to:cc :subject:date:message-id:reply-to; bh=2j4bmpBA96MRpS+OqsbnvG8yRElZSAdbDuw8PyBsuag=; b=M6oz/IdHMJmIE9Q5ByXnvvqtsorCMl712YENtrS8hH/EqMvlxmwQWpmGWqy44Homjh 2x9hQaz4RW7Dx1NBw3ZLet//dMO9gkekyp/Zo/a3xskMQyFEp8ximCR0Jy4hmB8Fpz09 tGJqIrhsEeqTiw12RKkyeaVMSL8N4rSRxAvaXiK1nIeJHl4BO9CGhYG2HWVwdD8zebtH WinI6w/uMGIMEM+JXlBnVraOZPDaU4FXLHyivhzpRQZsF6VcM7/iqXN5m3BHNQp4+VZf +6w4JuvB0SkwO6yFosyPMqneSouNVQ80/48oHR1p1p8o9B5NVttiHY9Yy36iq7aiDrFQ n7RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697551622; x=1698156422; 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 :ui-outboundreport: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=2j4bmpBA96MRpS+OqsbnvG8yRElZSAdbDuw8PyBsuag=; b=Y9gZOTA1KYLccIOS4ax82GFJgcq4MrHTPXQnGtRU3+XoCSlyxipx4c5yi/OEySWIKb c+kb/jySy4fHOf4PPM+XON+q6dCm7Zj1L9hhWyn22CEfJ+wO4leoOUGUgg0Hkb6eiqMO vd/ijnKfD9m3pKdaXdwqmRUFi+5uGuMIrK0r9xHZCMJLbMeI80tPP2Fl2Drqxkv8444V XIkitQx07SLws/hNxHQ4+zTsTl15FFw0UN6aBJAC6iy3sjbE6ClE4fXq1Bd6veCSldaz mEmtWM+LeXHkHgDPSMgzJQDs9iBlkGeZ4QanP3Y37KKOg7toyLh4vWV/K7xPilOzWeH9 FQ0A== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOJu0YwooCrvkjYGX1Oh92Fc4dAAO69wQL4qtld/jZiDeOAnWreuaCGu 0e2BIm4u8N/W0nfnxCqLwOc= X-Google-Smtp-Source: AGHT+IEIxluW51elZWOUn3PRrNCS1efScEPSUaqvFqoRwmse6QSH5IlCqiHE7h7nE6ZmgZDDzL4agg== X-Received: by 2002:a50:9fe3:0:b0:53d:a1c0:410e with SMTP id c90-20020a509fe3000000b0053da1c0410emr2093426edf.7.1697551622265; Tue, 17 Oct 2023 07:07:02 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6402:f07:b0:532:c9b6:5c14 with SMTP id i7-20020a0564020f0700b00532c9b65c14ls34558eda.2.-pod-prod-04-eu; Tue, 17 Oct 2023 07:07:00 -0700 (PDT) X-Received: by 2002:a50:c8cd:0:b0:53e:455c:6273 with SMTP id k13-20020a50c8cd000000b0053e455c6273mr1675128edh.2.1697551620327; Tue, 17 Oct 2023 07:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697551620; cv=none; d=google.com; s=arc-20160816; b=NncVvdrMDXmf3UCziUAqdP2jUo2UFa4h7dZ/uKAk6Ix7NujClpd+jhQy9zdXYM6A69 Dq/6Z3pT2Y8qzuNI7vXm6DHK4wmSv0UQ4PD+AT5SiEd/Ygem8/xHl26dyTrlXhwRFjCK +YhT31h0Tnn5n4MQfPpIz4IDhHEpoLrkLI97ztl9g8uGWeLUCGlilDv196eX67EUkRJy 79uvEeGBsFhHV+DGIIbTYmLqj8lZKEQjTyTuWften1jjYHfT5B95iTdTk/Eu3w1EN3VO UNw9xdH8fMw1do4idjQsdsDA5mNypFn/xUyvlDPzFH2AFh+PsIheC2SEXYrXLCTUkx5e CSIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version:message-id :date:subject:cc:to:from; bh=lkXvWe6L0NFJrQZ4hQjkoA8hlT+f/3Iqw+jEc1vtwmk=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=H7YOtHjCfZoFAyiGQKII/3gV9UepFRFZI0GDNwlZQgrDHyfwqVxo/qwPWcmJagsG/7 LrP3uZ4zur310S7c1oMRpqTurnXs0RuyWrSZzyJBgWXTCee5qACT9z51e+d3EFPfCNEz qM8l5jkP7pN1WVLtUZ+CHu7MVeIxDc+VzWb1n1L/Mnh2VCvqOvqd9BrRf2nBZB0v5c+k 5b772S2kUfNPjfq8tjf1xiUiXSzpqLTEWzoJrRgCeG2eUFN0ACrLqpDV7b6iDwD+3ueQ yttBW4HcGZ/8wTPFOu0RfELRip/rQwY4jOE4tA2Shf2YUjkYzru5PxFpwUMtGqTO01i8 Noyw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.10 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.17.10]) by gmr-mx.google.com with ESMTPS id d5-20020aa7ce05000000b005378cb9a578si79934edv.2.2023.10.17.07.07.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 07:07:00 -0700 (PDT) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.10 as permitted sender) client-ip=212.227.17.10; Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MeD1l-1rQR2y37EV-00bIYK; Tue, 17 Oct 2023 16:06:59 +0200 From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH V2 00/11] Handle Hawkbit action_id and on the fly updates Date: Tue, 17 Oct 2023 16:06:46 +0200 Message-Id: <20231017140657.95860-1-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:SExPmIiNuHwd0J1jXp53VDhW/S32El+3s3pOtAUnGM6uoBKzlmL ahqbkt0PbKCWZ2KipR8Q7SFpUd72CbLN3HGQj6EGtxXwP4vXVy/Fk5GsUUxfj9k82Rp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sender: stefano.babic@swupdate.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.10 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org 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: , Getting the action_id from an update via Hawkbit has always required to implement something that reads the action_id when issued by SWUpdate, and finds a way to store permanently. This was often tricky. If it is not done, SWUpdate asks the Server for the action_id, but this leads to a mismatch if the operator has cancelled the update. The result could be that SWUpdate acknowledge an update that was not yet done, and the device still runs an older verion. With the support of application variables, SWUpdate can store for itself variables that are not for the bootloader. With this series, the action_id is stored and retrieved by SWUpdate without asking the Hawkbit server, solving the issue above. Variables can be set only by the core, that means an IPC is introduced to let processes with low-rights like suricatta to store values. Enhance sw-description adding a "reboot" attribute. If set to false, the update is decölared as "free from reboot" (on the fly updates without bootloader involvement). I freboot is deactivated, SWUPdate will: - send automatically the result to the Hawkbit Server if update is coming from it. - swupdate-progress will skip the reboot. Stefano Babic (11): IPC: add SET_SWUPDATE_VARS and GET_SWUPDATE_VARS Store globally namespace for swupdate_vars Implement IPC to set / get SWUpdate's vars hawkbit: add server name into the IPC request hawkbit: use stored action_id instead of current IPC: check if variable is set in SET_SWUPDATE_VARS Enum for cause field in progress messages Reset action_id after usage Send information to backend in case of on the fly updates swupdate-progress: parse if reboot is disabled doc: document the "reboot" attribute core/network_thread.c | 17 ++++++++ core/parser.c | 2 +- core/stream_interface.c | 41 ++++++++++++++++++ core/swupdate.c | 6 +++ core/swupdate_vars.c | 78 ++++++++++++++++++++++++++++++++--- doc/source/sw-description.rst | 30 ++++++++++++++ include/network_ipc.h | 9 +++- include/progress_ipc.h | 5 +++ include/swupdate.h | 1 + include/swupdate_vars.h | 2 + parser/parser.c | 13 ++++++ suricatta/server_hawkbit.c | 72 ++++++++++++++++++++++++++++---- tools/swupdate-progress.c | 30 ++++++++++++-- 13 files changed, 287 insertions(+), 19 deletions(-)