pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

efivar: address compilation warnings, explain missing /dev/efi



Module Name:	pkgsrc-wip
Committed By:	Sergii Dmytruk <sergii.dmytruk%3mdeb.com@localhost>
Pushed By:	sergiidmytruk
Date:		Tue Aug 6 16:42:48 2024 +0300
Changeset:	544079c02725498b09e381599c040c42ad7d921a

Modified Files:
	efivar/TODO
	efivar/distinfo
Added Files:
	efivar/patches/patch-src_include_efivar_efivar-types.h

Log Message:
efivar: address compilation warnings, explain missing /dev/efi

Redefinitions of macros were resolved in favour of libefivar which casts
constants to uint64_t.

Also explain how to get /dev/efi on NetBSD 10.0 where it doesn't appear
by default due to incomplete change.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk%3mdeb.com@localhost>

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=544079c02725498b09e381599c040c42ad7d921a

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 efivar/TODO                                        |  9 ++---
 efivar/distinfo                                    |  1 +
 .../patch-src_include_efivar_efivar-types.h        | 42 ++++++++++++++++++++++
 3 files changed, 45 insertions(+), 7 deletions(-)

diffs:
diff --git a/efivar/TODO b/efivar/TODO
index c75b0829d2..0932636139 100644
--- a/efivar/TODO
+++ b/efivar/TODO
@@ -2,10 +2,5 @@ Can generally be used, but see [1] for limitations.
 
 [1]: https://github.com/3mdeb/efivar/blob/bsd/BSD_PORTING.md
 
-This uses EFI driver which seem to NOT be included into releases?
-
-The are warnings during build like (not sure if needs to be fixed):
-
-    In file included from ioctl.c:25:0:
-    /usr/include/sys/efiio.h:46:0: note: this is the location of the previous definition
-     #define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS   0x00000010
+The EFI driver did make it into NetBSD 10.0, but /dev/efi isn't created
+automatically.  Running `cd /dev && ./MAKEDEF efi` remedies that.
diff --git a/efivar/distinfo b/efivar/distinfo
index 8e5fcaf00c..ac82dad858 100644
--- a/efivar/distinfo
+++ b/efivar/distinfo
@@ -8,4 +8,5 @@ SHA1 (patch-src_efisec.pc.in) = f5a3ddee2aa3863d4f2b2009ec03bb921a9c28a6
 SHA1 (patch-src_efivar.pc.in) = 7b5f42eab8c6bd71aa69893a8df6e810a65c8f5d
 SHA1 (patch-src_include_defaults.mk) = e79446000ba43eb82ecd6a141de593d9d768d27f
 SHA1 (patch-src_include_efivar_efivar-dp.h) = 8eaeb0a3657a6263e2b19da77c14b29bd7b6f411
+SHA1 (patch-src_include_efivar_efivar-types.h) = efb16792e17e69a3f86db28c61044eeb27a80508
 SHA1 (patch-src_include_gcc.specs) = b63825b96dcedc44404de730683a09f421a07eea
diff --git a/efivar/patches/patch-src_include_efivar_efivar-types.h b/efivar/patches/patch-src_include_efivar_efivar-types.h
new file mode 100644
index 0000000000..da8e8ccfae
--- /dev/null
+++ b/efivar/patches/patch-src_include_efivar_efivar-types.h
@@ -0,0 +1,42 @@
+$NetBSD$
+
+--- src/include/efivar/efivar-types.h.orig	2022-10-05 17:03:05.000000000 +0000
++++ src/include/efivar/efivar-types.h
+@@ -90,6 +90,37 @@ typedef struct {
+ #define EFI_UNSPECIFIED_TIMEZONE        ((uint16_t)0x07ff)
+ #endif /* !defined(EFIVAR_NO_EFI_TIME_T) || EFIVAR_NO_EFI_TIME_T */
+ 
++/*
++ * /usr/include/sys/efiio.h provides the same definitions but of `int` type,
++ * prefer definitions from this header as somewhat more correct.  This is
++ * unlikely to have a real difference and is mostly to avoid warnings on
++ * redefining macros.
++ */
++#ifdef EFI_VARIABLE_NON_VOLATILE
++#undef EFI_VARIABLE_NON_VOLATILE
++#endif
++#ifdef EFI_VARIABLE_BOOTSERVICE_ACCESS
++#undef EFI_VARIABLE_BOOTSERVICE_ACCESS
++#endif
++#ifdef EFI_VARIABLE_RUNTIME_ACCESS
++#undef EFI_VARIABLE_RUNTIME_ACCESS
++#endif
++#ifdef EFI_VARIABLE_HARDWARE_ERROR_RECORD
++#undef EFI_VARIABLE_HARDWARE_ERROR_RECORD
++#endif
++#ifdef EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
++#undef EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
++#endif
++#ifdef EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS
++#undef EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS
++#endif
++#ifdef EFI_VARIABLE_APPEND_WRITE
++#undef EFI_VARIABLE_APPEND_WRITE
++#endif
++#ifdef EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS
++#undef EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS
++#endif
++
+ #define EFI_VARIABLE_NON_VOLATILE				((uint64_t)0x0000000000000001)
+ #define EFI_VARIABLE_BOOTSERVICE_ACCESS				((uint64_t)0x0000000000000002)
+ #define EFI_VARIABLE_RUNTIME_ACCESS				((uint64_t)0x0000000000000004)


Home | Main Index | Thread Index | Old Index