daemon: Make gdisk into an optional dependency and optgroup.

Also document that gdisk is a dependency at all.

This fixes commit 956e30effa.
This commit is contained in:
Richard W.M. Jones
2012-12-18 11:51:42 +00:00
parent 2434a86da4
commit fa162417ed
3 changed files with 12 additions and 0 deletions

3
README
View File

@@ -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.

View File

@@ -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)
{

View File

@@ -10650,6 +10650,7 @@ group with GUID <diskgroup>." };
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";