Message ID | 20201117094122.2153374-2-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBSFVZ36QKGQE2AWSR3Y@googlegroups.com> 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=<UNKNOWN>) 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 <incoming@patchwork.ozlabs.org>; Tue, 17 Nov 2020 20:41:32 +1100 (AEDT) Received: by mail-wr1-x43a.google.com with SMTP id e18sf12727895wrs.23 for <incoming@patchwork.ozlabs.org>; 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 <swupdate@googlegroups.com> (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 <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> 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 Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
[1/3] Connect the internal data tree to the shared data structure
|
expand
|
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);
It can be useful to know inside an embedded script which selection is running. Signed-off-by: Stefano Babic <sbabic@denx.de> --- core/stream_interface.c | 24 ++++++++++++++++++++++++ include/util.h | 2 ++ 2 files changed, 26 insertions(+)