summaryrefslogtreecommitdiff
path: root/config/uefitool
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-07-28 16:38:48 +0100
committerLeah Rowe <leah@libreboot.org>2024-07-28 16:38:48 +0100
commit490a94d7bc48fc4eddfb257066482e66d4cff9dc (patch)
tree0b6cde799883e4fd6f44b7128dd047b1cc00da4f /config/uefitool
parenta78eaac88336922e38f33f51d7ee5d2262abdf10 (diff)
uefitool: Only define ACCESSPERMS on *nix
I re-read the modified code, and it has defines in place for building on Windows; I was defining ACCESSPERMS universally, but it should only be defined for non-Windows systems, which the context in this code means Linux/BSD. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'config/uefitool')
-rw-r--r--config/uefitool/patches/0001-common-filesystem-define-ACCESSPERMS-if-undefined.patch32
1 files changed, 17 insertions, 15 deletions
diff --git a/config/uefitool/patches/0001-common-filesystem-define-ACCESSPERMS-if-undefined.patch b/config/uefitool/patches/0001-common-filesystem-define-ACCESSPERMS-if-undefined.patch
index 56ba0cb6..8241cebe 100644
--- a/config/uefitool/patches/0001-common-filesystem-define-ACCESSPERMS-if-undefined.patch
+++ b/config/uefitool/patches/0001-common-filesystem-define-ACCESSPERMS-if-undefined.patch
@@ -1,9 +1,9 @@
-From 35f5bbf5aa7dc32f0140147737af73fd3866f455 Mon Sep 17 00:00:00 2001
+From 75437e2253fc70f4e3368c9d030415ce4ae52fa6 Mon Sep 17 00:00:00 2001
From: Leah Rowe <info@minifree.org>
Date: Sun, 28 Jul 2024 16:04:30 +0100
Subject: [PATCH 1/1] common/filesystem: define ACCESSPERMS if undefined
-normally defined in sys/stat.h on various libc implementations,
+Normally defined in sys/stat.h on various libc implementations,
but musl libc doesn't seem to have it, leading to this build
issue:
@@ -19,30 +19,32 @@ ACCESSPERMS is supported on GNU C Library, for compatibility with
BSD libc implementations; the latter also implements ALLPERMS
and DEFFILEMODE, which don't seem to be used by uefitool regardless.
+Do not define it on the Windows builds; only do it for the others,
+such as Linux.
+
Signed-off-by: Leah Rowe <info@minifree.org>
---
- common/filesystem.cpp | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
+ common/filesystem.cpp | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/common/filesystem.cpp b/common/filesystem.cpp
-index b2b8d65..9672e07 100644
+index b2b8d65..af5e537 100644
--- a/common/filesystem.cpp
+++ b/common/filesystem.cpp
-@@ -15,6 +15,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- #include <sys/stat.h>
- #include <fstream>
-
-+/* musl libc does not define ACCESSPERMS, seen on glibc and many bsd libc.
-+ * let's do alpine linux users a massive favour, so that the code compiles.
-+ */
+@@ -75,6 +75,12 @@ UString getAbsPath(const UString & path)
+ #else
+ #include <unistd.h>
+ #include <stdlib.h>
++
++/* musl libc does not define ACCESSPERMS */
+#ifndef ACCESSPERMS
+#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) /* chmod permission: 0777 */
+#endif
+
- bool readFileIntoBuffer(const UString& inPath, UByteArray& buf)
+ bool isExistOnFs(const UString & path)
{
- if (!isExistOnFs(inPath))
-@@ -103,4 +110,4 @@ UString getAbsPath(const UString & path) {
+ struct stat buf;
+@@ -103,4 +109,4 @@ UString getAbsPath(const UString & path) {
return UString(abs);
return path;
}