Upcoming sbuild in Isar support
v2 cover Upcoming sbuild in Isar support
There is 'sbuild' patchset under development in Isar and it requires some changes in the downstream.
This patchset makes 'xenomai-images' compatible with it without breaking compatibility with current 'next' branch of Isar.
Changes since v1:
- Removed bootstrap for xenomai recipe since it's done in debian/rules
- Kernel patching is done in Debian way, so should be compatible with any build system. Both buildchroot and sbuild were tested.
Uladzimir Bely (2):
xenomai: remove bootstrap task from dpkg_runbuild_prepend
linux-xenomai: handle xenomai-kernel patch in Debian way
recipes-kernel/linux/linux-xenomai.inc | 13 ++++++++----- recipes-xenomai/xenomai/xenomai.inc | 17 ----------------- 2 files changed, 8 insertions(+), 22 deletions(-)
Signature · 1 line
2.20.1
PATCH v2 1/2 xenomai: remove bootstrap task from dpkg_runbuild_prepend
This looks unneeded while bootstrapping is done in the same way in debian/rules file before the build.
--- recipes-xenomai/xenomai/xenomai.inc | 17 ----------------- 1 file changed, 17 deletions(-)
recipes-xenomai/xenomai/xenomai.inc +0 -17
@@ -13,15 +13,6 @@ inherit dpkg PROVIDES += "xenomai-kernel-source xenomai-runtime xenomai-runtime-dbgsym libxenomai1 libxenomai-dev libxenomai1-dbgsym" -# use bitbake get_srcrev to get the current commit id -def get_commit(d): - try: - return bb.fetch2.get_srcrev(d).strip('AUTOINC+') - except bb.fetch2.FetchError: - return "" - -COMMIT="${@get_commit(d)}" - do_prepare_build() { # Xenomai currently does not maintain its changelog, plus we want the # actual package version in there.
@@ -31,11 +22,3 @@ do_prepare_build() { # package version more freely. rm -f ${S}/debian/source/format } - -dpkg_runbuild_prepend() { - bbplain $(printf "xenomai-%s: Building revision %.20s\n" \ - ${PV} ${COMMIT}) - - sudo chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \ - sh -c "cd ${PP}/${PPS}; scripts/bootstrap" -}
Signature · 1 line
2.20.1
Re: [xenomai-images] [PATCH v2 1/2] xenomai: remove bootstrap task from dpkg_runbuild_prepend
Quoted 29 lines · Uladzimir Bely via Xenomai
This looks unneeded while bootstrapping is done in the same way in debian/rules file before the build.
Signed-off-by Uladzimir Bely <[email protected]>--- recipes-xenomai/xenomai/xenomai.inc | 17 ----------------- 1 file changed, 17 deletions(-)recipes-xenomai/xenomai/xenomai.inc +0
-9@@ -13,15 +13,6 @@ inherit dpkg PROVIDES += "xenomai-kernel-source xenomai-runtime xenomai-runtime-dbgsym libxenomai1 libxenomai-dev libxenomai1-dbgsym" -# use bitbake get_srcrev to get the current commit id -def get_commit(d): - try: - return bb.fetch2.get_srcrev(d).strip('AUTOINC+') - except bb.fetch2.FetchError: - return "" - -COMMIT="${@get_commit(d)}" - do_prepare_build() { # Xenomai currently does not maintain its changelog, plus we want the # actual package version in there.
recipes-xenomai/xenomai/xenomai.inc do_prepare_build() { · line 37
Quoted 7 lines
recipes-xenomai/xenomai/xenomai.inc +0
-4@@ -31,11 +22,3 @@ do_prepare_build() { # package version more freely. rm -f ${S}/debian/source/format } - -dpkg_runbuild_prepend() { - bbplain $(printf "xenomai-%s: Building revision %.20s\n" \ - ${PV} ${COMMIT})
This is unrelated and must not be removed. It provides information about the actually built revision when using "latest" as version.
recipes-xenomai/xenomai/xenomai.inc do_prepare_build() { · line 41
Quoted 4 lines
recipes-xenomai/xenomai/xenomai.inc +0
-4- - sudo chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \ - sh -c "cd ${PP}/${PPS}; scripts/bootstrap" -}
Ah, that was obsolete by [1], fortunately in all stable branches as well. So this is fine indeed.
Jan
[1] https://gitlab.com/Xenomai/xenomai-hacker-space/-/commit/951739291eb208076b638a06351ff9aa23c524c2
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux
PATCH v2 2/2 linux-xenomai: handle xenomai-kernel patch in Debian way
In reply to Uladzimir BelyThis change moves generating xenomai-kernel.patch and applying it from the recipe into a build script in 'debian/' subdirectory.
This makes linux-xenomai recipe buildchroot-independent and allows to use it with any build system (e.g. sbuild).
--- recipes-kernel/linux/linux-xenomai.inc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
recipes-kernel/linux/linux-xenomai.inc +8 -5
@@ -49,9 +49,12 @@ dpkg_runbuild_prepend() { bbplain $(printf "linux-xenomai-%s: Building revision %.20s\n" \ ${PV} ${LINUX_COMMIT}) - ${BUILDCHROOT_DIR}/usr/src/xenomai-kernel-source/scripts/prepare-kernel.sh \ - --linux=${BUILDCHROOT_DIR}/${PP}/${PPS} --arch=$ARCH \ - --outpatch=${WORKDIR}/xenomai-kernel.patch - patch -d ${BUILDCHROOT_DIR}/${PP}/${PPS} \ - -p1 -i ${WORKDIR}/xenomai-kernel.patch + if ! grep -q "prepare-kernel.sh" ${S}/debian/isar/build; then + cat << EOF | sed -i '/^do_build/ r /dev/stdin' ${S}/debian/isar/build + /usr/src/xenomai-kernel-source/scripts/prepare-kernel.sh \\ + --linux=. --arch=$ARCH \\ + --outpatch=../xenomai-kernel.patch + patch -d . -p1 -i ../xenomai-kernel.patch +EOF + fi }
Signature · 1 line
2.20.1
Re: [xenomai-images] [PATCH v2 2/2] linux-xenomai: handle xenomai-kernel patch in Debian way
Quoted 21 lines · Uladzimir Bely via Xenomai
This change moves generating xenomai-kernel.patch and applying it from the recipe into a build script in 'debian/' subdirectory.
This makes linux-xenomai recipe buildchroot-independent and allows to use it with any build system (e.g. sbuild).
Signed-off-by Uladzimir Bely <[email protected]>--- recipes-kernel/linux/linux-xenomai.inc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)recipes-kernel/linux/linux-xenomai.inc +0
-2@@ -49,9 +49,12 @@ dpkg_runbuild_prepend() { bbplain $(printf "linux-xenomai-%s: Building revision %.20s\n" \ ${PV} ${LINUX_COMMIT}) - ${BUILDCHROOT_DIR}/usr/src/xenomai-kernel-source/scripts/prepare-kernel.sh \ - --linux=${BUILDCHROOT_DIR}/${PP}/${PPS} --arch=$ARCH \
recipes-kernel/linux/linux-xenomai.inc dpkg_runbuild_prepend() { · line 58
Quoted 10 lines
recipes-kernel/linux/linux-xenomai.inc +7
-3- --outpatch=${WORKDIR}/xenomai-kernel.patch - patch -d ${BUILDCHROOT_DIR}/${PP}/${PPS} \ - -p1 -i ${WORKDIR}/xenomai-kernel.patch + if ! grep -q "prepare-kernel.sh" ${S}/debian/isar/build; then + cat << EOF | sed -i '/^do_build/ r /dev/stdin' ${S}/debian/isar/build + /usr/src/xenomai-kernel-source/scripts/prepare-kernel.sh \\ + --linux=. --arch=$ARCH \\ + --outpatch=../xenomai-kernel.patch + patch -d . -p1 -i ../xenomai-kernel.patch +EOF
Can't we pick up ARCH from the environment of the build and use a static script? This conditional patching-in is not so nice.
Jan
Quoted 2 lines
recipes-kernel/linux/linux-xenomai.inc +1
-0+ fi }
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux
Re: [xenomai-images] [PATCH v2 2/2] linux-xenomai: handle xenomai-kernel patch in Debian way
In the email from понедельник, 24 января 2022 г. 20:56:31 +03 user Jan Kiszka
Quoted 19 lines · wrote:
Quoted 18 lines · Uladzimir Bely via Xenomai
This change moves generating xenomai-kernel.patch and applying it from the recipe into a build script in 'debian/' subdirectory.
This makes linux-xenomai recipe buildchroot-independent and allows to use it with any build system (e.g. sbuild).
Signed-off-by Uladzimir Bely <[email protected]>---
recipes-kernel/linux/linux-xenomai.inc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)(quoted diff) +0
-0b/recipes-kernel/linux/linux-xenomai.inc index 7dba96e..bd7db7d 100644
recipes-kernel/linux/linux-xenomai.inc +0
-0@@ -49,9 +49,12 @@ dpkg_runbuild_prepend() {
Quoted 5 lines
recipes-kernel/linux/linux-xenomai.inc dpkg_runbuild_prepend() {
Quoted 5 lines
recipes-kernel/linux/linux-xenomai.inc +0
-1bbplain $(printf "linux-xenomai-%s: Building revision %.20s\n" \ ${PV} ${LINUX_COMMIT}) - ${BUILDCHROOT_DIR}/usr/src/xenomai-kernel-source/scripts/prepare-
kernel.
Quoted 1 line
Quoted 1 line
sh \ - --linux=${BUILDCHROOT_DIR}/${PP}/${PPS} --arch=$ARCH
\
Quoted 5 lines
recipes-kernel/linux/linux-xenomai.inc dpkg_runbuild_prepend() {
Quoted 5 lines
recipes-kernel/linux/linux-xenomai.inc +2
-3- --outpatch=${WORKDIR}/xenomai-kernel.patch - patch -d ${BUILDCHROOT_DIR}/${PP}/${PPS} \ - -p1 -i ${WORKDIR}/xenomai-kernel.patch + if ! grep -q "prepare-kernel.sh" ${S}/debian/isar/build; then + cat << EOF | sed -i '/^do_build/ r /dev/stdin' ${S}/
debian/isar/build
Quoted 8 lines
recipes-kernel/linux/linux-xenomai.inc dpkg_runbuild_prepend() { · line 58
Quoted 5 lines
recipes-kernel/linux/linux-xenomai.inc +5
-0+ /usr/src/xenomai-kernel-source/scripts/prepare-kernel.sh \\ + --linux=. --arch=$ARCH \\ + --outpatch=../xenomai-kernel.patch + patch -d . -p1 -i ../xenomai-kernel.patch +EOFCan't we pick up ARCH from the environment of the build and use a static script? This conditional patching-in is not so nice.
Yes, we can do it. Instead of using $ARCH we could use \$ARCH, so the variable will take the value not in "dpkg_runbuild", but in 'debian/isar/build', from the environment. In this case the architecture will be calculated by similar function get_kernel_arch() from isar/meta/recipes-kernel/linux/linux- custom.inc
I first wanted to do it this way, but notices, that Isar's function handles more architectures than arm/arm64/x86. For example, in case of DISTRO_ARCH="mipsel" function from 'linux-xenoami.ing' produces an error ("Unsupported architecture"), while one from 'linux-custom.inc' returns "mips".
If it's not a problem, we can simplify it and remove more code.
Quoted 6 lines
Jan
Quoted 3 lines
recipes-kernel/linux/linux-xenomai.inc +1
-0+ fi }