NACK/Cmnt: [PATCH 2/2][FOCAL kernel-snaps-uc20] pc-lowlatency: snapcraft.yaml use pure snapcraft syntax

Dimitri John Ledkov dimitri.ledkov at canonical.com
Thu Jul 29 11:14:05 UTC 2021


On Thu, Jul 29, 2021 at 10:30 AM Stefan Bader
<stefan.bader at canonical.com> wrote:
>
> On 28.07.21 16:18, Dimitri John Ledkov wrote:
> > Use pure snapcraft syntax to package debs into a snap, with
> > declarative syntax for additional PPA repositories, packages to stage,
> > and reorg inside the kernel snap.
> >
> > This removes dependency on the Makefiles, and makes the snap always
> > buildable as ABI version is automatically selected. This makes it
> > possible to build this snapcraft.yaml in ESM and embargoed PPAs ahead
> > of public releases without cranking, simply by doing requestbuilds()
> > via API or launchpad WebUI. Once can still do empty git commit and
> > push to trigger builds with a code change. One can also build it
> > locally with multipass or lxd providers, remotely with remote-build,
> > or push to launchpad and create snap build there.
> >
> > Sample build at
> > https://launchpad.net/~xnox/+snap/xnox-lowlatency/+build/1478574
> >
> > Differences versus current snap:
> > - different locations of the copyright and license files
> > - lack of lib/{modules|firmware} ../{modules|firmware} symlinks, which
> >    are unused (?!)
> >
> > Signed-off-by: Dimitri John Ledkov <dimitri.ledkov at canonical.com>
> > ---
>
> This breaks tooling as it is. And I have not idea (as this never properly was
> discussed what would be the way to fix it.
>

Let me create a cranky update-snap patch that will still make it crankable.

But also add cranky snap-request-builds command to trigger rebuilds of
snaps crankless.

What does swm currently use to detect whether or not a snap got
cranked? does it look at versions in the snapstore? git tags? version
in snapcraft.yaml?

Would it help to split removal of version tag into stand alone change?


> -Stefan
>
> >   snapcraft.yaml | 43 +++++++++++++++++++++++++++++++------------
> >   1 file changed, 31 insertions(+), 12 deletions(-)
> >
> > diff --git a/snapcraft.yaml b/snapcraft.yaml
> > index acf96d8636..283ef172e6 100644
> > --- a/snapcraft.yaml
> > +++ b/snapcraft.yaml
> > @@ -1,23 +1,42 @@
> >   name: pc-lowlatency-kernel
> > -version: 5.4.0-80.90.1
> > +adopt-info: kernel
> >   summary: lowlatency linux kernel
> >   description: The lowlatency Ubuntu kernel package as a snap
> >   type: kernel
> > +grade: stable
> >   confinement: strict
> >   build-base: core20
> > +# In addition to these repositories, the /+snap/ page on launchpad may
> > +# also build with ESM repositories enabled, or built in a particular
> > +# PPA, which will also be used.
> > +package-repositories:
> > +  - type: apt
> > +    ppa: canonical-kernel-team/uc20-release
> > +  - type: apt
> > +    ppa: canonical-kernel-team/uc20-staging
> > +  - type: apt
> > +    ppa: canonical-kernel-team/proposed
> >
> >   parts:
> >     kernel:
> > -    source: git://git.launchpad.net/~canonical-kernel-snaps/+git/kernel-snaps-uc20
> > -    source-type: git
> > -    source-branch: master
> > -    plugin: make
> > -    make-parameters:
> > -      - KERNEL_SOURCE=focal:linux-uc20-efi
> > -      - KERNEL=linux-image-uc20-efi-lowlatency
> > -      - KERNEL_IMAGE_FORMAT=efi
> > -      - PROPOSED=true
> > +    plugin: nil
> > +    override-pull: |
> > +      snapcraftctl pull
> > +      snapcraftctl set-version "$(apt show linux-image-uc20-efi-lowlatency 2>/dev/null | sed -n 's/^Version: //p')"
> >       build-packages:
> > -      - gnupg
> >         - kmod
> > -      - lsb-release
> > +    stage-packages:
> > +      - linux-image-uc20-efi-lowlatency
> > +    override-build: |
> > +      snapcraftctl build
> > +      depmod -b $SNAPCRAFT_PART_INSTALL $(ls $SNAPCRAFT_PART_INSTALL/lib/modules)
> > +      mv $SNAPCRAFT_PART_INSTALL/boot/kernel.efi* $SNAPCRAFT_PART_INSTALL/boot/kernel.efi
> > +    organize:
> > +      boot/: /
> > +      lib/modules: modules
> > +      lib/firmware: firmware
> > +    stage:
> > +      - -usr/share/man
> > +      - -usr/lib/linux
> > +      - -lib/crda
> > +      - -lib/modprobe.d
> >
>
>
> --
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team



-- 
Regards,

Dimitri.



More information about the kernel-team mailing list