diff --git a/README.md b/README.md index 8d0f7f5..adfb86d 100644 --- a/README.md +++ b/README.md @@ -54,18 +54,12 @@ For additional info as well as precompiled drivers, see https://efi.akeo.ie ``` build -a X64 -b RELEASE -t -p EfiFsPkg/EfiFsPkg.dsc ``` - where `` is something like `VS2015` (Windows) or `GCC5` (Linux). + where `` is something like `VS2019` (Windows) or `GCC5` (Linux). NB: To build an individual driver, such as NTFS, you can also use something like: ``` build -a X64 -b RELEASE -t -p EfiFsPkg/EfiFsPkg.dsc -m EfiFsPkg/EfiFsPkg/Ntfs.inf ``` -* Note that, provided that you cloned a recent EDK2 from git, you should be able - to use `VS2019` as your EDK2 toolchain, including for buidling the ARM or - ARM64 drivers, with something like: - ``` - build -a AARCH64 -b RELEASE -t VS2019 -p EfiFsPkg/EfiFsPkg.dsc - ``` * A Windows script to build the drivers, using EDK2 with VS2019 is also provided as `edk2_build_drivers.cmd`. @@ -102,6 +96,11 @@ This is a pure GPLv3+ implementation of EFI drivers. Great care was taken not to use any code from non GPLv3 compatible sources, such as rEFInd's `fsw_efi` (GPLv2 only) or Intel's FAT driver (requires an extra copyright notice). +Note however that some files (the non `grub_####` sources under `./src/`) are +licensed under GPLv2+ rather than GPLv3+ and that, just like the GPLv3+ sources, +we took great care of ensuring that we are fully compliant with any licensing +or relicensing matters, so that they can legally be reused into GPLv2+ works. + ## Bonus: Commands to compile EfiFs using EDK2 on a vanilla Debian GNU/Linux 10.x As root: diff --git a/debug.vbs b/debug.vbs index e642eb6..56be028 100644 --- a/debug.vbs +++ b/debug.vbs @@ -1,4 +1,18 @@ ' Visual Studio QEMU debugging script. +' Copyright © 2014-2021 Pete Batard +' +' 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, either version 2 of the License, or +' (at your option) any later version. +' +' 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. +' +' You should have received a copy of the GNU General Public License +' along with this program. If not, see . ' ' I like invoking vbs as much as anyone else, but we need to download and unzip a ' bunch of files, as well as launch QEMU, and neither Powershell or a standard batch diff --git a/src/driver.c b/src/driver.c index d2678da..815f070 100644 --- a/src/driver.c +++ b/src/driver.c @@ -4,9 +4,14 @@ * Based on iPXE's efi_driver.c and efi_file.c: * Copyright © 2011,2013 Michael Brown . * + * Note: This file has been relicensed from GPLv3+ to GPLv2+ by formal + * agreement of all of the contributors who applied changes on top of + * its original GPLv2+ source. The original source can be found at: + * https://github.com/ipxe/ipxe/blob/26029658063dcafcca746640a28a76d4f7f4a66e/src/interface/efi/efi_driver.c + * * 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, either version 3 of the License, or + * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/driver.h b/src/driver.h index 181bcc8..482209a 100644 --- a/src/driver.h +++ b/src/driver.h @@ -2,9 +2,12 @@ /* * Copyright © 2014-2020 Pete Batard * + * Note: This file has been relicensed from GPLv3+ to GPLv2+ by formal + * agreement of all of its contributors. + * * 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, either version 3 of the License, or + * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -205,9 +208,7 @@ extern CHAR16 *ShortDriverName, *FullDriverName; extern GRUB_MOD_INIT GrubModuleInit[]; extern GRUB_MOD_EXIT GrubModuleExit[]; -extern VOID strcpya(CHAR8 *dst, CONST CHAR8 *src); -extern CHAR8 *strchra(const CHAR8 *s, INTN c); -extern CHAR8 *strrchra(const CHAR8 *s, INTN c); +#define strcpya(dst, src) CopyMem(dst, src, strlena(src) + 1) extern VOID SetLogging(VOID); extern VOID PrintStatus(EFI_STATUS Status); extern VOID GrubDriverInit(VOID); diff --git a/src/file.c b/src/file.c index 59749e9..29ee598 100644 --- a/src/file.c +++ b/src/file.c @@ -4,9 +4,14 @@ * Based on iPXE's efi_driver.c and efi_file.c: * Copyright © 2011,2013 Michael Brown . * + * Note: This file has been relicensed from GPLv3+ to GPLv2+ by formal + * agreement of all of the contributors who applied changes on top of + * its original GPLv2+ source. The original source can be found at: + * https://github.com/ipxe/ipxe/blob/26029658063dcafcca746640a28a76d4f7f4a66e/src/interface/efi/efi_file.c + * * 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, either version 3 of the License, or + * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -128,7 +133,7 @@ FileOpen(EFI_FILE_HANDLE This, EFI_FILE_HANDLE *New, path[i] = '/'; } - /* We only want to handle with absolute paths */ + /* We only want to handle absolute paths */ clean_path[0] = '/'; /* Find out if we're dealing with root by removing the junk */ CopyPathRelative(&clean_path[1], path, MAX_PATH - 1); diff --git a/src/logging.c b/src/logging.c index 059baf0..d208b2a 100644 --- a/src/logging.c +++ b/src/logging.c @@ -2,9 +2,12 @@ /* * Copyright © 2014-2017 Pete Batard * + * Note: This file has been relicensed from GPLv3+ to GPLv2+ by formal + * agreement of all of its contributors. + * * 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, either version 3 of the License, or + * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/missing.c b/src/missing.c index 355bf44..128519a 100644 --- a/src/missing.c +++ b/src/missing.c @@ -1,12 +1,16 @@ /* missing.c - Missing convenience calls from the EFI interface */ /* - * Copyright © 2014-2017 Pete Batard - * Based on GRUB -- GRand Unified Bootloader - * Copyright © 1999-2010 Free Software Foundation, Inc. + * Copyright © 2014-2021 Pete Batard * + * NB: This file was relicensed from GPLv3+ to GPLv2+ by its author. + * Per https://github.com/pbatard/efifs/commit/6472929565970fc88fbad479c5973898c3275235#diff-e4e188b933de262cfdf4c2be771da37b2ec89ba97d353a16352c6eebb41a286f + * you can confirm that we did remove the initial 3 function calls + * that were derived from GPLv3+ work, thus granting us the ability + * to relicense this file. + * * 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, either version 3 of the License, or + * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -25,39 +29,6 @@ #pragma comment(linker, "/INCLUDE:_MultS64x64") #endif -VOID -strcpya(CHAR8 *dst, CONST CHAR8 *src) -{ - INTN len = strlena(src) + 1; - CopyMem(dst, src, len); -} - -CHAR8 * -strchra(const CHAR8 *s, INTN c) -{ - do { - if (*s == c) - return (CHAR8 *) s; - } - while (*s++); - - return NULL; -} - -CHAR8 * -strrchra(const CHAR8 *s, INTN c) -{ - CHAR8 *p = NULL; - - do { - if (*s == c) - p = (CHAR8 *) s; - } - while (*s++); - - return p; -} - EFI_STATUS PrintGuid(EFI_GUID *Guid) { diff --git a/src/path.c b/src/path.c index c11482d..27eb018 100644 --- a/src/path.c +++ b/src/path.c @@ -1,11 +1,16 @@ /* path.c - Path handling routines */ /* - * Copyright © 2014 Pete Batard + * Copyright © 2014-2021 Pete Batard * Based on path sanitation code by Ludwig Nussel * + * Note: This file has been relicensed from GPLv3+ to GPLv2+ by formal + * agreement of all of the contributors who applied changes on top of + * its original Public Domain source. The original source can be found at: + * https://github.com/saygili/pisilinux/blob/65c6b72d90aa282d8a3e79be209fa364c7180ffc/extra/util/archive/unarj/files/unarj-2.65-sanitation.patch#L4-L86 + * * 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, either version 3 of the License, or + * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -38,8 +43,8 @@ VOID CopyPathRelative(CHAR8 *dest, CHAR8 *src, INTN len) for(; len && *p;) { src = p; - p = strchra(src, PATH_CHAR); - if(!p) p = src+strlena(src); + while (*p && *p != PATH_CHAR) p++; + if (!*p) p = src+strlena(src); /* . => skip */ if(p-src == 1 && *src == '.' ) @@ -51,21 +56,12 @@ VOID CopyPathRelative(CHAR8 *dest, CHAR8 *src, INTN len) { if(o != dest) { - CHAR8* tmp; + UINTN i; *o = '\0'; - tmp = strrchra(dest, PATH_CHAR); - if(!tmp) - { - len += o-dest; - o = dest; - if(*p) ++p; - } - else - { - len += o-tmp; - o = tmp; - if(*p) ++p; - } + for(i = strlena(dest)-1; i > 0 && dest[i] != PATH_CHAR; i--); + len += o-&dest[i]; + o = &dest[i]; + if(*p) ++p; } else /* nothing to pop */ if(*p) ++p; diff --git a/src/this.c b/src/this.c index 2658461..c177fd1 100644 --- a/src/this.c +++ b/src/this.c @@ -2,9 +2,12 @@ /* * Copyright © 2014-2017 Pete Batard * + * Note: This file has been relicensed from GPLv3+ to GPLv2+ by formal + * agreement of all of its contributors. + * * 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, either version 3 of the License, or + * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, diff --git a/src/utf8.c b/src/utf8.c index f73def7..dd610b3 100644 --- a/src/utf8.c +++ b/src/utf8.c @@ -4,9 +4,14 @@ * Based on Netscape security libraries: * Copyright © 1994-2000 Netscape Communications Corporation. * + * Note: This file has been relicensed from GPLv3+ to GPLv2+ by formal + * agreement of all of the contributors who applied changes on top of + * its original GPLv2+ source. The original source can be found at: + * https://github.com/mozilla/gecko-dev/blob/9fd7059a19baa49b01a534eddf9a5a4de918a9f9/security/nss/lib/util/utf8.c + * * 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, either version 3 of the License, or + * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful,