summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMirco Tischler2016-07-07 09:08:10 +0200
committerMirco Tischler2016-07-07 09:08:10 +0200
commitbe1cbe92cfd48153936e2b9c6da7e53cfb120323 (patch)
tree2b4c6bcff8bcfc71eca44ca8ab4b9439d93bed93
parenta9b20a624f75a0b83702b5e9113a7e068d1f1d37 (diff)
downloadaur-be1cbe92cfd48153936e2b9c6da7e53cfb120323.tar.gz
fwupdate: version 0.5-2: backports for API-changes in efivar
-rw-r--r--0001-Always-set-a-mode-with-efi_set_variable.patch58
-rw-r--r--0001-libfwup-better-bounds-checking-with-efivar-0.24-APIs.patch31
-rw-r--r--PKGBUILD16
3 files changed, 102 insertions, 3 deletions
diff --git a/0001-Always-set-a-mode-with-efi_set_variable.patch b/0001-Always-set-a-mode-with-efi_set_variable.patch
new file mode 100644
index 000000000000..8d5c26d46d98
--- /dev/null
+++ b/0001-Always-set-a-mode-with-efi_set_variable.patch
@@ -0,0 +1,58 @@
+From 84f2ea96f88751fe01228dcd9fc130cfa0893dfc Mon Sep 17 00:00:00 2001
+From: Peter Jones <pjones@redhat.com>
+Date: Wed, 2 Mar 2016 10:05:19 -0500
+Subject: [PATCH] Always set a mode with efi_set_variable()
+
+Apparently the code in efivar to handle whether mode is there or not
+does not always work, so it's going to go away soon.
+
+Signed-off-by: Peter Jones <pjones@redhat.com>
+---
+ linux/libfwup.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/linux/libfwup.c b/linux/libfwup.c
+index 6f2f896..d50e4d5 100644
+--- a/linux/libfwup.c
++++ b/linux/libfwup.c
+@@ -331,7 +331,7 @@ err:
+ | EFI_VARIABLE_BOOTSERVICE_ACCESS
+ | EFI_VARIABLE_RUNTIME_ACCESS;
+ rc = efi_set_variable(varguid, varname, (uint8_t *)info2,
+- is, attributes, 0644);
++ is, attributes, 0600);
+ error = errno;
+ free(info2);
+ errno = error;
+@@ -797,7 +797,7 @@ do_next:
+ if (found) {
+ efi_loadopt_attr_set(loadopt, LOAD_OPTION_ACTIVE);
+ rc = efi_set_variable(*guid, name, var_data,
+- var_data_size, attr);
++ var_data_size, attr, 0600);
+ free(var_data);
+ if (rc < 0)
+ goto out;
+@@ -822,7 +822,8 @@ do_next:
+ opt_size,
+ EFI_VARIABLE_NON_VOLATILE |
+ EFI_VARIABLE_BOOTSERVICE_ACCESS |
+- EFI_VARIABLE_RUNTIME_ACCESS);
++ EFI_VARIABLE_RUNTIME_ACCESS,
++ 0600);
+ if (rc < 0)
+ goto out;
+
+@@ -833,7 +834,8 @@ do_next:
+ (uint8_t *)&real_boot_next, 2,
+ EFI_VARIABLE_NON_VOLATILE |
+ EFI_VARIABLE_BOOTSERVICE_ACCESS |
+- EFI_VARIABLE_RUNTIME_ACCESS);
++ EFI_VARIABLE_RUNTIME_ACCESS,
++ 0600);
+ ret = rc;
+
+ out:
+--
+2.9.0
+
diff --git a/0001-libfwup-better-bounds-checking-with-efivar-0.24-APIs.patch b/0001-libfwup-better-bounds-checking-with-efivar-0.24-APIs.patch
new file mode 100644
index 000000000000..f1aa1f22b1fc
--- /dev/null
+++ b/0001-libfwup-better-bounds-checking-with-efivar-0.24-APIs.patch
@@ -0,0 +1,31 @@
+From 9b0258e62c3d5272bb8431f1067042945197b2c8 Mon Sep 17 00:00:00 2001
+From: Peter Jones <pjones@redhat.com>
+Date: Thu, 25 Feb 2016 14:59:28 -0500
+Subject: [PATCH] libfwup: better bounds checking with efivar 0.24 APIs
+
+Signed-off-by: Peter Jones <pjones@redhat.com>
+---
+ linux/libfwup.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/linux/libfwup.c b/linux/libfwup.c
+index 5de9d4c..4154480 100644
+--- a/linux/libfwup.c
++++ b/linux/libfwup.c
+@@ -695,11 +695,11 @@ do_next:
+ continue;
+ }
+
+- sz = efi_loadopt_pathlen(loadopt);
++ sz = efi_loadopt_pathlen(loadopt, var_data_size);
+ if (sz != efidp_size((efidp)dp_buf))
+ goto do_next;
+
+- efidp found_dp = efi_loadopt_path(loadopt);
++ efidp found_dp = efi_loadopt_path(loadopt, var_data_size);
+ if (memcmp(found_dp, dp_buf, sz))
+ goto do_next;
+
+--
+2.9.0
+
diff --git a/PKGBUILD b/PKGBUILD
index adb8fddff00f..580fd11453a4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,15 +2,25 @@
pkgname=fwupdate
pkgver=0.5
-pkgrel=1
+pkgrel=2
pkgdesc='Tools for using the ESRT and UpdateCapsule() to apply firmware updates'
arch=('i686' 'x86_64')
url='https://github.com/rhinstaller/fwupdate'
license=('GPL2')
depends=('efivar')
makedepends=('pesign' 'gnu-efi-libs')
-source=("${url}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.bz2")
-sha256sums=('633cd81e5120857ca4ab94067a59e56a031bb3764584ce1fcfe4fdb9c71031d5')
+source=("${url}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.bz2"
+ "0001-libfwup-better-bounds-checking-with-efivar-0.24-APIs.patch"
+ "0001-Always-set-a-mode-with-efi_set_variable.patch")
+sha256sums=('633cd81e5120857ca4ab94067a59e56a031bb3764584ce1fcfe4fdb9c71031d5'
+ '76311cc35e262c8128c914d38f6fe2b3ea6083b090b13729f93033d7e3e65abd'
+ '2845e3f1fb5db180e2b602ff0f359166d2fcfe80eaba0b95c4ce67abf5527c3e')
+
+prepare() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -p1 < "${srcdir}/${source[1]}"
+ patch -p1 < "${srcdir}/${source[2]}"
+}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"