* grub-core/commands/acpihalt.c: Gettextized.
* grub-core/commands/cacheinfo.c: Likewise. * grub-core/commands/cmp.c: Likewise. * grub-core/commands/efi/loadbios.c: Likewise. * grub-core/commands/gptsync.c: Likewise. * grub-core/commands/ieee1275/suspend.c: Likewise. * grub-core/commands/legacycfg.c: Likewise. * grub-core/commands/memrw.c: Likewise. * grub-core/commands/minicmd.c: Likewise. * grub-core/commands/parttool.c: Likewise. * grub-core/commands/time.c: Likewise. * grub-core/commands/videoinfo.c: Likewise. * grub-core/disk/geli.c: Likewise. * grub-core/disk/i386/pc/biosdisk.c: Likewise. * grub-core/disk/luks.c: Likewise. * grub-core/disk/lvm.c: Likewise. * grub-core/font/font_cmd.c: Likewise. * grub-core/fs/zfs/zfscrypt.c: Likewise. * grub-core/fs/zfs/zfsinfo.c: Likewise. * grub-core/gfxmenu/view.c: Likewise. * grub-core/kern/emu/hostdisk.c: Likewise. * grub-core/kern/emu/main.c: Likewise. * grub-core/kern/emu/misc.c: Likewise. * grub-core/kern/emu/mm.c: Likewise. * grub-core/kern/mips/arc/init.c: Likewise. * grub-core/kern/mips/loongson/init.c: Likewise. * grub-core/kern/partition.c: Likewise. * grub-core/lib/i386/halt.c: Likewise. * grub-core/lib/mips/arc/reboot.c: Likewise. * grub-core/lib/mips/loongson/reboot.c: Likewise. * grub-core/loader/i386/pc/chainloader.c: Likewise. * grub-core/loader/i386/xnu.c: Likewise. * grub-core/loader/multiboot.c: Likewise. * grub-core/net/bootp.c: Likewise. * grub-core/net/net.c: Likewise. * grub-core/normal/term.c: Likewise. * grub-core/partmap/bsdlabel.c: Likewise. * grub-core/parttool/msdospart.c: Likewise. * grub-core/term/gfxterm.c: Likewise. * grub-core/term/terminfo.c: Likewise. * grub-core/video/i386/pc/vbe.c: Likewise. * util/grub-menulst2cfg.c: Likewise. * util/grub-mkdevicemap.c: Likewise. * util/grub-mklayout.c: Likewise. * util/grub-mkrelpath.c: Likewise. * util/grub-script-check.c: Likewise. * util/ieee1275/grub-ofpathname.c: Likewise. * util/resolve.c: Likewise.
This commit is contained in:
parent
073aa7a9bf
commit
6e0632e28c
49 changed files with 275 additions and 200 deletions
|
@ -25,6 +25,7 @@
|
|||
#include <grub/mm.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/env.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
|
@ -44,32 +45,32 @@ print_state (char *nvlist, int tab)
|
|||
int isok = 1;
|
||||
|
||||
print_tabs (tab);
|
||||
grub_printf ("State: ");
|
||||
grub_xputs (_("State: "));
|
||||
|
||||
if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_REMOVED, &ival))
|
||||
{
|
||||
grub_printf ("removed ");
|
||||
grub_xputs (_("removed "));
|
||||
isok = 0;
|
||||
}
|
||||
|
||||
if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_FAULTED, &ival))
|
||||
{
|
||||
grub_printf ("faulted ");
|
||||
grub_xputs (_("faulted "));
|
||||
isok = 0;
|
||||
}
|
||||
|
||||
if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_OFFLINE, &ival))
|
||||
{
|
||||
grub_printf ("offline ");
|
||||
grub_xputs (_("offline "));
|
||||
isok = 0;
|
||||
}
|
||||
|
||||
if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_FAULTED, &ival))
|
||||
grub_printf ("degraded ");
|
||||
grub_xputs (_("degraded "));
|
||||
|
||||
if (isok)
|
||||
grub_printf ("online");
|
||||
grub_printf ("\n");
|
||||
grub_xputs (_("online"));
|
||||
grub_xputs ("\n");
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
@ -84,7 +85,7 @@ print_vdev_info (char *nvlist, int tab)
|
|||
if (!type)
|
||||
{
|
||||
print_tabs (tab);
|
||||
grub_printf ("Incorrect VDEV: no type available\n");
|
||||
grub_puts_ (N_("Incorrect VDEV: no type available"));
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
|
@ -95,7 +96,7 @@ print_vdev_info (char *nvlist, int tab)
|
|||
char *devid = 0;
|
||||
|
||||
print_tabs (tab);
|
||||
grub_printf ("Leaf VDEV\n");
|
||||
grub_puts_ (N_("Leaf VDEV"));
|
||||
|
||||
print_state (nvlist, tab);
|
||||
|
||||
|
@ -103,23 +104,23 @@ print_vdev_info (char *nvlist, int tab)
|
|||
grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_PHYS_PATH);
|
||||
print_tabs (tab);
|
||||
if (!bootpath)
|
||||
grub_printf ("Bootpath: unavailable\n");
|
||||
grub_puts_ (N_("Bootpath: unavailable\n"));
|
||||
else
|
||||
grub_printf ("Bootpath: %s\n", bootpath);
|
||||
grub_printf_ (N_("Bootpath: %s\n"), bootpath);
|
||||
|
||||
path = grub_zfs_nvlist_lookup_string (nvlist, "path");
|
||||
print_tabs (tab);
|
||||
if (!path)
|
||||
grub_printf ("Path: unavailable\n");
|
||||
grub_puts_ (N_("Path: unavailable"));
|
||||
else
|
||||
grub_printf ("Path: %s\n", path);
|
||||
grub_printf_ (N_("Path: %s\n"), path);
|
||||
|
||||
devid = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_DEVID);
|
||||
print_tabs (tab);
|
||||
if (!devid)
|
||||
grub_printf ("Devid: unavailable\n");
|
||||
grub_puts_ (N_("Devid: unavailable"));
|
||||
else
|
||||
grub_printf ("Devid: %s\n", devid);
|
||||
grub_printf_ (N_("Devid: %s\n"), devid);
|
||||
grub_free (bootpath);
|
||||
grub_free (devid);
|
||||
grub_free (path);
|
||||
|
@ -136,10 +137,10 @@ print_vdev_info (char *nvlist, int tab)
|
|||
print_tabs (tab);
|
||||
if (nelm <= 0)
|
||||
{
|
||||
grub_printf ("Incorrect mirror VDEV\n");
|
||||
grub_puts_ (N_("Incorrect mirror VDEV"));
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
grub_printf ("Mirror VDEV with %d children\n", nelm);
|
||||
grub_printf_ (N_("Mirror VDEV with %d children\n"), nelm);
|
||||
print_state (nvlist, tab);
|
||||
for (i = 0; i < nelm; i++)
|
||||
{
|
||||
|
@ -151,11 +152,11 @@ print_vdev_info (char *nvlist, int tab)
|
|||
print_tabs (tab);
|
||||
if (!child)
|
||||
{
|
||||
grub_printf ("Mirror VDEV element %d isn't correct\n", i);
|
||||
grub_printf_ (N_("Mirror VDEV element %d isn't correct\n"), i);
|
||||
continue;
|
||||
}
|
||||
|
||||
grub_printf ("Mirror VDEV element %d:\n", i);
|
||||
grub_printf_ (N_("Mirror VDEV element %d:\n"), i);
|
||||
print_vdev_info (child, tab + 1);
|
||||
|
||||
grub_free (child);
|
||||
|
@ -164,7 +165,7 @@ print_vdev_info (char *nvlist, int tab)
|
|||
}
|
||||
|
||||
print_tabs (tab);
|
||||
grub_printf ("Unknown VDEV type: %s\n", type);
|
||||
grub_printf_ (N_("Unknown VDEV type: %s\n"), type);
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
@ -221,15 +222,15 @@ get_bootpath (char *nvlist, char **bootpath, char **devid)
|
|||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static char *poolstates[] = {
|
||||
[POOL_STATE_ACTIVE] = "active",
|
||||
[POOL_STATE_EXPORTED] = "exported",
|
||||
[POOL_STATE_DESTROYED] = "destroyed",
|
||||
[POOL_STATE_SPARE] = "reserved for hot spare",
|
||||
[POOL_STATE_L2CACHE] = "level 2 ARC device",
|
||||
[POOL_STATE_UNINITIALIZED] = "uninitialized",
|
||||
[POOL_STATE_UNAVAIL] = "unavailable",
|
||||
[POOL_STATE_POTENTIALLY_ACTIVE] = "potentially active"
|
||||
static const char *poolstates[] = {
|
||||
[POOL_STATE_ACTIVE] = N_("Pool state: active"),
|
||||
[POOL_STATE_EXPORTED] = N_("Pool state: exported"),
|
||||
[POOL_STATE_DESTROYED] = N_("Pool state: destroyed"),
|
||||
[POOL_STATE_SPARE] = N_("Pool state: reserved for hot spare"),
|
||||
[POOL_STATE_L2CACHE] = N_("Pool state: level 2 ARC device"),
|
||||
[POOL_STATE_UNINITIALIZED] = N_("Pool state: uninitialized"),
|
||||
[POOL_STATE_UNAVAIL] = N_("Pool state: unavailable"),
|
||||
[POOL_STATE_POTENTIALLY_ACTIVE] = N_("Pool state: potentially active")
|
||||
};
|
||||
|
||||
static grub_err_t
|
||||
|
@ -274,30 +275,30 @@ grub_cmd_zfsinfo (grub_command_t cmd __attribute__ ((unused)), int argc,
|
|||
|
||||
poolname = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_POOL_NAME);
|
||||
if (!poolname)
|
||||
grub_printf ("Pool name: unavailable\n");
|
||||
grub_puts_ (N_("Pool name: unavailable"));
|
||||
else
|
||||
grub_printf ("Pool name: %s\n", poolname);
|
||||
grub_printf_ (N_("Pool name: %s\n"), poolname);
|
||||
|
||||
found =
|
||||
grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_GUID, &guid);
|
||||
if (!found)
|
||||
grub_printf ("Pool GUID: unavailable\n");
|
||||
grub_puts_ (N_("Pool GUID: unavailable"));
|
||||
else
|
||||
grub_printf ("Pool GUID: %016llx\n", (long long unsigned) guid);
|
||||
grub_printf_ (N_("Pool GUID: %016llx\n"), (long long unsigned) guid);
|
||||
|
||||
found = grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_STATE,
|
||||
&pool_state);
|
||||
if (!found)
|
||||
grub_printf ("Unable to retrieve pool state\n");
|
||||
grub_puts_ (N_("Unable to retrieve pool state"));
|
||||
else if (pool_state >= ARRAY_SIZE (poolstates))
|
||||
grub_printf ("Unrecognized pool state\n");
|
||||
grub_puts_ (N_("Unrecognized pool state"));
|
||||
else
|
||||
grub_printf ("Pool state: %s\n", poolstates[pool_state]);
|
||||
grub_puts_ (poolstates[pool_state]);
|
||||
|
||||
nv = grub_zfs_nvlist_lookup_nvlist (nvlist, ZPOOL_CONFIG_VDEV_TREE);
|
||||
|
||||
if (!nv)
|
||||
grub_printf ("No vdev tree available\n");
|
||||
grub_puts_ (N_("No vdev tree available"));
|
||||
else
|
||||
print_vdev_info (nv, 1);
|
||||
|
||||
|
@ -395,11 +396,11 @@ static grub_command_t cmd_info, cmd_bootfs;
|
|||
GRUB_MOD_INIT (zfsinfo)
|
||||
{
|
||||
cmd_info = grub_register_command ("zfsinfo", grub_cmd_zfsinfo,
|
||||
"zfsinfo DEVICE",
|
||||
"Print ZFS info about DEVICE.");
|
||||
N_("DEVICE"),
|
||||
N_("Print ZFS info about DEVICE."));
|
||||
cmd_bootfs = grub_register_command ("zfs-bootfs", grub_cmd_zfs_bootfs,
|
||||
"zfs-bootfs FILESYSTEM [VARIABLE]",
|
||||
"Print ZFS-BOOTFSOBJ or set it to VARIABLE");
|
||||
N_("FILESYSTEM [VARIABLE]"),
|
||||
N_("Print ZFS-BOOTFSOBJ or set it to VARIABLE"));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI (zfsinfo)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue