* [PATCH v2 0/9] Avoid using shell environment during the build
@ 2022-01-25 12:32 Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 1/9] template: Copy template attributes on transform Uladzimir Bely
` (9 more replies)
0 siblings, 10 replies; 13+ messages in thread
From: Uladzimir Bely @ 2022-01-25 12:32 UTC (permalink / raw)
To: isar-users
This patchset is a subseries of 'Sbuild/Schroot migration' patchset
including only preparation patches. It doesn't require any changes
in host machine configuration for downstreams (meta-iot2050 and
xenomai-images were tested) so can be merged independently.
In this patchset the main topic is a migration to template files that
allows to use cleaner build environment.
When this patchset is merged, it will make maintenance of remaining
sbuild-related patches easier and will shorten their number.
Changes since v1:
- Introduced `dpkg_build_export` function to be used for passing
variables to build environment;
- Linux kernel framgments handling is done in Debian way.
Anton Mikanovich (6):
linux-module: Do not use shell environment
u-boot: Do not use shell environment
trusted-firmware: Do not use shell environment
optee-os: Do not use shell environment
kselftest: Do not use shell environment
linux-mainline: Move cfg fragment test to debian/rules
Uladzimir Bely (3):
template: Copy template attributes on transform
dpkg: Use a specific export function in pre-build tasks
linux-custom: Move cfg fragments applying to debian/rules
meta-isar/recipes-app/hello/hello.bb | 2 +-
.../optee-os/optee-os-stm32mp15x_3.11.0.bb | 2 +-
.../linux/linux-mainline_5.4.70.bb | 16 +++---
meta/classes/dpkg-base.bbclass | 9 ++++
meta/classes/dpkg.bbclass | 2 +-
meta/classes/template.bbclass | 4 +-
.../libubootenv/libubootenv_0.3-3.bb | 2 +-
.../files/debian/{rules => rules.tmpl} | 4 +-
meta/recipes-bsp/optee-os/optee-os-custom.inc | 9 +---
.../files/debian/{rules => rules.tmpl} | 4 +-
.../trusted-firmware-a-custom.inc | 9 +---
.../u-boot/files/debian/{rules => rules.tmpl} | 2 +-
meta/recipes-bsp/u-boot/u-boot-custom.inc | 9 +---
.../kselftest/files/{rules => rules.tmpl} | 0
meta/recipes-kernel/kselftest/kselftest.inc | 21 +++-----
.../linux-module/files/debian/rules | 37 -------------
.../linux-module/files/debian/rules.tmpl | 52 +++++++++++++++++++
meta/recipes-kernel/linux-module/module.inc | 19 ++-----
.../linux/files/debian/isar/configure.tmpl | 19 +++++++
.../linux/files/debian/rules.tmpl | 3 ++
meta/recipes-kernel/linux/linux-custom.inc | 14 ++---
21 files changed, 125 insertions(+), 114 deletions(-)
rename meta/recipes-bsp/optee-os/files/debian/{rules => rules.tmpl} (75%)
rename meta/recipes-bsp/trusted-firmware-a/files/debian/{rules => rules.tmpl} (77%)
rename meta/recipes-bsp/u-boot/files/debian/{rules => rules.tmpl} (94%)
rename meta/recipes-kernel/kselftest/files/{rules => rules.tmpl} (100%)
delete mode 100755 meta/recipes-kernel/linux-module/files/debian/rules
create mode 100755 meta/recipes-kernel/linux-module/files/debian/rules.tmpl
create mode 100644 meta/recipes-kernel/linux/files/debian/isar/configure.tmpl
--
2.20.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 1/9] template: Copy template attributes on transform
2022-01-25 12:32 [PATCH v2 0/9] Avoid using shell environment during the build Uladzimir Bely
@ 2022-01-25 12:32 ` Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 2/9] linux-module: Do not use shell environment Uladzimir Bely
` (8 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Uladzimir Bely @ 2022-01-25 12:32 UTC (permalink / raw)
To: isar-users
Output file should have exactly the same flags as input one,
which is usefull for the cases like debian/rules or other executables.
So we should copy this part of metadata after the conversion.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
meta/classes/template.bbclass | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/meta/classes/template.bbclass b/meta/classes/template.bbclass
index fb9d1186..e6bcc362 100644
--- a/meta/classes/template.bbclass
+++ b/meta/classes/template.bbclass
@@ -8,7 +8,7 @@ TEMPLATE_VARS ?= "PN PV DESCRIPTION HOMEPAGE MAINTAINER DISTRO_ARCH"
do_transform_template[vardeps] = "TEMPLATE_FILES ${TEMPLATE_VARS}"
python do_transform_template() {
- import subprocess, contextlib
+ import subprocess, contextlib, shutil
workdir = os.path.normpath(d.getVar('WORKDIR', True))
@@ -56,5 +56,7 @@ python do_transform_template() {
stdout=output, env=env))
if process.wait() != 0:
bb.fatal("processing of template failed")
+
+ shutil.copymode(template_file, output_file)
}
addtask do_transform_template after do_unpack
--
2.20.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 2/9] linux-module: Do not use shell environment
2022-01-25 12:32 [PATCH v2 0/9] Avoid using shell environment during the build Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 1/9] template: Copy template attributes on transform Uladzimir Bely
@ 2022-01-25 12:32 ` Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 3/9] u-boot: " Uladzimir Bely
` (7 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Uladzimir Bely @ 2022-01-25 12:32 UTC (permalink / raw)
To: isar-users
From: Anton Mikanovich <amikan@ilbers.de>
To make package build process independent of the shell environment we
should remove KDIR and PN passing through export call.
KDIR can be prepared during package build. This also will allow not to
rely on previous builddeps install task.
To pass PN variable we can just migrate to template-based debian/rules
file.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
.../linux-module/files/debian/rules | 37 -------------
.../linux-module/files/debian/rules.tmpl | 52 +++++++++++++++++++
meta/recipes-kernel/linux-module/module.inc | 19 ++-----
3 files changed, 55 insertions(+), 53 deletions(-)
delete mode 100755 meta/recipes-kernel/linux-module/files/debian/rules
create mode 100755 meta/recipes-kernel/linux-module/files/debian/rules.tmpl
diff --git a/meta/recipes-kernel/linux-module/files/debian/rules b/meta/recipes-kernel/linux-module/files/debian/rules
deleted file mode 100755
index 59720b37..00000000
--- a/meta/recipes-kernel/linux-module/files/debian/rules
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/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
-
-export DEB_BUILD_OPTIONS=parallel=$(shell nproc)
-
-export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)-
-
-ifeq ($(DEB_HOST_GNU_CPU), arm)
-export ARCH=arm
-endif
-ifeq ($(DEB_HOST_GNU_CPU), aarch64)
-export ARCH=arm64
-endif
-ifeq ($(DEB_HOST_GNU_CPU), riscv64)
-export ARCH=riscv
-endif
-ifneq (,$(findstring 86,$(DEB_HOST_GNU_CPU)))
-export ARCH=x86
-endif
-
-override_dh_auto_clean:
- $(MAKE) -C $(KDIR) M=$(PWD) clean
-
-override_dh_auto_build:
- $(MAKE) -C $(KDIR) M=$(PWD) modules
-
-override_dh_auto_install:
- $(MAKE) -C $(KDIR) M=$(PWD) INSTALL_MOD_PATH=$(PWD)/debian/$(PN) modules_install
-
-%:
- CFLAGS= LDFLAGS= dh $@ --parallel
diff --git a/meta/recipes-kernel/linux-module/files/debian/rules.tmpl b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
new file mode 100755
index 00000000..52453e5f
--- /dev/null
+++ b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
@@ -0,0 +1,52 @@
+#!/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
+
+export DEB_BUILD_OPTIONS=parallel=$(shell nproc)
+
+export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)-
+
+ifeq ($(DEB_HOST_GNU_CPU), arm)
+export ARCH=arm
+endif
+ifeq ($(DEB_HOST_GNU_CPU), aarch64)
+export ARCH=arm64
+endif
+ifeq ($(DEB_HOST_GNU_CPU), riscv64)
+export ARCH=riscv
+endif
+ifneq (,$(findstring 86,$(DEB_HOST_GNU_CPU)))
+export ARCH=x86
+endif
+
+# Custom kernels contain the build folder directly.
+KDIR := $(shell dpkg -L linux-headers-${KERNEL_NAME} | grep "/lib/modules/.*/build")
+ifeq ($(KDIR),)
+# Debian kernels install that folder indirectly via a dependency.
+KERNEL_DEP := $(shell dpkg-query -W -f '$${Depends}' linux-headers-${KERNEL_NAME} | sed 's/.*\(linux-headers-[[:graph:]]*\).*/\1/')
+KDIR := $(shell dpkg -L $(KERNEL_DEP) | grep "/lib/modules/.*/build")
+endif
+
+# With some build systems like sbuild `dh clean` can be called twice:
+# first, by build system itself before chroot's apt database updated,
+# second, by dpkg-buildpackage during build. So, KDIR may be empty
+# in first case (while no dependencies are yet installed), and a broken
+# 'make ... clean' command is produced. Just skip override in this case.
+ifneq ($(KDIR),)
+override_dh_auto_clean:
+ $(MAKE) -C $(KDIR) M=$(PWD) clean
+endif
+
+override_dh_auto_build:
+ $(MAKE) -C $(KDIR) M=$(PWD) modules
+
+override_dh_auto_install:
+ $(MAKE) -C $(KDIR) M=$(PWD) INSTALL_MOD_PATH=$(PWD)/debian/${PN} modules_install
+
+%:
+ CFLAGS= LDFLAGS= dh $@ --parallel
diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc
index 0515621a..9ae3af9b 100644
--- a/meta/recipes-kernel/linux-module/module.inc
+++ b/meta/recipes-kernel/linux-module/module.inc
@@ -22,8 +22,9 @@ AUTOLOAD ?= ""
inherit dpkg
TEMPLATE_FILES = "debian/control.tmpl \
- debian/changelog.tmpl"
-TEMPLATE_VARS += "KERNEL_NAME"
+ debian/changelog.tmpl \
+ debian/rules.tmpl"
+TEMPLATE_VARS += "KERNEL_NAME PN"
do_prepare_build() {
cp -r ${WORKDIR}/debian ${S}/
@@ -32,17 +33,3 @@ do_prepare_build() {
echo "echo $module >> /etc/modules" >> ${S}/debian/postinst
done
}
-
-dpkg_runbuild_prepend() {
- # Custom kernels contain the build folder directly.
- export KDIR=$(dpkg -L --root=${BUILDCHROOT_DIR} linux-headers-${KERNEL_NAME} | \
- grep "/lib/modules/.*/build")
- if [ -z "$KDIR" ]; then
- # Debian kernels install that folder indirectly via a dependency.
- KERNEL_DEP=$(dpkg-query -W -f '${Depends}' --admindir=${BUILDCHROOT_DIR}/var/lib/dpkg \
- linux-headers-${KERNEL_NAME} | sed 's/.*\(linux-headers-[[:graph:]]*\).*/\1/')
- export KDIR=$(dpkg -L --root=${BUILDCHROOT_DIR} ${KERNEL_DEP} | \
- grep "/lib/modules/.*/build")
- fi
- export PN=${PN}
-}
--
2.20.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 3/9] u-boot: Do not use shell environment
2022-01-25 12:32 [PATCH v2 0/9] Avoid using shell environment during the build Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 1/9] template: Copy template attributes on transform Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 2/9] linux-module: Do not use shell environment Uladzimir Bely
@ 2022-01-25 12:32 ` Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 4/9] trusted-firmware: " Uladzimir Bely
` (6 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Uladzimir Bely @ 2022-01-25 12:32 UTC (permalink / raw)
To: isar-users
From: Anton Mikanovich <amikan@ilbers.de>
To make package build process independent of the shell environment we
should remove U_BOOT_CONFIG and U_BOOT_BIN passing through export call.
So we migrate to template-based debian/rules file.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
.../u-boot/files/debian/{rules => rules.tmpl} | 2 +-
meta/recipes-bsp/u-boot/u-boot-custom.inc | 9 ++-------
2 files changed, 3 insertions(+), 8 deletions(-)
rename meta/recipes-bsp/u-boot/files/debian/{rules => rules.tmpl} (94%)
diff --git a/meta/recipes-bsp/u-boot/files/debian/rules b/meta/recipes-bsp/u-boot/files/debian/rules.tmpl
similarity index 94%
rename from meta/recipes-bsp/u-boot/files/debian/rules
rename to meta/recipes-bsp/u-boot/files/debian/rules.tmpl
index 3d667620..806b01fe 100755
--- a/meta/recipes-bsp/u-boot/files/debian/rules
+++ b/meta/recipes-bsp/u-boot/files/debian/rules.tmpl
@@ -13,7 +13,7 @@ SET_CROSS_BUILD_TOOLS=CROSS_BUILD_TOOLS=y
endif
override_dh_auto_build:
- $(MAKE) $(PARALLEL_MAKE) $(U_BOOT_CONFIG)
+ $(MAKE) $(PARALLEL_MAKE) ${U_BOOT_CONFIG}
$(MAKE) $(PARALLEL_MAKE) ${U_BOOT_BIN}
$(MAKE) -n u-boot-initial-env >/dev/null 2>&1; if [ $$? -ne 2 ]; then \
$(MAKE) $(PARALLEL_MAKE) u-boot-initial-env; \
diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc
index 9984d8cc..2af7ada1 100644
--- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
@@ -26,8 +26,8 @@ python() {
DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git"
-TEMPLATE_FILES = "debian/control.tmpl"
-TEMPLATE_VARS += "MACHINE DEBIAN_BUILD_DEPENDS"
+TEMPLATE_FILES = "debian/control.tmpl debian/rules.tmpl"
+TEMPLATE_VARS += "MACHINE DEBIAN_BUILD_DEPENDS U_BOOT_CONFIG U_BOOT_BIN"
U_BOOT_TOOLS_PACKAGE ?= "0"
U_BOOT_CONFIG_PACKAGE ?= "0"
@@ -71,8 +71,3 @@ fw_env.config /etc
EOF
fi
}
-
-dpkg_runbuild_prepend() {
- export U_BOOT_CONFIG="${U_BOOT_CONFIG}"
- export U_BOOT_BIN="${U_BOOT_BIN}"
-}
--
2.20.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 4/9] trusted-firmware: Do not use shell environment
2022-01-25 12:32 [PATCH v2 0/9] Avoid using shell environment during the build Uladzimir Bely
` (2 preceding siblings ...)
2022-01-25 12:32 ` [PATCH v2 3/9] u-boot: " Uladzimir Bely
@ 2022-01-25 12:32 ` Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 5/9] optee-os: " Uladzimir Bely
` (5 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Uladzimir Bely @ 2022-01-25 12:32 UTC (permalink / raw)
To: isar-users
From: Anton Mikanovich <amikan@ilbers.de>
To make package build process independent of the shell environment we
should remove TF_A_PLATFORM and TF_A_EXTRA_BUILDARGS passing through
export call. So we migrate to template-based debian/rules file.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
.../files/debian/{rules => rules.tmpl} | 4 ++--
.../trusted-firmware-a/trusted-firmware-a-custom.inc | 9 ++-------
2 files changed, 4 insertions(+), 9 deletions(-)
rename meta/recipes-bsp/trusted-firmware-a/files/debian/{rules => rules.tmpl} (77%)
diff --git a/meta/recipes-bsp/trusted-firmware-a/files/debian/rules b/meta/recipes-bsp/trusted-firmware-a/files/debian/rules.tmpl
similarity index 77%
rename from meta/recipes-bsp/trusted-firmware-a/files/debian/rules
rename to meta/recipes-bsp/trusted-firmware-a/files/debian/rules.tmpl
index 70e1dd66..6dbf44db 100755
--- a/meta/recipes-bsp/trusted-firmware-a/files/debian/rules
+++ b/meta/recipes-bsp/trusted-firmware-a/files/debian/rules.tmpl
@@ -12,8 +12,8 @@ export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)-
endif
override_dh_auto_build:
- CFLAGS= LDFLAGS= $(MAKE) $(PARALLEL_MAKE) PLAT=$(TF_A_PLATFORM) \
- $(TF_A_EXTRA_BUILDARGS)
+ CFLAGS= LDFLAGS= $(MAKE) $(PARALLEL_MAKE) PLAT=${TF_A_PLATFORM} \
+ ${TF_A_EXTRA_BUILDARGS}
%:
dh $@
diff --git a/meta/recipes-bsp/trusted-firmware-a/trusted-firmware-a-custom.inc b/meta/recipes-bsp/trusted-firmware-a/trusted-firmware-a-custom.inc
index 1142bfce..64153c6b 100644
--- a/meta/recipes-bsp/trusted-firmware-a/trusted-firmware-a-custom.inc
+++ b/meta/recipes-bsp/trusted-firmware-a/trusted-firmware-a-custom.inc
@@ -22,8 +22,8 @@ DEBIAN_BUILD_DEPENDS ?= ""
PROVIDES += "trusted-firmware-a-${TF_A_NAME}"
-TEMPLATE_FILES = "debian/control.tmpl"
-TEMPLATE_VARS += "TF_A_NAME DEBIAN_BUILD_DEPENDS"
+TEMPLATE_FILES = "debian/control.tmpl debian/rules.tmpl"
+TEMPLATE_VARS += "TF_A_NAME DEBIAN_BUILD_DEPENDS TF_A_PLATFORM TF_A_EXTRA_BUILDARGS"
do_prepare_build() {
cp -r ${WORKDIR}/debian ${S}/
@@ -36,8 +36,3 @@ do_prepare_build() {
${S}/debian/trusted-firmware-a-${TF_A_NAME}.install
done
}
-
-dpkg_runbuild_prepend() {
- export TF_A_PLATFORM="${TF_A_PLATFORM}"
- export TF_A_EXTRA_BUILDARGS="${TF_A_EXTRA_BUILDARGS}"
-}
--
2.20.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 5/9] optee-os: Do not use shell environment
2022-01-25 12:32 [PATCH v2 0/9] Avoid using shell environment during the build Uladzimir Bely
` (3 preceding siblings ...)
2022-01-25 12:32 ` [PATCH v2 4/9] trusted-firmware: " Uladzimir Bely
@ 2022-01-25 12:32 ` Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 6/9] kselftest: " Uladzimir Bely
` (4 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Uladzimir Bely @ 2022-01-25 12:32 UTC (permalink / raw)
To: isar-users
From: Anton Mikanovich <amikan@ilbers.de>
To make package build process independent of the shell environment we
should remove OPTEE_PLATFORM and OPTEE_EXTRA_BUILDARGS passing through
export call. So we migrate to template-based debian/rules file.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
.../optee-os/files/debian/{rules => rules.tmpl} | 4 ++--
meta/recipes-bsp/optee-os/optee-os-custom.inc | 9 ++-------
2 files changed, 4 insertions(+), 9 deletions(-)
rename meta/recipes-bsp/optee-os/files/debian/{rules => rules.tmpl} (75%)
diff --git a/meta/recipes-bsp/optee-os/files/debian/rules b/meta/recipes-bsp/optee-os/files/debian/rules.tmpl
similarity index 75%
rename from meta/recipes-bsp/optee-os/files/debian/rules
rename to meta/recipes-bsp/optee-os/files/debian/rules.tmpl
index d2e9900f..9ab80dfe 100755
--- a/meta/recipes-bsp/optee-os/files/debian/rules
+++ b/meta/recipes-bsp/optee-os/files/debian/rules.tmpl
@@ -12,8 +12,8 @@ export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)-
endif
override_dh_auto_build:
- CFLAGS= LDFLAGS= $(MAKE) $(PARALLEL_MAKE) PLATFORM=$(OPTEE_PLATFORM) \
- $(OPTEE_EXTRA_BUILDARGS)
+ CFLAGS= LDFLAGS= $(MAKE) $(PARALLEL_MAKE) PLATFORM=${OPTEE_PLATFORM} \
+ ${OPTEE_EXTRA_BUILDARGS}
%:
dh $@
diff --git a/meta/recipes-bsp/optee-os/optee-os-custom.inc b/meta/recipes-bsp/optee-os/optee-os-custom.inc
index 1bd51969..23612d81 100644
--- a/meta/recipes-bsp/optee-os/optee-os-custom.inc
+++ b/meta/recipes-bsp/optee-os/optee-os-custom.inc
@@ -22,8 +22,8 @@ DEBIAN_BUILD_DEPENDS ?= "python3-pycryptodome:native, python3-pyelftools"
PROVIDES += "optee-os-${OPTEE_NAME}"
-TEMPLATE_FILES = "debian/control.tmpl"
-TEMPLATE_VARS += "OPTEE_NAME DEBIAN_BUILD_DEPENDS"
+TEMPLATE_FILES = "debian/control.tmpl debian/rules.tmpl"
+TEMPLATE_VARS += "OPTEE_NAME DEBIAN_BUILD_DEPENDS OPTEE_PLATFORM OPTEE_EXTRA_BUILDARGS"
# split strip platform flavor, if any, from the specified platform string
OPTEE_PLATFORM_BASE = "${@d.getVar('OPTEE_PLATFORM').split('-')[0]}"
@@ -39,8 +39,3 @@ do_prepare_build() {
${S}/debian/optee-os-${OPTEE_NAME}.install
done
}
-
-dpkg_runbuild_prepend() {
- export OPTEE_PLATFORM="${OPTEE_PLATFORM}"
- export OPTEE_EXTRA_BUILDARGS="${OPTEE_EXTRA_BUILDARGS}"
-}
--
2.20.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 6/9] kselftest: Do not use shell environment
2022-01-25 12:32 [PATCH v2 0/9] Avoid using shell environment during the build Uladzimir Bely
` (4 preceding siblings ...)
2022-01-25 12:32 ` [PATCH v2 5/9] optee-os: " Uladzimir Bely
@ 2022-01-25 12:32 ` Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 7/9] linux-mainline: Move cfg fragment test to debian/rules Uladzimir Bely
` (3 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Uladzimir Bely @ 2022-01-25 12:32 UTC (permalink / raw)
To: isar-users
From: Anton Mikanovich <amikan@ilbers.de>
To make package build process independent of the shell environment we
should remove KSELFTEST_ARGS passing through export call. The same
logic can be done by internal recipe parser and then pass variable to
template-based debian/rules file.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
.../kselftest/files/{rules => rules.tmpl} | 0
meta/recipes-kernel/kselftest/kselftest.inc | 21 +++++++------------
2 files changed, 8 insertions(+), 13 deletions(-)
rename meta/recipes-kernel/kselftest/files/{rules => rules.tmpl} (100%)
diff --git a/meta/recipes-kernel/kselftest/files/rules b/meta/recipes-kernel/kselftest/files/rules.tmpl
similarity index 100%
rename from meta/recipes-kernel/kselftest/files/rules
rename to meta/recipes-kernel/kselftest/files/rules.tmpl
diff --git a/meta/recipes-kernel/kselftest/kselftest.inc b/meta/recipes-kernel/kselftest/kselftest.inc
index 2a76028b..6187d8e4 100644
--- a/meta/recipes-kernel/kselftest/kselftest.inc
+++ b/meta/recipes-kernel/kselftest/kselftest.inc
@@ -33,26 +33,21 @@ DEBIAN_BUILD_DEPENDS ?= " \
llvm:native, \
"
-SRC_URI += "file://rules"
+SRC_URI += "file://rules.tmpl"
S = "${WORKDIR}/linux-${PV}"
+TEMPLATE_FILES = "rules.tmpl"
+TEMPLATE_VARS += "KSELFTEST_ARGS"
+
KSELFTEST_TARGETS ?= ""
KSELFTEST_SKIP_TARGETS ?= ""
KSELFTEST_FORCE_TARGETS ?= "0"
+KSELFTEST_ARGS = "${@ "TARGETS=\"${KSELFTEST_TARGETS}\"" if d.getVar('KSELFTEST_TARGETS', True) else ''}"
+KSELFTEST_ARGS_append = "${@ " FORCE_TARGETS=1" if d.getVar('KSELFTEST_FORCE_TARGETS', True) == '1' else ''}"
+KSELFTEST_ARGS_append .= "${@ " SKIP_TARGETS=\"${KSELFTEST_SKIP_TARGETS}\"" if d.getVar('KSELFTEST_SKIP_TARGETS', True) else ''}"
+
do_prepare_build[cleandirs] += "${S}/debian"
do_prepare_build() {
deb_debianize
}
-
-dpkg_runbuild_prepend() {
- if [ -n "${KSELFTEST_TARGETS}" ];then
- export KSELFTEST_ARGS="TARGETS=\"${KSELFTEST_TARGETS}\""
- fi
- if [ ${KSELFTEST_FORCE_TARGETS} -eq 1 ];then
- export KSELFTEST_ARGS="${KSELFTEST_ARGS} FORCE_TARGETS=1"
- fi
- if [ -n "${KSELFTEST_SKIP_TARGETS}" ];then
- export KSELFTEST_ARGS="${KSELFTEST_ARGS} SKIP_TARGETS=\"${KSELFTEST_SKIP_TARGETS}\""
- fi
-}
--
2.20.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 7/9] linux-mainline: Move cfg fragment test to debian/rules
2022-01-25 12:32 [PATCH v2 0/9] Avoid using shell environment during the build Uladzimir Bely
` (5 preceding siblings ...)
2022-01-25 12:32 ` [PATCH v2 6/9] kselftest: " Uladzimir Bely
@ 2022-01-25 12:32 ` Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 8/9] dpkg: Use a specific export function in pre-build tasks Uladzimir Bely
` (2 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Uladzimir Bely @ 2022-01-25 12:32 UTC (permalink / raw)
To: isar-users
From: Anton Mikanovich <amikan@ilbers.de>
Perform all config fragments checking in Debian way.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
.../linux/linux-mainline_5.4.70.bb | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/meta-isar/recipes-kernel/linux/linux-mainline_5.4.70.bb b/meta-isar/recipes-kernel/linux/linux-mainline_5.4.70.bb
index 980e137b..28e51c0d 100644
--- a/meta-isar/recipes-kernel/linux/linux-mainline_5.4.70.bb
+++ b/meta-isar/recipes-kernel/linux/linux-mainline_5.4.70.bb
@@ -25,11 +25,13 @@ LINUX_VERSION_EXTENSION = "-isar"
# For testing purposes only
dpkg_configure_kernel_append() {
- if ! grep "# CONFIG_MTD is not set" ${S}/${KERNEL_BUILD_DIR}/.config && \
- ! grep "# CONFIG_MTD_UBI is not set" ${S}/${KERNEL_BUILD_DIR}/.config; then
- grep "# CONFIG_UBIFS_FS is not set" ${S}/${KERNEL_BUILD_DIR}/.config || \
- bbfatal "Self-check failed: CONFIG_UBIFS_FS still enabled"
- fi
- grep "CONFIG_ROOT_NFS=y" ${S}/${KERNEL_BUILD_DIR}/.config || \
- bbfatal "Self-check failed: CONFIG_ROOT_NFS not enabled"
+cat << EOF | sed -i '/^override_dh_auto_build/ r /dev/stdin' ${S}/debian/rules
+ if ! grep "# CONFIG_MTD is not set" \$(O)/.config && \\
+ ! grep "# CONFIG_MTD_UBI is not set" \$(O)/.config; then \\
+ grep "# CONFIG_UBIFS_FS is not set" \$(O)/.config || \\
+ (echo "Self-check failed: CONFIG_UBIFS_FS still enabled" && exit 1); \\
+ fi
+ grep "CONFIG_ROOT_NFS=y" \$(O)/.config || \\
+ (echo "Self-check failed: CONFIG_ROOT_NFS not enabled" && exit 1)
+EOF
}
--
2.20.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 8/9] dpkg: Use a specific export function in pre-build tasks
2022-01-25 12:32 [PATCH v2 0/9] Avoid using shell environment during the build Uladzimir Bely
` (6 preceding siblings ...)
2022-01-25 12:32 ` [PATCH v2 7/9] linux-mainline: Move cfg fragment test to debian/rules Uladzimir Bely
@ 2022-01-25 12:32 ` Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 9/9] linux-custom: Move cfg fragments applying to debian/rules Uladzimir Bely
2022-01-25 13:29 ` [PATCH v2 0/9] Avoid using shell environment during the build Jan Kiszka
9 siblings, 0 replies; 13+ messages in thread
From: Uladzimir Bely @ 2022-01-25 12:32 UTC (permalink / raw)
To: isar-users
Build system like sbuild may not use the system environment, so direct
shell export won't work.
This introduces dpkg_build_export function that may be overloaded in
sbuild or other build systems to be implemented in Isar.
Use it in some recipes like optee-os-stm32mp15x as an alternative
of passing TEE_IMPL_VERSION variable through template mechanism.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
meta-isar/recipes-app/hello/hello.bb | 2 +-
.../recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb | 2 +-
meta/classes/dpkg-base.bbclass | 9 +++++++++
meta/classes/dpkg.bbclass | 2 +-
meta/recipes-bsp/libubootenv/libubootenv_0.3-3.bb | 2 +-
meta/recipes-kernel/linux/linux-custom.inc | 2 +-
6 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/meta-isar/recipes-app/hello/hello.bb b/meta-isar/recipes-app/hello/hello.bb
index d6bdf9bb..dfeea6e9 100644
--- a/meta-isar/recipes-app/hello/hello.bb
+++ b/meta-isar/recipes-app/hello/hello.bb
@@ -25,6 +25,6 @@ do_prepare_build() {
dpkg_runbuild_prepend() {
if [ ${ISAR_CROSS_COMPILE} -eq 1 ]; then
- export DEB_BUILD_OPTIONS="nocheck"
+ dpkg_build_export DEB_BUILD_OPTIONS "nocheck"
fi
}
diff --git a/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb b/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb
index 0fa2005d..00b92707 100644
--- a/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb
+++ b/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb
@@ -21,5 +21,5 @@ OPTEE_BINARIES = "tee-header_v2.stm32 tee-pageable_v2.stm32 tee-pager_v2.stm32"
# Set version manually to PV, the tarball does not contain any hint.
# Alternative: pull from git and add git as build dependency.
dpkg_runbuild_prepend() {
- export TEE_IMPL_VERSION=${PV}
+ dpkg_build_export TEE_IMPL_VERSION ${PV}
}
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 2add0b22..76b1290a 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -196,6 +196,15 @@ dpkg_undo_mounts() {
sudo rmdir ${BUILDROOT}
}
+# Basic export implementation supporting multiword values
+dpkg_build_export() {
+ var=$1
+ shift
+ value=$@
+
+ export $var="$value"
+}
+
# Placeholder for actual dpkg_runbuild() implementation
dpkg_runbuild() {
die "This should never be called, overwrite it in your derived class"
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 27fe84f4..e8c7e2eb 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -33,7 +33,7 @@ addtask devshell after do_install_builddeps
dpkg_runbuild() {
E="${@ isar_export_proxies(d)}"
E="${@ isar_export_ccache(d)}"
- export PARALLEL_MAKE="${PARALLEL_MAKE}"
+ dpkg_build_export PARALLEL_MAKE "${PARALLEL_MAKE}"
sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \
/isar/build.sh ${PP}/${PPS} ${PACKAGE_ARCH}
}
diff --git a/meta/recipes-bsp/libubootenv/libubootenv_0.3-3.bb b/meta/recipes-bsp/libubootenv/libubootenv_0.3-3.bb
index 68a55003..9cdbb366 100644
--- a/meta/recipes-bsp/libubootenv/libubootenv_0.3-3.bb
+++ b/meta/recipes-bsp/libubootenv/libubootenv_0.3-3.bb
@@ -21,5 +21,5 @@ S = "${WORKDIR}/git"
dpkg_runbuild_prepend() {
- export DEB_BUILD_OPTIONS="nocheck"
+ dpkg_build_export DEB_BUILD_OPTIONS "nocheck"
}
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index ed89aa09..72706f23 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -180,6 +180,6 @@ dpkg_runbuild_prepend() {
if [ "${KERNEL_LIBC_DEV_DEPLOY}" != "1" ]; then
profiles="${profiles} nolibcdev"
fi
- export DEB_BUILD_PROFILES="${profiles}"
+ dpkg_build_export DEB_BUILD_PROFILES "${profiles}"
dpkg_configure_kernel
}
--
2.20.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 9/9] linux-custom: Move cfg fragments applying to debian/rules
2022-01-25 12:32 [PATCH v2 0/9] Avoid using shell environment during the build Uladzimir Bely
` (7 preceding siblings ...)
2022-01-25 12:32 ` [PATCH v2 8/9] dpkg: Use a specific export function in pre-build tasks Uladzimir Bely
@ 2022-01-25 12:32 ` Uladzimir Bely
2022-01-25 13:29 ` [PATCH v2 0/9] Avoid using shell environment during the build Jan Kiszka
9 siblings, 0 replies; 13+ messages in thread
From: Uladzimir Bely @ 2022-01-25 12:32 UTC (permalink / raw)
To: isar-users
Prepare linux fragments applying in Debian way.
This allows to avoid pre-build chroot call used for merging
kernel config file and custom config fragments.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
.../linux/files/debian/isar/configure.tmpl | 19 +++++++++++++++++++
.../linux/files/debian/rules.tmpl | 3 +++
meta/recipes-kernel/linux/linux-custom.inc | 12 +++---------
3 files changed, 25 insertions(+), 9 deletions(-)
create mode 100644 meta/recipes-kernel/linux/files/debian/isar/configure.tmpl
diff --git a/meta/recipes-kernel/linux/files/debian/isar/configure.tmpl b/meta/recipes-kernel/linux/files/debian/isar/configure.tmpl
new file mode 100644
index 00000000..83871baa
--- /dev/null
+++ b/meta/recipes-kernel/linux/files/debian/isar/configure.tmpl
@@ -0,0 +1,19 @@
+#!/bin/bash
+# Copyright (c) Mentor Graphics, a Siemens business, 2019
+# SPDX-License-Identifier: MIT
+
+# Load common stuff
+. ${S}/debian/isar/common || exit ${?}
+
+do_configure() {
+
+ # Process kernel config target and fragments
+ ${MAKE} O=${KERNEL_BUILD_DIR} ${KERNEL_CONFIG_TARGET} || exit ${?}
+ ./scripts/kconfig/merge_config.sh -O ${KERNEL_BUILD_DIR}/ \
+ ${KERNEL_BUILD_DIR}/.config ${KERNEL_CONFIG_FRAGMENTS}
+
+ # Stop tracing
+ set +x
+}
+
+main configure ${*}
diff --git a/meta/recipes-kernel/linux/files/debian/rules.tmpl b/meta/recipes-kernel/linux/files/debian/rules.tmpl
index 05a26fe2..a1166287 100755
--- a/meta/recipes-kernel/linux/files/debian/rules.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/rules.tmpl
@@ -22,6 +22,9 @@ isar_env=$(strip \
override_dh_auto_clean:
$(isar_env) && bash $(deb_top_dir)/isar/clean
+override_dh_auto_configure:
+ $(isar_env) && bash $(deb_top_dir)/isar/configure
+
override_dh_auto_build:
$(isar_env) && bash $(deb_top_dir)/isar/build
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 72706f23..eaaa2eef 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -52,6 +52,7 @@ TEMPLATE_FILES += " \
debian/isar/build.tmpl \
debian/isar/clean.tmpl \
debian/isar/common.tmpl \
+ debian/isar/configure.tmpl \
debian/isar/install.tmpl \
debian/isar/version.cfg.tmpl \
debian/linux-image.postinst.tmpl \
@@ -164,15 +165,8 @@ dpkg_configure_kernel() {
(cd ${WORKDIR} && cp ${src_frags} ${S}/debian/fragments/)
fi
- sudo -E chroot --userspec=$(id -u):$(id -g) ${BUILDCHROOT_DIR} sh -c " \
- export ARCH=${KERNEL_ARCH} && \
- cd ${PP}/${PPS} && \
- make O=${KERNEL_BUILD_DIR} ${config_target} && \
- ./scripts/kconfig/merge_config.sh \
- -O ${KERNEL_BUILD_DIR}/ \
- ${KERNEL_BUILD_DIR}/.config \
- ${out_frags} \
- "
+ dpkg_build_export KERNEL_CONFIG_TARGET ${config_target}
+ dpkg_build_export KERNEL_CONFIG_FRAGMENTS ${out_frags}
}
dpkg_runbuild_prepend() {
--
2.20.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 0/9] Avoid using shell environment during the build
2022-01-25 12:32 [PATCH v2 0/9] Avoid using shell environment during the build Uladzimir Bely
` (8 preceding siblings ...)
2022-01-25 12:32 ` [PATCH v2 9/9] linux-custom: Move cfg fragments applying to debian/rules Uladzimir Bely
@ 2022-01-25 13:29 ` Jan Kiszka
2022-01-25 13:51 ` Uladzimir Bely
9 siblings, 1 reply; 13+ messages in thread
From: Jan Kiszka @ 2022-01-25 13:29 UTC (permalink / raw)
To: Uladzimir Bely, isar-users
On 25.01.22 13:32, Uladzimir Bely wrote:
> This patchset is a subseries of 'Sbuild/Schroot migration' patchset
> including only preparation patches. It doesn't require any changes
> in host machine configuration for downstreams (meta-iot2050 and
> xenomai-images were tested) so can be merged independently.
>
> In this patchset the main topic is a migration to template files that
> allows to use cleaner build environment.
>
> When this patchset is merged, it will make maintenance of remaining
> sbuild-related patches easier and will shorten their number.
>
> Changes since v1:
> - Introduced `dpkg_build_export` function to be used for passing
> variables to build environment;
I wonder - as just written in the iot2050 PR - if we have any chance to
detect old exports and warn the user if their recipes need to be
converted to dpkg_build_export. Any ideas?
Jan
> - Linux kernel framgments handling is done in Debian way.
>
> Anton Mikanovich (6):
> linux-module: Do not use shell environment
> u-boot: Do not use shell environment
> trusted-firmware: Do not use shell environment
> optee-os: Do not use shell environment
> kselftest: Do not use shell environment
> linux-mainline: Move cfg fragment test to debian/rules
>
> Uladzimir Bely (3):
> template: Copy template attributes on transform
> dpkg: Use a specific export function in pre-build tasks
> linux-custom: Move cfg fragments applying to debian/rules
>
> meta-isar/recipes-app/hello/hello.bb | 2 +-
> .../optee-os/optee-os-stm32mp15x_3.11.0.bb | 2 +-
> .../linux/linux-mainline_5.4.70.bb | 16 +++---
> meta/classes/dpkg-base.bbclass | 9 ++++
> meta/classes/dpkg.bbclass | 2 +-
> meta/classes/template.bbclass | 4 +-
> .../libubootenv/libubootenv_0.3-3.bb | 2 +-
> .../files/debian/{rules => rules.tmpl} | 4 +-
> meta/recipes-bsp/optee-os/optee-os-custom.inc | 9 +---
> .../files/debian/{rules => rules.tmpl} | 4 +-
> .../trusted-firmware-a-custom.inc | 9 +---
> .../u-boot/files/debian/{rules => rules.tmpl} | 2 +-
> meta/recipes-bsp/u-boot/u-boot-custom.inc | 9 +---
> .../kselftest/files/{rules => rules.tmpl} | 0
> meta/recipes-kernel/kselftest/kselftest.inc | 21 +++-----
> .../linux-module/files/debian/rules | 37 -------------
> .../linux-module/files/debian/rules.tmpl | 52 +++++++++++++++++++
> meta/recipes-kernel/linux-module/module.inc | 19 ++-----
> .../linux/files/debian/isar/configure.tmpl | 19 +++++++
> .../linux/files/debian/rules.tmpl | 3 ++
> meta/recipes-kernel/linux/linux-custom.inc | 14 ++---
> 21 files changed, 125 insertions(+), 114 deletions(-)
> rename meta/recipes-bsp/optee-os/files/debian/{rules => rules.tmpl} (75%)
> rename meta/recipes-bsp/trusted-firmware-a/files/debian/{rules => rules.tmpl} (77%)
> rename meta/recipes-bsp/u-boot/files/debian/{rules => rules.tmpl} (94%)
> rename meta/recipes-kernel/kselftest/files/{rules => rules.tmpl} (100%)
> delete mode 100755 meta/recipes-kernel/linux-module/files/debian/rules
> create mode 100755 meta/recipes-kernel/linux-module/files/debian/rules.tmpl
> create mode 100644 meta/recipes-kernel/linux/files/debian/isar/configure.tmpl
>
--
Siemens AG, Technology
Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 0/9] Avoid using shell environment during the build
2022-01-25 13:29 ` [PATCH v2 0/9] Avoid using shell environment during the build Jan Kiszka
@ 2022-01-25 13:51 ` Uladzimir Bely
2022-01-25 13:55 ` Jan Kiszka
0 siblings, 1 reply; 13+ messages in thread
From: Uladzimir Bely @ 2022-01-25 13:51 UTC (permalink / raw)
To: isar-users, Jan Kiszka
In the email from вторник, 25 января 2022 г. 16:29:28 +03 user Jan Kiszka
wrote:
> On 25.01.22 13:32, Uladzimir Bely wrote:
> > This patchset is a subseries of 'Sbuild/Schroot migration' patchset
> > including only preparation patches. It doesn't require any changes
> > in host machine configuration for downstreams (meta-iot2050 and
> > xenomai-images were tested) so can be merged independently.
> >
> > In this patchset the main topic is a migration to template files that
> > allows to use cleaner build environment.
> >
> > When this patchset is merged, it will make maintenance of remaining
> > sbuild-related patches easier and will shorten their number.
> >
> > Changes since v1:
> > - Introduced `dpkg_build_export` function to be used for passing
> > variables to build environment;
>
> I wonder - as just written in the iot2050 PR - if we have any chance to
> detect old exports and warn the user if their recipes need to be
> converted to dpkg_build_export. Any ideas?
>
> Jan
>
That's an interesting question. If we could make a hook that could intercept
any 'export' call in dpkg_runbuild (usually, in _prepend), we could make a
warning. On the other hand, in this case we could not introduce a new
function, but just do what we really need instead of doing shell export.
For now I have no ideas how we could do it.
> > - Linux kernel framgments handling is done in Debian way.
> >
> > Anton Mikanovich (6):
> > linux-module: Do not use shell environment
> > u-boot: Do not use shell environment
> > trusted-firmware: Do not use shell environment
> > optee-os: Do not use shell environment
> > kselftest: Do not use shell environment
> > linux-mainline: Move cfg fragment test to debian/rules
> >
> > Uladzimir Bely (3):
> > template: Copy template attributes on transform
> > dpkg: Use a specific export function in pre-build tasks
> > linux-custom: Move cfg fragments applying to debian/rules
> >
> > meta-isar/recipes-app/hello/hello.bb | 2 +-
> > .../optee-os/optee-os-stm32mp15x_3.11.0.bb | 2 +-
> > .../linux/linux-mainline_5.4.70.bb | 16 +++---
> > meta/classes/dpkg-base.bbclass | 9 ++++
> > meta/classes/dpkg.bbclass | 2 +-
> > meta/classes/template.bbclass | 4 +-
> > .../libubootenv/libubootenv_0.3-3.bb | 2 +-
> > .../files/debian/{rules => rules.tmpl} | 4 +-
> > meta/recipes-bsp/optee-os/optee-os-custom.inc | 9 +---
> > .../files/debian/{rules => rules.tmpl} | 4 +-
> > .../trusted-firmware-a-custom.inc | 9 +---
> > .../u-boot/files/debian/{rules => rules.tmpl} | 2 +-
> > meta/recipes-bsp/u-boot/u-boot-custom.inc | 9 +---
> > .../kselftest/files/{rules => rules.tmpl} | 0
> > meta/recipes-kernel/kselftest/kselftest.inc | 21 +++-----
> > .../linux-module/files/debian/rules | 37 -------------
> > .../linux-module/files/debian/rules.tmpl | 52 +++++++++++++++++++
> > meta/recipes-kernel/linux-module/module.inc | 19 ++-----
> > .../linux/files/debian/isar/configure.tmpl | 19 +++++++
> > .../linux/files/debian/rules.tmpl | 3 ++
> > meta/recipes-kernel/linux/linux-custom.inc | 14 ++---
> > 21 files changed, 125 insertions(+), 114 deletions(-)
> > rename meta/recipes-bsp/optee-os/files/debian/{rules => rules.tmpl}
> > (75%)
> > rename meta/recipes-bsp/trusted-firmware-a/files/debian/{rules =>
> > rules.tmpl} (77%) rename meta/recipes-bsp/u-boot/files/debian/{rules =>
> > rules.tmpl} (94%) rename meta/recipes-kernel/kselftest/files/{rules =>
> > rules.tmpl} (100%) delete mode 100755
> > meta/recipes-kernel/linux-module/files/debian/rules create mode 100755
> > meta/recipes-kernel/linux-module/files/debian/rules.tmpl create mode
> > 100644 meta/recipes-kernel/linux/files/debian/isar/configure.tmpl
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 0/9] Avoid using shell environment during the build
2022-01-25 13:51 ` Uladzimir Bely
@ 2022-01-25 13:55 ` Jan Kiszka
0 siblings, 0 replies; 13+ messages in thread
From: Jan Kiszka @ 2022-01-25 13:55 UTC (permalink / raw)
To: Uladzimir Bely, isar-users
On 25.01.22 14:51, Uladzimir Bely wrote:
> In the email from вторник, 25 января 2022 г. 16:29:28 +03 user Jan Kiszka
> wrote:
>> On 25.01.22 13:32, Uladzimir Bely wrote:
>>> This patchset is a subseries of 'Sbuild/Schroot migration' patchset
>>> including only preparation patches. It doesn't require any changes
>>> in host machine configuration for downstreams (meta-iot2050 and
>>> xenomai-images were tested) so can be merged independently.
>>>
>>> In this patchset the main topic is a migration to template files that
>>> allows to use cleaner build environment.
>>>
>>> When this patchset is merged, it will make maintenance of remaining
>>> sbuild-related patches easier and will shorten their number.
>>>
>>> Changes since v1:
>>> - Introduced `dpkg_build_export` function to be used for passing
>>> variables to build environment;
>>
>> I wonder - as just written in the iot2050 PR - if we have any chance to
>> detect old exports and warn the user if their recipes need to be
>> converted to dpkg_build_export. Any ideas?
>>
>> Jan
>>
>
> That's an interesting question. If we could make a hook that could intercept
> any 'export' call in dpkg_runbuild (usually, in _prepend), we could make a
> warning. On the other hand, in this case we could not introduce a new
> function, but just do what we really need instead of doing shell export.
>
> For now I have no ideas how we could do it.
>
Maybe a hook at the beginning of that task which collects the
environment and one at the end that does that again, checking for
additionally exported vars?
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2022-01-25 13:55 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-25 12:32 [PATCH v2 0/9] Avoid using shell environment during the build Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 1/9] template: Copy template attributes on transform Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 2/9] linux-module: Do not use shell environment Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 3/9] u-boot: " Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 4/9] trusted-firmware: " Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 5/9] optee-os: " Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 6/9] kselftest: " Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 7/9] linux-mainline: Move cfg fragment test to debian/rules Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 8/9] dpkg: Use a specific export function in pre-build tasks Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 9/9] linux-custom: Move cfg fragments applying to debian/rules Uladzimir Bely
2022-01-25 13:29 ` [PATCH v2 0/9] Avoid using shell environment during the build Jan Kiszka
2022-01-25 13:51 ` Uladzimir Bely
2022-01-25 13:55 ` Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox