From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6597806297219858432 X-Received: by 2002:a2e:93cf:: with SMTP id p15-v6mr1597424ljh.39.1536171487559; Wed, 05 Sep 2018 11:18:07 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:d90a:: with SMTP id q10-v6ls198354lfg.15.gmail; Wed, 05 Sep 2018 11:18:06 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZikKTgL1sHOisUnyxb0jYWUY8c2TrjTftI88grzBxaBh6JninicmA7fVhZiM1vo9vSr2Ik X-Received: by 2002:a19:1890:: with SMTP id 16-v6mr1033353lfy.9.1536171486806; Wed, 05 Sep 2018 11:18:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536171486; cv=none; d=google.com; s=arc-20160816; b=gaEv6hE+STx8gBpH+D7OpNvFucAJXkJA26XJk4R8EhJZPRzWqZNAki2Kb1YlRYnckt 43WfRFKLZM5IFZfwk6Yd4bB1ruEA4/NVwzvPZVYPMZuSTPC3xGIUQlpOZC/Cz5YMLMkm 2TupACz+Iz0N4jQEpAmPboJ1W7iIOGYLP8cisQhBWy8DUdYHDAnNuY0QPjvkmr7w6b2W HmgG6Edbg5k/IDzz7pBgzVA2qxv9D7Dvyr5Y5/fI2T6bV0Ds337yRwcL0XZBQwypU52q qW/e9iNdYaWn8HVCqfowp5qzm9diyfd+9e0eVG9OAVFwAEzJqZEMtwNnsJxEOHUpSe2j YaMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:references:in-reply-to:message-id:date :subject:to:from; bh=SgOawYKW4ojzpcABxDJT3AmWTvYJyTjbm6J0bGtHSrU=; b=mc41TDkwZT5k588rpJma47rzbUAn4Ou+KO1ZAdCsgm8xCgtpOWVNe00k4adRaYUGw9 +Oic+M7kIixruB/Ggn9m+5ST8ZLB2zAfQy78O7bSHBAfrqAcanvFPGKKqIZAw/+iBzcp OO7e3d3HjQXVzw/R7zBbLH3QN/XWJoENKCkwlhtsETzEjLApDI97QAHe3EN+wkHGxcPh J5V7VjpYav+Wsso6a7dTKaeI6d0deEEQXwFGRvlxvt7h+4/wkMIsqA3f9Y7hx/vG/HnX HZuJIPGJzjP+XIb+1hcDWlE2UftImd8PhPD0op3sAokzqXOJ6+daksc+N7KFM+qOR0OB dHRQ== 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 Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id a1-v6si76881lfe.5.2018.09.05.11.18.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 11:18:06 -0700 (PDT) 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; 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 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 w85II5Vh003072 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 5 Sep 2018 20:18:05 +0200 Received: from md1f2u6c.ad001.siemens.net (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id w85II4ct028591 for ; Wed, 5 Sep 2018 20:18:05 +0200 From: Jan Kiszka To: isar-users Subject: [PATCH 5/5] meta: Add custom U-Boot recipe include Date: Wed, 5 Sep 2018 20:18:04 +0200 Message-Id: <4e945fe0d12981b2a7f60f14a0317117d69cfdaa.1536171484.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: References: In-Reply-To: References: X-TUID: bT0unzNKlf5q From: Jan Kiszka This simplifies the building of custom U-Boot versions significantly. Just include u-boot-custom.inc in a recipe, define the source as well as U_BOOT_CONFIG and the target U_BOOT_BIN (binary). The latter will be packaged and can then be deployed via IMAGER_INSTALL + IMAGER_BUILD_DEPS to the buildchroot for installation by the imager (e.g. wic). The package structure this generates is similar though no identical to Debian upstream: - u-boot-${MACHINE}: contains U_BOOT_BIN - u-boot-${MACHINE}-dev: contains tools/env/lib.a as libubootenv.a which is needed by SWUpdate (recipe for the latter will eventually be contributed) - u-boot-tools which replaces the upstream package (minus some special SOC-specific tools we skip for simplicity reasons) There is no plain "u-boot" package as we have no use case for it here. Signed-off-by: Jan Kiszka --- meta/recipes-bsp/u-boot/files/debian/changelog | 5 +++ meta/recipes-bsp/u-boot/files/debian/compat | 1 + meta/recipes-bsp/u-boot/files/debian/control | 19 ++++++++++++ meta/recipes-bsp/u-boot/files/debian/rules | 28 +++++++++++++++++ .../u-boot/files/debian/u-boot-tools.conffiles | 1 + .../u-boot/files/debian/u-boot-tools.install | 5 +++ .../u-boot/files/debian/u-boot-tools.links | 1 + meta/recipes-bsp/u-boot/u-boot-custom.inc | 36 ++++++++++++++++++++++ 8 files changed, 96 insertions(+) create mode 100644 meta/recipes-bsp/u-boot/files/debian/changelog create mode 100644 meta/recipes-bsp/u-boot/files/debian/compat create mode 100644 meta/recipes-bsp/u-boot/files/debian/control create mode 100755 meta/recipes-bsp/u-boot/files/debian/rules create mode 100644 meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles create mode 100644 meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install create mode 100644 meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links create mode 100644 meta/recipes-bsp/u-boot/u-boot-custom.inc diff --git a/meta/recipes-bsp/u-boot/files/debian/changelog b/meta/recipes-bsp/u-boot/files/debian/changelog new file mode 100644 index 0000000..c1c3516 --- /dev/null +++ b/meta/recipes-bsp/u-boot/files/debian/changelog @@ -0,0 +1,5 @@ +@PN@ (@PV@) unstable; urgency=low + + * Generated package. + + -- ISAR project Tue, 6 Feb 2018 00:00:00 +0000 diff --git a/meta/recipes-bsp/u-boot/files/debian/compat b/meta/recipes-bsp/u-boot/files/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/meta/recipes-bsp/u-boot/files/debian/compat @@ -0,0 +1 @@ +9 diff --git a/meta/recipes-bsp/u-boot/files/debian/control b/meta/recipes-bsp/u-boot/files/debian/control new file mode 100644 index 0000000..df23a69 --- /dev/null +++ b/meta/recipes-bsp/u-boot/files/debian/control @@ -0,0 +1,19 @@ +Source: @PN@ +Section: admin +Priority: optional +Standards-Version: 3.9.6 +Build-Depends: bc, bison, flex, device-tree-compiler +Maintainer: ISAR project + +Package: u-boot-@MACHINE@ +Architecture: @DISTRO_ARCH@ +Description: @DESCRIPTION@, bootloader binaries + +Package: u-boot-@MACHINE@-dev +Architecture: @DISTRO_ARCH@ +Description: @DESCRIPTION@, bootloader libraries + +Package: u-boot-tools +Architecture: linux-any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: @DESCRIPTION@, companion tools diff --git a/meta/recipes-bsp/u-boot/files/debian/rules b/meta/recipes-bsp/u-boot/files/debian/rules new file mode 100755 index 0000000..deb7c8e --- /dev/null +++ b/meta/recipes-bsp/u-boot/files/debian/rules @@ -0,0 +1,28 @@ +#!/usr/bin/make -f + +# Debian rules for custom kernel module build +# +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2018 +# +# SPDX-License-Identifier: MIT + +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) +export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)- +SET_CROSS_BUILD_TOOLS=CROSS_BUILD_TOOLS=y +endif + +PARALLEL_BUILD=-j $(shell $$(($$(nproc) * 2))) + +override_dh_auto_build: + $(MAKE) $(PARALLEL_BUILD) $(U_BOOT_CONFIG) + $(MAKE) $(PARALLEL_BUILD) ${U_BOOT_BIN} + $(MAKE) $(PARALLEL_BUILD) $(SET_CROSS_BUILD_TOOLS) NO_SDL=1 tools-only envtools + +override_dh_auto_install: + mv tools/env/lib.a tools/env/libubootenv.a + +override_dh_auto_test: + +%: + dh $@ --parallel 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 new file mode 100644 index 0000000..d49a8fb --- /dev/null +++ b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles @@ -0,0 +1 @@ +/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 new file mode 100644 index 0000000..d1ae3e0 --- /dev/null +++ b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000..92f5a6c --- /dev/null +++ b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links @@ -0,0 +1 @@ +/usr/bin/fw_printenv /usr/bin/fw_setenv diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc new file mode 100644 index 0000000..07fd597 --- /dev/null +++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc @@ -0,0 +1,36 @@ +# Custom U-Boot build +# +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2018 +# +# SPDX-License-Identifier: MIT + +FILESPATH =. "${LAYERDIR_core}/recipes-kernel/linux/files:" + +DESCRIPTION ?= "Custom U-Boot" + +PROVIDES += "u-boot-${MACHINE} u-boot-tools" + +inherit dpkg + +SRC_URI += "file://debian/" + +do_prepare_build() { + cp -r ${WORKDIR}/debian ${S}/ + sed -i -e 's/@PN@/${PN}/g' -e 's/@PV@/${PV}/g' \ + -e 's/@MACHINE@/${MACHINE}/g' \ + -e 's/@DISTRO_ARCH@/${DISTRO_ARCH}/g' \ + -e 's/@DESCRIPTION@/${DESCRIPTION}/g' \ + ${S}/debian/changelog ${S}/debian/control + + echo "${U_BOOT_BIN} /usr/lib/u-boot/${MACHINE}" > \ + ${S}/debian/u-boot-${MACHINE}.install + + echo "tools/env/libubootenv.a usr/lib" > \ + ${S}/debian/u-boot-${MACHINE}-dev.install +} + +dpkg_runbuild_prepend() { + export U_BOOT_CONFIG=${U_BOOT_CONFIG} + export U_BOOT_BIN=${U_BOOT_BIN} +} -- 2.16.4