diff mbox series

[bpf-next] bpftool: Add SPDX identifier to btf-dump-file output

Message ID 1d2931e80c03f4d3f7263beaf8f19a4867e9fe32.1647212431.git.dxu@dxuuu.xyz (mailing list archive)
State Rejected
Delegated to: BPF
Headers show
Series [bpf-next] bpftool: Add SPDX identifier to btf-dump-file output | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 7 maintainers not CCed: netdev@vger.kernel.org quentin@isovalent.com songliubraving@fb.com yhs@fb.com john.fastabend@gmail.com kafai@fb.com kpsingh@kernel.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch warning WARNING: Misplaced SPDX-License-Identifier tag - use line 1 instead
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next success VM_Test

Commit Message

Daniel Xu March 13, 2022, 11:01 p.m. UTC
A concern about potential GPL violations came up at the new $DAYJOB when
I tried to vendor the vmlinux.h output. The central point was that the
generated vmlinux.h does not embed a license string -- making the
licensing of the file non-obvious.

This commit adds a LGPL-2.1 OR BSD-2-Clause SPDX license identifier to
the generated vmlinux.h output. This is line with what bpftool generates
in object file skeletons.

Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
---
 tools/bpf/bpftool/btf.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Alexei Starovoitov March 15, 2022, 9:38 p.m. UTC | #1
On Sun, Mar 13, 2022 at 4:01 PM Daniel Xu <dxu@dxuuu.xyz> wrote:
>
> A concern about potential GPL violations came up at the new $DAYJOB when
> I tried to vendor the vmlinux.h output. The central point was that the
> generated vmlinux.h does not embed a license string -- making the
> licensing of the file non-obvious.
>
> This commit adds a LGPL-2.1 OR BSD-2-Clause SPDX license identifier to
> the generated vmlinux.h output. This is line with what bpftool generates
> in object file skeletons.
>
> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
> ---
>  tools/bpf/bpftool/btf.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
> index a2c665beda87..fca810a27768 100644
> --- a/tools/bpf/bpftool/btf.c
> +++ b/tools/bpf/bpftool/btf.c
> @@ -425,6 +425,7 @@ static int dump_btf_c(const struct btf *btf,
>         if (err)
>                 return err;
>
> +       printf("/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */\n\n");

I don't think we can add any kind of license identifier
to the auto generated output.
vmlinux.h is a pretty printed dwarfdump.
Daniel Xu March 15, 2022, 11:10 p.m. UTC | #2
Hi Alexei,

On Tue, Mar 15, 2022, at 2:38 PM, Alexei Starovoitov wrote:
> On Sun, Mar 13, 2022 at 4:01 PM Daniel Xu <dxu@dxuuu.xyz> wrote:
>>
>> A concern about potential GPL violations came up at the new $DAYJOB when
>> I tried to vendor the vmlinux.h output. The central point was that the
>> generated vmlinux.h does not embed a license string -- making the
>> licensing of the file non-obvious.
>>
>> This commit adds a LGPL-2.1 OR BSD-2-Clause SPDX license identifier to
>> the generated vmlinux.h output. This is line with what bpftool generates
>> in object file skeletons.
>>
>> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
>> ---
>>  tools/bpf/bpftool/btf.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
>> index a2c665beda87..fca810a27768 100644
>> --- a/tools/bpf/bpftool/btf.c
>> +++ b/tools/bpf/bpftool/btf.c
>> @@ -425,6 +425,7 @@ static int dump_btf_c(const struct btf *btf,
>>         if (err)
>>                 return err;
>>
>> +       printf("/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */\n\n");
>
> I don't think we can add any kind of license identifier
> to the auto generated output.
> vmlinux.h is a pretty printed dwarfdump.

Just so I understand better, when you say "I don't think we can",
do you mean:

1) There may be legal issues w/ adding the license identifier
2) It doesn't make sense to add the license header
3) Something else?

