Print this page
fixes + mirror

@@ -61,10 +61,11 @@
      N_("HINT"), ARG_TYPE_STRING},
     {"hint-arc",   0, GRUB_ARG_OPTION_REPEATABLE,
      N_("First try the device HINT if currently running on ARC."
         " If HINT ends in comma, also try subpartitions"),
      N_("HINT"), ARG_TYPE_STRING},
+    {"zfs-mirror", 'z', 0, N_("Handle zfs-mirror disk"), 0, 0},
     {0, 0, 0, 0, 0, 0}
   };
 
 enum options
   {

@@ -77,20 +78,22 @@
     SEARCH_HINT_IEEE1275,
     SEARCH_HINT_BIOS,
     SEARCH_HINT_BAREMETAL,
     SEARCH_HINT_EFI,
     SEARCH_HINT_ARC,
+    SEARCH_ZFS_MIRROR,
  };
 
 static grub_err_t
 grub_cmd_search (grub_extcmd_context_t ctxt, int argc, char **args)
 {
   struct grub_arg_list *state = ctxt->state;
   const char *var = 0;
   const char *id = 0;
   int i = 0, j = 0, nhints = 0;
   char **hints = NULL;
+  int mirror_mode = 0;
 
   if (state[SEARCH_HINT].set)
     for (i = 0; state[SEARCH_HINT].args[i]; i++)
       nhints++;
 

@@ -175,19 +178,22 @@
       var = "root";
     }
   else
     return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
 
+  if (state[SEARCH_ZFS_MIRROR].set)
+    mirror_mode = 1;
+
   if (state[SEARCH_LABEL].set)
     grub_search_label (id, var, state[SEARCH_NO_FLOPPY].set, 
-                       hints, nhints);
+                       hints, nhints, mirror_mode);
   else if (state[SEARCH_FS_UUID].set)
     grub_search_fs_uuid (id, var, state[SEARCH_NO_FLOPPY].set,
-                         hints, nhints);
+                         hints, nhints, mirror_mode);
   else if (state[SEARCH_FILE].set)
     grub_search_fs_file (id, var, state[SEARCH_NO_FLOPPY].set, 
-                         hints, nhints);
+                         hints, nhints, mirror_mode);
   else
     return grub_error (GRUB_ERR_INVALID_COMMAND, "unspecified search type");
 
   return grub_errno;
 }