tools: add sgdisk host build
authorDUPONCHEEL Sébastien <sebastien.duponcheel@corp.ovh.com>
Tue, 11 Apr 2017 10:45:16 +0000 (12:45 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 14 Aug 2019 05:56:58 +0000 (07:56 +0200)
Add a sgdisk host build to convert MBR partitions to GPT for EFI systems.

Signed-off-by: DUPONCHEEL Sébastien <sebastien.duponcheel@corp.ovh.com>
[Jo-Philipp Wich: reword commit message, use libuuid from e2fsprogs,
                  use libpopt host build]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
tools/Makefile
tools/gptfdisk/Makefile [new file with mode: 0644]

index d7207ba89dd91df558eaf970961fdef225aa1f37..3ac9b9b58cb2d520041e54ba15dd67d7bf6b74b7 100644 (file)
@@ -29,6 +29,7 @@ tools-y += mm-macros missing-macros cmake scons bc findutils gengetopt patchelf
 tools-y += mtools dosfstools libressl
 tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
 tools-$(CONFIG_TARGET_x86) += qemu
+tools-$(CONFIG_EFI_IMAGES) += gptfdisk popt
 tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
 tools-$(CONFIG_TARGET_ar71xx) += lzma-old
 tools-$(CONFIG_TARGET_ar71xx)$(CONFIG_TARGET_ath79) += squashfs
@@ -78,6 +79,7 @@ $(curdir)/wrt350nv2-builder/compile := $(curdir)/zlib/compile
 $(curdir)/lzma-old/compile := $(curdir)/zlib/compile
 $(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile
 $(curdir)/cbootimage/compile += $(curdir)/automake/compile
+$(curdir)/gptfdisk/compile += $(curdir)/e2fsprogs/compile $(curdir)/popt/compile
 
 ifneq ($(HOST_OS),Linux)
   $(curdir)/squashfskit4/compile += $(curdir)/coreutils/compile
diff --git a/tools/gptfdisk/Makefile b/tools/gptfdisk/Makefile
new file mode 100644 (file)
index 0000000..44315ed
--- /dev/null
@@ -0,0 +1,29 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gptfdisk
+PKG_VERSION:=1.0.1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.rodsbooks.com/gdisk/
+PKG_HASH:=864c8aee2efdda50346804d7e6230407d5f42a8ae754df70404dd8b2fdfaeac7
+
+HOST_BUILD_PARALLEL := 1
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_CPPFLAGS += \
+       -I$(STAGING_DIR_HOST)/include/e2fsprogs
+
+define Host/Compile
+       $(call Host/Compile/Default,sgdisk)
+endef
+
+define Host/Install
+        $(INSTALL_BIN) $(HOST_BUILD_DIR)/sgdisk $(STAGING_DIR_HOST)/bin/
+endef
+
+define Host/Clean
+        rm -f $(STAGING_DIR_HOST)/bin/sgdisk
+endef
+
+$(eval $(call HostBuild))