Thanks,
Daniel
Alexei Starovoitov March 15, 2022, 11:39 p.m. UTC | #3
On Tue, Mar 15, 2022 at 4:10 PM Daniel Xu <dxu@dxuuu.xyz> wrote:
>
> Hi Alexei,
>
> On Tue, Mar 15, 2022, at 2:38 PM, Alexei Starovoitov wrote:
> > On Sun, Mar 13, 2022 at 4:01 PM Daniel Xu <dxu@dxuuu.xyz> wrote:
> >>
> >> A concern about potential GPL violations came up at the new $DAYJOB when
> >> I tried to vendor the vmlinux.h output. The central point was that the
> >> generated vmlinux.h does not embed a license string -- making the
> >> licensing of the file non-obvious.
> >>
> >> This commit adds a LGPL-2.1 OR BSD-2-Clause SPDX license identifier to
> >> the generated vmlinux.h output. This is line with what bpftool generates
> >> in object file skeletons.
> >>
> >> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
> >> ---
> >>  tools/bpf/bpftool/btf.c | 1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
> >> index a2c665beda87..fca810a27768 100644
> >> --- a/tools/bpf/bpftool/btf.c
> >> +++ b/tools/bpf/bpftool/btf.c
> >> @@ -425,6 +425,7 @@ static int dump_btf_c(const struct btf *btf,
> >>         if (err)
> >>                 return err;
> >>
> >> +       printf("/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */\n\n");
> >
> > I don't think we can add any kind of license identifier
> > to the auto generated output.
> > vmlinux.h is a pretty printed dwarfdump.
>
> Just so I understand better, when you say "I don't think we can",
> do you mean:
>
> 1) There may be legal issues w/ adding the license identifier
> 2) It doesn't make sense to add the license header
> 3) Something else?

2
Daniel Xu March 16, 2022, 4:57 a.m. UTC | #4
On Tue, Mar 15, 2022, at 4:39 PM, Alexei Starovoitov wrote:
> On Tue, Mar 15, 2022 at 4:10 PM Daniel Xu <dxu@dxuuu.xyz> wrote:
>>
>> Hi Alexei,
>>
>> On Tue, Mar 15, 2022, at 2:38 PM, Alexei Starovoitov wrote:
>> > On Sun, Mar 13, 2022 at 4:01 PM Daniel Xu <dxu@dxuuu.xyz> wrote:
>> >>
>> >> A concern about potential GPL violations came up at the new $DAYJOB when
>> >> I tried to vendor the vmlinux.h output. The central point was that the
>> >> generated vmlinux.h does not embed a license string -- making the
>> >> licensing of the file non-obvious.
>> >>
>> >> This commit adds a LGPL-2.1 OR BSD-2-Clause SPDX license identifier to
>> >> the generated vmlinux.h output. This is line with what bpftool generates
>> >> in object file skeletons.
>> >>
>> >> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
>> >> ---
>> >>  tools/bpf/bpftool/btf.c | 1 +
>> >>  1 file changed, 1 insertion(+)
>> >>
>> >> diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
>> >> index a2c665beda87..fca810a27768 100644
>> >> --- a/tools/bpf/bpftool/btf.c
>> >> +++ b/tools/bpf/bpftool/btf.c
>> >> @@ -425,6 +425,7 @@ static int dump_btf_c(const struct btf *btf,
>> >>         if (err)
>> >>                 return err;
>> >>
>> >> +       printf("/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */\n\n");
>> >
>> > I don't think we can add any kind of license identifier
>> > to the auto generated output.
>> > vmlinux.h is a pretty printed dwarfdump.
>>
>> Just so I understand better, when you say "I don't think we can",
>> do you mean:
>>
>> 1) There may be legal issues w/ adding the license identifier
>> 2) It doesn't make sense to add the license header
>> 3) Something else?
>
> 2

Got it, thanks.
diff mbox series

Patch

diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
index a2c665beda87..fca810a27768 100644
--- a/tools/bpf/bpftool/btf.c
+++ b/tools/bpf/bpftool/btf.c
@@ -425,6 +425,7 @@  static int dump_btf_c(const struct btf *btf,
 	if (err)
 		return err;
 
+	printf("/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */\n\n");
 	printf("#ifndef __VMLINUX_H__\n");
 	printf("#define __VMLINUX_H__\n");
 	printf("\n");