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-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
$(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
--- /dev/null
+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))