All of lore.kernel.org
 help / color / mirror / Atom feed
* [xenomai-images] [PATCH v2 0/2] Upcoming sbuild in Isar support
@ 2022-01-18 10:51 Uladzimir Bely
  2022-01-18 10:51 ` [xenomai-images] [PATCH v2 1/2] xenomai: remove bootstrap task from dpkg_runbuild_prepend Uladzimir Bely
  2022-01-18 10:51 ` [xenomai-images] [PATCH v2 2/2] linux-xenomai: handle xenomai-kernel patch in Debian way Uladzimir Bely
  0 siblings, 2 replies; 6+ messages in thread
From: Uladzimir Bely @ 2022-01-18 10:51 UTC (permalink / raw)
  To: xenomai, ubely

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(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [xenomai-images] [PATCH v2 1/2] xenomai: remove bootstrap task from dpkg_runbuild_prepend
  2022-01-18 10:51 [xenomai-images] [PATCH v2 0/2] Upcoming sbuild in Isar support Uladzimir Bely
@ 2022-01-18 10:51 ` Uladzimir Bely
  2022-01-24 17:54   ` Jan Kiszka
  2022-01-18 10:51 ` [xenomai-images] [PATCH v2 2/2] linux-xenomai: handle xenomai-kernel patch in Debian way Uladzimir Bely
  1 sibling, 1 reply; 6+ messages in thread
From: Uladzimir Bely @ 2022-01-18 10:51 UTC (permalink / raw)
  To: xenomai, ubely

This looks unneeded while bootstrapping is done in the same way
in debian/rules file before the build.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 recipes-xenomai/xenomai/xenomai.inc | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/recipes-xenomai/xenomai/xenomai.inc b/recipes-xenomai/xenomai/xenomai.inc
index fe84883..b8ec5bd 100644
--- a/recipes-xenomai/xenomai/xenomai.inc
+++ b/recipes-xenomai/xenomai/xenomai.inc
@@ -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"
-}
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [xenomai-images] [PATCH v2 2/2] linux-xenomai: handle xenomai-kernel patch in Debian way
  2022-01-18 10:51 [xenomai-images] [PATCH v2 0/2] Upcoming sbuild in Isar support Uladzimir Bely
  2022-01-18 10:51 ` [xenomai-images] [PATCH v2 1/2] xenomai: remove bootstrap task from dpkg_runbuild_prepend Uladzimir Bely
@ 2022-01-18 10:51 ` Uladzimir Bely
  2022-01-24 17:56   ` Jan Kiszka
  1 sibling, 1 reply; 6+ messages in thread
From: Uladzimir Bely @ 2022-01-18 10:51 UTC (permalink / raw)
  To: xenomai, ubely

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 <ubely@ilbers.de>
---
 recipes-kernel/linux/linux-xenomai.inc | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/recipes-kernel/linux/linux-xenomai.inc b/recipes-kernel/linux/linux-xenomai.inc
index 7dba96e..bd7db7d 100644
--- a/recipes-kernel/linux/linux-xenomai.inc
+++ b/recipes-kernel/linux/linux-xenomai.inc
@@ -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
 }
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [xenomai-images] [PATCH v2 1/2] xenomai: remove bootstrap task from dpkg_runbuild_prepend
  2022-01-18 10:51 ` [xenomai-images] [PATCH v2 1/2] xenomai: remove bootstrap task from dpkg_runbuild_prepend Uladzimir Bely
@ 2022-01-24 17:54   ` Jan Kiszka
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Kiszka @ 2022-01-24 17:54 UTC (permalink / raw)
  To: Uladzimir Bely, xenomai

On 18.01.22 11:51, Uladzimir Bely via Xenomai wrote:
> This looks unneeded while bootstrapping is done in the same way
> in debian/rules file before the build.
> 
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
>   recipes-xenomai/xenomai/xenomai.inc | 17 -----------------
>   1 file changed, 17 deletions(-)
> 
> diff --git a/recipes-xenomai/xenomai/xenomai.inc b/recipes-xenomai/xenomai/xenomai.inc
> index fe84883..b8ec5bd 100644
> --- a/recipes-xenomai/xenomai/xenomai.inc
> +++ b/recipes-xenomai/xenomai/xenomai.inc
> @@ -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})

This is unrelated and must not be removed. It provides information about 
the actually built revision when using "latest" as version.

> -
> -    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

-- 
Siemens AG, Technology
Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [xenomai-images] [PATCH v2 2/2] linux-xenomai: handle xenomai-kernel patch in Debian way
  2022-01-18 10:51 ` [xenomai-images] [PATCH v2 2/2] linux-xenomai: handle xenomai-kernel patch in Debian way Uladzimir Bely
@ 2022-01-24 17:56   ` Jan Kiszka
  2022-01-27  5:08     ` Uladzimir Bely
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2022-01-24 17:56 UTC (permalink / raw)
  To: Uladzimir Bely, xenomai

On 18.01.22 11:51, Uladzimir Bely via Xenomai wrote:
> 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 <ubely@ilbers.de>
> ---
>   recipes-kernel/linux/linux-xenomai.inc | 13 ++++++++-----
>   1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/recipes-kernel/linux/linux-xenomai.inc b/recipes-kernel/linux/linux-xenomai.inc
> index 7dba96e..bd7db7d 100644
> --- a/recipes-kernel/linux/linux-xenomai.inc
> +++ b/recipes-kernel/linux/linux-xenomai.inc
> @@ -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

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

> +	fi
>   }

-- 
Siemens AG, Technology
Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [xenomai-images] [PATCH v2 2/2] linux-xenomai: handle xenomai-kernel patch in Debian way
  2022-01-24 17:56   ` Jan Kiszka
@ 2022-01-27  5:08     ` Uladzimir Bely
  0 siblings, 0 replies; 6+ messages in thread
From: Uladzimir Bely @ 2022-01-27  5:08 UTC (permalink / raw)
  To: xenomai, Jan Kiszka

In the email from понедельник, 24 января 2022 г. 20:56:31 +03 user Jan Kiszka 
wrote:
> On 18.01.22 11:51, Uladzimir Bely via Xenomai wrote:
> > 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 <ubely@ilbers.de>
> > ---
> > 
> >   recipes-kernel/linux/linux-xenomai.inc | 13 ++++++++-----
> >   1 file changed, 8 insertions(+), 5 deletions(-)
> > 
> > diff --git a/recipes-kernel/linux/linux-xenomai.inc
> > b/recipes-kernel/linux/linux-xenomai.inc index 7dba96e..bd7db7d 100644
> > --- a/recipes-kernel/linux/linux-xenomai.inc
> > +++ b/recipes-kernel/linux/linux-xenomai.inc
> > @@ -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
> 
> 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.

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.

> 
> Jan
> 
> > +	fi
> > 
> >   }






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-27  5:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18 10:51 [xenomai-images] [PATCH v2 0/2] Upcoming sbuild in Isar support Uladzimir Bely
2022-01-18 10:51 ` [xenomai-images] [PATCH v2 1/2] xenomai: remove bootstrap task from dpkg_runbuild_prepend Uladzimir Bely
2022-01-24 17:54   ` Jan Kiszka
2022-01-18 10:51 ` [xenomai-images] [PATCH v2 2/2] linux-xenomai: handle xenomai-kernel patch in Debian way Uladzimir Bely
2022-01-24 17:56   ` Jan Kiszka
2022-01-27  5:08     ` Uladzimir Bely

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.