From patchwork Sat Nov 21 03:33:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 174 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:df02:0:0:0:0:0 with SMTP id i2csp1523655oou; Sat, 21 Nov 2020 05:33:40 -0800 (PST) X-Received: by 2002:a1c:4485:: with SMTP id r127mr14859421wma.177.1605965620202; Sat, 21 Nov 2020 05:33:40 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1605965620; cv=pass; d=google.com; s=arc-20160816; b=w3uF5VO3vjT0mu6goeouDg83HMGE++VqxUwyx007BULq2ED42uUTfpUGM/WmKQQ/8w HHuuk8ydKo82mdHq8vehXHEOM9CO6K19vGELof9VlXaKmVA8cXzcqd081A0tHO+JDFce KHQ8C6d/YUf9bpxfdIuMwW7u8WdvldRdHknNawYgOCayn8Qb6xP49uxmaGot0eBiU0qf 2D056S7sqRhYhpVz/6a/u5Cik+xOwZ4vouTfb9VZcPID8OWe3dxuIXlOjFNygHkEoFW9 BSeeqSrUMbUuWfXnhW7uoq2q/94F9E2xNVP3J1zS0wkEV+tkbNSH3v9kb6m6WB4TJvYg /7eg== 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:in-reply-to :mime-version:user-agent:date:message-id:references:cc:to:from :subject:sender:dkim-signature; bh=cr4abr4lqOuLDTzP8LloTw79127SOEWAoQ1tgn3g+vk=; b=QSlGqs5hqUVJKBmgYnJrCiL64gw7icMYhnYIFaPag9GXbNKzPI0h5KFz1rq4ZeL9KN ALP7D6A7rWz0bp67/kFIaxkHKY3Tv8JQdHZAqa6F4KPpCGEgLeBalWIwyg1y0YzhXqN+ 1UJlrk4Cki/3pNs+C99CaH9vQ80LEah6JI53Pl0ED5HiDdbBoq3d1TF9Xy1CM2qVndUO kDzL8PlUUU5+SVbJTjxKG+0HagiqUUmOx0DpFEMqunVlHWAVo4EyI7MiihsF8iPDfLuO 7WE613dSW3d7GRRRndBtWZjY7vlnbCGpagymU4PDSddqXPsNXVCzG9NbvwzMfXo9RQcB c7XA== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=Ja5tK89Q; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbcji7smnv4nbbm5o4t6qkgqej4qjyry@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCJI7SMNV4NBBM5O4T6QKGQEJ4QJYRY@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 l4sor2818252wrm.20.2020.11.21.05.33.39 (Google Transport Security); Sat, 21 Nov 2020 05:33:40 -0800 (PST) Received-SPF: pass (google.com: domain of isar-users+bncbcji7smnv4nbbm5o4t6qkgqej4qjyry@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=Ja5tK89Q; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbcji7smnv4nbbm5o4t6qkgqej4qjyry@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCJI7SMNV4NBBM5O4T6QKGQEJ4QJYRY@googlegroups.com; dmarc=fail (p=NONE sp=NONE dis=NONE arc=pass) header.from=siemens.com ARC-Seal: i=2; a=rsa-sha256; t=1605965619; cv=pass; d=google.com; s=arc-20160816; b=AIzYBKMHqGcOzk2I1LNFVtE3D/cjQdTKJn99yPpkYiDOwccm+Yy/d1LVmjnMoJCHKb 8TzQNKlbSwsTJpJQJ62mGd/pkanfCRUkgVyzia/4mno3wH+y23r/xUP7dXp44xIsGyru TCmfhemea97s0zf1hegUkAM+yLKxXlTFh/u40+7qFHHsm/c2ZkyQJT7u9AL0sOv/Zi6j qQ8QcyJEpVmGrJ+gVg4fCmdrIbKdY5CFRDSUUKbBdJv1ouUJFoJLK8uFweA9YhK46Y0m BThBNF0MkjoRN3DOl9dG+WqIXsXnNDaOvpICHoSjeimTdhvXymz19lOEF1NDDSBVpw8P T/rQ== 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:in-reply-to :mime-version:user-agent:date:message-id:references:cc:to:from :subject:sender:dkim-signature; bh=cr4abr4lqOuLDTzP8LloTw79127SOEWAoQ1tgn3g+vk=; b=N9l7fSRMGaS7mWxcIojsbzcHpdnB7EyDZsB6nsxOA6fFdS4b4fQr/IKRnkgXw4Y/VH 1smO0EX1xKnFvTNy7fNfxLiuvTSEgSH8SQtTCz3YyILTw/55X+kizu18WKySFAcZjkb5 hL7y1nbG1rTMqZZcKYLILcyx/oPMO91t7pZzj/fm69q9LHtJx8lSD7MCBYySzYrQsRpH hlp5j+ebVs1mBEXm9NOjyVFXNxsKVz4ZuIxVI2NTA//fSYNi8PNo+5cME146CSI0xy5V QSzLCdduNVOuNZMJ7Mk4ux3WT503YWcR4poTSywfKV77Dhn3CUC4oM3OyU666pXAsLrV mPtg== 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:subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to: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=cr4abr4lqOuLDTzP8LloTw79127SOEWAoQ1tgn3g+vk=; b=Ja5tK89QfSh536We8sRRR/0YCCZVu65WmWp9UOnfeS+oST9XecED5TBS3WcFVX8dQd SvyZK79cmQPN/SJeYTm9TZEVqnEeqZn89K5S6lho80LWWWe5YmBKXei4QaASHq+4Z0o8 tKGIucRvXdvypsiCBQhZDoBaScdbkMUBGS9A+1EFCQWgm5/Ai3VRixuZAHfBHStymVk/ zCIeqbiIZLBMc5qUbWO8IN5vxEvykeVHd2pI++LqvXP/3Ve6Sa6r33l2EEK7TOhhBG8b GMNKkF06BBHafIBLytEXd3Nsd0OblL10wbMuNNtxI9fsBm8E8Sco/f3srB6DUan4Q1UI tYXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:subject:from:to:cc:references:message-id :date:user-agent:mime-version:in-reply-to: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=cr4abr4lqOuLDTzP8LloTw79127SOEWAoQ1tgn3g+vk=; b=Y2J7zHkQsqIihOS+QzSdyHS2Lq03JMv1gzBvs8vZ61t8ZOtd4VaHqJTT7zJivj5dmZ uiUV/RdA/s+bjZKZbfd0/HU+oywr7QQucJbK79duwLmTyUCEP4qGlt2LlnoOjpDQ2zUk nBeOisRzriT7UIBdhnkLYNkP4pKuIU+SMt8jQJfCoJMRk02NSt1yEpaVwwg+57pOgmQf awoHTpXKp7EsI/WHs8lQ/zWuQwe+vsikHQTcsGXgWgYvTZ5X5B9BVnyF6RCwEXEkvSh8 CcGoSV+4hAGHdnMKt8nPJXBPSVIx9c61N7P+eSklOP85iH0fYPtK9jHRjctCPDctF/kg 6Peg== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM531dFaXjynTt/BM/SY2obYUM9/2qJsgmXTqwcDU8SqYKlpZW5ujK 5tlmgp5phA/xeMEpIyxHJwY= X-Google-Smtp-Source: ABdhPJxU0t45EGNAycEDYU4RJtnjY4JduaANm9Ks9eu9ExP/fT6UlRhlQbMsmJDO7uCWuOdBdRNH5w== X-Received: by 2002:a5d:4a0a:: with SMTP id m10mr22699497wrq.16.1605965619607; Sat, 21 Nov 2020 05:33:39 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:aa87:: with SMTP id h7ls2022562wrc.2.gmail; Sat, 21 Nov 2020 05:33:38 -0800 (PST) X-Received: by 2002:a05:6000:10cd:: with SMTP id b13mr22729582wrx.220.1605965618680; Sat, 21 Nov 2020 05:33:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605965618; cv=none; d=google.com; s=arc-20160816; b=bzgBX25bgmX2/kVJMsXa8pMjppzz7TyjiagzkmddLLWUPAo+3gV5sfJBuf3M6xmUAY u9bqGvxasOJJ5/mmpdKHl+aONdrvm6Mzz3/OfpZiEtnX9DPOo1oLHEcvAAOZIDG6Ez4A D4f42Zb3nNyGaHrT9cIZtOYB2nE+zIpYYEpy2PCV6y9PFsCHYFKE3XB3cNviI0vKyKdK t0UCqUrGgRc8yOALfwBg9wdGEhL8TKf1TWBQ43aJzDVWHGVAkaMrAKaovVsgJA+X4D4Z 6BKYCQbNj5ikNB7VBfuh2dbCrmE+iVMSkckcBPm80RAxYh/WevbUbTbyUyZepNMludYd emDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:references:cc:to:from:subject; bh=g66RSQGPzJ5x5xvmWXs1V9JcGiVInnysDjkuGIL4jvY=; b=ZgdKEo/FFuMIA+RF4E9j2CD5O6WISbQDqgfZsp8Qum60qXD9IZP4ubIkxyISx/Efyq KpUsY6qBLoLHsPh5zZeVITDI7XJlBzJDH1x2qqv+OWZL2Bgjqko4w9fqv4muB2vXAAyG vcq+lFGV97/1AlOnma5Nvp/bQKJkeMK39poGF/35M9GslmX3A8ybxYBOtPvK7BKHMdn9 M5VLgfpHUI8FSq7cPpQ0NtonnWphDIOloLPQrJQmXpNrruENY0zHHRcWWHBzsvLxZcbt 95ppmYizReYbtY0MQzbflpXS1XguQSY6mkhdX60pLer4Y87xn+NuIlvZUvnyj6WqK0r/ Yxww== 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 c20si379893wmd.2.2020.11.21.05.33.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Nov 2020 05:33:38 -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 0ALDXbSQ027031 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 21 Nov 2020 14:33:37 +0100 Received: from [167.87.38.29] ([167.87.38.29]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 0ALDXaLN029806; Sat, 21 Nov 2020 14:33:36 +0100 Subject: [PATCH v4] u-boot: add libubootenv From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff , Harald Seiler References: Message-ID: <5e8156b9-e90a-b035-a538-b387865e9b44@siemens.com> Date: Sat, 21 Nov 2020 14:33:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: 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?1683977006143968416?= 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: add PROVIDES, fix indention, fix de0-nano-soc example] Signed-off-by: Jan Kiszka --- Changes in v4: - add PROVIDES, fixing de0-nano-soc build meta-isar/conf/machine/de0-nano-soc.conf | 2 +- .../0002-Add-support-GNUInstallDirs.patch | 48 +++++++++++++++++++ .../libubootenv/libubootenv_0.2.bb | 32 +++++++++++++ .../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, 81 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..5e35602c 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-tool 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..8eea584c --- /dev/null +++ b/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb @@ -0,0 +1,32 @@ +# 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" + +PROVIDES = "libubootenv-tool libubootenv-dev libubootenv-doc libubootenv0.1" + +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