diff --git a/README b/README index aa9fc8e0d..6cbec6df1 100644 --- a/README +++ b/README @@ -118,6 +118,9 @@ For basic functionality and the C tools: - yajl >= 2 (optional) JSON parser, needed to handle the output of ldmtool. +- gdisk (optional) + For managing some aspects of GPT disks. + - netpbm, icoutils (optional) These programs are used to render icons from guests. diff --git a/daemon/parted.c b/daemon/parted.c index 5c080da5f..dd4271c38 100644 --- a/daemon/parted.c +++ b/daemon/parted.c @@ -27,6 +27,7 @@ #include "daemon.h" #include "actions.h" +#include "optgroups.h" GUESTFSD_EXT_CMD(str_parted, parted); GUESTFSD_EXT_CMD(str_sfdisk, sfdisk); @@ -804,6 +805,12 @@ do_part_set_mbr_id (const char *device, int partnum, int idbyte) return 0; } +int +optgroup_gdisk_available (void) +{ + return prog_exists (str_sgdisk); +} + int do_part_set_gpt_type(const char *device, int partnum, const char *guid) { diff --git a/generator/actions.ml b/generator/actions.ml index e7fc745fa..9e8f017dc 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -10650,6 +10650,7 @@ group with GUID ." }; name = "part_set_gpt_type"; style = RErr, [Device "device"; Int "partnum"; String "guid"], []; proc_nr = Some 392; + optional = Some "gdisk"; tests = []; shortdesc = "set the type GUID of a GPT partition"; longdesc = "\ @@ -10664,6 +10665,7 @@ for a useful list of type GUIDs." }; name = "part_get_gpt_type"; style = RString "guid", [Device "device"; Int "partnum"], []; proc_nr = Some 393; + optional = Some "gdisk"; tests = [ InitGPT, Always, TestOutput ( [["part_set_gpt_type"; "/dev/sda"; "1";