From: Uladzimir Bely <ubely@ilbers.de>
To: xenomai@xenomai.org, Jan Kiszka <jan.kiszka@siemens.com>
Subject: Re: [xenomai-images] [PATCH v2 2/2] linux-xenomai: handle xenomai-kernel patch in Debian way
Date: Thu, 27 Jan 2022 08:08:30 +0300 [thread overview]
Message-ID: <1704169.9hSmTKtgW7@home> (raw)
In-Reply-To: <5991440c-9a6e-e460-8cbe-191113c44f12@siemens.com>
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
> >
> > }
prev parent reply other threads:[~2022-01-27 5:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1704169.9hSmTKtgW7@home \
--to=ubely@ilbers.de \
--cc=jan.kiszka@siemens.com \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.