137 Commits

Author SHA1 Message Date
Mehmet Basaran 71075d441a UBUNTU: [Packaging] update annotations scripts
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
2025-06-15 10:34:06 +03:00
Stefan Bader 91137688a1 UBUNTU: [Packaging] update annotations scripts
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2025-05-19 11:20:39 +02:00
Manuel Diewald 2e00a6fe44 UBUNTU: [Packaging] resync git-ubuntu-log
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com>
2024-11-30 19:17:26 +01:00
Magali Lemes d3e18e2b69 UBUNTU: [Packaging] Remove fips-checks script
BugLink: https://bugs.launchpad.net/bugs/2055083

This script is now part of `cranky` and there is no need for it to live
in debian/ anymore, so remove it.

Signed-off-by: Magali Lemes <magali.lemes@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
2024-05-01 15:55:10 +02:00
Roxana Nicolescu 782e3646d1 UBUNTU: [Packaging] update annotations scripts
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
2024-05-01 15:52:58 +02:00
Paolo Pisati 81914dd14e Revert "UBUNTU: [Packaging] Add debian/control sanity check"
This reverts commit 8482350050.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
2024-04-04 23:49:02 +02:00
Masahiro Yamada 056f4386aa UBUNTU: [Packaging] remove debian/scripts/misc/arch-has-odm-enabled.sh
On Ubuntu, /bin/sh is a symlink to /bin/dash by default.

While this is a rare use case, when /bin/sh is a symlink to /bin/bash,
the annotation check fails due to a mismatch of CONFIG_UBUNTU_ODM_DRIVERS.

debian/scripts/misc/arch-has-odm-enabled.sh always fails with bash.

You can see it if you directly execute it.

[with dash]

  $ dash debian/scripts/misc/arch-has-odm-enabled.sh amd64
  cat: debian/scripts/misc/../../../debian.master/rules.d/hooks.mk: No such file or directory
  $ echo $?
  0

