NACK/Cmnt: [linux-uc20-efi][FOCAL][PATCH 2/2] UBUNTU: [Packaging] automatically detect flavours from build-deps

Dimitri John Ledkov dimitri.ledkov at canonical.com
Thu Jun 10 08:56:13 UTC 2021


On Wed, Jun 9, 2021 at 9:03 AM Stefan Bader <stefan.bader at canonical.com> wrote:
>
> On 08.06.21 13:56, Dimitri John Ledkov wrote:
> > Automatically detected from build-deps which flavours to build
> > kernel.efi apps for. This means that suffixes of
> > linux-image-unsigned-$(ABI)-* are used to determine the desired
> > flavours.
> >
> > If this parsing becomes insufficient, it might need to be updated to
> > use python-apt in the future, or encode flavours in
> > $(debian)/flavors.mk or some such.
> >
> > This makes it trivial to build derivative kernel.efi apps, by simply
> > adjusting appropriate control.stub with the desired flavour
> > build-deps.
> >
> > BugLink: https://bugs.launchpad.net/bugs/1931242
> > Signed-off-by: Dimitri John Ledkov <dimitri.ledkov at canonical.com>
> > ---
> >   debian/rules | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/debian/rules b/debian/rules
> > index f6e6ec0..18adb20 100755
> > --- a/debian/rules
> > +++ b/debian/rules
> > @@ -12,7 +12,7 @@ KERNEL_ABI_VERSION=$(shell echo "$(VERSION)" | sed -ne 's/\([0-9]*\.[0-9]*\.[0-9
> >
> >   DEB_HOST_ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)
> >
> > -FLAVOURS=generic lowlatency
> > +FLAVOURS=$(shell sed -n 's/linux-image-unsigned-$(KERNEL_ABI_VERSION)-//p' debian/control | sed 's/[ ,]//g')
>
> debian/control is a generated file. This will cause errors running clean after
> git clean -d -x -f and potentially could pick up the wrong flavours if there is
> a left over conrol. The latter might only be relevant once there are multiple
> efi intermediates since switching between normal kernels and those requires a
> git clean -d -x -f.
>

In Makefiles '=' is a lazy evaluated assignment, meaning it is only
evaluated and called when used.
clean target does not use the FLAVOURS variable, and I am not
anticipating it will be in the future.
Therefore there are no errors running clean after `git clean -d -x -f`.
FLAVOURS is only used during the build stage, that must be done after
invoking the clean target (as per debian policy)
Meaning wrong flavour will not be picked up from a stale control file
at build time.

$ git clean -d -x -f
Removing debian/changelog
Removing debian/control

$ fakeroot ./debian/rules clean
sed <debian.uc20-efi/control.stub >debian/control \
-e 's/@SERIES@/focal/g' \
-e 's/@KERNEL_ABI_VERSION@/5.4.0-74/g' \
-e 's/@SRCPKGNAME@/linux-uc20-efi/g'
cp debian.uc20-efi/changelog debian/changelog
dh_testdir
dh_testroot
rm -rf debian/tmp SIGNING
dh_clean
dh_clean: warning: Compatibility levels before 10 are deprecated
(level 9 in use)

Which errors are you seeing that I am not able to reproduce?

-- 
Regards,

Dimitri.



More information about the kernel-team mailing list