From patchwork Mon Aug 17 00:24:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 4 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a05:7000:6242:0:0:0:0 with SMTP id v2csp2300285mad; Mon, 17 Aug 2020 01:24:53 -0700 (PDT) X-Received: by 2002:a19:818a:: with SMTP id c132mr3730231lfd.76.1597652693029; Mon, 17 Aug 2020 01:24:53 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1597652693; cv=pass; d=google.com; s=arc-20160816; b=dCvbt/Aq4IaUvnFvhQr6W4OX+LAkgmxA7SJ0i88sGss0+N3dqpMeTL38OW3YMqWZPT EacjvolTN+Aw/6oPYYars4tMXJ+iBqZBkUAWlVUMWyvM/V0IaRq6YGINW9paVIP6MP2c iZIYi1dwlZ40jEqQKgdzZKsYM9BGTTNkB0V7brP1lrU0yromBMcJv8Vjhc4G0p43ujzR sUULtkYQVHAQPbaI3MuK1sK3waJzxGFHlReGdTJ1/S6cGevF5wX4UJKbPVON8CXtfUJo pKtcws4AcdWTYupxH3Sz62I77oUU7MzlHQEczhwYL7HYLCgarjaNK7AM26Y1MqEVO7z6 Spdg== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=vt1YOyWOFP0FMRJt72HINsc6d9syqHT1nB99duDUB24=; b=NLG4aDsyAZnjdq0kl2DxFV5nqcLMO5Z8nC9pFtf7dxLSNgL53mW97pCmYZ37YV+4Bz C874Px2wyoPvCaBbPJ5cZN65S7HRsTX9JPYabDQqd9AoNpTpZrXDvGzNlzenuo1H/X/1 dNU705p6KdfmapJHaJ1efJMGEoSu5LSObSzHrX+bkstRetkLoDJZdptmCHqI1Tl9DumM GkRmKBsUamReKPwPQ3YW/ka8yv/yO3DVQLXygPm29GkudgJu20Wdbz6uQlQNX9M2S2sx OgMRMm8z8azS/IfK0kvcquvZrfU0H/wsPKME4rICfcrZ8jHH3MtVj5egZPuQYSoBPUcM gZXw== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=nhrEdCxU; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbctzztvx2qcrbvh55d4qkgqekuwgiti@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCTZZTVX2QCRBVH55D4QKGQEKUWGITI@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 d12sor7060264ljj.54.2020.08.17.01.24.52 (Google Transport Security); Mon, 17 Aug 2020 01:24:53 -0700 (PDT) Received-SPF: pass (google.com: domain of isar-users+bncbctzztvx2qcrbvh55d4qkgqekuwgiti@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=nhrEdCxU; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbctzztvx2qcrbvh55d4qkgqekuwgiti@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCTZZTVX2QCRBVH55D4QKGQEKUWGITI@googlegroups.com; dmarc=fail (p=NONE sp=NONE dis=NONE arc=pass) header.from=siemens.com ARC-Seal: i=2; a=rsa-sha256; t=1597652692; cv=pass; d=google.com; s=arc-20160816; b=Ia5FBe28gJPR5fP6r7zF/vxXCUz0QJ65ECM6b99eq1Lo0VcuD+n3zSmAafP8BZ/JUx L0+h8WL8hTQMLVIex+KxvcjTMt/fSHYNpEURWJdcanvwLVTvbi5fibX1uKmCIiXpvarX 6WIQE//A23rFRL3qn7bofVBDV1TmIwripcPVOqt65NS9kSlEeXHShVOhiNbvIQwvOFA+ 5ondOCaU6T9y8cipHPgHCskIXup5RnNkJjBn6F5CwPZTxfNvBzINIaKNo6b+GLPPWOaV EuNVNdWeTvGV3oml39FaHzL5CDFUgvOHSwROioU5NpCuxwBfPWgGxcDlpvI1VW67JFVX kqEQ== 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=vt1YOyWOFP0FMRJt72HINsc6d9syqHT1nB99duDUB24=; b=sZxjWotlwg8emYAYO3Dyd7oAxVjXBXXCvh0fGSV/DcAD1MeklMCAEOx3e0Xi47TnIp ANb7yZhmdEWEteN5OMvn/hNXgKh8jFHaDJwWjNorxFkoj7CxYFPOz0f9AStNOIuLW33k yUME8oez0tzpYg2XYWf4aLxjf7UU3v56XkepCFChR5JGh4YA3ukZqBYWtf0EIVgU/jLg qGbc+UajJJjDPgMwaMj8HrVxPeD8V3hDwlOphvsrrQkOuLn3W3ZMVQ8dQbHniF01DDDw SAfrCAkaSESTSIKXPWd+iYqWYvHz+r7EsL0hMzqgCvMga0jZh4t7MXqzj1A653YHW+RO baFg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=Quirin.Gylstorff@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: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=vt1YOyWOFP0FMRJt72HINsc6d9syqHT1nB99duDUB24=; b=nhrEdCxUmhjupgXy7rdR672AxWk1wkEZ3qiFyyJ+c2+uWCBS2uFEtLywgWPnKxcAQA Q0n8RbjgO6YudtWM/zAtkMF8HI+pMFPSKfkvYEbmWDjL1XA9uuKj+7S10CKV/D2mxuFp jo044dmoKqARVq0UlDqQs0Wki1RSbxgCqeZx4u+ceKgn68/vlrTIKMw+eBrO2ITFQ6UG cB0LNKUD1kcqJ2bjsshPoo7Hl1Owz+P/BjY/8R6BscJZZeXqgXftjQsa9L/Bv/ol3szl DkI4o4ke3fUjV92VnsfUe7WaFy8Q00eORLVHHvKrpCKU8ZFlRRAkTQTBNwm29tC/cG7O 3pmA== 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=vt1YOyWOFP0FMRJt72HINsc6d9syqHT1nB99duDUB24=; b=pxM5yjiICRej2noA8AG6Kc7B5dI7tmK6tU38jcgUvljgSuOlIx9DXfa/b3IFHAyk6c x8RXdg5DMAoNApRDlRLyDo3BuMZhiRygy6m5fkJYjBXcj0Cvd8zGGT0l4SsU8OHAbQHp ABkI+xDXE8kMl9bD2YnRCfolY70okP94OXBfA4Ft93GPvhdvgfHK6e1pTP6DDloD8m7G eFvSKRskqAzHPs2wrYjS8QwFjJg7qnSwOzlPBfkWvsy5rQHPae5/3v3SJNHtJxQho2Tk hhCF8cPFddVtTxbu9/q9xT3DkSamK8cxgC+z7GWRujnLBWXLbEdWkWME/4WdOVfIXFC1 fuJQ== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM532fHB7//fLLegvgWQ1WFY4MOur7NxGzDv96r4jZvFRKr+bn3n5d p8Pb0DcP8+Gi3lAnh7X87e4= X-Google-Smtp-Source: ABdhPJx5HT2oU1mo3FKfIqorn5ZbiFFS5GA63SlX38MPRE4kR5YQ5C+ZlL1knio1XAXUrFuncYgScw== X-Received: by 2002:a2e:804d:: with SMTP id p13mr7165888ljg.359.1597652692321; Mon, 17 Aug 2020 01:24:52 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:6c18:: with SMTP id h24ls1111869ljc.6.gmail; Mon, 17 Aug 2020 01:24:51 -0700 (PDT) X-Received: by 2002:a05:651c:1134:: with SMTP id e20mr7204838ljo.40.1597652691519; Mon, 17 Aug 2020 01:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597652691; cv=none; d=google.com; s=arc-20160816; b=bEonAWJxm8aWEkAejfN1bxfrO387Q3kO3fukTJzc53PBs+PHE4B6/YB4yt8Pz77ohh uXMaBzAsbVl+kqrU1R8wBSzj0sthw/udhvNI34+T0anDwtI4qEZJue+cS81CMBa6vQAO gnQ6XSoZgBQzelk0O078+aiZPeOI9/LJ47/EUeo+CO/qXw2tGicziScNk3jRam5sxgCu Sff87owcwGgGlnVRxO7FQ8EwbHIQ/TOcre42zlALYdEutPHS0cTW+badGtvuN0lWSBnl HLR20llkNOX1O/7r3NeI+B2pLw/x6DDMdofwNB0DwThBYACujA2k/gF474Htknb8vSpN tNFg== 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=mmJWle3gYXUwVtXH7h39DasQkzTww+KRWxPygetFGZk=; b=H9l0EvcCCBRUFlYXO9QGWMxL9sdMit/k1j9t2ddqLrHDZJGH0AoxYxMD7qf5WENAz9 cspjGf82wMmP6Pm4pGdnhKFr9vCyQFrbAoy8NH5BEVdVfyek9c8ImB5SIkale/4jzAgA F5kMbyOQP5INNHNJ+NEa1gYts8a7nwZhn+230ZuYJfzQPy36ItScsLl9ALSUKzWz9jAa gjgIRb2uAlfUKbwawsJB/mjSmj8heCWJKaBbZINLVhS+QoljzNzx9nActJ87WKWKIcf2 ZlqEuDvV6uMHjVb3XJcW8Ov5lmD7cVkZMhiD/yLEgiGBRQB88OfCsPE3015oPiUxSyCO s55g== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=Quirin.Gylstorff@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 t3si480407ljg.1.2020.08.17.01.24.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Aug 2020 01:24:51 -0700 (PDT) Received-SPF: pass (google.com: domain of quirin.gylstorff@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 07H8OosG025610 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 17 Aug 2020 10:24:50 +0200 Received: from md2dvrtc.fritz.box ([167.87.24.184]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 07H8OovW009089; Mon, 17 Aug 2020 10:24:50 +0200 From: "Q. Gylstorff" To: isar-users@googlegroups.com Cc: Quirin Gylstorff Subject: [PATCH v2] u-boot: add libubootenv Date: Mon, 17 Aug 2020 10:24:50 +0200 Message-Id: <20200817082450.28101-1-Quirin.Gylstorff@siemens.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 X-Original-Sender: quirin.gylstorff@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=Quirin.Gylstorff@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?1675260270591379767?= X-GMAIL-MSGID: =?utf-8?q?1675260270591379767?= 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 --- Changes V2: - use dpkg-gbd instead dpkg - use salsa.debian.org as source - add fix for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=967487 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 3a2c009..6558d90 100644 --- a/meta-isar/conf/machine/de0-nano-soc.conf +++ b/meta-isar/conf/machine/de0-nano-soc.conf @@ -15,4 +15,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 0000000..f8c3038 --- /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 0000000..995e581 --- /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 d49a8fb..0000000 --- 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 d1ae3e0..2893b9a 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 92f5a6c..0000000 --- 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