2005-07-31 Yoshinori K. Okuji <okuji@enbug.org>

* loader/i386/pc/multiboot.c (grub_multiboot_is_elf32): New
	function.
	(grub_multiboot_load_elf32): Likewise.
	(grub_multiboot_is_elf64): Likewise.
	(grub_multiboot_load_elf64): Likewise.
	(grub_multiboot_load_elf): Likewise.
	(grub_rescue_cmd_multiboot): Call grub_multiboot_load_elf to load
	an ELF32 or ELF64 file.
	This is based on a patch from Ruslan Nikolaev <nruslan@mail.com>.

	From Serbinenko Vladimir <serbinenko.vova@list.ru>:
	* kern/disk.c (grub_print_partinfo): Check if FS->LABEL is not
	NULL before calling FS->LABEL.
	* fs/fat.c (grub_fat_dir): Initialize DIRNAME to NULL.
	* commands/ls.c (grub_ls_list_files): Show labels, if possible.
	(grub_ls_list_disks): Check if FS and FS->LABEL are not NULL
	before calling FS->LABEL.
This commit is contained in:
okuji 2005-07-31 16:12:29 +00:00
parent 141a288bb0
commit ea4097134f
6 changed files with 222 additions and 85 deletions

View file

@ -83,17 +83,20 @@ grub_ls_list_disks (int longlist)
grub_errno = GRUB_ERR_NONE;
grub_printf (", Filesystem type %s",
fs ? fs->name : "Unknown");
(fs->label) (dev, &label);
if (grub_errno == GRUB_ERR_NONE)
fs ? fs->name : "unknown");
if (fs && fs->label)
{
if (label && grub_strlen (label))
grub_printf (", Label: %s", label);
grub_free (label);
(fs->label) (dev, &label);
if (grub_errno == GRUB_ERR_NONE)
{
if (label && grub_strlen (label))
grub_printf (", Label: %s", label);
grub_free (label);
}
else
grub_errno = GRUB_ERR_NONE;
}
else
grub_errno = GRUB_ERR_NONE;
}
grub_putchar ('\n');
@ -221,8 +224,25 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
if (grub_errno == GRUB_ERR_UNKNOWN_FS)
grub_errno = GRUB_ERR_NONE;
grub_printf ("(%s): Filesystem is %s.\n",
grub_printf ("(%s): Filesystem is %s",
device_name, fs ? fs->name : "unknown");
if (fs && fs->label)
{
char *label;
(fs->label) (dev, &label);
if (grub_errno == GRUB_ERR_NONE)
{
if (label && grub_strlen (label))
grub_printf (", Label: %s", label);
grub_free (label);
}
else
grub_errno = GRUB_ERR_NONE;
}
grub_putchar ('\n');
}
else if (fs)
{