From: Vladimir 'phcoder' Serbinenko Date: Fri, 15 Mar 2024 19:59:04 +0000 (+0300) Subject: util/grub-fstest: Add a new command zfs-bootfs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28c4405208cfb6e2cea737f6cbaf17e631bac6cd;p=thirdparty%2Fgrub.git util/grub-fstest: Add a new command zfs-bootfs It is useful to check zfs-bootfs command. Signed-off-by: Vladimir Serbinenko Reviewed-by: Daniel Kiper --- diff --git a/util/grub-fstest.c b/util/grub-fstest.c index 25ae52ab6..7ff9037b8 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -69,7 +69,8 @@ enum { CMD_BLOCKLIST, CMD_TESTLOAD, CMD_ZFSINFO, - CMD_XNU_UUID + CMD_XNU_UUID, + CMD_ZFS_BOOTFS }; #define BUF_SIZE 32256 @@ -441,6 +442,9 @@ fstest (int n) case CMD_ZFSINFO: execute_command ("zfsinfo", n, args); break; + case CMD_ZFS_BOOTFS: + execute_command ("zfs-bootfs", n, args); + break; case CMD_CP: cmd_cp (args[0], args[1]); break; @@ -518,6 +522,7 @@ static struct argp_option options[] = { {N_("crc FILE"), 0, 0 , OPTION_DOC, N_("Get crc32 checksum of FILE."), 1}, {N_("blocklist FILE"), 0, 0, OPTION_DOC, N_("Display blocklist of FILE."), 1}, {N_("xnu_uuid DEVICE"), 0, 0, OPTION_DOC, N_("Compute XNU UUID of the device."), 1}, + {N_("zfs-bootfs ZFS_DATASET"), 0, 0, OPTION_DOC, N_("Compute ZFS dataset bootpath."), 1}, {"root", 'r', N_("DEVICE_NAME"), 0, N_("Set root device."), 2}, {"skip", 's', N_("NUM"), 0, N_("Skip N bytes from output file."), 2}, @@ -712,6 +717,11 @@ argp_parser (int key, char *arg, struct argp_state *state) cmd = CMD_XNU_UUID; nparm = 0; } + else if (grub_strcmp (arg, "zfs-bootfs") == 0) + { + cmd = CMD_ZFS_BOOTFS; + nparm = 0; + } else { fprintf (stderr, _("Invalid command %s.\n"), arg);