From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6597806297219858432 X-Received: by 2002:a19:94c5:: with SMTP id o66-v6mr213517lfk.19.1536344851369; Fri, 07 Sep 2018 11:27:31 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:d050:: with SMTP id h77-v6ls622921lfg.26.gmail; Fri, 07 Sep 2018 11:27:30 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaJadEPdnWI/vGBQnL7z8VOOTdYWW1jFwZj0oUHQBps232QcXCDeAxFefUQO828MiI9VAsW X-Received: by 2002:a19:9606:: with SMTP id y6-v6mr228559lfd.42.1536344850780; Fri, 07 Sep 2018 11:27:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536344850; cv=none; d=google.com; s=arc-20160816; b=ORvOEK95+dA5LzH9gLrMCA4jR52FDctwRGJEmMeDjpRK0JJv9lSA4rRQCY0rrfqh7Y BCyQu181XvndJrufHzsxdXrVnXsVwdq1U5aPCGuBezTkEtQ+4cZE6HE+m7awBEO1eBHb D33HMzZjLqpw0KMfsjkKsctHGay8+uW+5d6tB58YQ/PUMjxFuORKsesm8sPVLnEhet1G ucv30yG2OimfPIZL2dzqIJliRDsFiSsGKFz9oWynxwgC5XK5Ns8ZIbbJozLa6Q+ZQlIn xy81gUc24Jsb/pOVDaMksoDijfeJ/TD+HCIfdX+zbaaxquPHIsjJCBW8lclUtcS5DwaJ uysA== 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:to:from:subject; bh=kPd0v5qUUGbkXEljvaZ19l5aTj3hhL5QfHjrBsR0jG8=; b=zD3JplgQbFiPTZ4aSRR21wFEpJCMtvgBz0dVgFkXsz845+2geeXsfNZ0xWaWg5uSwD BIPnA0zja0RTGgN+oiG6ve/qITmWk7oou8UKiIvYU2TWLI9yVXw7igJiFsh1EM7ZNpWY JMNaGhCN0GFuI5yWWHvryRWNJijIzSj9e57iL9QPyKmB+6SjSwCyukCXoGw21NYgQz9b FefA4FMwJ0Zlsbb0icXUXmW8fjAR/FrOOoCL7iIbx4pmRBC6lPkTfR+yPgSDyF+V7zOe uyJsPzrcC2LuOqT3kS+8Wv43MsaXJ1ecekMY0nHXvLmD2TZZehp1l/e48TdhFZh8bnpz A0zg== 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 n42-v6si321205lfi.2.2018.09.07.11.27.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 11:27:30 -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 mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id w87IRTYW016122 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 7 Sep 2018 20:27:29 +0200 Received: from [139.25.68.37] (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id w87IRSJ3015888 for ; Fri, 7 Sep 2018 20:27:28 +0200 Subject: [PATCH v2 5/5] meta: Add custom U-Boot recipe include From: Jan Kiszka To: isar-users References: <4e945fe0d12981b2a7f60f14a0317117d69cfdaa.1536171484.git.jan.kiszka@siemens.com> Message-ID: <495bc377-9eda-9a2b-7ead-595ec8953b24@siemens.com> Date: Fri, 7 Sep 2018 20:27:27 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <4e945fe0d12981b2a7f60f14a0317117d69cfdaa.1536171484.git.jan.kiszka@siemens.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: tMeUuboPs9AA 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 --- Changes in v2: - fix copy&paste error in FILESPATH 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..f3fca00 --- /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-bsp/u-boot/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