Andrea Righi [Fri, 9 Dec 2022 15:38:48 +0000 (16:38 +0100)]
UBUNTU: [Packaging] annotations: do not hijack CONFIGS/* to update annotations
Files in CONFIGS/* have been always considered as "output" for
genconfigs. The annotations code changed those to be used both as output
(by genconfigs) and input (by updateconfigs), potentially breaking old
behaviors or old scripts that rely on the fact that CONFIGS/* files are
output-only.
Move temporary configs generated during updateconfigs to a proper
temporary directory.
Also drop config-check.log, because there's not really much value to
provide this file, since the changed config values can be easily
reviewed in annotations simply by running a git diff.
This exactly restores the previous behavior.
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Andrea Righi [Fri, 9 Dec 2022 15:14:55 +0000 (16:14 +0100)]
UBUNTU: [Packaging] kernelconfig: drop listnewconfigs
Now that everything is managed in annotations there is not much value to
provide a listnewconfigs command, the list of new config options can be
seen easily by looking at annotations after running updateconfigs and if
really needed new config options can easily generated by running
`make listnewconfig` directly.
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Andrea Righi [Fri, 9 Dec 2022 07:41:46 +0000 (08:41 +0100)]
UBUNTU: [Packaging] automatically apply changes to annotations and drop importconfigs
Having to run importconfigs to resync the changes from the configs into
annotations is slightly changing the previous workflow (since we're
implicitly adding an "importconfigs" step, rather than fixing/reviewing
the changes and modifying annotations manually).
We can make the whole process look a lot similar as before simply by
running the 'importconfigs' phase automatically after updateconfigs.
In this way we would still have the failed checks reported in output,
but we would automatically have all the changes applied to annotations
already, so they can be reviewed with a simple git diff, inspected and
adjusted if needed.
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Masahiro Yamada [Mon, 5 Dec 2022 08:56:17 +0000 (17:56 +0900)]
UBUNTU: [Packaging] simplify abinum and uploadnum definitions
I do not say that I fully understood this complex regex, but this
commit splits the debian revision at the first period - the first
half as abinum and the second as uploadnum.
Masahiro Yamada [Mon, 5 Dec 2022 08:56:16 +0000 (17:56 +0900)]
UBUNTU: [Packaging] install headers to debian/linux-libc-dev directly
The header installation is somewhat complex; 'make headers_install'
installs headers to debian/tmp-headers, then cpio copies them to
debian/linux-libc-dev, pruning '.*' files.
My best guess for the reason of this indirection is to avoid garbage
files contained in the packages.
In fact, "make headers_install" used to create dot files '.install'
and '.check' in the install destination.
Since Linux 5.3 (or more specifically since commit 59b2bd05f5f4),
headers_install does not install any dot files.
Specify the final destination to INSTALL_HDR_PATH, and you can get
clean installation.
Masahiro Yamada [Mon, 5 Dec 2022 08:56:15 +0000 (17:56 +0900)]
UBUNTU: [Packaging] use parralel builds in more places
Kbuild is designed to work correctly with parallel builds.
For Kconfig stage, header installation, or whatever. I do not
see any reason why these must run in a single thread.
Masahiro Yamada [Mon, 5 Dec 2022 08:56:14 +0000 (17:56 +0900)]
UBUNTU: [Packaging] use olddefconfig in stamp-prepare-tree
You do not need to invoke syncconfig here because Kbuild takes care of
it before staring the build. prepare and scripts are unneeded for the
same reason.
All the use of 'syncconfig' in debian/rules is suspicous because
syncconfig may stop to ask for user's preference when it finds a
new config option. There is nobody to answer the Kconfig's question
when the package is being built in auto-builders such as cbd, launchpad.
Presumably what you want here is olddefconfig, which is a non-interactive
command to set any config option to its default.
Masahiro Yamada [Mon, 5 Dec 2022 08:56:11 +0000 (17:56 +0900)]
UBUNTU: [Packaging] simplify revision/release
Use "dpkg-parsepackage -S version" to get the version, and use Make's
built-in functions to split it into the upsteam-version and the
debian revision. This is more readable and works more efficiently.
BTW, GNU Make >= 3.81 supports $(lastword x) as a shorthand of
$(word $(words x), x).
Drop "revisions" and "prev_revisions", which are unused anywhere
except "printenv".
I did not get the use of "?=" for revision and prev_revison, but
I am keeping them in case I am missing something here.
Masahiro Yamada [Mon, 5 Dec 2022 08:56:10 +0000 (17:56 +0900)]
UBUNTU: [Packaging] use dpkg-parsechangelog to get package name and series
dpkg-parsechangelog is more readable than the complex regex matching.
Also, use the simple variables (:=) instead of recursive variables (=)
since these are used over and over again. Invoking the shell every time
is not efficient.
Updating makefiles....
Considering target file 'debian/rules.d/4-checks.mk'.
Looking for an implicit rule for 'debian/rules.d/4-checks.mk'.
Trying pattern rule with stem '4-checks.mk'.
Trying implicit prerequisite 'debian/rules.d/4-checks.mk.o'.
Trying pattern rule with stem '4-checks.mk'.
Trying implicit prerequisite 'debian/rules.d/4-checks.mk.c'.
Trying pattern rule with stem '4-checks.mk'.
Trying implicit prerequisite 'debian/rules.d/4-checks.mk.cc'.
Trying pattern rule with stem '4-checks.mk'.
Trying implicit prerequisite 'debian/rules.d/4-checks.mk.C'.
Trying pattern rule with stem '4-checks.mk'.
Trying implicit prerequisite 'debian/rules.d/4-checks.mk.cpp'.
Trying pattern rule with stem '4-checks.mk'.
Trying implicit prerequisite 'debian/rules.d/4-checks.mk.p'.
Trying pattern rule with stem '4-checks.mk'.
Trying implicit prerequisite 'debian/rules.d/4-checks.mk.f'.
[ snip a tons of examinations for implicit rules ]
No implicit rule found for 'debian/rules.d/4-checks.mk'.
Finished prerequisites of target file 'debian/rules.d/4-checks.mk'.
No need to remake target 'debian/rules.d/4-checks.mk'.
[After]
Updating makefiles....
Considering target file 'debian/rules.d/4-checks.mk'.
Looking for an implicit rule for 'debian/rules.d/4-checks.mk'.
No implicit rule found for 'debian/rules.d/4-checks.mk'.
Finished prerequisites of target file 'debian/rules.d/4-checks.mk'.
Masahiro Yamada [Mon, 5 Dec 2022 08:56:08 +0000 (17:56 +0900)]
UBUNTU: [Packaging] Make the compiler for fix-filenames explicit
The rule for debian/scripts/fix-filenames:
$(CC) -o $@ $^
is fragile because 'CC' is not set anywhere in our Makefiles.
We rely on GNU Make using 'CC' in its internal database. This assumption
would break if the -R option is given. In this case, the line above
would expand to:
-o $@ $^
What is worse, GNU Make ignores errors if the recipe line starts with '-'.
(See the note below)
Then, GNU Make would proceed without building fix-filenames.
$ debian/rules -R debian/scripts/fix-filenames
o debian/scripts/fix-filenames debian/scripts/fix-filenames.c
/bin/bash: line 1: o: command not found
make: [debian/rules.d/2-binary-arch.mk:17: debian/scripts/fix-filenames] Error 127 (ignored)
Make the compiler explicit, and change the posion of -o to make it even
robust.
[Note]
Make manual "5.5 Errors in Recipes" [1] says:
To ignore errors in a recipe line, write a ‘-’ at the beginning of the
line’s text (after the initial tab). The ‘-’ is discarded before the
line is passed to the shell for execution.
Masahiro Yamada [Mon, 5 Dec 2022 08:56:07 +0000 (17:56 +0900)]
UBUNTU: [Packaging] mark phony targets
I added the .PHONY before each of the target rules.
If we add multiple phony targets to .PHONY in a single line,
as in debian/rules.d/0-common-vars.mk, it is difficult to parse
which target is missing the .PHONY marker.
Split the reading of the old modules and the checking of missing/new
modules into two separate blocks. This makes the code simpler and
easier to understand and also aligns it with similar code in the new
abi-check script.
Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com> Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
etc/kernelconfig is no longer needed with the new annotation scheme so
drop it. Check for its existence in the kernelconfig script until all
derivatives have migrated to the new scheme at which point this can be
dropped as well.
Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com> Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Andrea Righi [Mon, 5 Dec 2022 16:50:24 +0000 (17:50 +0100)]
UBUNTU: [Packaging] annotations: add an option to enable config autocompletion in bash
Type `source <(annotations --autocomplete)` to enable auto-completion of
config options (without the CONFIG_ prefix) in bash when running
annotations script commands.
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Andrea Righi [Mon, 5 Dec 2022 11:51:25 +0000 (12:51 +0100)]
UBUNTU: [Packaging] annotations: prevent generating .pyc files on import
We may end up adding these files to our git repos by mistake, so simply
prevent generating them in advance.
There's a tiny performance penalty with this change, because python
needs to re-generate the bytecode on-the-fly every time the annotations
script is called, but this overhead is absolutely negligible compared
the rest of the kernel build time.
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Andrea Righi [Mon, 5 Dec 2022 06:41:53 +0000 (07:41 +0100)]
UBUNTU: [Packaging] annotations: accept config options with or without CONFIG_ prefix
Allow to specify config options with or without CONFIG_ prefix in the
commands --write and --note, to be consistent with --query that already
accepts both formats.
Reported-by: Masahiro Yamada <masahiro.yamada@canonical.com> Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
In this case, for example, -lowlatency flavours inherits the config
values from -generic (both for amd64 and arm64) and -lowlatency-64
inherits the value from -generic-64k (only on arm64).
This allows to strongly reduce the size of annotations and helps to
read and review changes in annotations.
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Andrea Righi [Thu, 1 Dec 2022 10:03:05 +0000 (11:03 +0100)]
UBUNTU: [Packaging] annotations: allow to query using CONFIG_<option> or <option>
Allow to use CONFIG_FOO or just FOO when querying config options in
annotations.
This can help to speed up config update/reviews simply by doing
copy/paste from the console during an updateconfigs when checking values
from master or other kernels doing queries with annotations.
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Andrea Righi [Tue, 29 Nov 2022 08:59:58 +0000 (09:59 +0100)]
UBUNTU: [Packaging] migrate-annotations: properly determine arches in derivatives
Source debian.<kernel>/etc/kernelconfig instead of parsing it to
properly determine the list of supported architectures (this can fix
potential issues with derivatives).
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Andrea Righi [Tue, 15 Nov 2022 12:17:00 +0000 (13:17 +0100)]
UBUNTU: [Packaging] kernelconfig: provide listnewconfigs
Provide a target to generate list of new config options in CONFIGS/new-*
(this is useful after a rebase to determine only the subset of new
config options that have been introduced).
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Do not delete the CONFIGS folder, now that we only have annotations it
could be useful to compare the real configs with the information stored
in the annotations file.
Moreover, also save a log of the config-check and store it in the
CONFIGS folder to help reviewing the failed config checks.
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Andrea Righi [Mon, 14 Nov 2022 12:26:53 +0000 (13:26 +0100)]
UBUNTU: [Packaging] use annotations to generate initial configs check them
Fix debian build scripts to use annotations to generate initial configs.
Moreover, ignore the old config-check script, since the .config check
can be done using the annotations script itself (config-check will be
dropped later).
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Andrea Righi [Mon, 14 Nov 2022 11:36:40 +0000 (12:36 +0100)]
UBUNTU: [Packaging] config-check: do not strictly enforce CONFIG_CC_VERSION_TEXT
Do not check for CONFIG_CC_VERSION_TEXT to allow building the kernel
with different versions of gcc (otherwise we need to always keep the
build chroots in sync to run a test build).
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Haijun Liu [Thu, 10 Nov 2022 08:25:52 +0000 (16:25 +0800)]
net: wwan: t7xx: Add AP CLDMA
BugLink: https://bugs.launchpad.net/bugs/1990700
The t7xx device contains two Cross Layer DMA (CLDMA) interfaces to
communicate with AP and Modem processors respectively. So far only
MD-CLDMA was being used, this patch enables AP-CLDMA.
Rename small Application Processor (sAP) to AP.
Signed-off-by: Haijun Liu <haijun.liu@mediatek.com> Co-developed-by: Madhusmita Sahu <madhusmita.sahu@intel.com> Signed-off-by: Madhusmita Sahu <madhusmita.sahu@intel.com> Signed-off-by: Moises Veleta <moises.veleta@linux.intel.com> Signed-off-by: Devegowda Chandrashekar <chandrashekar.devegowda@intel.com> Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d20ef656f9942950d67e29418512a6929682ad60) Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
BugLink: https://bugs.launchpad.net/bugs/1982833 Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Cory Todd <cory.todd@canonical.com> Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>