From patchwork Wed Jan 4 15:19:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1721446 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::539; helo=mail-ed1-x539.google.com; envelope-from=swupdate+bncbcxploxj6ikrbdfs22oqmgqegn2awxi@googlegroups.com; receiver=) 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=20210112 header.b=sIzfOO28; dkim-atps=neutral Received: from mail-ed1-x539.google.com (mail-ed1-x539.google.com [IPv6:2a00:1450:4864:20::539]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NnCvR3r6kz23f5 for ; Thu, 5 Jan 2023 02:19:45 +1100 (AEDT) Received: by mail-ed1-x539.google.com with SMTP id f15-20020a056402354f00b00485864db618sf15543070edd.13 for ; Wed, 04 Jan 2023 07:19:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672845580; cv=pass; d=google.com; s=arc-20160816; b=VmNigXDy2VfwshgP+kFa8nUrT0RZwih2PJdgIoQqrz7xZm5tvElUNTpb6xyRhu4D+d sKiNRY6gKahewl6OF3+xIZvynbV5JjAXn/9SFjZZxCqUw6wdGSXIlUnZcUQaLPH965SB SxdNc6Iji9TkJjOtvaw0L2Jbok+LgETYB+laR8UTfpMoQ6E5r0/iUWDsouatmC4zmwOF voG11WNRLDoRuRm/MtZN2knBXIdtejfVwqUXRRCfbwqGHPtTbmeOTjSq5NkQav1C7c1B AZnHTesBdiLc4Vx28lAdnKBfOzM0pgyuWa6vC0ZZHjy/PXm/uYw8PVdEszrav2J7/lBt lKSA== 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=03NtXsmxl0LVgrp63HflU4ApR/g/dcA5DLaKl2yKLb4=; b=ZIl5fTf0wP2BLCfhMSRlNSzjSRlC+xw4iNutrWdJ+6Qw5NDnFp+4KU2RIi4LTDJNQy 8IvSz0y7uyKyMIqEJM1VW1rKvOZV03WfFOgsBBbjZNRQfkayeMSTwVp7EKzBj1OYOcu7 KDjKCD6bSILsczclRyxY0ZbA0aEXVT4dnJMW0wfa/XIDJQ0pF+xzVRdI9iKQVLlCW8BD Z3Stm9hXO/kj6EQmdPzQ0U37M/OjSvJ/v+pBK/4GayPccZ6v/8DwOV4CZSf47fHFV4Vj ogLD0zyduqu/otTmcbQTJ2AuF+AS922V5aCO9A6Nclxt/C+wm9lSBRVsLnSrN17Fq4h0 QPTg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=03NtXsmxl0LVgrp63HflU4ApR/g/dcA5DLaKl2yKLb4=; b=sIzfOO28kGRDPrhYT0UuZEpTwJPLEZ7HOePYrptnhJAPP9MN9NuZeiEnTz1vwYWpiC nBcSEMe5Fw2J4pomdQph4gODspn8b4iAecqgFjetVorQMhFKlwOXCOQKTNLdSC6digtg lVqOAADoX3r53DQNxfgfPgKBjexjjEAam/273Y5HHd3wyubLEXNHPNwkl0G9du2pudBY GnfIVNNG7/mpeeyPDkfgJ5Q+P+hywoRzq3Pcg/9WlPmxWfrUXzuznUqDeWklCxkRyjwR 8npdqgxZ9n2qM3uNgNtWu02K0qXH64eKlV9QEORzXAaxXkNUnT7r51ai/Ec/yi0J4F8s hpBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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:mime-version :message-id:date:subject:cc:to:from:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=03NtXsmxl0LVgrp63HflU4ApR/g/dcA5DLaKl2yKLb4=; b=4bjzZUika7+XvsjqTBKQNHYgJmKYqrRh+t78+GM9OOBaX6iXJN5KNlBBv4Vja75L+l lGmU6GEUktSxFJ900LXMC70q720Sg0YVZ8PzMExGrx0GGoSgmj545/uEPl7zLHjnr/mE NjgIkswWkvgH+hTWorMDhu5x8ksGEKYGdhh2dytGWcLeM9h/YAUHHSUPiFM2tfH1Vi+c MrPZpAr5l/HF8jue8ruCDxLoARGM02sBn/26xuHiYnv64dHd2RPvSDy7mxBnSoqCF3BM J745xCF8fePKt/6n/0yfsSZ8rCur0SaK4u2KKx98T9p/NTSth3BLr/dQvIQFIyse9x3G W9ng== Sender: swupdate@googlegroups.com X-Gm-Message-State: AFqh2kriIHNES22rsO5vMOIzHcsOb2ZUe2rnb61pxogXoAac78s6JUhd Gfsy9lXwx3K1b5jArYBYFVE= X-Google-Smtp-Source: AMrXdXsZ7d4Tr9jO0eKkk8jUH316reLuznj0Zo9aAwmhaSBrDqSP8nZzbJ95OjtSngfp53YkFocZLg== X-Received: by 2002:a05:6402:1f10:b0:48d:5382:1da8 with SMTP id b16-20020a0564021f1000b0048d53821da8mr1141342edb.240.1672845580450; Wed, 04 Jan 2023 07:19:40 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6402:4413:b0:43d:b3c4:cd21 with SMTP id y19-20020a056402441300b0043db3c4cd21ls1284512eda.2.-pod-prod-gmail; Wed, 04 Jan 2023 07:19:39 -0800 (PST) X-Received: by 2002:a05:6402:685:b0:470:25cf:99d1 with SMTP id f5-20020a056402068500b0047025cf99d1mr41359664edy.31.1672845579259; Wed, 04 Jan 2023 07:19:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672845579; cv=none; d=google.com; s=arc-20160816; b=WbX5fo0w5X+8ltaBos420pG7aFHnG+bZwhQJNlrMfYI525z5wc9jQUqNCE6rjmKLiN mrJb9HE0B4I1zl6nEXaRpcSozXbQL+56hug/RMGK1b4c+R/EaYAvO8m+p2bD+Tz3dN3s XkW33Y1JhAR443Y1r4PcfHC2ew/yuFFUsaeuYzNwSemwZavfFLcWXXjR9t6a0kPoCUDx ug9+qIpGfueDh42Tv9fJlqq4A0khI8uAP6M6tF7M+5xwiwv9lwL1tvMU6z4ywaCcY8pA rnGetqHKmaLr7mTWr1pjjCwfUrMhePVGlXFGspJgfA1vuassSocW/jbhJWRcN8+CnenK 7D0Q== 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=05+JOInriwaSJrkuGHOFAZFSCCnWhtLIF0vM+54yOnA=; b=uAWg2OzEWurgK7/dzYpX7v0Tfh2QRYNquj0G34XqHtg/TmtX8wazqH0rrO7fWwqon4 CQIZPQzJ5EpCiciPw5NNP+OubgoMAbZsTbGM3EM2uhtBiHsId8TLRU9AqyiErm5OvEXH y+5aNEbPLV7cZjwfjapwCC6xv+Wpq3eZ90I5BB5pRkb6et7HmENlU0SCerp6ZrFPjzgQ lQzh1i+8ST2G6XI7MbIWpAnFnIdHbiEd59QEARWJRScPYZhcVmopCwLnfIv4+YCexTBu Oic7tWMltSgy0cOgfoRN4b6jm+doYQ20UPI5KBUXKgprHiLMmHqF6tjnYXEHgXpliA0r TGUQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by 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.10]) by gmr-mx.google.com with ESMTPS id r8-20020aa7d148000000b0048ecd372fccsi194467edo.5.2023.01.04.07.19.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Jan 2023 07:19:39 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.10 is neither permitted nor denied by domain of sbabic@denx.de) client-ip=212.18.0.10; Received: from frontend03.mail.m-online.net (unknown [192.168.6.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4NnCvH0HNsz1s88c; Wed, 4 Jan 2023 16:19:39 +0100 (CET) Received: from localhost (dynscan3.mnet-online.de [192.168.6.84]) by mail.m-online.net (Postfix) with ESMTP id 4NnCvG6yyFz1qqlR; Wed, 4 Jan 2023 16:19:38 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan3.mail.m-online.net [192.168.6.84]) (amavisd-new, port 10024) with ESMTP id ibZVSAcFBEA8; Wed, 4 Jan 2023 16:19:37 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Wed, 4 Jan 2023 16:19:37 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 347554540D57; Wed, 4 Jan 2023 16:19:37 +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 5bPzKwbum_0B; Wed, 4 Jan 2023 16:19:34 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.48]) by babic.homelinux.org (Postfix) with ESMTP id 4AF3E454066B; Wed, 4 Jan 2023 16:19:34 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: James Hilliard , Stefano Babic Subject: [swupdate] [PATCH 1/2] Kconfig: Add HAVE_LIBUBOOTENV and HAVE_LIBEBGENV Date: Wed, 4 Jan 2023 16:19:23 +0100 Message-Id: <20230104151924.3797632-1-sbabic@denx.de> X-Mailer: git-send-email 2.34.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.10 is neither permitted nor denied by 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: , From: James Hilliard Allow passing through the environment if libubootenv or libebgenv are available for the build target. Defaults to yes because we do not do any library checking for now. Signed-off-by: James Hilliard Signed-off-by: Stefano Babic --- Kconfig | 8 ++++++++ Makefile.deps | 4 ++++ bootloader/Config.in | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/Kconfig b/Kconfig index 85fa5fd7..48325bf2 100644 --- a/Kconfig +++ b/Kconfig @@ -53,6 +53,14 @@ config HAVE_LIBUBI bool option env="HAVE_LIBUBI" +config HAVE_LIBUBOOTENV + bool + option env="HAVE_LIBUBOOTENV" + +config HAVE_LIBEBGENV + bool + option env="HAVE_LIBEBGENV" + config HAVE_LIBEXT2FS bool option env="HAVE_LIBEXT2FS" diff --git a/Makefile.deps b/Makefile.deps index 08df4e22..97ac96e3 100644 --- a/Makefile.deps +++ b/Makefile.deps @@ -42,6 +42,10 @@ ifeq ($(HAVE_LIBUBI),) export HAVE_LIBUBI = y endif +ifeq ($(HAVE_LIBUBOOTENV),) +export HAVE_LIBUBOOTENV = y +endif + ifeq ($(HAVE_LIBZEROMQ),) export HAVE_LIBZEROMQ = y endif diff --git a/bootloader/Config.in b/bootloader/Config.in index 1744b612..ad784c51 100644 --- a/bootloader/Config.in +++ b/bootloader/Config.in @@ -14,16 +14,24 @@ config BOOTLOADER_NONE config BOOTLOADER_EBG bool "EFI Boot Guard" + depends on HAVE_LIBEBGENV help Support for EFI Boot Guard https://github.com/siemens/efibootguard +comment "EFI Boot Guard needs libebgenv and libz" + depends on !HAVE_ZLIB || !HAVE_LIBEBGENV + config UBOOT bool "U-Boot" + depends on HAVE_LIBUBOOTENV help Support for U-Boot https://www.denx.de/wiki/U-Boot +comment "U-Boot needs libubootenv" + depends on !HAVE_LIBUBOOTENV + config UBOOT_FWENV string "U-Boot Environment Configuration file" depends on UBOOT From patchwork Wed Jan 4 15:19:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1721445 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::438; helo=mail-wr1-x438.google.com; envelope-from=swupdate+bncbcxploxj6ikrbdvs22oqmgqecqgzdwa@googlegroups.com; receiver=) 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=20210112 header.b=iPRJIxxp; dkim-atps=neutral Received: from mail-wr1-x438.google.com (mail-wr1-x438.google.com [IPv6:2a00:1450:4864:20::438]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NnCvR3wKxz23fg for ; Thu, 5 Jan 2023 02:19:46 +1100 (AEDT) Received: by mail-wr1-x438.google.com with SMTP id t18-20020adfa2d2000000b00277e6c6f275sf3262271wra.0 for ; Wed, 04 Jan 2023 07:19:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672845582; cv=pass; d=google.com; s=arc-20160816; b=Lp7fQUJY7lg9S853JyGmAM/b1ReXiDbMsHac4ihR/hFg/VEUr+G7Jubt/s/1YIQDxs P/l5dYaa7jbq7OIerVZNak9GwXTJQY8eQeUFOvLNQUyTftjT29EWwntraLiZ1JrMMjLh tpNEXa6Yhzg7fPLqNZvjdG4UmUbA8FsufwINOjFXJQJKOFyINvl/EfK7El7EBTf2fiKP lQVh6zYsY+EFF30fGwo9SAYBM+8cu7g5W5Y3ei5wwQUU3/OBQoVon/UdAdqA5A4VlNpR fLr8Ml+EQaGnGpbGxf+Qx6lQ7Ksi1l1NYdleZTPRrluUURP7Kw+4Cix8X2Qam0x7IQQG pEWw== 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=Mg9Dbz2dCrMPK1kKbb67ZgyQ6N+440QpJRHNAdqQGEY=; b=Ecj2J3RHyEUnlCMrid7m0NkjR/Pru37gm/IAbnl4I17sNLXPBRHjygdR0XuktlejsQ 83xXuUm/Aj30kbOSwdIwWuUEVAgSF85ya5Z3D1a25YtSuo013ycac8v1CcIyRCIqWKYL 4CpqbCJuBgaQWBcc1sy1CQBiNyl8re2mv76etXlv/REOYAkR9EeOpoi3ycrR2bkESbSX eL5KJmXNKvzTq1jlmmVHVdYK7AwJvpw1Hrljr50YmdD7Sth0T5pe6lrSzqItpwr8iHBG i1PHtZ7OCc1pAhtOGe1kYGtV1lCdmfIbFNl1c3CunC05Dj1zyfmuDFjt8kvjAQz1g5P0 Gs9A== 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 domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=Mg9Dbz2dCrMPK1kKbb67ZgyQ6N+440QpJRHNAdqQGEY=; b=iPRJIxxpGlaUYtcqD2Jr77fh9NsgEaSYJHuEQg3oHZnALFqAV3z1vVW2onZ6qwnl9/ EJzehrINqwAtoupgqJsB6Q8LT+TJbwgjudec0j7brqMJKVcpg4wYvVGKHdq4XP083ajk fHRg0sFN+P/syHEZptjrTljtAx15qZgWDLX6mnVSyJoFV4vI8fMNgO72fPUVLNOIeQyd pMKZC9m1biptq8IBXNQVz14Q4Ddvn4vfLjEa493aFFIAFKiPuz1ooxqJp8xiAvIf99DV pTrArn3eISl4xLYOSSu1iuf52jmdc5/ShAF4wPy4ld4Om1+IdGg6steqEKt0UDdMA3Ne FvOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=Mg9Dbz2dCrMPK1kKbb67ZgyQ6N+440QpJRHNAdqQGEY=; b=EsLSkyiyEszCv+uUGLfQKv4xLnLlKp9lr+wafVxByGuU08h43YO30OkU8cGMdvpDjW AWeZLQ+Utf2/xAEJ6keMtY/WAomnHg1v53eB8eDtzTNPnaUFINJg6jaQVQ6X37uuOKjr fODiCLhPCIxO/JC70AzY24d9nS4W+uNqZXcvxQBE+Ommo+r0gSqabOvYCKacOE9mHW+k CdGgnBL4j0mvroaWSrVeNv7m6JzrgEdTumuMJH4sOaIf78foKoTakbf2SSmU+oNhVUai QmSvtuMUb1hFU113vLuyBIctDKMuJ/ESUjWby0LZYGVt6nw3SrA5bdQP377ZcC/cglLW wdYw== Sender: swupdate@googlegroups.com X-Gm-Message-State: AFqh2kr1xQSPIdil12EaG9fqtzXRJ5DoFaWniAAqgxPdrhFefqQ2n0Au kUREedvoLB+vroCDzctTHE8= X-Google-Smtp-Source: AMrXdXsmX+07qibxvCxq0OXJSyJTzq7TidmkOrGbCe53NqZWH4TAtr0duO/8mrEOAWqU+zZd7Renxw== X-Received: by 2002:a05:6000:614:b0:271:95d5:4ccf with SMTP id bn20-20020a056000061400b0027195d54ccfmr1741419wrb.106.1672845582616; Wed, 04 Jan 2023 07:19:42 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6000:251:b0:269:604b:a0dd with SMTP id m17-20020a056000025100b00269604ba0ddls693179wrz.0.-pod-prod-gmail; Wed, 04 Jan 2023 07:19:41 -0800 (PST) X-Received: by 2002:a5d:52c1:0:b0:242:5d8e:6c35 with SMTP id r1-20020a5d52c1000000b002425d8e6c35mr29015792wrv.28.1672845581466; Wed, 04 Jan 2023 07:19:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672845581; cv=none; d=google.com; s=arc-20160816; b=SfkqMqUnj3melRAvTFDpCFQ/gdJwkTibw5kJI2UUKOabKV3SrXR1GFEslPvNdeY+TX SNM54FOId6ur61Ud0McA3UaMLCjGrv6e8X8iyCG8PUrOgVRroI/8zaq7DhxNzqMA+wby DBthI85nL92SZeXNpGDgBHlv1UAPAa+JBfB+J7zpelywfB5nwecL+6JhRoF5UgPtOCS8 dmZH+M+O7zpQdPCJ5wPKSAx+SY/L4InCd+32PtpuuWCAPBFhdbErMDRWFOXg4gXgK54L nQToJygMRVE7QTf/jmMFVvmpp52ofD/s30oIIEBa1exQsAX388sK0dHz5mCEk2NQI8nV HctA== 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=Kb1Vy98OoP92dWSFv5FYNDuyvJFPnWIM22OS2q1zNp8=; b=U7MjVJxNWV+Mw7GiYpDVrbcxOfjUngkQrxVo+/5ZwdyyY/AFXtYqehLvxUqNOGwJ+E ulgaweX6scb0gjUc4pIRLrS538xFX3j1Nq3guIC2GRQt8VkZUIqTMqfC7pup2bTWOYkM VOMQmqSXaMndGclt2GeeQlQdblGHC9UsIan1y9FK4Rcvp0k22N0h4OLK1QpEOdo2pQ23 RYZ/aP6OgvUm8iCxgLLY0BhdegCn2+7herZnpdjdrEm435yJcMZqCHcDbSFBYDh6yKMq ejNVkw4uVDMgNaUujqEUcUyTFYA85p3NqFJh13p6J5caAunJ2mlmaibPmeRCvvlcytA2 nGeQ== 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 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 l6-20020a5d5266000000b00241d0141fbcsi1196760wrc.8.2023.01.04.07.19.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Jan 2023 07:19:41 -0800 (PST) Received-SPF: neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by domain of sbabic@denx.de) client-ip=2001:a60:0:28:0:1:25:1; Received: from frontend03.mail.m-online.net (unknown [192.168.6.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4NnCvK1g7Kz1s88c; Wed, 4 Jan 2023 16:19:41 +0100 (CET) Received: from localhost (dynscan3.mnet-online.de [192.168.6.84]) by mail.m-online.net (Postfix) with ESMTP id 4NnCvK1Pjxz1qqlR; Wed, 4 Jan 2023 16:19:41 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan3.mail.m-online.net [192.168.6.84]) (amavisd-new, port 10024) with ESMTP id RaATpNkC2Qk8; Wed, 4 Jan 2023 16:19:40 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Wed, 4 Jan 2023 16:19:40 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id F26AB4540D57; Wed, 4 Jan 2023 16:19:39 +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 9pC-SMqzqrxL; Wed, 4 Jan 2023 16:19:37 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.48]) by babic.homelinux.org (Postfix) with ESMTP id 7CAD9454066B; Wed, 4 Jan 2023 16:19:37 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH 2/2] Add option to link bootloader libraries statically Date: Wed, 4 Jan 2023 16:19:24 +0100 Message-Id: <20230104151924.3797632-2-sbabic@denx.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230104151924.3797632-1-sbabic@denx.de> References: <20230104151924.3797632-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 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: , Commit 3a4e626b857 introduced dynamic linking for the bootloader interface. This helps with standard Linux distros, where SWUpdate is provided as package and it is not built from sources, and SWUpdate checks at startup if the chosen library can be loaded. However, this mechanism just works if dynamic linking is supported, and it fails on system where dlopen() is not available, like uclibc and musl. Add an option BOOTLOADER_STATIC_LINKED to reintroduce again static linking. Signed-off-by: Stefano Babic --- Makefile.flags | 17 +++++++++++++---- bootloader/Config.in | 10 ++++++++++ bootloader/ebg.c | 13 +++++++++++++ bootloader/uboot.c | 12 ++++++++++++ 4 files changed, 48 insertions(+), 4 deletions(-) diff --git a/Makefile.flags b/Makefile.flags index 2bec8468..c44412da 100644 --- a/Makefile.flags +++ b/Makefile.flags @@ -209,18 +209,27 @@ ifeq ($(CONFIG_UCFWHANDLER),y) LDLIBS += gpiod endif + +ifeq ($(CONFIG_BOOTLOADER_STATIC_LINKED),y) ifeq ($(CONFIG_UBOOT),y) +LDLIBS += ubootenv +endif +ifeq ($(CONFIG_BOOTLOADER_EBG),y) +LDLIBS += ebgenv +endif +else +ifeq ($(CONFIG_UBOOT),y) +LDLIBS += dl +endif +ifeq ($(CONFIG_BOOTLOADER_EBG),y) LDLIBS += dl endif +endif ifeq ($(CONFIG_SYSTEMD),y) LDLIBS += systemd endif -ifeq ($(CONFIG_BOOTLOADER_EBG),y) -LDLIBS += dl -endif - ifeq ($(CONFIG_BOOTLOADER_DEFAULT_NONE),y) KBUILD_CPPFLAGS += -DBOOTLOADER_DEFAULT="none" else ifeq ($(CONFIG_BOOTLOADER_DEFAULT_GRUB),y) diff --git a/bootloader/Config.in b/bootloader/Config.in index ad784c51..82e5b6e5 100644 --- a/bootloader/Config.in +++ b/bootloader/Config.in @@ -106,6 +106,16 @@ config BOOTLOADER_DEFAULT_NONE endchoice +config BOOTLOADER_STATIC_LINKED + bool "Bootloader interface static linked" + help + Link statically the interface to the bootloader. In case of distros, + more interfaces are available at the same time and SWUpdate checks + at runtime and loads the interface via dlopen(). This is available + with glibc and dlopen support. For other system, the interface can be linked + statically. + + choice prompt "Update Status Storage" help diff --git a/bootloader/ebg.c b/bootloader/ebg.c index a456e1ab..edfc9047 100644 --- a/bootloader/ebg.c +++ b/bootloader/ebg.c @@ -518,6 +518,18 @@ static bootloader *probe(void) return NULL; } +#if defined(BOOTLOADER_STATIC_LINKED) + libebg.beverbose = ebg_beverbose; + libebg.env_create_new = ebg_env_create_new; + libebg.env_open_current = ebg_env_open_current; + libebg.env_get = ebg_env_get; + libebg.env_set = ebg_env_set; + libebg.env_set_ex = ebg_env_set_ex; + libebg.env_getglobalstate = ebg_env_getglobalstate; + libebg.env_setglobalstate = ebg_env_setglobalstate; + libebg.env_close = ebg_env_close; + libebg.env_finalize_update = ebg_env_finalize_update; +#else void *handle = dlopen("libebgenv.so.0", RTLD_NOW | RTLD_GLOBAL); if (!handle) { return NULL; @@ -534,6 +546,7 @@ static bootloader *probe(void) load_symbol(handle, &libebg.env_setglobalstate, "ebg_env_setglobalstate"); load_symbol(handle, &libebg.env_close, "ebg_env_close"); load_symbol(handle, &libebg.env_finalize_update, "ebg_env_finalize_update"); +#endif return &ebg; } diff --git a/bootloader/uboot.c b/bootloader/uboot.c index 2720b1ea..a2f07948 100644 --- a/bootloader/uboot.c +++ b/bootloader/uboot.c @@ -123,6 +123,17 @@ static bootloader uboot = { static bootloader* probe(void) { +#if defined(BOOTLOADER_STATIC_LINKED) + libuboot.open = libuboot_open; + libuboot.close = libuboot_close; + libuboot.exit = libuboot_exit; + libuboot.initialize = libuboot_initialize; + libuboot.get_env = libuboot_get_env; + libuboot.read_config = libuboot_read_config; + libuboot.load_file = libuboot_load_file; + libuboot.set_env = libuboot_set_env; + libuboot.env_store = libuboot_env_store; +#else void* handle = dlopen("libubootenv.so.0", RTLD_NOW | RTLD_GLOBAL); if (!handle) { return NULL; @@ -138,6 +149,7 @@ static bootloader* probe(void) load_symbol(handle, &libuboot.load_file, "libuboot_load_file"); load_symbol(handle, &libuboot.set_env, "libuboot_set_env"); load_symbol(handle, &libuboot.env_store, "libuboot_env_store"); +#endif return &uboot; }