On Mon, Jul 01, 2019 at 06:38:12PM +0200, Bastien Nocera wrote: > Add comments to mention that keymap files are generated, and that > they shouldn't be modified by hand. Also list which tool was used > to generate them and the kernel source filename. > > Signed-off-by: Bastien Nocera <had...@hadess.net> > --- > utils/keytable/gen_keytables.pl | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/utils/keytable/gen_keytables.pl b/utils/keytable/gen_keytables.pl > index 4124e366..3dc74ba6 100755 > --- a/utils/keytable/gen_keytables.pl > +++ b/utils/keytable/gen_keytables.pl > @@ -36,10 +36,17 @@ sub flush($$) > my $filename = shift; > my $legacy = shift; > my $defined; > + my $relative_filename = $filename; > > return if (!$keyname || !$out); > - print "Creating $dir/$keyname.toml\n"; > + $relative_filename =~ s/^$kernel_dir//; > + $relative_filename =~ s/^\///; > + print "Creating $dir/$keyname.toml from $relative_filename\n"; > open OUT, ">$dir/$keyname.toml"; > + print OUT "# This file is a generated data file, do not modify > manually\n"; > + print OUT "#\n"; > + print OUT "# Generated with gen_keytables.pl in v4l-utils\n"; > + print OUT "# using $relative_filename as a source file\n";
This is only relevant for a developer who is wanting to upstream their keymap changes to v4l-utils. If it should be documented somewhere it should be in the v4l-utils repo itself, so that anyone generating patches will notice before spending too much time making a patch on the keymaps directory. Also some remotes do not have definitions in the kernel, only in v4l-utils. For an end user who is trying to patch their keymap this is confusing. Someone who just wants to patch their keymap for their remote might be put off by this message; can they not simply edit the toml file? NAK, I'm afraid. > print OUT "[[protocols]]\n"; > print OUT "name = \"$keyname\"\n"; > print OUT "protocol = \"$type\"\n"; > -- > 2.21.0 Sean