From 5930285206ba4fd661a68a0d0d9ccf9850620d82 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Mon, 1 May 2017 10:33:56 +0200 Subject: [PATCH] autoport: Add GPL boilerplate header to not empty .c files The idea behind this not to enforce a license on autogenerated code but is simply out of convenience in the case one wants to make the result public (in which case it needs to have these license headers). Change-Id: I1d6b48762b1249bb0becb178a30e1396bf6978fc Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/19510 Reviewed-by: Patrick Rudolph Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- util/autoport/azalia.go | 1 + util/autoport/bd82x6x.go | 3 +++ util/autoport/ec_lenovo.go | 20 ++------------------ util/autoport/main.go | 21 +++++++++++++++++++++ 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/util/autoport/azalia.go b/util/autoport/azalia.go index 2ee60d7335..c525189972 100644 --- a/util/autoport/azalia.go +++ b/util/autoport/azalia.go @@ -12,6 +12,7 @@ func (i azalia) Scan(ctx Context, addr PCIDevData) { az := Create(ctx, "hda_verb.c") defer az.Close() + Add_gpl(az) az.WriteString( `#include diff --git a/util/autoport/bd82x6x.go b/util/autoport/bd82x6x.go index ee7e207d25..796bc0fee5 100644 --- a/util/autoport/bd82x6x.go +++ b/util/autoport/bd82x6x.go @@ -43,6 +43,7 @@ func (b bd82x6x) GPIO(ctx Context, inteltool InteltoolData) { AddROMStageFile("gpio.c", "") + Add_gpl(gpio) gpio.WriteString("#include \n\n") addresses := [3][6]int{ @@ -305,6 +306,7 @@ func (b bd82x6x) Scan(ctx Context, addr PCIDevData) { sb := Create(ctx, "early_southbridge.c") defer sb.Close() AddROMStageFile("early_southbridge.c", "") + Add_gpl(sb) sb.WriteString(`#include #include #include @@ -401,6 +403,7 @@ void mainboard_get_spd(spd_raw_data *spd, bool id_only) gnvs := Create(ctx, "gnvs.c") defer gnvs.Close() + Add_gpl(gnvs) gnvs.WriteString(`#include /* FIXME: check this function. */ diff --git a/util/autoport/ec_lenovo.go b/util/autoport/ec_lenovo.go index a0d21f13c7..c2dd333c73 100644 --- a/util/autoport/ec_lenovo.go +++ b/util/autoport/ec_lenovo.go @@ -79,25 +79,9 @@ void h8_mainboard_init_dock (void) AddSMMFile("smihandler.c", "") + Add_gpl(smi) smi.WriteString( - `/* - * This file is part of the coreboot project. - * - * Copyright (C) 2008-2009 coresystems GmbH - * Copyright (C) 2014 Vladimir Serbinenko - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; version 2 of - * the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include + `#include #include #include #include diff --git a/util/autoport/main.go b/util/autoport/main.go index 2eb1588158..1d507802c9 100644 --- a/util/autoport/main.go +++ b/util/autoport/main.go @@ -207,6 +207,27 @@ func Create(ctx Context, name string) *os.File { return mf } +func Add_gpl(fp *os.File) { + fp.WriteString(`/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2014 Vladimir Serbinenko + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of + * the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +`) +} + func RestorePCI16Simple(f *os.File, pcidev PCIDevData, addr uint16) { fmt.Fprintf(f, " pci_write_config16(PCI_DEV(%d, 0x%02x, %d), 0x%02x, 0x%02x%02x);\n", pcidev.Bus, pcidev.Dev, pcidev.Func, addr,