Nicholas Chin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/84329?usp=email )
Change subject: util/autoport: Add function to create empty files ......................................................................
util/autoport: Add function to create empty files
As per commit cf4722d317ea (src/mb: Update unlicensable files with the CC-PDDC SPDX ID) effectively empty files should use the Creative Commons Public Domain Dedication and Certification (CC-PDDC) license header. Add a function to create an empty file and add the CC-PDDC SPDX header and a comment to change the license if content is added.
The only empty files that autoport currently generates are ec.asl and superio.asl on non-laptop systems, where NoEC() is used.
Change-Id: I409a6d90d671258e318c26e34a35c238d6fd28c1 Signed-off-by: Nicholas Chin nic.c3.14@gmail.com --- M util/autoport/ec_none.go M util/autoport/main.go 2 files changed, 12 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/29/84329/1
diff --git a/util/autoport/ec_none.go b/util/autoport/ec_none.go index a1a0df9..ceb84a0 100644 --- a/util/autoport/ec_none.go +++ b/util/autoport/ec_none.go @@ -16,9 +16,6 @@ } `)
- si := Create(ctx, "acpi/superio.asl") - defer si.Close() - - ec := Create(ctx, "acpi/ec.asl") - defer ec.Close() + Create_Empty(ctx, "acpi/superio.asl", ASL) + Create_Empty(ctx, "acpi/ec.asl", ASL) } diff --git a/util/autoport/main.go b/util/autoport/main.go index c4f884a9..62511e3 100644 --- a/util/autoport/main.go +++ b/util/autoport/main.go @@ -120,8 +120,9 @@ type License string
const ( - GPL2_only License = "GPL-2.0-only" - GPL2_or_later = "GPL-2.0-or-later" + CC_PDDC License = "CC-PDDC" + GPL2_only = "GPL-2.0-only" + GPL2_or_later = "GPL-2.0-or-later" )
var KconfigBool map[string]bool = map[string]bool{} @@ -233,6 +234,13 @@ } return mf } +func Create_Empty(ctx Context, name string, filetype Filetype) *os.File { + f := Create(ctx, name) + defer f.Close() + Add_SPDX(f, filetype, CC_PDDC) + Add_Comment(f, filetype, + "Please update the license if adding licensable material.") +}
func Add_SPDX(f *os.File, filetype Filetype, license License) { Add_Comment(f, filetype, "SPDX-License-Identifier: " + string(license))