From patchwork Tue Nov 17 09:41:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1401432 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::337; helo=mail-wm1-x337.google.com; envelope-from=swupdate+bncbcxploxj6ikrbr5vz36qkgqetg34kxq@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=EeYUz6ac; dkim-atps=neutral Received: from mail-wm1-x337.google.com (mail-wm1-x337.google.com [IPv6:2a00:1450:4864:20::337]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cb1DD1TWSz9sRK for ; Tue, 17 Nov 2020 20:41:31 +1100 (AEDT) Received: by mail-wm1-x337.google.com with SMTP id j62sf1458289wma.4 for ; Tue, 17 Nov 2020 01:41:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1605606088; cv=pass; d=google.com; s=arc-20160816; b=lnt/j5pM3yVWq4Zio8+Kvvz/XXRdubaA5+ZId+E8w99hsWzAxNvE38bvILSB5aoa5h 0vIZmd4p+panjVscGm5wjH7S9WtGyC/aw4Q7Wr8h1MA0mPwOz4CdKG+Ic3itD2mp57mr CJwlhjW3ONR9fSNk0Af+IRJVghUkRC/4txRYQXVsq8+Z2jKn4JQvrXC4nNVNOcQPeg2D q4ruvHYJyeFU3zyFTuaowfHpqXp22+hSZuS4oV/V5nRt+cCzh2gTVTb2hHiyXN0GickD Tv7C/HiFKlM0wrF7n/lkpWeJBPw6jHAMrVYOszn4eh+miF38JxKy2dCI8Yu7zEnRR2LH GSDQ== 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:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=wZ7XdRsxU1P1z3ZaJf4uAzYdVZg9y/OZ/Sj6+o1W8ZM=; b=Cg8SQqzDXBX38ETlnZMz4iAk5cuILEzYCFLukBa1YHzNw+MS7Wvux2stc2B6yb9rtO VfGw1+7H6tP6nGKWzRF7nLaYqNT8+wDy/m8/Dbm9Vbq6THLmsZZ4o/RLhdbmGA4t45N+ An+VXFDhRIqtNWVZPFUpJyemxeM9BVVHyjoPb5LtepDx1b59Dydhh80ZxJV+AFmGAw9t Wx3xqj1LXAa8/U2fBYJzQ13P9qfzFXjAbiKYHgZN0aVPTDVgGh9vPQMH+3Y7qZXRN2xt J+o9xov2We8uRxaFXVCiveXOsvEe/9boss1+TjjIkLuyMF3KiKrKxUeH1btpuB3dkrOM nWAw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=wZ7XdRsxU1P1z3ZaJf4uAzYdVZg9y/OZ/Sj6+o1W8ZM=; b=EeYUz6acgzSSUMJle4uvcdmSPK5R36QaGzSeDaPMHh5x2Dlb/+kDv+cP/YkcjL1uLg r+ZjvU4PZfWktXQvCUCI2jCVzWQq6VrrrXI7QYg5UX3xbuWptNs7G9r58NQ7vaKEu0p3 4wbVKpuldBN4c7H82vHREc/2W8x1/W6dW/xlqVI2nw4Wsv7xwMVwvXbd5JDJIeDmTuAI 5RvOdzCOIU9qjcFPlMnr/EU7ey/RhriNm0vno5u4my0vWbYsZ5w6OcZgG16prL/ImHpL DFbgFJFvRlUtgbllfWrZRxpxoTQVhydqOo1IjwfjnYvYHm3Drjzg91Z8ZVvQPwnoi2XZ /mxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=wZ7XdRsxU1P1z3ZaJf4uAzYdVZg9y/OZ/Sj6+o1W8ZM=; b=gM1YBYT8djciKCyaGigj+eXiRReHdrkwoVda67+H1Rds8ffiutIbcI5RtWe6Jx3UkX Ugv4tqWj1xDFde+8A9nGK3IA+rWKpVkodoTRuZqFIh88PbpFeb2Tk73Z0LJM5cuOp4ou E5wI1HDLKzpwiQ8kFreaxiU54plWOqwHbcdM0FxC/2Rh+Uzg8CNpz2o3I32RnHmUtAqW mVXzVa1qwCcBW9RNlzbEryDody+X3A5HHAvRq71XVeEexeh4TMBdSSSZQy9dosCWWVsQ 9xVhBd/bBG4BdiG/HQiRUgLZKzZoUkmt3yEjm1hE+sJM8EwG8mvRwT5zYvBURKlnoVc3 kDhg== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM532a/tf2dP4pUdLmNdNYWuZjCi70MLT/ty7wFPxBcoGbbmCETLXG kKrZHlQbZ1qPo5Fxv2dVLqs= X-Google-Smtp-Source: ABdhPJwEXP73rzmlpTNugww6HFEduVuM+8a3EoW/Tmndu4uvmVMZNmsziRKnr98K55JulT4hO2IADA== X-Received: by 2002:adf:de12:: with SMTP id b18mr24743480wrm.187.1605606088172; Tue, 17 Nov 2020 01:41:28 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:adf:f70d:: with SMTP id r13ls1976102wrp.1.gmail; Tue, 17 Nov 2020 01:41:27 -0800 (PST) X-Received: by 2002:a5d:4d4d:: with SMTP id a13mr7942742wru.152.1605606087173; Tue, 17 Nov 2020 01:41:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605606087; cv=none; d=google.com; s=arc-20160816; b=QA6HEdwOlQ4cQEBLSm3ddrc4rpLzBLpFYszbGU4h/t3Hzo37/JTsn4tP05y+hDpoJz IzqIClC1Enl1V3L87fTZgxrew5nQfoZO8UkTok42QT9p8KktMmbrCXtFqN+cT5MvAbHr db0qo5JXe3G4VOgxvP9/k1glax7+CuH9mF4G4VnyPgKaPdF46FFjl/0O3QTHX7+c8NGI E5Bx9xY+H6/hngtItbICJRmw2ueiL+IWk0VmA2YLx+dyqutcyRnDwC+pzewx5nl3S/5G yzLZDRnnG6BQUdsovUUcMrDsA83QcNLMMA/gKiy6BxjiToyTqrAQNMbxn7HRvhzjVQqH +Zow== 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; bh=sdeeX39IP2ctoRxhHmmChw+lJxVTXjMDU9Zzfa5fG/s=; b=JgNWUrOgK6p4q0DxD+PELTr4EnHdszio8VaKjY19gTKzpDIiS1gG01dcScEq3IHcsA sirv9LhNt91yyNnH7GjkOODf2dPEJyrnJyi7NH/OolbG6WOCtk73BiWr4V2k8ibW/gb+ 5aJQgxmbqkuwGPccU0y7AQCwzLZaMXqHXVb7nZrZIKFlg1HGwzN2ajigZU3huyUrkAWS guO83dtX8ysp9Z06bOieEyCLWt+RcduTk3wjUwJRjfhf0axfNUrY60JN1lfIHpFAHcZs 8xIelMmMPggtmK5qFZi+D0nzpuyYOkEsvflUVoTNw8M4ffqi7ErRkdbK4PXtPupPoJDM Q6FA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id i1si72490wml.2.2020.11.17.01.41.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Nov 2020 01:41:27 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4Cb1D672cDz1qt4C; Tue, 17 Nov 2020 10:41:26 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4Cb1D66nYZz1rYFK; Tue, 17 Nov 2020 10:41:26 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id wZWhMlIZzHpk; Tue, 17 Nov 2020 10:41:26 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Tue, 17 Nov 2020 10:41:26 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 08E4C4540A7E; Tue, 17 Nov 2020 10:41:26 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([IPv6:::1]) by localhost (mail.babic.homelinux.org [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 5HPyUcS38xKM; Tue, 17 Nov 2020 10:41:23 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.64]) by babic.homelinux.org (Postfix) with ESMTP id 721AE4540191; Tue, 17 Nov 2020 10:41:23 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH 1/3] Connect the internal data tree to the shared data structure Date: Tue, 17 Nov 2020 10:41:20 +0100 Message-Id: <20201117094122.2153374-1-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de 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: , The parser generates an internal representation how the update should run and store it into a struct swupdate_cfg. This connects the shared object "installer" to the internal database to retrieve information about the update via IPC. It is thought that the database is for IPC just read-only and no direct access is allowed. Signed-off-by: Stefano Babic --- core/stream_interface.c | 1 + include/installer_priv.h | 1 + 2 files changed, 2 insertions(+) diff --git a/core/stream_interface.c b/core/stream_interface.c index 89ae52e..7df33ec 100644 --- a/core/stream_interface.c +++ b/core/stream_interface.c @@ -482,6 +482,7 @@ void *network_initializer(void *data) memset(&inst, 0, sizeof(inst)); inst.fd = -1; inst.status = IDLE; + inst.software = software; /* fork off the local dialogs and network service */ network_thread_id = start_thread(network_thread, &inst); diff --git a/include/installer_priv.h b/include/installer_priv.h index 1a7013a..d406f27 100644 --- a/include/installer_priv.h +++ b/include/installer_priv.h @@ -18,6 +18,7 @@ struct installer { int last_error; /* error code if installation failed */ char errormsg[64]; /* error message if installation failed */ struct swupdate_request req; + struct swupdate_cfg const *software; }; #endif From patchwork Tue Nov 17 09:41:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1401433 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::43a; helo=mail-wr1-x43a.google.com; envelope-from=swupdate+bncbcxploxj6ikrbsfvz36qkgqe2awsr3y@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=gJ3Iq8MT; dkim-atps=neutral Received: from mail-wr1-x43a.google.com (mail-wr1-x43a.google.com [IPv6:2a00:1450:4864:20::43a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cb1DD4jkJz9sSs for ; Tue, 17 Nov 2020 20:41:32 +1100 (AEDT) Received: by mail-wr1-x43a.google.com with SMTP id e18sf12727895wrs.23 for ; Tue, 17 Nov 2020 01:41:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1605606089; cv=pass; d=google.com; s=arc-20160816; b=jYSaq55+/7xzDzC4izjmgJuSYIc3WFMhReTGy2ejzo4apzgNi9Pk0wHftBOr4KqNaq nvatBWxrd/i/UkQ6K5bcGMbnpved3Htb+mrALAHpQuaKeB2K4y5xQaHrduXIjMCBwF/f qws058zoTOQebY+SP4xfAqStrtBVXOyquRgRl5Xr0CFwuZJdu51NGje+ijD0VL0ndKkO qR2a41tjOVgG0ei8yX1hzVKxHGRgpVxQHeuYxQZbFDW6JHrJEi+tYYZKWDQ8r5DMu0mE rJgQzHnqAkSKNsRF46aJzPFNTpV7d0NMC7gAKRg53gLrUrzAO/ABx7VW9EQZ8WjBecpm nizg== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=0t6tw0UFNEobrtyk6Grlysl5Oh5cDzvLhI1Nw94P9/w=; b=QQGAMGVqAIZhNQE0YY7T+HtXAG7X5yiUBJ/ToAb564EBx1iYyG/e003Irvk0oKxXuK CosUxjlV2Xq4vyqZiucfkJMFit4ckNyUKeVWp1D/vVnAOAU//fvqo4XknCD47/k3W9ja CLZ5IkFPMQ+d6XsDcfryekrjSSdH//4NVHmuErRhswd+GpR1z4Ssc2U63K3rR7u/WrE4 t0niICJHpXirtYk3WvAToeBY/RXogidN6TparJmuMw/HCnMiPFOpswVacljY2utoEPrg T2yoNA2+OwiJK6VY4Oh9xrvp0n8adfPSpQXIeWDLtF58pxLsK7IndIVS0ZvsPrH742cd 4uyA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=0t6tw0UFNEobrtyk6Grlysl5Oh5cDzvLhI1Nw94P9/w=; b=gJ3Iq8MTakRNjaeF9DMmwF1uShaOnWK44QHVr04ojK0ZzHiO8NMyBc9S2gTLQjRi6c Zhbv4h4nusoz9biEGpWwLwScGNX8Mjxtbr2w1QEolNn2clYmXzP5NtLzY5YxyQmUll2A fb0j58XSmGQ37phqjdD5GKtDJzqlvbIrUj0gxbhMwUITtkiP/NLFZFfpT9TH0X+UvMa1 GcMRmBT7l/ItqNjN1SKbBPlNNtdlLevw2OJLI1AnOnfmLlbdXH2HSLcNEFGz5/iDpblr OOdDKztFg5iAk0Pl3GZpqKhMfLp8Jqlp73GXNqn8H5rB87ZiORsqK9N2E329q5hnHnZI 6FCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=0t6tw0UFNEobrtyk6Grlysl5Oh5cDzvLhI1Nw94P9/w=; b=mg3QlzlTkPwdk55FoOeD2qUwx09drFEhzeP/hRysK1aMU3ZlPFuDtXAwgqHiMIX8Md hHeB/VPC0JGI+MtNiYftgh7DLotf8FQhmM08p6f+Gt3Q5IFawSHJAGqy4YQf3Qf6TxVy 2Evamgt8cpo8SsEm15Em1n+J0KQ2FyU/yRHs1fkcWfeK6LXADvbu1SllwTDw3v25WaTl LvBX7I+jp86QWLK+fcwrD/nW2mTfeHZjVO9i6wd7bNgTlLHfFIhmHoHd7XMEjTQR68oc 71UE9dbjO3cVkiZQ6Yc+77EGQLECTGRxKbDGpUHSsBColT8jEr/0JOxkwNbvtFpxsqDm LZOA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM530A1vpeqAY1/nB9T7jWOtmDL579rgxB6fOdb7h86AD5+lj/gRcC 4/mx5JFavTbd5FJfX2SfELA= X-Google-Smtp-Source: ABdhPJxKuEXcVl9MmMBgmv+SQKlw1RlF/VuuYE+Sr1BhV0Rw79GHQ/t8iGoykONVhes98hrhmULTyg== X-Received: by 2002:adf:f40a:: with SMTP id g10mr25589844wro.58.1605606089098; Tue, 17 Nov 2020 01:41:29 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:adf:aa87:: with SMTP id h7ls1971812wrc.2.gmail; Tue, 17 Nov 2020 01:41:28 -0800 (PST) X-Received: by 2002:adf:f08a:: with SMTP id n10mr24169842wro.260.1605606088042; Tue, 17 Nov 2020 01:41:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605606088; cv=none; d=google.com; s=arc-20160816; b=TyhhaSZvblW6cyDQ1hJE7FD9mHLr8Lk5ZZb/b13Ewcn2FqrXrF761p3tgpHfumS1K2 s3YlI8QldqzMn//rXCn34K1ICk2OEAEnpDNBzu0+liAwvrb4Cf/DYRUBWxp2jzXhkYLn AMefDXhaCxtp0M5/E/SD3dW8ZibDDVGVF9gEdCjsJx7V7UCyHt2eTuh2gQFRR33alYFV 20O3hmX7c6DHv/HRDVUK9K4CdtqBThFhEJJkXvav38KD5tB47SPkjUwIjgH49/7dMQS8 c+zwDCFGdz0lC6col5mzXpRltVHV2y+GTYOArgppP6zXnWH7dTouxF4NABb1Ois5zbwh yMpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=iTul0qZzHCIGHlqDD7usTuGs/FVqyw6lBO4DVC8U1R8=; b=BP2VvMefqQeLUj1THL7lbtnflWywHn1ex0InXKde/U/2ht/smVwLmGBrwq/HgO0zFX 5a6yuNngFowD3RpVzoYuRr+LI1RwB0ZL8FAg8AiSp8X1cdSSMdbDnzohrttKS//3cJXt CMFk8M0ileohP2AxXqYpvhbFRySWtgmzdEgrq0Nwubcsqdu6fjEyOr2B692pO/Mx8hJR s0yESaM/9Ahz92KcmTQocrRzw20AcyLpwbyGxWERi63d0j9MW1MYAi5o5raGMLjWxIUh cWbPZHZJJupZJAZ2TADXTBSEaeuBkeSBGjTD6It/shU33MgNDm5BdZp98VDcK33C9jwG 6MdQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id r21si833584wra.4.2020.11.17.01.41.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Nov 2020 01:41:28 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4Cb1D76J05z1qt4C; Tue, 17 Nov 2020 10:41:27 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4Cb1D763C1z1rYFK; Tue, 17 Nov 2020 10:41:27 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id TL38qP4s2JQO; Tue, 17 Nov 2020 10:41:27 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Tue, 17 Nov 2020 10:41:27 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 997EC4540191; Tue, 17 Nov 2020 10:41:26 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b57LdiEYj1OX; Tue, 17 Nov 2020 10:41:23 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.64]) by babic.homelinux.org (Postfix) with ESMTP id 8B9B6454042F; Tue, 17 Nov 2020 10:41:23 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH 2/3] Lua: Create accessors to get selection mode Date: Tue, 17 Nov 2020 10:41:21 +0100 Message-Id: <20201117094122.2153374-2-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201117094122.2153374-1-sbabic@denx.de> References: <20201117094122.2153374-1-sbabic@denx.de> MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de 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: , It can be useful to know inside an embedded script which selection is running. Signed-off-by: Stefano Babic --- core/stream_interface.c | 24 ++++++++++++++++++++++++ include/util.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/core/stream_interface.c b/core/stream_interface.c index 7df33ec..3f8a168 100644 --- a/core/stream_interface.c +++ b/core/stream_interface.c @@ -617,6 +617,30 @@ void *network_initializer(void *data) pthread_exit((void *)0); } +/* + * Accessors to get information about an update, they are the interface + * to the "inst" structure. + */ + +void get_install_swset(char *buf, size_t len) +{ + + if (!buf) + return; + + strncpy(buf, inst.software->software_set, len - 1); + +} + +void get_install_running_mode(char *buf, size_t len) +{ + + if (!buf) + return; + + strncpy(buf, inst.software->running_mode, len - 1); +} + /* * Retrieve additional info sent by the source * The data is not locked because it is retrieve diff --git a/include/util.h b/include/util.h index 99da3a8..92aec5f 100644 --- a/include/util.h +++ b/include/util.h @@ -226,6 +226,8 @@ int set_aes_ivt(const char *ivt); /* Getting global information */ int get_install_info(sourcetype *source, char *buf, size_t len); +void get_install_swset(char *buf, size_t len); +void get_install_running_mode(char *buf, size_t len); unsigned long long ustrtoull(const char *cp, unsigned int base); From patchwork Tue Nov 17 09:41:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1401434 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::13b; helo=mail-lf1-x13b.google.com; envelope-from=swupdate+bncbcxploxj6ikrbs5vz36qkgqeuftxvsi@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=UXjgDtbM; dkim-atps=neutral Received: from mail-lf1-x13b.google.com (mail-lf1-x13b.google.com [IPv6:2a00:1450:4864:20::13b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cb1DH0f6Hz9sRK for ; Tue, 17 Nov 2020 20:41:34 +1100 (AEDT) Received: by mail-lf1-x13b.google.com with SMTP id 205sf6179715lfb.17 for ; Tue, 17 Nov 2020 01:41:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1605606091; cv=pass; d=google.com; s=arc-20160816; b=uUsm6zAUkpCsX17h95b9gf1bx5J0DWTLT1iecViMjldcU25O5pa63TaUi9SGId9/Yi gYC0xAjcooSn3y8xHxo/rhKnEK0OABmNH245/uDW8jLHwjufL9yk7e569a1JBUI5nNBs WfBP5jRn82+QaNElZxGe5c/NV+rXBWYu01v4nbvQ8gYYmcAxK51wNzBHiVenFFx3qXpO hg+vwIwijFRD6cO7Dn+AyxwaZsuIEV6sI2aPz811TWqHn5b/kPp0SDNJG/AtIS04iT0x Eox8s0LpCc2RDxwm58ztcQKDc90wBs5W71OTZICfATysUJts6UdIGJVFjfaXQ3BnRHOv UMqw== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=IZ6Xor9mFcY1zuD6WmoQVb1/P2EPqVfLubefyoMjE+o=; b=rYDr5B+QiyZE7f9I0arNByFyFRY8JSoKIkKi4UcLR7F2MUqd47bn6O/8gA+QEEe4JM pi0D+oWUdSeL+Cyf49AYyGt8HMULZ1TlKGbmdX44s+JvlGAFlRMhyV5TdT74a0NRC4hR VEbDqPvcc3Y4sRkoYWiH0p6RYwOXUKlnT/WaYNSfeQ/p3jVu8BJzyGBiKjdCRIAr4pEF ElPubXasxcfE+fRfhRPp0H4mhTI6s8Tdud0rZ5b+O64Q08jydQNhR76Z/paYCpGernZz eqE1g59jD53U9FLTZiS/PKhNPc20AMWuIxgUgUSnXJC2p1Mc9uI0Ats64kv3M0B7tWgX PXyg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=IZ6Xor9mFcY1zuD6WmoQVb1/P2EPqVfLubefyoMjE+o=; b=UXjgDtbMGCQUpSZdKaxwce+jtqqaJOyd7udsQy8BQkAfAcAiDOFliSheKRIUBDSIaq p1jde2R3h4ZpOd0/Jcmgjn+6/0w6KUWFEZ03/lFMj8Au/zhPmHGKBfwdmNI6af8FRCk/ 09wSb3NBWKDbc+tolTrvTXK8e480YcR/OQmHMvlZR3M6vxlgd9RVZEeogidGZk0AH9x3 MaI5DvoEpA7jhl6NaeeVOOy8HqKb6CbhQQu2Rb4cM4YmsGI1VwfyV2IWmxLXvzhgJVqa AliHKfTuozxWA2vKxsc/0tjmPiBE2co33/OqBRHOXikDFsdrKV8x72K9ftZiLXkFsLkM /6YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=IZ6Xor9mFcY1zuD6WmoQVb1/P2EPqVfLubefyoMjE+o=; b=sCxw1wPA1QAkDbc7tytNKpC56IeKRllk4Nmh+IiiZyLm0sHeC4JV8FXmToBVVEOrZT KekewM3IuaEUa1k0/dDaW7BrDDO/BDbmv/L5EBQ56+1V+qcJ1zB5/CJpVZUE5LMmuaSn 95MyRufLFUo0sD1BXIqp1yaeY3vfFUDcWXg38Xrub7CmqY4i4nCo3OYv0vyXrjTCmkt7 fnVzREVimkb3Kuu4ta/2t4EXM7ShWJvCV/FQRxKzSVqQyOO5ltSts5PEIHZ1WCIYrdEp aWDfXPgxmLhhUJd8yNRymTJ7Oyz8AHXsFL3kxiiPZoMq2WjWtgynd4KymkfcVuru5q4D ZDvg== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM5327UpjjJ01xaAY5yxY2fo5N/UnrCri+Z2wM8oe+qlgjZreaNSfy aqqI8RMQ6PvHI8mMxRxVj4k= X-Google-Smtp-Source: ABdhPJx1tnzR5KRcmo0NGaReBh65Mdyo5A17u7O0aFmCh5ErOLUT3SDFrFOPYAGPIUqIsJ23tx/waQ== X-Received: by 2002:a19:54f:: with SMTP id 76mr1482172lff.202.1605606091627; Tue, 17 Nov 2020 01:41:31 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a2e:b0c1:: with SMTP id g1ls2472361ljl.5.gmail; Tue, 17 Nov 2020 01:41:30 -0800 (PST) X-Received: by 2002:a05:651c:152:: with SMTP id c18mr1550757ljd.228.1605606090125; Tue, 17 Nov 2020 01:41:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605606090; cv=none; d=google.com; s=arc-20160816; b=N8/TNqvcbHSR+oYQj5JonyrTLoVwr1P6EZoOnzYaMH3wn0uxKsWCHK19iE5GfCXpF5 NRYXcEITWApq8dMjnmSpbaHBtDY22DDzB8O5aabAeAXlpF1pSf2eM37x7JPeww/esKQb Tg+ezuJV8GMGrGRS1as2eoSkOLUxAmtM5pdGoHumZ1LWqDgrCShDM7ZnT5UmlRR5Urd5 4Wd86tAHMo7xx04cYJgddfCN/psv0Oaac0zPEN9EVk8wfh7zqMLnA94a2caRQwjJBtWa gGeZ160/1rP/G3b2NiLof/TleoFkfixtmIM24tcTrfp0GGgAcNEAOCl9oCi1nmxSGHyP LEEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=F5JFaGg5VnNlRpgEoyZrY+UiyOJCQtb42xFre021XPc=; b=fJMmi/9eHNWjZEuHVhSikLvFL6b4VDj50cU4vjOaUisILZHBppf6XLMEQgJIyodWNN XpE38n8QzaxBr6J5ND1lRf7XJIoSYx2LSF0kSUjvemxTGVBPZBTPLUHfU8GqBndvvLxL fLPJ76tMjNC2Y8QtnYi3GgSBNQt9pG+E1GlmETSy0yDhqgaY+quScJ5GNKIO+hWafgXT MWbSORYhN7BEhBR00jQhzQU+wn/iNjQylgM7TOslqGe7G0Uq0+HVpfuzX0FLcgf5N6pM WTjOB9rZdAhA6lzz5IOnPdYgrms8TbQxnNdsIagIqHUDVrxhv/sAsLbivEuIC907y0y1 KwCw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [2001:a60:0:28:0:1:25:1]) by gmr-mx.google.com with ESMTPS id z19si69219lfd.7.2020.11.17.01.41.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Nov 2020 01:41:29 -0800 (PST) Received-SPF: neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=2001:a60:0:28:0:1:25:1; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4Cb1D93Rttz1s1JC; Tue, 17 Nov 2020 10:41:29 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4Cb1D93KCQz1rYFK; Tue, 17 Nov 2020 10:41:29 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 2ju_k1xENQtu; Tue, 17 Nov 2020 10:41:28 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Tue, 17 Nov 2020 10:41:28 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 9DAA74540191; Tue, 17 Nov 2020 10:41:28 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F9ri6j_-blgh; Tue, 17 Nov 2020 10:41:26 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.64]) by babic.homelinux.org (Postfix) with ESMTP id B4FCE454093B; Tue, 17 Nov 2020 10:41:23 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH 3/3] Lua: add function to get selection Date: Tue, 17 Nov 2020 10:41:22 +0100 Message-Id: <20201117094122.2153374-3-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201117094122.2153374-1-sbabic@denx.de> References: <20201117094122.2153374-1-sbabic@denx.de> MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de 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: , Signed-off-by: Stefano Babic --- corelib/lua_interface.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c index 73f5a9c..a0d9297 100644 --- a/corelib/lua_interface.c +++ b/corelib/lua_interface.c @@ -831,6 +831,20 @@ static int l_set_bootenv(lua_State *L) { return 0; } +static int l_get_selection(lua_State *L) { + char tmp[SWUPDATE_GENERAL_STRING_SIZE]; + + tmp[0] = '\0'; + get_install_swset(tmp, sizeof(tmp)); + lua_pushstring(L, tmp); + tmp[0] = '\0'; + get_install_running_mode(tmp, sizeof(tmp)); + lua_pushstring(L, tmp); + + return 2; +} + + #ifdef CONFIG_HANDLER_IN_LUA static int l_get_tmpdir(lua_State *L) { @@ -870,6 +884,7 @@ static const luaL_Reg l_swupdate[] = { static const luaL_Reg l_swupdate_bootenv[] = { { "get_bootenv", l_get_bootenv }, { "set_bootenv", l_set_bootenv }, + { "get_selection", l_get_selection }, { NULL, NULL } };