pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/devel
Module Name: pkgsrc
Committed By: bsiegert
Date: Tue Aug 20 15:29:32 UTC 2024
Modified Files:
pkgsrc/devel: Makefile
Added Files:
pkgsrc/devel/efivar: DESCR Makefile PLIST buildlink3.mk distinfo
pkgsrc/devel/efivar/patches: patch-src_efiboot.pc.in
patch-src_efisec.pc.in patch-src_efivar.pc.in
patch-src_include_defaults.mk patch-src_include_efivar_efivar-dp.h
patch-src_include_efivar_efivar-types.h patch-src_include_gcc.specs
Log Message:
devel/efivar: Add efivar 38
This is an adaptation of https://github.com/rhboot/efivar to make it
work on BSD systems. Amount of changes is quite substantial and is
very similar across *BSD systems, so a fork is used instead of a set of
patches (there are still small patches in the port related to building
on NetBSD).
Fully implementing libefiboot for a system will take a lot of work, so
it has limitations [1]. Generating abbreviated device paths works and
that's enough to boot an EFI payload, making it useful for fwupd.
[1]: https://github.com/3mdeb/efivar/blob/bsd/BSD_PORTING.md
Patch provided by Sergii Dmytruk in PR pkg/57559.
To generate a diff of this commit:
cvs rdiff -u -r1.4337 -r1.4338 pkgsrc/devel/Makefile
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/efivar/DESCR pkgsrc/devel/efivar/Makefile \
pkgsrc/devel/efivar/PLIST pkgsrc/devel/efivar/buildlink3.mk \
pkgsrc/devel/efivar/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/efivar/patches/patch-src_efiboot.pc.in \
pkgsrc/devel/efivar/patches/patch-src_efisec.pc.in \
pkgsrc/devel/efivar/patches/patch-src_efivar.pc.in \
pkgsrc/devel/efivar/patches/patch-src_include_defaults.mk \
pkgsrc/devel/efivar/patches/patch-src_include_efivar_efivar-dp.h \
pkgsrc/devel/efivar/patches/patch-src_include_efivar_efivar-types.h \
pkgsrc/devel/efivar/patches/patch-src_include_gcc.specs
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/devel/Makefile
diff -u pkgsrc/devel/Makefile:1.4337 pkgsrc/devel/Makefile:1.4338
--- pkgsrc/devel/Makefile:1.4337 Tue Aug 20 06:42:31 2024
+++ pkgsrc/devel/Makefile Tue Aug 20 15:29:32 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4337 2024/08/20 06:42:31 pin Exp $
+# $NetBSD: Makefile,v 1.4338 2024/08/20 15:29:32 bsiegert Exp $
#
COMMENT= Development utilities
@@ -351,6 +351,7 @@ SUBDIR+= ecore
SUBDIR+= editline
SUBDIR+= editorconfig-core
SUBDIR+= eet
+SUBDIR+= efivar
SUBDIR+= egypt
SUBDIR+= eina
SUBDIR+= eio
Added files:
Index: pkgsrc/devel/efivar/DESCR
diff -u /dev/null pkgsrc/devel/efivar/DESCR:1.1
--- /dev/null Tue Aug 20 15:29:32 2024
+++ pkgsrc/devel/efivar/DESCR Tue Aug 20 15:29:32 2024
@@ -0,0 +1,5 @@
+This package provides user-space tools and libraries for EFI.
+It includes libraries for managing EFI variables (libefivar), device paths,
+load options (both by libefiboot), security certificates (libefisec) as well
+as binaries for accessing EFI variables (efivar) and manipulating
+certificates (efisecdb).
Index: pkgsrc/devel/efivar/Makefile
diff -u /dev/null pkgsrc/devel/efivar/Makefile:1.1
--- /dev/null Tue Aug 20 15:29:32 2024
+++ pkgsrc/devel/efivar/Makefile Tue Aug 20 15:29:32 2024
@@ -0,0 +1,31 @@
+# $NetBSD: Makefile,v 1.1 2024/08/20 15:29:32 bsiegert Exp $
+
+DISTNAME= efivar-38
+CATEGORIES= devel
+# The project is Linux-oriented, using fork with BSD-specific changes so that
+# patches are manageable and can be potentially sent upstream.
+#
+# The fork also uses unreleased changes as some of them fix build on systems
+# that don't use glibc.
+MASTER_SITES= ${MASTER_SITE_GITHUB:=3mdeb/}
+GITHUB_PROJECT= efivar
+GITHUB_TAG= bsd-v1
+
+MAINTAINER= sergii.dmytruk%3mdeb.com@localhost
+HOMEPAGE= https://github.com/rhboot/efivar
+COMMENT= Tools and libraries to work with EFI
+LICENSE= gnu-lgpl-v2.1 # or later
+
+# Depends on EFI and relevant API in the kernel
+ONLY_FOR_PLATFORM= *-*-x86_64
+
+USE_TOOLS+= gmake
+
+# Specify lib directory name.
+MAKE_FLAGS= LIBDIR=${PREFIX}/lib
+# Override man directory default of prefix/share/man.
+MAKE_FLAGS+= MANDIR=${PREFIX}/${PKGMANDIR}
+# Instruct dynamic linker to give preference to /usr/pkg/lib.
+MAKE_FLAGS+= SOFLAGS=${COMPILER_RPATH_FLAG}${PREFIX}/lib
+
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/devel/efivar/PLIST
diff -u /dev/null pkgsrc/devel/efivar/PLIST:1.1
--- /dev/null Tue Aug 20 15:29:32 2024
+++ pkgsrc/devel/efivar/PLIST Tue Aug 20 15:29:32 2024
@@ -0,0 +1,57 @@
+@comment $NetBSD: PLIST,v 1.1 2024/08/20 15:29:32 bsiegert Exp $
+bin/efisecdb
+bin/efivar
+include/efivar/efiboot-creator.h
+include/efivar/efiboot-loadopt.h
+include/efivar/efiboot.h
+include/efivar/efisec-secdb.h
+include/efivar/efisec-types.h
+include/efivar/efisec.h
+include/efivar/efivar-dp.h
+include/efivar/efivar-guids.h
+include/efivar/efivar-time.h
+include/efivar/efivar-types.h
+include/efivar/efivar.h
+lib/libefiboot.so
+lib/libefiboot.so.1
+lib/libefiboot.so.1.${PKGVERSION}
+lib/libefisec.so
+lib/libefisec.so.1
+lib/libefisec.so.1.${PKGVERSION}
+lib/libefivar.so
+lib/libefivar.so.1
+lib/libefivar.so.1.${PKGVERSION}
+lib/pkgconfig/efiboot.pc
+lib/pkgconfig/efisec.pc
+lib/pkgconfig/efivar.pc
+man/man1/efisecdb.1
+man/man1/efivar.1
+man/man3/efi_append_variable.3
+man/man3/efi_del_variable.3
+man/man3/efi_get_next_variable_name.3
+man/man3/efi_get_variable.3
+man/man3/efi_get_variable_attributes.3
+man/man3/efi_get_variable_size.3
+man/man3/efi_guid_to_id_guid.3
+man/man3/efi_guid_to_name.3
+man/man3/efi_guid_to_str.3
+man/man3/efi_guid_to_symbol.3
+man/man3/efi_name_to_guid.3
+man/man3/efi_set_variable.3
+man/man3/efi_str_to_guid.3
+man/man3/efi_symbol_to_guid.3
+man/man3/efi_variable_alloc.3
+man/man3/efi_variable_export.3
+man/man3/efi_variable_free.3
+man/man3/efi_variable_get_attributes.3
+man/man3/efi_variable_get_data.3
+man/man3/efi_variable_get_guid.3
+man/man3/efi_variable_get_name.3
+man/man3/efi_variable_import.3
+man/man3/efi_variable_realize.3
+man/man3/efi_variable_set_attributes.3
+man/man3/efi_variable_set_data.3
+man/man3/efi_variable_set_guid.3
+man/man3/efi_variable_set_name.3
+man/man3/efi_variable_t.3
+man/man3/efi_variables_supported.3
Index: pkgsrc/devel/efivar/buildlink3.mk
diff -u /dev/null pkgsrc/devel/efivar/buildlink3.mk:1.1
--- /dev/null Tue Aug 20 15:29:32 2024
+++ pkgsrc/devel/efivar/buildlink3.mk Tue Aug 20 15:29:32 2024
@@ -0,0 +1,12 @@
+# $NetBSD: buildlink3.mk,v 1.1 2024/08/20 15:29:32 bsiegert Exp $
+
+BUILDLINK_TREE+= efivar
+
+.if !defined(EFIVAR_BUILDLINK3_MK)
+EFIVAR_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.efivar+= efivar>=38
+BUILDLINK_PKGSRCDIR.efivar?= ../../devel/efivar
+.endif # EFIVAR_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -efivar
Index: pkgsrc/devel/efivar/distinfo
diff -u /dev/null pkgsrc/devel/efivar/distinfo:1.1
--- /dev/null Tue Aug 20 15:29:32 2024
+++ pkgsrc/devel/efivar/distinfo Tue Aug 20 15:29:32 2024
@@ -0,0 +1,12 @@
+$NetBSD: distinfo,v 1.1 2024/08/20 15:29:32 bsiegert Exp $
+
+BLAKE2s (efivar-38.tar.gz) = 2e0821f4373bf99ee6e59ddf98fafb6e9341dc2f7f5f6ba072c9ba5c95b25435
+SHA512 (efivar-38.tar.gz) = 5ac146227e20c845d0cd39d7cb9b8a109a3ddb8f2e3c78a9fdf480c5ac37417360bce815c7d359354a9aa07bfb30be1d6d318a2ffa250e2904f629df6113a430
+Size (efivar-38.tar.gz) = 470176 bytes
+SHA1 (patch-src_efiboot.pc.in) = abcabe3c6d050e7227a42bea674a3352496d58b9
+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
Index: pkgsrc/devel/efivar/patches/patch-src_efiboot.pc.in
diff -u /dev/null pkgsrc/devel/efivar/patches/patch-src_efiboot.pc.in:1.1
--- /dev/null Tue Aug 20 15:29:32 2024
+++ pkgsrc/devel/efivar/patches/patch-src_efiboot.pc.in Tue Aug 20 15:29:32 2024
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_efiboot.pc.in,v 1.1 2024/08/20 15:29:32 bsiegert Exp $
+
+Add -rpath, drop -ldl, add one more include path.
+
+--- src/efiboot.pc.in.orig 2022-10-05 17:03:05.000000000 +0000
++++ src/efiboot.pc.in
+@@ -7,5 +7,5 @@ Name: efiboot
+ Description: UEFI Boot variable support
+ Version: @@VERSION@@
+ Requires.private: efivar
+-Libs: -L${libdir} -lefiboot
+-Cflags: -I${includedir}/efivar
++Libs: -Wl,-rpath,${libdir} -L${libdir} -lefiboot
++Cflags: -I${includedir} -I${includedir}/efivar
Index: pkgsrc/devel/efivar/patches/patch-src_efisec.pc.in
diff -u /dev/null pkgsrc/devel/efivar/patches/patch-src_efisec.pc.in:1.1
--- /dev/null Tue Aug 20 15:29:32 2024
+++ pkgsrc/devel/efivar/patches/patch-src_efisec.pc.in Tue Aug 20 15:29:32 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_efisec.pc.in,v 1.1 2024/08/20 15:29:32 bsiegert Exp $
+
+Add -rpath, drop -ldl, add one more include path.
+
+--- src/efisec.pc.in.orig 2022-10-13 22:03:58.467502286 +0000
++++ src/efisec.pc.in
+@@ -6,6 +6,5 @@ includedir=@@INCLUDEDIR@@
+ Name: efisec
+ Description: UEFI Security Features
+ Version: @@VERSION@@
+-Libs: -L${libdir} -lefivar -lefisec
+-Libs.private: -ldl
+-Cflags: -I${includedir}/efivar
++Libs: -Wl,-rpath,${libdir} -L${libdir} -lefivar -lefisec
++Cflags: -I${includedir} -I${includedir}/efivar
Index: pkgsrc/devel/efivar/patches/patch-src_efivar.pc.in
diff -u /dev/null pkgsrc/devel/efivar/patches/patch-src_efivar.pc.in:1.1
--- /dev/null Tue Aug 20 15:29:32 2024
+++ pkgsrc/devel/efivar/patches/patch-src_efivar.pc.in Tue Aug 20 15:29:32 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_efivar.pc.in,v 1.1 2024/08/20 15:29:32 bsiegert Exp $
+
+Add -rpath, drop -ldl, add one more include path.
+
+--- src/efivar.pc.in.orig 2022-10-05 17:03:05.000000000 +0000
++++ src/efivar.pc.in
+@@ -6,6 +6,5 @@ includedir=@@INCLUDEDIR@@
+ Name: efivar
+ Description: UEFI Variable Management
+ Version: @@VERSION@@
+-Libs: -L${libdir} -lefivar
+-Libs.private: -ldl
+-Cflags: -I${includedir}/efivar
++Libs: -Wl,-rpath,${libdir} -L${libdir} -lefivar
++Cflags: -I${includedir} -I${includedir}/efivar
Index: pkgsrc/devel/efivar/patches/patch-src_include_defaults.mk
diff -u /dev/null pkgsrc/devel/efivar/patches/patch-src_include_defaults.mk:1.1
--- /dev/null Tue Aug 20 15:29:32 2024
+++ pkgsrc/devel/efivar/patches/patch-src_include_defaults.mk Tue Aug 20 15:29:32 2024
@@ -0,0 +1,20 @@
+$NetBSD: patch-src_include_defaults.mk,v 1.1 2024/08/20 15:29:32 bsiegert Exp $
+
+ld produces this warning:
+
+ warning: guids.lds contains output sections; did you forget -T?
+
+It's harmless and is meant to make user notice lack of -T, but it's not needed
+here. Not clear how to suppress the warning, so removing --fatal-warnings as it
+causes the build to fail.
+
+--- src/include/defaults.mk.orig 2022-09-30 15:17:36.405877661 +0000
++++ src/include/defaults.mk
+@@ -56,7 +56,6 @@ override LDFLAGS = $(CFLAGS) -L. $(_LDFL
+ -Wl,-z,now \
+ -Wl,-z,muldefs \
+ -Wl,-z,relro \
+- -Wl,--fatal-warnings \
+ $(call family,LDFLAGS) $(call family,CCLDFLAGS) \
+ $(call pkg-config-ccldflags)
+ override CCLDFLAGS = $(LDFLAGS)
Index: pkgsrc/devel/efivar/patches/patch-src_include_efivar_efivar-dp.h
diff -u /dev/null pkgsrc/devel/efivar/patches/patch-src_include_efivar_efivar-dp.h:1.1
--- /dev/null Tue Aug 20 15:29:32 2024
+++ pkgsrc/devel/efivar/patches/patch-src_include_efivar_efivar-dp.h Tue Aug 20 15:29:32 2024
@@ -0,0 +1,19 @@
+$NetBSD: patch-src_include_efivar_efivar-dp.h,v 1.1 2024/08/20 15:29:32 bsiegert Exp $
+
+/usr/include/net/if.h contains:
+
+ #define if_type if_data.ifi_type
+
+--- src/include/efivar/efivar-dp.h.orig 2022-09-30 16:35:57.395069283 +0000
++++ src/include/efivar/efivar-dp.h
+@@ -425,6 +425,10 @@ typedef struct {
+ uint32_t target;
+ } EFIVAR_PACKED efidp_i2o;
+
++#ifdef if_type
++# undef if_type
++#endif
++
+ #define EFIDP_MSG_MAC_ADDR 0x0b
+ typedef struct {
+ efidp_header header;
Index: pkgsrc/devel/efivar/patches/patch-src_include_efivar_efivar-types.h
diff -u /dev/null pkgsrc/devel/efivar/patches/patch-src_include_efivar_efivar-types.h:1.1
--- /dev/null Tue Aug 20 15:29:32 2024
+++ pkgsrc/devel/efivar/patches/patch-src_include_efivar_efivar-types.h Tue Aug 20 15:29:32 2024
@@ -0,0 +1,42 @@
+$NetBSD: patch-src_include_efivar_efivar-types.h,v 1.1 2024/08/20 15:29:32 bsiegert Exp $
+
+--- 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)
Index: pkgsrc/devel/efivar/patches/patch-src_include_gcc.specs
diff -u /dev/null pkgsrc/devel/efivar/patches/patch-src_include_gcc.specs:1.1
--- /dev/null Tue Aug 20 15:29:32 2024
+++ pkgsrc/devel/efivar/patches/patch-src_include_gcc.specs Tue Aug 20 15:29:32 2024
@@ -0,0 +1,18 @@
+$NetBSD: patch-src_include_gcc.specs,v 1.1 2024/08/20 15:29:32 bsiegert Exp $
+
+ld produces this warning:
+
+ warning: guids.lds contains output sections; did you forget -T?
+
+It's harmless and is meant to make user notice lack of -T, but it's not needed
+here. Not clear how to suppress the warning, so removing --fatal-warnings as it
+causes the build to fail.
+
+--- src/include/gcc.specs.orig 2022-09-30 15:19:39.356337220 +0000
++++ src/include/gcc.specs
+@@ -5,4 +5,4 @@
+ + %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now} -grecord-gcc-switches
+
+ *link:
+-+ %{!static:--fatal-warnings} --no-undefined-version -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
+++ --no-undefined-version -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
Home |
Main Index |
Thread Index |
Old Index