Re: [Ksummit-discuss] [PATCH RFC] scripts: add a script to handle Documentation/features

Mauro Carvalho Chehab
2019-06-17T19:45:57Z

Em Mon, 17 Jun 2019 20:11:16 +0200
Greg Kroah-Hartman <gregkh@linuxfoundation.org> escreveu:

> On Mon, Jun 17, 2019 at 03:05:07PM -0300, Mauro Carvalho Chehab wrote:
> > The Documentation/features contains a set of parseable files.
> > It is not worth converting them to ReST format, as they're
> > useful the way it is. It is, however, interesting to parse
> > them and produce output on different formats:
> >
> > 1) Output the contents of a feature in ReST format;
> >
> > 2) Output what features a given architecture supports;
> >
> > 3) Output a matrix with features x architectures.
> >
> > Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
> > ---
> >
> > As commented at KS mailing list, converting the Documentation/features
> > file to ReST may not be the best way to handle it.
> >
> > This script allows validating the features files and to generate ReST files
> > on three different formats.
> >
> > The goal is to support it via a sphinx extension, in order to be able to add
> > the features inside the Kernel documentation.
> >
> > scripts/get_feat.pl | 470 ++++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 470 insertions(+)
> > create mode 100755 scripts/get_feat.pl
> >
> > diff --git a/scripts/get_feat.pl b/scripts/get_feat.pl
> > new file mode 100755
> > index 000000000000..c5a267b12f49
> > --- /dev/null
> > +++ b/scripts/get_feat.pl
> > @@ -0,0 +1,470 @@
> > +#!/usr/bin/perl
> > +
>
> No SPDX line :(

Added.

I also added a Sphinx extension to handle it as well. You'll notice that it
is almost a copy of kernel_abi.py.

With regards to patch 2/2, it will generate both a feature x arch matrix
at the admin-guide and a x86-specific features list.

IMO, it makes sense to have a per-arch feature file just like the one
I added to x86. As the patches converting documentation for other archs
are still being merged via docs tree, before adding the features list to
the other arch documents, it seems better to wait to do it after the
next merge window.

Those patches are applied after the ABI patches on this dir:

https://git.linuxtv.org/mchehab/experimental.git/log/?h=abi_patches_v4.1

The output with both scripts are at:

https://www.infradead.org/~mchehab/rst_features/index.html

The relevant parts are: ABI:

https://www.infradead.org/~mchehab/rst_features/admin-guide/abi.html

Feature list x architecture (at admin-guide:

https://www.infradead.org/~mchehab/rst_features/admin-guide/features.html

X86 features:

https://www.infradead.org/~mchehab/rst_features/x86/features.html

While I didn't write a patch, with the new get_feat.pl script, we can probably
get rid of the previous shell script at:

Documentation/features/list-arch.sh

As calling:

./scripts/get_feat.pl current

Will output the same content (with a different format, though).

Thanks,
Mauro