From patchwork Mon Jul 15 15:35:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe REYNES X-Patchwork-Id: 1132086 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::23a; helo=mail-lj1-x23a.google.com; envelope-from=swupdate+bncbaabbsf2wluqkgqeocrln2y@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=softathome.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="mDR5qxwk"; dkim-atps=neutral Received: from mail-lj1-x23a.google.com (mail-lj1-x23a.google.com [IPv6:2a00:1450:4864:20::23a]) (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 45nSKT060gz9sRm for ; Tue, 16 Jul 2019 01:35:39 +1000 (AEST) Received: by mail-lj1-x23a.google.com with SMTP id p3sf3931348ljp.8 for ; Mon, 15 Jul 2019 08:35:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563204936; cv=pass; d=google.com; s=arc-20160816; b=ErjtpEMqKpr7uGIobR5A+jPbvEr5l11iTZSgfy1EuiqZPT/PKkZA7fBQBcn/HKoNZ5 +urlmih9Wc/i4Nf3K9O4joTJCpKxRE+L+e7ipEJdp38Gv//b84fgJ1UjyiX+XETG7DZU FUaotCr+nbUj6WrbIobu9jGIBBxGWRvjuuwyiYnr6+vZcN5VXTLi//geIfikWQHmKSpA XDun9fon7umMkKjZqxukEC2NEGetvYwPDLs03ZvevnOwKMJRq4X+YJtUeXGffXoWuM32 P/i5KtH9+JtMhkS9GAO/QrWbnkHGgSKh3lX3GoN7ZVx1k5arRMt/JqIvjjwZRW7L67IL 0KaA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:mime-version:sender:dkim-signature; bh=JJZ/xp2SDqhaVCbZT/Rie7BnubvRmrWg18HQ36sH3p0=; b=uCHj9iAMUHLfy6fJGO3Lq2BKuCtKi5G7fq8y+CbxE8MKT4t5/kLzpWKsKY79xfxQUI G22+9RrzMCBi0/bkhzG1Q5ypGdZZPoovm2Alw4LA8HPWEfH9K+feO2r0RAevwveMDpU5 OoT76VnE0p9foJ8EErT1/7onsm01CbDyEpAuprI4OYu5wyVYsQNM1d89ruR1YEZVfir6 gPFtg2T1b2nZNTYOQSBQRHH5c/4VDyQ3UCrG33HxtMr+yv2CjtGNZP+28GoL3vjE/Z82 M9onAqswg2j775h0ZwUhlU2QvBy8HyyePNOjHOBT6z5/WxiLdjmvwnkE/bQ+itRR4jeJ 4/BA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=softfail (google.com: domain of transitioning philippe.reynes@softathome.com does not designate 185.56.204.33 as permitted sender) smtp.mailfrom=philippe.reynes@softathome.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=JJZ/xp2SDqhaVCbZT/Rie7BnubvRmrWg18HQ36sH3p0=; b=mDR5qxwkT+yD4FpbdHgK6rcXXkzghAc1vDzr6UkhRGtexejfpBcKbTIS7zdFpPy3g6 Yj0zLeyAekW8XkIJ3FSCiC0gbfwSgHbahdz1Yl4snK4OLwr2JQDoPq7+P4AvdXHw/jW8 xiVNYePOakKRNq0J7qAzXkcJwdn6YsmNf55Q+MSpFOzh4aga7EIYRAG/CeOHpmvbLd6U Xf+WA4eRLfWZh8WY/R+uEzrxrot5kFB0Eg4LUdYF2C5D5IkryW3vrRbF5H2s4u0fI1J+ zzQIqi407rv8dDOLebQPnkgFN4u8OianKaVib3RC/Zf73b3+Ojn+rwrLQcljVIo0QfIy LX9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:in-reply-to:references: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=JJZ/xp2SDqhaVCbZT/Rie7BnubvRmrWg18HQ36sH3p0=; b=CaGPaJo9V0d+64HqB29Dl26+j0euDZXciy93f/UompLPqlKUFZVRVw+JpgDIaKyh1C tYJa4DO58Bco8NMvgUu1hZw2CVtVu4TWA8fO54TQR2kurIDpA0ng17V+SwxHZRo2xT/g QIj6Y04AqjfAph+leJBmI521lGZAZpP6fBjD1bCcGN1Sjwcb5m8VNcmB7KSIRhs5bDTG 6b8PvhGo5IRH2TAkzg88fKASMY5AjmZLa9I+E8m2LBKhO/cjcnN3Du3kedHmrQSOUApO WYcWrvwtgP+bf+FW+yu7yBeVX9kqIyCFeTvhtAx7HppXYr/SZCSagRvpNgz7wGh2Dnhl 3Elg== Sender: swupdate@googlegroups.com X-Gm-Message-State: APjAAAV3oO2ktJqtnLFLIMH4k7yrP7UpZGeeno7aoaLIqAGZWGGwtXWB JPj1IIeeF1Pn67j/O16QXuE= X-Google-Smtp-Source: APXvYqyknaDyzKIIbiZHgVn5IR0hzTv/lId6HaSdJVPxBwsT3cKNsu9lc2SnPrWhKgkRIgA7lo7juA== X-Received: by 2002:a05:651c:c6:: with SMTP id 6mr14485500ljr.127.1563204936426; Mon, 15 Jul 2019 08:35:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 2002:a2e:6556:: with SMTP id z83ls1993793ljb.11.gmail; Mon, 15 Jul 2019 08:35:36 -0700 (PDT) X-Received: by 2002:a2e:898b:: with SMTP id c11mr14943182lji.241.1563204935984; Mon, 15 Jul 2019 08:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563204935; cv=none; d=google.com; s=arc-20160816; b=zByf1NG7YABSshqMprxhbD5S6X6K6D1chwB0UaY1J41LzzcyidWAqVy0sev3kZJU1A P7fdl+RQCVNc+hoc5GhHnDHKspDRJimOhkZrTwX64sUqp3TiA/TvwZRmTwTsKpGK6u19 NGSrIusrE1r/w0DWALJYgwqNK0UBFuf3nNNdI7cgwxOy0bFf6A1cCUn+K27mptKXo45x KvsLxqGEQMDfRITi7VfN/tN/kEybk4JYuusCQrMdjcsN22vKV9Zc2rMG0bZD14Lez0+i IsXBj06Y0l/CYyxXIf7ryNbhjKgpmy3ajGPxaw/wp4YeFhH8YzDEV19mXF1p+emEnMw1 hqyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=zyhnV6JnNXnXNPbVBcV4dsZJ9edmf7X7uYag9LAY+WI=; b=CTjgoLM0WGN94xDXhj8iw5q+J8pMpl8iiPppCYIeSwkPeMpx95nNPFoMK4ovSVOtOX Vr0TP1rOxtbmkHTAOYTjazSZnEmiaTlGojcMQFlq/zYQs/vtOmGSjm3H3iWpdEFY09Qz 1Ys2YkI53pZegj7s9CliuzBDfw0cqHKghNgIEKYAMyG5CG5TvBTn+rn/AddUAp7H17UK uP0AAezIpQ6FPQWWaHRmsgqo/J9G5tVhsEOJQq3982WtW3Rf8002i5QLvPyi19Qjhmn5 XbyTeEDKevonzlyS2qEOQUXhaxRyfdbGppHjrpaZQ47fmXK70zCLBKzio/XkOfGdHWH/ lhTw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=softfail (google.com: domain of transitioning philippe.reynes@softathome.com does not designate 185.56.204.33 as permitted sender) smtp.mailfrom=philippe.reynes@softathome.com Received: from vrout30.yaziba.net (vrout30.yaziba.net. [185.56.204.33]) by gmr-mx.google.com with ESMTPS id s14si1132493ljg.4.2019.07.15.08.35.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 08:35:35 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning philippe.reynes@softathome.com does not designate 185.56.204.33 as permitted sender) client-ip=185.56.204.33; Received: from mtaout20.int.yaziba.net (mtaout20.int.yaziba.net [10.4.20.37]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by vrout30.yaziba.net (mx10.yaziba.net) with ESMTPS id 0400651FE6 for ; Mon, 15 Jul 2019 17:35:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mtaout20.int.yaziba.net (Postfix) with ESMTP id 026EF1600C2; Mon, 15 Jul 2019 17:35:35 +0200 (CEST) Received: from mtaout20.int.yaziba.net ([127.0.0.1]) by localhost (mtaout20.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 08eKlC0tLQ1U; Mon, 15 Jul 2019 17:35:34 +0200 (CEST) Received: from sahnlpt0333.softathome.com (unknown [149.6.166.170]) by mtaout20.int.yaziba.net (Postfix) with ESMTPSA id DAAE11600B9; Mon, 15 Jul 2019 17:35:34 +0200 (CEST) From: Philippe Reynes To: swupdate@googlegroups.com Cc: Philippe Reynes Subject: [swupdate] [PATCH 1/4] handlers: add a special handler flag NO_DATA_HANDLER Date: Mon, 15 Jul 2019 17:35:26 +0200 Message-Id: <1563204929-2762-2-git-send-email-philippe.reynes@softathome.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1563204929-2762-1-git-send-email-philippe.reynes@softathome.com> References: <1563204929-2762-1-git-send-email-philippe.reynes@softathome.com> X-CLAMAV-SCAN: ok X-VRSPAM-SCORE: 0 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrheekgdekhecutefuodetggdotefrucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhestddtredtredttdenucfhrhhomheprfhhihhlihhpphgvucftvgihnhgvshcuoehphhhilhhiphhpvgdrrhgvhihnvghssehsohhfthgrthhhohhmvgdrtghomheqnecukfhppedugeelrdeirdduieeirddujedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht X-Original-Sender: philippe.reynes@softathome.com X-Original-Authentication-Results: gmr-mx.google.com; spf=softfail (google.com: domain of transitioning philippe.reynes@softathome.com does not designate 185.56.204.33 as permitted sender) smtp.mailfrom=philippe.reynes@softathome.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , This commit add a special handler flag NO_DATA_HANDLER to define a handler that don't use a file from the swupdate image. Signed-off-by: Philippe Reynes Acked-by: Stefano Babic --- core/handler.c | 12 ++++++++++++ include/handler.h | 8 ++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/core/handler.c b/core/handler.c index 5716be9..d8f879e 100644 --- a/core/handler.c +++ b/core/handler.c @@ -78,3 +78,15 @@ struct installer_handler *get_next_handler(void) return &supported_types[handler_index++]; } +unsigned int get_handler_mask(struct img_type *img) +{ + struct installer_handler *hnd; + unsigned int mask = 0; + + hnd = find_handler(img); + + if (hnd) + mask = hnd->mask; + + return mask; +} diff --git a/include/handler.h b/include/handler.h index 73e855a..74c94dc 100644 --- a/include/handler.h +++ b/include/handler.h @@ -25,11 +25,13 @@ typedef enum { FILE_HANDLER = 2, SCRIPT_HANDLER = 4, BOOTLOADER_HANDLER = 8, - PARTITION_HANDLER = 16 + PARTITION_HANDLER = 16, + NO_DATA_HANDLER = 32 } HANDLER_MASK; #define ANY_HANDLER (IMAGE_HANDLER | FILE_HANDLER | SCRIPT_HANDLER | \ - BOOTLOADER_HANDLER | PARTITION_HANDLER) + BOOTLOADER_HANDLER | PARTITION_HANDLER | \ + NO_DATA_HANDLER) typedef int (*handler)(struct img_type *img, void *data); struct installer_handler{ @@ -45,4 +47,6 @@ int register_handler(const char *desc, struct installer_handler *find_handler(struct img_type *img); void print_registered_handlers(void); struct installer_handler *get_next_handler(void); +unsigned int get_handler_mask(struct img_type *img); + #endif