From patchwork Fri Nov 20 22:11:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 173 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:df02:0:0:0:0:0 with SMTP id i2csp1348491oou; Sat, 21 Nov 2020 00:12:03 -0800 (PST) X-Received: by 2002:a7b:c841:: with SMTP id c1mr13370343wml.31.1605946323758; Sat, 21 Nov 2020 00:12:03 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1605946323; cv=pass; d=google.com; s=arc-20160816; b=br7RNx07n0x8FdV0IX0cL36tZ1UxGPLwRo9ciCgWsrL4yn4nJ5cE+fZ8yRNN9f+MjC G9cSbfqEwCGybw2C46K0Yy1oFynQ6oYiUVG3a4nRDIneVkrsvihH5N7Zzis+oyi7mxg5 1atUHQUq37gxq/Bt16M/QL9WreikuNjheQtB5hS2+Ss7jI5Zs19ZLM3WigOVfFzWXVRd gxNBOfLRHQCJIZx0pfcxj64f02KHLd42husXZryRSWD1Sjz/yM6cVkX6lYXG7yz8r91b 3+6iSbr3JMDHXsYmUnFaoS95sZ4VE56tFb9lqeFA6yPdS6vU1Ctc6jMtaLhE8keLN5R4 5VQw== ARC-Message-Signature: i=3; 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:content-language:mime-version :user-agent:date:message-id:cc:to:subject:from:sender:dkim-signature; bh=0n1doz3RHr/LEoXVLh31zFUxryUwLuCAFVZ7LAgSf6k=; b=f1UBtpZDUcTy0nyYxt5WEBhTfFb3ygEWfX6iDgmAS4Rjscfb9ExdpD6N+QuiUpnZrG yXmCBBhUF3BOQJ0pG9XhlkwqpQ/BmjaLC/M5bqN3DIsWIRzI8U+Th/TISojzfVouS6DQ B1g6fxGevUYki7zNs0vjnoqHM7dzKeDumDDWiag/8zKq15jtC+bMufosScOo6fBohxWn R+5wVtOTKADQ7wfSF6h0aydZpWiPW+fizQ/tSNZRJoaC7mGo4GvSf71CeMYG2UQx3XFG y33FlSPvB0znn+Zf3ejl/HE8F1xCV824asgprsBOFsZXm1i43Ij+xjP6dSIvqZI3xfKT 5hPw== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=QaXe9zwH; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbcji7smnv4nbbuux4p6qkgqep4xnpuy@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCJI7SMNV4NBBUUX4P6QKGQEP4XNPUY@googlegroups.com; dmarc=fail (p=NONE sp=NONE dis=NONE arc=pass) header.from=siemens.com Received: from mail-sor-f55.google.com (mail-sor-f55.google.com. [209.85.220.55]) by mx.google.com with SMTPS id s205sor2025591wmf.15.2020.11.21.00.12.03 (Google Transport Security); Sat, 21 Nov 2020 00:12:03 -0800 (PST) Received-SPF: pass (google.com: domain of isar-users+bncbcji7smnv4nbbuux4p6qkgqep4xnpuy@googlegroups.com designates 209.85.220.55 as permitted sender) client-ip=209.85.220.55; Authentication-Results: mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=QaXe9zwH; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbcji7smnv4nbbuux4p6qkgqep4xnpuy@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCJI7SMNV4NBBUUX4P6QKGQEP4XNPUY@googlegroups.com; dmarc=fail (p=NONE sp=NONE dis=NONE arc=pass) header.from=siemens.com ARC-Seal: i=2; a=rsa-sha256; t=1605946323; cv=pass; d=google.com; s=arc-20160816; b=HpagY10ba5SeX4sMW9rug7zjLhsVxCt8vq08hFGeOkXDmm2401kK3VYuSxrmHJWUh2 PRcyYdsSYXmyx85ABWw7U+BRD+IdGDj9nF6ONlw6rs3kWrPi1jBUYimYhYiwgKXJh10Y vTCT7l43z6bzBRv0CAH011f7M2HofoNCBfw8p5YgqjF4KdxYcEc6Hj7HPiRJSz4ZvnOM 8ynU6Z7w3T111HaiIeZn04Gvcn8HU73LEkir2XALM1tbvPHe8N+44G1gg05W6IHhzuke vsDM1fd3Oylohwmmq67VfAO1r6wNXV1e/PvGLeQDruuwNwxyqldz8dPcegAUEZz+UN/A eTaA== 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:content-language:mime-version :user-agent:date:message-id:cc:to:subject:from:sender:dkim-signature; bh=0n1doz3RHr/LEoXVLh31zFUxryUwLuCAFVZ7LAgSf6k=; b=NYVKagd8ixeO50FbxMV6jzrOl7CBRJj9XKpAnydoP+xH3BVp6WuxM2SUy0+odBJVFy X+IlAtrGtThCdBq4zGqYHb6epog95MNuJ/vdpYJc3V8w3YM4oiOw24cMl3hejJ9+/szG BMkxZksmaqrx1iaT28KgA1OL1rvbTMa1HDEZS8yKzjVmG8FR0Uud4igw7VXiN+oj087q ow2dZ0S3ZN47IgGZNsqvd8a2YAkO7rQInamXWjI6vMBRRS6wE6VQe/8SJaRCoDHnFhZz +tirTXizKJJIgGFGftiku1UXEhUHMp41vCQ0NODj928nIE8n5XnC6cAjkuyPs++jzth1 8Gjw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:subject:to:cc:message-id:date:user-agent:mime-version :content-language:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=0n1doz3RHr/LEoXVLh31zFUxryUwLuCAFVZ7LAgSf6k=; b=QaXe9zwHUbEJan6h594FgdN7m5dJqn2985iJYG5jcP2MYCP+5Aymj7R3S0KF/8f4+F Rg/bdWUVM31W75w3bOqz73BP8W1cHk2nfu4umurWIc1enr8XyWkC1eiambjU4woi3nBr Q/KeQPOV38Kp5CeIVvxM0fLMKkm+oybgq6iwQpquo3emGtJlA+mElGewssZJFdORbCXI eOBmtzlS4nBtzrE96CZGvD8Sh2dEbf3kRrf+gk7VlADIjj8B7j37GXwwVGJcoZAtTs6E twoAueuyMrFuvxZUoAjKWopfbloUNj2YizIgr8CVqLTvSQgh0s3U6sfSRcdb0QmlLsRJ p9pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:subject:to:cc:message-id:date :user-agent:mime-version:content-language: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=0n1doz3RHr/LEoXVLh31zFUxryUwLuCAFVZ7LAgSf6k=; b=ZM6ZfFo0zo84BVP8/g5p3K3OhNXDDWD4r4cu1LYZyEtG4mAFdipWTFyTTbW1qFjSxq 4Pi8+Xf11Ii1qc+HdULDv9sRPxkKVYDnZtSD6F3iPRcID53X4l5+JH5WQgDNjXMBS86j 9n6XxfhKCMJJSH3vkcaCmzC7d7dP/ETLC6aEVDCR6yPMHpE3BATHvvPNmsITuPyMejFE CPnsh7ZElg4K6iKLjVsG4hVpnJpqoTHU1Nsb0it2pRIcrDsPOdcqTWLfQIz4lhI8gJn6 l1eLZHuzMZaQbuA+dnMQk29zfuj1AtFsh5ttuocdgtbOGACT2JfnAFAxnAc2mryHcjx6 ZgNw== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM533ZogJXSupRTcymESUUSICrkX98d+IiADOVHbF0BB63+R+u14Yz mZBNClhw5+Ti0xJ8RWpENG0= X-Google-Smtp-Source: ABdhPJz09yLoSnhv9BT1d+lD+tTxaf5+ZYNm9dVbcnpAwpLlN1EOOuBsxZT1zocSHljXFsyM6Ro5mw== X-Received: by 2002:a05:600c:2048:: with SMTP id p8mr14188486wmg.165.1605946322939; Sat, 21 Nov 2020 00:12:02 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:f70d:: with SMTP id r13ls1383432wrp.1.gmail; Sat, 21 Nov 2020 00:12:02 -0800 (PST) X-Received: by 2002:a5d:50d1:: with SMTP id f17mr20465910wrt.264.1605946321931; Sat, 21 Nov 2020 00:12:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605946321; cv=none; d=google.com; s=arc-20160816; b=wMCBDuf6h3VzY3hRenEaIpUkjm/icr5RiHvgJOM5T3nJhuk9FW39XrpaQsqVY3ND4W b/UaPhtwzpe0iOTp/JCYVAb1bXpHdKK1WvAaRViLRPUW7BBIvfYYNsQ6SJrpo6sn5nSM 10vXzF+L35wD5wVgnoxaF6ivZ5i1k2iNqVxLm8f4YCVwXaySSCCXymZkvUAStPyLeWYW scHdHt1Uo8iiL9UdbYbGFWcp5TJSeg7XjbEt6vfIHUZEQ8GwE1G1dP1PvgeOARGzlXaj KyERQ9tFzKRI+Q6eSdk/097WS9Mb2r4E56mnVzLtb+2M3Q1EdmiABIvHO87QrdM3zd6f ERkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version:user-agent :date:message-id:cc:to:subject:from; bh=bNM2yBdyw7boT1teIe8rWzF0Q1TsnDpXLvDQQVPhOAI=; b=yvRbQHlOPEU6t8iaA3uO0DpIfL1OptG9GlYRv4hJBfhFd2HQIJ+A5VAQwtJkPE6v6H bfTfwKiRNzqgKyUlhQAZELult9v2CoEpJYN1FcjebvNtm4+V3iKsxioCRec2oyf46Ax/ pefo7fKMyfqwnMflLQBgbOfD28fnZDlbX476pEhXTx2q1JjIpdriztaCeJEZ4a0JsbiY 52hRGlnJcZ1vWQi3u/l1SXeGaE8IAiRijZKqsN/izsrWho0nikIBgYavs1vNeJWNvO3c gSV1QXtjfCDHg2rdjpXUX/6afnn1gbkAQI+ryg6XDJ0K1zgeQu1SJVq9mjgDCbLdNY5v bMqw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id r21si251958wra.4.2020.11.21.00.12.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Nov 2020 00:12:01 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 0AL8C06k000300 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 21 Nov 2020 09:12:00 +0100 Received: from [167.87.38.29] ([167.87.38.29]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 0AL8C0Uq009947; Sat, 21 Nov 2020 09:12:00 +0100 From: Jan Kiszka Subject: [PATCH v3] u-boot: add libubootenv To: isar-users Cc: Quirin Gylstorff , Harald Seiler Message-ID: Date: Sat, 21 Nov 2020 09:11:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 Content-Language: en-US X-Original-Sender: jan.kiszka@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1683956772256241190?= X-GMAIL-MSGID: =?utf-8?q?1683956772256241190?= From: Quirin Gylstorff Add the new library libubootenv and remove fw_printenv and fw_setenv form u-boot-tools as the are now part of the new library. libubootenv is a library that provides a hardware independent way to access to U-Boot environment. U-Boot has its default environment compiled board-dependently and this means that tools to access the environment are also board specific, too. libubootenv conflicts with u-boot-tools from Debian 10 as both try to install fw_printenv and fw_sentenv. This conflict is not part of the control file as it breaks the installation of custom u-boot-tools from the u-boot-sources. This patch uses dpkg-gdb to build the package from salsa.debian.org and adds a fix for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=967487. Signed-off-by: Quirin Gylstorff [Jan: fix indention] Signed-off-by: Jan Kiszka --- Changes in v3: - indention fix meta-isar/conf/machine/de0-nano-soc.conf | 2 +- .../0002-Add-support-GNUInstallDirs.patch | 48 +++++++++++++++++++ .../libubootenv/libubootenv_0.2.bb | 30 ++++++++++++ .../files/debian/u-boot-tools.conffiles | 1 - .../u-boot/files/debian/u-boot-tools.install | 2 - .../u-boot/files/debian/u-boot-tools.links | 1 - 6 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch create mode 100644 meta/recipes-bsp/libubootenv/libubootenv_0.2.bb delete mode 100644 meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles delete mode 100644 meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links diff --git a/meta-isar/conf/machine/de0-nano-soc.conf b/meta-isar/conf/machine/de0-nano-soc.conf index 5a734d4d..d1904894 100644 --- a/meta-isar/conf/machine/de0-nano-soc.conf +++ b/meta-isar/conf/machine/de0-nano-soc.conf @@ -16,4 +16,4 @@ WKS_FILE ?= "de0-nano-soc.wks.in" IMAGER_INSTALL += "u-boot-de0-nano-soc" IMAGER_BUILD_DEPS += "u-boot-de0-nano-soc" -IMAGE_INSTALL += "u-boot-tools u-boot-script" +IMAGE_INSTALL += "u-boot-tools libubootenv u-boot-script" diff --git a/meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch b/meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch new file mode 100644 index 00000000..f8c3038e --- /dev/null +++ b/meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch @@ -0,0 +1,48 @@ +From b17d194bd8285a19382a902a0bec9e5e042df064 Mon Sep 17 00:00:00 2001 +From: Nobuhiro Iwamatsu +Date: Tue, 16 Apr 2019 08:52:01 +0900 +Subject: [PATCH 2/4] Add support GNUInstallDirs + +This adds the functionality of the module "GNUInstallDirs" to make the +installation compatible with GNU. + +https://cmake.org/cmake/help/v3.14/module/GNUInstallDirs.html + +Signed-off-by: Nobuhiro Iwamatsu +--- + CMakeLists.txt | 2 ++ + src/CMakeLists.txt | 8 ++++---- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 104969e..57477fc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -10,6 +10,8 @@ add_definitions(-DVERSION="${VERSION}") + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") + ++include("GNUInstallDirs") ++ + #set(CMAKE_C_FLAGS_DEBUG "-g") + include_directories ("${PROJECT_SOURCE_DIR}/src") + add_subdirectory (src) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index ea5979c..d97f221 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -19,7 +19,7 @@ add_executable(fw_setenv fw_setenv.c) + target_link_libraries(fw_printenv ubootenv z) + target_link_libraries(fw_setenv ubootenv z) + +-install (TARGETS ubootenv DESTINATION lib) +-install (FILES libuboot.h DESTINATION include) +-install (TARGETS fw_printenv DESTINATION bin) +-install (TARGETS fw_setenv DESTINATION bin) ++install (TARGETS ubootenv DESTINATION "${CMAKE_INSTALL_LIBDIR}") ++install (FILES libuboot.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++install (TARGETS fw_printenv DESTINATION "${CMAKE_INSTALL_BINDIR}") ++install (TARGETS fw_setenv DESTINATION "${CMAKE_INSTALL_BINDIR}") +-- +2.20.1 + diff --git a/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb b/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb new file mode 100644 index 00000000..7ebfb76d --- /dev/null +++ b/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb @@ -0,0 +1,30 @@ +# libubootenv +# +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2020 +# +# SPDX-License-Identifier: MIT + +DESCRIPTION = "swupdate utility for software updates" +HOMEPAGE= "https://github.com/sbabic/swupdate" +LICENSE = "GPL-2.0" +LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe" + +inherit dpkg-gbp + +SRC_URI = "git://salsa.debian.org/debian/libubootenv.git;protocol=https \ + file://0002-Add-support-GNUInstallDirs.patch;apply=no " +SRCREV = "2c7cb6d941d906dcc1d2e447cc17e418485dff12" + +S = "${WORKDIR}/git" + +do_prepare_build() { + cd ${S} + export QUILT_PATCHES=debian/patches + quilt import -f ${WORKDIR}/*.patch + quilt push -a +} + +dpkg_runbuild_prepend() { + export DEB_BUILD_OPTIONS="nocheck" +} diff --git a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles deleted file mode 100644 index d49a8fbb..00000000 --- a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles +++ /dev/null @@ -1 +0,0 @@ -/etc/fw_env.config diff --git a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install index d1ae3e0b..2893b9a5 100644 --- a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install +++ b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install @@ -1,5 +1,3 @@ tools/dumpimage /usr/bin/ -tools/env/fw_printenv /usr/bin/ tools/mkenvimage /usr/bin/ tools/mkimage /usr/bin/ -tools/env/fw_env.config /etc diff --git a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links deleted file mode 100644 index 92f5a6cb..00000000 --- a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/fw_printenv /usr/bin/fw_setenv