On Tue, Jan 26, 2021 at 06:45:14PM +0100, Bastien Nocera wrote: > Add comments to mention that keymap files are generated, and list which > tool was used to generate them and the kernel source filename. > > This should make it less likely that generated files are used as > examples to contribute keymaps from, and more likely that upstream > changes are channeled through the right source tree. > > Signed-off-by: Bastien Nocera <hadess@xxxxxxxxxx> > --- > utils/keytable/gen_keytables.pl | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/utils/keytable/gen_keytables.pl b/utils/keytable/gen_keytables.pl > index c14aded3..40556479 100755 > --- a/utils/keytable/gen_keytables.pl > +++ b/utils/keytable/gen_keytables.pl > @@ -36,10 +36,15 @@ 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 "# Generated with gen_keytables.pl in v4l-utils\n"; > + print OUT "# using $relative_filename as a source file\n"; So on second thought, this is a good idea. How would feel about shortening it to one line, like: print OUT "# Generated with gen_keytables.pl from $relative_filename\n"; Thanks Sean > print OUT "[[protocols]]\n"; > print OUT "name = \"$keyname\"\n"; > print OUT "protocol = \"$type\"\n"; > -- > 2.29.2