[with bash]

  $ bash debian/scripts/misc/arch-has-odm-enabled.sh amd64
  cat: debian/scripts/misc/../../../debian.master/rules.d/hooks.mk: No such file or directory
  debian/scripts/misc/arch-has-odm-enabled.sh: line 26: return: can only `return' from a function or sourced script
  $ echo $?
  2

Bash provides stricter checks, hence the 'return' statement outside
a function leads to an error.

While it is trivial to fix, I wonder if we need this script in the
first place. Its purpose is to make CONFIG_UBUNTU_ODM_DRIVERS a
user-unconfigurable option.

Given debian.*/config/annotations specifying the CONFIG set for each
arch/flavour, why not handle CONFIG_UBUNTU_ODM_DRIVERS just like
other normal CONFIG options? Users are still allow to toggle it from
menuconfig etc., but I do not see a significant issue, as any trouble
comes to users' responsibility when they change CONFIG options by
themselves.

Signed-off-by: Masahiro Yamada <masahiro.yamada@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-04-04 23:49:01 +02:00
Juerg Haefliger 8482350050 UBUNTU: [Packaging] Add debian/control sanity check
BugLink: https://bugs.launchpad.net.bugs/2043994

Only the main linux source packages should produce linux-source-PKGVER
binary packages. Add a simple check that fails if debian/control looks
fishy.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
2024-03-11 09:41:27 +01:00
Juerg Haefliger 781aec4c13 UBUNTU: [Packaging] Remove update-dkms-versions and move dkms-versions
Remove the update-dkms-versions script from the tree, it's replaced by
'cranky update-dkms-versions', move the dkms-versions file and fix all
references to the old location.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
2024-03-11 09:41:24 +01:00
Dimitri John Ledkov 5f068dd3bc UBUNTU: [Packaging] Remove in-tree abi checks
linux-buildinfo packages are now externally compared by swm, with
results approving or rejecting updates based on the stable
tracker. Those checks also allow hints and overrides to accept
intentional changes.

Also these are done on the correct pair-wise comparisons, especially
when two streams are being cranked.

The above eliminates the need to identify previous build abi,
download, extract it, vendor it in, and assert it at build time.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
2024-03-11 09:41:23 +01:00
Andrea Righi 699c70c42e UBUNTU: [Packaging] resync getabis
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:41:20 +01:00
Dimitri John Ledkov bd433ee34b UBUNTU: [Packaging] Remove all custom retpoline-extract code
BugLink: https://bugs.launchpad.net/bugs/2046440

Now that retpoline & SLS mitigration checks are enforced during build
via objtool patch, drop all custom retpoline packaging, abi files, and
checks.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:41:19 +01:00
Marcelo Henrique Cerri ac9b3fe07b UBUNTU: [Packaging] Add a new fips-checks script
BugLink: https://bugs.launchpad.net/bugs/1945989

Add a new script responsible for checking if any FIPS relevant commit
was added since the last version. If a new change is found, a
corresponding entry should exist in the justifications file otherwise
the check will fail.

The justifications file is located at "${DEBIAN}/fips.justifications"
and should follow the following format for each commit justification:

<commit short message>

  <commit justification>

Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
(ported from commit 68d02506ae6b236d7df155cdcaa64456e9153d5e focal)
[magalilemes: added arch/arm64/crypto and lib/crypto/{sha1,aes}.c to
crypto_files; changed the way tag_prefix is set]
Signed-off-by: Magali Lemes <magali.lemes@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:41:11 +01:00
Roxana Nicolescu 6c70187239 UBUNTU: [Debian] autoreconstruct - Do not generate chmod -x for deleted files
BugLink: https://bugs.launchpad.net/bugs/2045562

Debian source format 1.0 cannot remove files, create symlinks and change
permission in the .diff.gz tarball. Therefore any changes in these 3
categories cannot be represented without any tricks. To solve this,
the `reconstruct` script is used every time we build the source package.
The script is generated by `gen-auto-reconstruct` script by the `cranky
close`. It checks if there has been any changes in the 3 categories
mentioned above between the upstream version (i.e v6.5) and the current one.
The problem with the script is that in case a file A was removed since the
upstream version was released, the `reconstruct` script will contains
these commands in this exact order:
        rm -f A
        chmod -x A
The second command will fail because file A does not exist anymore.
This is solved by generating the `chmod +/-x` commands before `rm`.
Which results in:
        chmod -x A
        rm -f A
But because the reconstruct script is used during `clean` rule which is
triggered pretty much during every cranky step which is run in the
source repo, the first command will always file because file is not
present anymore in the tree. To solve this, any `chmod` change is added
only if the file has not been deleted. Therefore if file A has been
deleted, the `reconstruct` script will contain only this:
        rm -f A

Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
Acked-by: Manuel Diewald <manuel.diewald@canonical.com>
Acked-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:41:09 +01:00
Andrea Righi 63a035ca10 UBUNTU: [Packaging] update annotations scripts
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:41:09 +01:00
Andrea Righi de99603f20 UBUNTU: [Packaging] remove helper scripts
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:41:08 +01:00
Juerg Haefliger a457ccd24f UBUNTU: [Packaging] scripts: Rewrite insert-ubuntu-changes in Python
Jira: https://warthogs.atlassian.net/browse/KERNTT-666
Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Acked-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
2024-03-11 09:41:07 +01:00
Juerg Haefliger c016043fd3 UBUNTU: [Packaging] Remove obsolete scripts
Remove the following old scripts which are no longer used:
  - fw-to-ihex.sh
  - insert-mainline-changes
  - retag
  - sanitize-annotations
  - splitconfig.pl
  - update-aufs.sh

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Acked-by: Agathe Porte <agathe.porte@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
2024-03-11 09:41:06 +01:00
Juerg Haefliger 70242d8162 UBUNTU: [Packaging] Remove support for sub-flavors
Sub-flavors were a concept in Maverick and earlier. In fact, it was
removed later in Maverick but that commit was not carried forward to
Natty so it's still here. Finally get rid of it.

(forwardported from commit db54f0fec701e97b829f0abb2750c30464b38dec maverick/linux)
Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Acked-by: Agathe Porte <agathe.porte@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
2024-03-11 09:41:06 +01:00
Andrea Righi 391e856f92 UBUNTU: [Packaging] update helper scripts
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:41:04 +01:00
Andrea Righi 0b411127d2 UBUNTU: [Packaging] update annotations scripts
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:41:04 +01:00
Paolo Pisati 8f621360fc UBUNTU: [Packaging] resync git-ubuntu-log
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
2024-03-11 09:41:03 +01:00
Andrea Righi 5dc1f73659 UBUNTU: [Packaging] update helper scripts
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:54 +01:00
Andrea Righi 28cc92b2c0 UBUNTU: [Packaging] resync getabis
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:49 +01:00
Juerg Haefliger fcda365ceb UBUNTU: [Packaging] checks/final-checks: Fix shellcheck issues
Fix the following shellcheck reported issues:
  - SC2145 (error): Argument mixes string and array. Use * or separate argument.
  - SC2166 (warning): Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
  - SC2086 (info): Double quote to prevent globbing and word splitting.
  - SC2140 (warning): Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"?
  - SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.
  - SC2001 (style): See if you can use ${variable//search/replace} instead.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Andrei Gherzan <andrei.gherzan@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:48 +01:00
Juerg Haefliger 6fd7f75e20 UBUNTU: [Packaging] checks/final-checks: check existance of Makefile first
Check that the per-arch Makefile exists before trying to read it.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Andrei Gherzan <andrei.gherzan@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:48 +01:00
Juerg Haefliger 72456d5e26 UBUNTU: [Packaging] checks/final-checks: Remove old configs handling
There are still some references to the old config/config.common.ubuntu file
which no longer exists, so remove them.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Andrei Gherzan <andrei.gherzan@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:48 +01:00
Andrea Righi 81311e5461 UBUNTU: [Packaging] update annotations scripts
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:45 +01:00
Andrea Righi 047ad5bf46 UBUNTU: [Packaging] resync getabis
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:42 +01:00
Andrea Righi ce4766e520 UBUNTU: [Packaging] resync git-ubuntu-log
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:42 +01:00
Andrea Righi 4795aa23f8 UBUNTU: [Packaging] annotations: never drop configs that have notes different than the parent
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:41 +01:00
Andrea Righi b967072613 UBUNTU: [Packaging] kconfig/annotations.py: support older way of merging dicts
BugLink: https://bugs.launchpad.net/bugs/2020531

The '|=' update operator for merging dicts is available starting in
python 3.9 however in focal we have python 3.8, which causes the
annotation parsing script to crash.

Support also the old way of merging dicts available since python 3.5
that uses dict unpacking, e.g. dict1 = {**dict1, **dict2}

Signed-off-by: Luke Nowakowski-Krijger <luke.nowakowskikrijger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:41 +01:00
Juerg Haefliger c66e49e483 UBUNTU: [Packaging] Drop support of old config handling
All kernels and their derivatives have been migrated to the new annotations
scheme by now so clean up the tree and drop the support of the old config
handling.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:40 +01:00
Andrea Righi 982457eeb1 UBUNTU: [Packaging] update helper scripts
BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:39 +01:00
Andrea Righi ebc5a672c7 UBUNTU: [Packaging] introduce a separate linux-lib-rust package
BugLink: https://bugs.launchpad.net/bugs/2015867

After enabling Rust in the kernel, the size of linux-headers increased
consistently.

Some work has been done to reduce the size, such as dropping the binary
artifacts (*.o and *.cmd), but it would be nice to keep the size of
linux-headers reasonably small to avoid wasting too much space in the
cloud images.

For this reason introduce a new package linux-lib-rust to ship all the
Rust headers and libraries required to build out-of-tree kernel modules
in Rust.

Before this patch: 96M	/usr/src/linux-headers-6.2.0-21-generic
 After this patch: 29M	/usr/src/linux-headers-6.2.0-21-generic

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:38 +01:00
Andrea Righi a6e925fc62 UBUNTU: [Packaging] annotations: use python3 in the shebang
Make sure to not depend on python-is-python3 and explicitly use python3
for the main script.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:38 +01:00
Andrea Righi 337c7eeb4a UBUNTU: [Packaging] ignore KBUILD_VERBOSE in arch-has-odm-enabled.sh
Recent kernels don't seem to set KBUILD_VERBOSE anymore, also checking
this variable to determine if we need to enable/disable Ubuntu ODM
drivers does not make any sense, so simply disable this check.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:35 +01:00
Roxana Nicolescu fafa7da28c UBUNTU: [Debian] autoreconstruct - fix restoration of execute permissions
BugLink: http://bugs.launchpad.net/bugs/2015498

Debian source package diffs cannot represent that a file should be
executable.
gen-auto-reconstruct detects the situations where a file has changed
its permissions and restores the execute permissions in the
reconstruct script, assuming the file has always had execute permission.
This does not work in case a file removed the execute permission because
the script will change it back.

The script now adds either `chmod +x` or `chmod -x` based on the actual
permission change.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
Acked-by: Andrei Gherzan <andrei.gherzan@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Cory Todd <cory.todd@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
2024-03-11 09:40:34 +01:00
Juerg Haefliger 6cee3921f9 UBUNTU: [Packaging] checks/final-checks: Honor 'do_skip_checks'
The final-checks script is doing some final ABI checkig that should be
skipped if 'do_skip_checks' is true. Just like the other checker scripts
in debian/scripts/checks.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
2024-03-11 09:40:34 +01:00
Juerg Haefliger 2a272fbe40 UBUNTU: [Packaging] Move final-checks script to debian/scripts/checks
Move the final-checks script to debian/scripts/checks so that all the
checker scripts are in one place.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
2024-03-11 09:40:34 +01:00
Andrea Righi 281ad73637 UBUNTU: [Packaging] annotations: prevent duplicate include lines
Includes are always parsed recursively, but when we save them (e.g.,
when the annotations file is updated) we should always save only the
top-level includes, without repeating the recursive ones.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:33 +01:00
Dimitri John Ledkov f907196681 UBUNTU: [Packaging] Preserve the correct log file variable value
In successful builds, ensure that log variable remains set to the
correct value, such that further processing can be done on it for the
lrm builds.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:30 +01:00
Dimitri John Ledkov 5746790504 UBUNTU: [Packaging] actually enforce set -e in dkms-build--nvidia-N
The current code is effectively this:

  set -e; (false; true) || exit "$?"

Due to historical reasons any code inside a pipeline is executed with
`set +e` mode effective, meaning false command doesn't return, the
rest of commands are executed, and the error code from () is set to
the last (usually successful) command.

This is the reason, why my previous buggy behaviour despite generating
errors inside the dkms-build--nvidia-N didn't abort the build, but
happily produced linux-nvidia-objects.deb which contained empty
SHA256SUMS file and broken BUILD CLEAN scripts that did nothing.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:30 +01:00
Dimitri John Ledkov 8b1d918149 UBUNTU: [Packaging] Support skipped dkms modules
In recent releases we have fixed up most dkms modules to correctly
detect, and skip building dkms modules when compiling against
incompatible kernels. For example, trying to build a WiFi driver
against a kernel without 80221 config enabled, results in dkms
returning error code 9 skipped build, due to incompatibility. Our DKMS
autopkgtests already honor such cases, and mark test results as
passing for skipped {kernel, dkms-module} combinations.

Improve kernel's dkms-build script to distinguish failed versus
skipped builds, by propagating exact status code. For standalone
skipped dkms modules, skip generating an empty deb packages.

Also do not fail over missing make.log for the skipped dkms builds,
which do not have one.

This change will enable us to use a static list of dkms-versions
across all kernels, without need to do anything special for cases were
a vendored dkms module is declared incompatible in dkms.conf for a
given kernel.

For example, v4l2loopback incompatible with cloud kernels that do not
enable CONFIG_VIDEO, or backports-iwlwifi incompatible with kvm
kernel.

This patch is tested against working, skipepd, and FTBFS dkms modules,
which correctly built the full kernel, skipped some dkms modules, or
failed the overall build.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:30 +01:00
Andrea Righi ad500f1b65 UBUNTU: [Packaging] propagate makefile variables to kernelconfig
BugLink: https://bugs.launchpad.net/bugs/2007654

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:28 +01:00
Andrea Righi 7ecfc3dd9d UBUNTU: [Packaging] annotations: various code cleanups
kconfig: Fix pylint violations

Fix the following:
R0205: Class 'Config' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance)
E1101: Instance of 'Config' has no '_parse' member (no-member)
W0613: Unused argument 'arch' (unused-argument)
W0613: Unused argument 'flavour' (unused-argument)
W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
R0201: Method could be a function (no-self-use)
E1101: Instance of 'Config' has no 'config' member (no-member)
W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
W0105: String statement has no effect (pointless-string-statement)
W0123: Use of eval (eval-used)
W0102: Dangerous default value [] as argument (dangerous-default-value)
R1723: Unnecessary "elif" after "break" (no-else-break)
R1705: Unnecessary "elif" after "return" (no-else-return)
R1704: Redefining argument with the local name 'arch' (redefined-argument-from-local)

Signed-off-by: Juerg Haefliger <juergh@proton.me>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:26 +01:00
Juerg Haefliger f1781299e3 UBUNTU: [Packaging] annotations: Check validity of FLAVOUR_DEP
FLAVOUR_DEP is used to map flavors from the main annotations file to
flavors from includes. Currently, there is no check that any of the
listed flavors exists or is valid so the resulting behavior is
(probably) undefined/unexpected. Add a sanity check to verify the
FLAVOUR_DEP flavors.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:26 +01:00
Juerg Haefliger 007607d60c UBUNTU: [Packaging] annotations: Write out annotations with notes first
When writing the annotations file, separate them  into two groups: With
and without a note. Write the group with notes first and separate the
other group with a visual marker.

The idea is that all configs that are set/modified manually should have
an annotation note and putting them at the top of the annotations file
should make it easier to figure out what the config of this kernel is
about.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:26 +01:00
Juerg Haefliger e011f2959f UBUNTU: [Packaging] annotations: Fail on invalid lines
Currently, invalid lines are silently ignored, which is not good.
Fix this by raising an exception if the line can't be parsed. While at
it, remove one level of nesting by using if-continue.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:26 +01:00
Juerg Haefliger 7e9800b36e UBUNTU: [Packaging] annotations: Handle tabs in annotations file
Handle tabs in the annotations file by replacing them with spaces.
While at make the parsing more robust by removing leading and trailing
whitespaces and ignoring empty lines.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-03-11 09:40:26 +01:00