[Buildroot] [PATCH v2] gptfdisk: Add host package

Trent Piepho tpiepho at kymetacorp.com
Tue Dec 15 01:53:54 UTC 2015


From 433ae11ef2eea9e4cd9190e5b1e38903cb6ca5c4 Mon Sep 17 00:00:00 2001
From: Trent Piepho <tpiepho at kymetacorp.com>
Date: Tue, 8 Dec 2015 15:20:23 -0800
Subject: [PATCH] gptfdisk: Add host package

This tool which is useful for scripts that create flash images with
multiple partitions.  The host-parted package can do this too, but is
missing a number of features that the gptfdisk program has for dealing
with GPT.

The interactive gdisk and curses based sgdisk aren't built.  Just the
scriptable tool sgdisk.  The target package allows configuring which
tools are built, but this seem unnecessarily complex for the host
tool.

Signed-off-by: Trent Piepho <tpiepho at kymetacorp.com>
---
Changes from v1:
  Selects host util-linux for libuuid

 package/Config.in.host          |  1 +
 package/gptfdisk/Config.in.host | 10 ++++++++++
 package/gptfdisk/gptfdisk.mk    | 11 +++++++++++
 3 files changed, 22 insertions(+)
 create mode 100644 package/gptfdisk/Config.in.host

diff --git a/package/Config.in.host b/package/Config.in.host
index ce1b6bc..d757316 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -12,6 +12,7 @@ menu "Host utilities"
 	source "package/genext2fs/Config.in.host"
 	source "package/genimage/Config.in.host"
 	source "package/genpart/Config.in.host"
+	source "package/gptfdisk/Config.in.host"
 	source "package/imx-usb-loader/Config.in.host"
 	source "package/jq/Config.in.host"
 	source "package/lpc3250loader/Config.in.host"
diff --git a/package/gptfdisk/Config.in.host b/package/gptfdisk/Config.in.host
new file mode 100644
index 0000000..9b4140f
--- /dev/null
+++ b/package/gptfdisk/Config.in.host
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_HOST_GPTFDISK
+	select BR2_PACKAGE_HOST_UTIL_LINUX
+	bool "host gptfdisk"
+	help
+          GPT fdisk (consisting of the gdisk and sgdisk programs) is a
+          text-mode partitioning tool that works on Globally Unique Identifier
+          (GUID) Partition Table (GPT) disks, rather than on the more common
+          (through 2010) Master Boot Record (MBR) partition tables.
+
+          http://www.rodsbooks.com/gdisk/
diff --git a/package/gptfdisk/gptfdisk.mk b/package/gptfdisk/gptfdisk.mk
index abfddfb..089e862 100644
--- a/package/gptfdisk/gptfdisk.mk
+++ b/package/gptfdisk/gptfdisk.mk
@@ -46,4 +46,15 @@ define GPTFDISK_INSTALL_TARGET_CMDS
 	done
 endef
 
+HOST_GPTFDISK_DEPENDENCIES = host-util-linux host-popt
+define HOST_GPTFDISK_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) \
+		sgdisk
+endef
+
+define HOST_GPTFDISK_INSTALL_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/sgdisk $(HOST_DIR)/usr/sbin/sgdisk
+endef
+
 $(eval $(generic-package))
+$(eval $(host-generic-package))
-- 
1.8.3.1




More information about the buildroot mailing list