gummiboot: add new package
Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
This commit is contained in:
parent
5d4d292e50
commit
ccf1b96e0e
3 changed files with 130 additions and 0 deletions
66
utils/gummiboot/Makefile
Normal file
66
utils/gummiboot/Makefile
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
#
|
||||||
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
# See /LICENSE for more information.
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=gummiboot
|
||||||
|
PKG_VERSION:=45
|
||||||
|
PKG_RELEASE:=$(AUTORELEASE)
|
||||||
|
|
||||||
|
PKG_SOURCE_PROTO:=git
|
||||||
|
PKG_SOURCE_URL:=https://github.com/rzr/gummiboot.git
|
||||||
|
PKG_SOURCE_DATE:=2021-04-11
|
||||||
|
PKG_SOURCE_VERSION:=eb3daf2ca4cb1657cf1f780957485d690a552bf6
|
||||||
|
PKG_MIRROR_HASH:=4c57791693b57bbe36e85b49d70310728b8008c4c545006a71c5a5f71b8df501
|
||||||
|
|
||||||
|
PKG_LICENSE:=LGPL-2.1-or-later
|
||||||
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
|
PKG_BUILD_DEPENDS:=gnu-efi
|
||||||
|
PKG_BUILD_PARALLEL:=1
|
||||||
|
PKG_FIXUP:=autoreconf
|
||||||
|
PKG_INSTALL:=1
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/gummiboot
|
||||||
|
SECTION:=boot
|
||||||
|
CATEGORY:=Boot Loaders
|
||||||
|
TITLE:=Simple UEFI boot manager
|
||||||
|
DEPENDS:=@TARGET_X86_64 +libblkid
|
||||||
|
URL:=https://github.com/rzr/gummiboot
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/gummiboot/description
|
||||||
|
gummiboot Simple UEFI boot manager
|
||||||
|
|
||||||
|
gummiboot executes EFI images. The default entry is selected by a configured
|
||||||
|
pattern (glob) or an on-screen menu.
|
||||||
|
endef
|
||||||
|
|
||||||
|
CONFIGURE_ARGS += \
|
||||||
|
--with-efi-libdir=$(STAGING_DIR)/usr/lib \
|
||||||
|
--with-efi-ldsdir=$(STAGING_DIR)/usr/lib \
|
||||||
|
--with-efi-includedir=$(STAGING_DIR)/usr/include
|
||||||
|
|
||||||
|
define Build/Compile
|
||||||
|
+$(MAKE_VARS) EFI_CFLAGS="-I$(TOOLCHAIN_DIR)/include $(TARGET_CFLAGS)" \
|
||||||
|
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
|
||||||
|
$(MAKE_FLAGS) \
|
||||||
|
$(1);
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Install
|
||||||
|
$(MAKE_VARS) EFI_CFLAGS="-I$(TOOLCHAIN_DIR)/include $(TARGET_CFLAGS)" \
|
||||||
|
$(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
|
||||||
|
$(MAKE_INSTALL_FLAGS) install
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/gummiboot/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/lib/gummiboot
|
||||||
|
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/gummiboot/gummibootx64.efi $(1)/usr/lib/gummiboot/
|
||||||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gummiboot $(1)/usr/sbin/
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,gummiboot))
|
10
utils/gummiboot/patches/010-fix-missing-includes.patch
Normal file
10
utils/gummiboot/patches/010-fix-missing-includes.patch
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
--- a/src/setup/setup.c
|
||||||
|
+++ b/src/setup/setup.c
|
||||||
|
@@ -37,6 +37,7 @@
|
||||||
|
#include <ftw.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <blkid.h>
|
||||||
|
+#include <sys/sysmacros.h>
|
||||||
|
|
||||||
|
#include "efivars.h"
|
||||||
|
|
54
utils/gummiboot/patches/020-fix-dev-mapping.patch
Normal file
54
utils/gummiboot/patches/020-fix-dev-mapping.patch
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
--- a/src/setup/setup.c
|
||||||
|
+++ b/src/setup/setup.c
|
||||||
|
@@ -83,6 +83,9 @@ static int verify_esp(const char *p, uin
|
||||||
|
blkid_probe b = NULL;
|
||||||
|
int r;
|
||||||
|
const char *v;
|
||||||
|
+ char buf[1024];
|
||||||
|
+
|
||||||
|
+ memset(buf, 0, sizeof(buf));
|
||||||
|
|
||||||
|
if (statfs(p, &sfs) < 0) {
|
||||||
|
fprintf(stderr, "Failed to check file system type of %s: %m\n", p);
|
||||||
|
@@ -122,24 +125,38 @@ static int verify_esp(const char *p, uin
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
- r = asprintf(&t, "/dev/block/%u:%u", major(st.st_dev), minor(st.st_dev));
|
||||||
|
+ r = asprintf(&t, "/sys/dev/block/%u:%u", major(st.st_dev), minor(st.st_dev));
|
||||||
|
if (r < 0) {
|
||||||
|
fprintf(stderr, "Out of memory.\n");
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ r = readlink(t, buf, sizeof(buf) - 1);
|
||||||
|
+ if (r < 0) {
|
||||||
|
+ fprintf(stderr, "Failed to identify device node for block device %u:%u\n", major(st.st_dev), minor(st.st_dev));
|
||||||
|
+ return -ENOMEM;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ r = asprintf(&t, "/dev/%s", basename(buf));
|
||||||
|
+ if (r < 0) {
|
||||||
|
+ fprintf(stderr, "Out of memory.\n");
|
||||||
|
+ return -ENOMEM;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
errno = 0;
|
||||||
|
b = blkid_new_probe_from_filename(t);
|
||||||
|
- free(t);
|
||||||
|
if (!b) {
|
||||||
|
if (errno != 0) {
|
||||||
|
- fprintf(stderr, "Failed to open file system %s: %m\n", p);
|
||||||
|
+ fprintf(stderr, "Failed to open file system %s on %s: %m\n", p, t);
|
||||||
|
+ free(t);
|
||||||
|
return -errno;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ free(t);
|
||||||
|
fprintf(stderr, "Out of memory.\n");
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
+ free(t);
|
||||||
|
|
||||||
|
blkid_probe_enable_superblocks(b, 1);
|
||||||
|
blkid_probe_set_superblocks_flags(b, BLKID_SUBLKS_TYPE);
|
Loading…
Reference in a new issue