Merge mainline into abstractmbi
This commit is contained in:
commit
05847c24e1
10 changed files with 98 additions and 156 deletions
48
ChangeLog
48
ChangeLog
|
@ -1,3 +1,51 @@
|
||||||
|
2010-01-13 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* kern/efi/init.c (grub_efi_fini): Don't call grub_efi_mm_fini as
|
||||||
|
it would result in module crash.
|
||||||
|
|
||||||
|
2010-01-13 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* term/ieee1275/ofconsole.c (grub_ofconsole_putchar): Handle '\r'.
|
||||||
|
(grub_ofconsole_getwh): Split to ...
|
||||||
|
(grub_ofconsole_getwh): ... this.
|
||||||
|
(grub_ofconsole_dimensions): ...and this.
|
||||||
|
(grub_ofconsole_init_output): Call grub_ofconsole_dimensions.
|
||||||
|
|
||||||
|
2010-01-13 Robert Millan <rmh.grub@aybabtu.com>
|
||||||
|
|
||||||
|
* util/mkisofs/rock.c (generate_rock_ridge_attributes): Fix a typo.
|
||||||
|
|
||||||
|
2010-01-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* loader/i386/pc/multiboot2.c: Removed stalled file.
|
||||||
|
|
||||||
|
2010-01-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* util/grub-mkpasswd-pbkdf2.c (main): Use grub_util_init_nls.
|
||||||
|
Reported by: Grégoire Sutre
|
||||||
|
|
||||||
|
2010-01-11 Robert Millan <rmh.grub@aybabtu.com>
|
||||||
|
|
||||||
|
* util/misc.c (canonicalize_file_name): New function.
|
||||||
|
(make_system_path_relative_to_its_root): Use canonicalize_file_name()
|
||||||
|
instead of realpath().
|
||||||
|
|
||||||
|
2010-01-11 Colin Watson <cjwatson@ubuntu.com>
|
||||||
|
|
||||||
|
* util/grub-install.in (usage): Clarify meaning of --root-directory,
|
||||||
|
and make it clearer that it's optional. Based on confusion
|
||||||
|
witnessed on IRC.
|
||||||
|
|
||||||
|
2010-01-10 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* term/i386/pc/vga_text.c (inc_y): Fix off-by-one error which resulted
|
||||||
|
in premature implicit newline.
|
||||||
|
|
||||||
|
2010-01-10 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* normal/cmdline.c (grub_cmdline_get): Fix off-by-one error
|
||||||
|
which resulted in garbled command line at the end of screen.
|
||||||
|
|
||||||
2010-01-10 Robert Millan <rmh.grub@aybabtu.com>
|
2010-01-10 Robert Millan <rmh.grub@aybabtu.com>
|
||||||
|
|
||||||
* loader/i386/ieee1275/linux.c (grub_linux_boot): Rework video position
|
* loader/i386/ieee1275/linux.c (grub_linux_boot): Rework video position
|
||||||
|
|
|
@ -82,6 +82,5 @@ void
|
||||||
grub_efi_fini (void)
|
grub_efi_fini (void)
|
||||||
{
|
{
|
||||||
grub_efidisk_fini ();
|
grub_efidisk_fini ();
|
||||||
grub_efi_mm_fini ();
|
|
||||||
grub_console_fini ();
|
grub_console_fini ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,122 +0,0 @@
|
||||||
/* multiboot2.c - boot a multiboot 2 OS image. */
|
|
||||||
/*
|
|
||||||
* GRUB -- GRand Unified Bootloader
|
|
||||||
* Copyright (C) 2007,2008,2009 Free Software Foundation, Inc.
|
|
||||||
*
|
|
||||||
* GRUB is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GRUB is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <grub/multiboot2.h>
|
|
||||||
#include <multiboot2.h>
|
|
||||||
#include <grub/elf.h>
|
|
||||||
#include <grub/err.h>
|
|
||||||
#include <grub/machine/loader.h>
|
|
||||||
#include <grub/mm.h>
|
|
||||||
#include <grub/multiboot.h>
|
|
||||||
#include <grub/cpu/multiboot.h>
|
|
||||||
|
|
||||||
grub_err_t
|
|
||||||
grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr,
|
|
||||||
grub_addr_t *addr __attribute__ ((unused)),
|
|
||||||
int *do_load)
|
|
||||||
{
|
|
||||||
Elf32_Addr paddr = phdr->p_paddr;
|
|
||||||
|
|
||||||
if (phdr->p_type != PT_LOAD)
|
|
||||||
{
|
|
||||||
*do_load = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
*do_load = 1;
|
|
||||||
|
|
||||||
if ((paddr < grub_os_area_addr)
|
|
||||||
|| (paddr + phdr->p_memsz > grub_os_area_addr + grub_os_area_size))
|
|
||||||
return grub_error(GRUB_ERR_OUT_OF_RANGE,"address 0x%x is out of range",
|
|
||||||
paddr);
|
|
||||||
|
|
||||||
return GRUB_ERR_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
grub_err_t
|
|
||||||
grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr,
|
|
||||||
grub_addr_t *addr __attribute__ ((unused)),
|
|
||||||
int *do_load)
|
|
||||||
{
|
|
||||||
Elf64_Addr paddr = phdr->p_paddr;
|
|
||||||
|
|
||||||
if (phdr->p_type != PT_LOAD)
|
|
||||||
{
|
|
||||||
*do_load = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
*do_load = 1;
|
|
||||||
|
|
||||||
if ((paddr < grub_os_area_addr)
|
|
||||||
|| (paddr + phdr->p_memsz > grub_os_area_addr + grub_os_area_size))
|
|
||||||
return grub_error (GRUB_ERR_OUT_OF_RANGE, "address 0x%x is out of range",
|
|
||||||
paddr);
|
|
||||||
|
|
||||||
return GRUB_ERR_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
grub_err_t
|
|
||||||
grub_mb2_arch_module_alloc (grub_size_t size, grub_addr_t *addr)
|
|
||||||
{
|
|
||||||
grub_addr_t modaddr;
|
|
||||||
|
|
||||||
modaddr = (grub_addr_t) grub_memalign (MULTIBOOT2_MOD_ALIGN, size);
|
|
||||||
if (! modaddr)
|
|
||||||
return grub_errno;
|
|
||||||
|
|
||||||
*addr = modaddr;
|
|
||||||
return GRUB_ERR_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
grub_err_t
|
|
||||||
grub_mb2_arch_module_free (grub_addr_t addr,
|
|
||||||
grub_size_t size __attribute__ ((unused)))
|
|
||||||
{
|
|
||||||
grub_free((void *) addr);
|
|
||||||
return GRUB_ERR_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
grub_mb2_arch_boot (grub_addr_t entry, void *tags)
|
|
||||||
{
|
|
||||||
grub_multiboot2_real_boot (entry, tags);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
grub_mb2_arch_unload (struct multiboot2_tag_header *tags)
|
|
||||||
{
|
|
||||||
struct multiboot2_tag_header *tag;
|
|
||||||
|
|
||||||
/* Free all module memory in the tag list. */
|
|
||||||
for_each_tag (tag, tags)
|
|
||||||
{
|
|
||||||
if (tag->key == MULTIBOOT2_TAG_MODULE)
|
|
||||||
{
|
|
||||||
struct multiboot2_tag_module *module =
|
|
||||||
(struct multiboot2_tag_module *) tag;
|
|
||||||
grub_free((void *) module->addr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
grub_err_t
|
|
||||||
grub_mb2_tags_arch_create (void)
|
|
||||||
{
|
|
||||||
/* XXX Create boot device et al. */
|
|
||||||
return GRUB_ERR_NONE;
|
|
||||||
}
|
|
|
@ -254,21 +254,20 @@ grub_cmdline_get (const char *prompt)
|
||||||
|
|
||||||
for (p = buf + pos; p < buf + llen; p++)
|
for (p = buf + pos; p < buf + llen; p++)
|
||||||
{
|
{
|
||||||
if (cl_term->xpos++ > cl_term->width - 2)
|
|
||||||
{
|
|
||||||
grub_putcode ('\n', cl_term->term);
|
|
||||||
|
|
||||||
cl_term->xpos = 1;
|
|
||||||
if (cl_term->ypos == (unsigned) (cl_term->height))
|
|
||||||
cl_term->ystart--;
|
|
||||||
else
|
|
||||||
cl_term->ypos++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (c)
|
if (c)
|
||||||
grub_putcode (c, cl_term->term);
|
grub_putcode (c, cl_term->term);
|
||||||
else
|
else
|
||||||
grub_putcode (*p, cl_term->term);
|
grub_putcode (*p, cl_term->term);
|
||||||
|
cl_term->xpos++;
|
||||||
|
if (cl_term->xpos >= cl_term->width - 1)
|
||||||
|
{
|
||||||
|
cl_term->xpos = 0;
|
||||||
|
if (cl_term->ypos >= (unsigned) (cl_term->height - 1))
|
||||||
|
cl_term->ystart--;
|
||||||
|
else
|
||||||
|
cl_term->ypos++;
|
||||||
|
grub_putcode ('\n', cl_term->term);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ inc_y (void)
|
||||||
static void
|
static void
|
||||||
inc_x (void)
|
inc_x (void)
|
||||||
{
|
{
|
||||||
if (grub_curr_x >= COLS - 2)
|
if (grub_curr_x >= COLS - 1)
|
||||||
inc_y ();
|
inc_y ();
|
||||||
else
|
else
|
||||||
grub_curr_x++;
|
grub_curr_x++;
|
||||||
|
|
|
@ -83,12 +83,17 @@ grub_ofconsole_putchar (grub_uint32_t c)
|
||||||
grub_curr_y++;
|
grub_curr_y++;
|
||||||
grub_curr_x = 0;
|
grub_curr_x = 0;
|
||||||
}
|
}
|
||||||
|
else if (c == '\r')
|
||||||
|
{
|
||||||
|
grub_curr_x = 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
grub_curr_x++;
|
grub_curr_x++;
|
||||||
if (grub_curr_x > grub_ofconsole_width)
|
if (grub_curr_x >= grub_ofconsole_width)
|
||||||
{
|
{
|
||||||
grub_ofconsole_putchar ('\n');
|
grub_ofconsole_putchar ('\n');
|
||||||
|
grub_ofconsole_putchar ('\r');
|
||||||
grub_curr_x++;
|
grub_curr_x++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -234,16 +239,13 @@ grub_ofconsole_getxy (void)
|
||||||
return ((grub_curr_x - 1) << 8) | grub_curr_y;
|
return ((grub_curr_x - 1) << 8) | grub_curr_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static grub_uint16_t
|
static void
|
||||||
grub_ofconsole_getwh (void)
|
grub_ofconsole_dimensions (void)
|
||||||
{
|
{
|
||||||
grub_ieee1275_ihandle_t options;
|
grub_ieee1275_ihandle_t options;
|
||||||
char *val;
|
char *val;
|
||||||
grub_ssize_t lval;
|
grub_ssize_t lval;
|
||||||
|
|
||||||
if (grub_ofconsole_width && grub_ofconsole_height)
|
|
||||||
return (grub_ofconsole_width << 8) | grub_ofconsole_height;
|
|
||||||
|
|
||||||
if (! grub_ieee1275_finddevice ("/options", &options)
|
if (! grub_ieee1275_finddevice ("/options", &options)
|
||||||
&& options != (grub_ieee1275_ihandle_t) -1)
|
&& options != (grub_ieee1275_ihandle_t) -1)
|
||||||
{
|
{
|
||||||
|
@ -280,7 +282,11 @@ grub_ofconsole_getwh (void)
|
||||||
grub_ofconsole_width = 80;
|
grub_ofconsole_width = 80;
|
||||||
if (! grub_ofconsole_height)
|
if (! grub_ofconsole_height)
|
||||||
grub_ofconsole_height = 24;
|
grub_ofconsole_height = 24;
|
||||||
|
}
|
||||||
|
|
||||||
|
static grub_uint16_t
|
||||||
|
grub_ofconsole_getwh (void)
|
||||||
|
{
|
||||||
return (grub_ofconsole_width << 8) | grub_ofconsole_height;
|
return (grub_ofconsole_width << 8) | grub_ofconsole_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,6 +385,8 @@ grub_ofconsole_init_output (void)
|
||||||
grub_ofconsole_setcolorstate (GRUB_TERM_COLOR_NORMAL);
|
grub_ofconsole_setcolorstate (GRUB_TERM_COLOR_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grub_ofconsole_dimensions ();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,9 +87,11 @@ fi
|
||||||
|
|
||||||
INSTALL_DEVICE can be a GRUB device name or a system device filename.
|
INSTALL_DEVICE can be a GRUB device name or a system device filename.
|
||||||
|
|
||||||
grub-install copies GRUB images into the DIR/boot directory specified by
|
grub-install copies GRUB images into /boot/grub (or /grub on NetBSD and
|
||||||
--root-directory, and uses grub-setup to install grub into the boot
|
OpenBSD), and uses grub-setup to install grub into the boot sector.
|
||||||
sector.
|
|
||||||
|
If the --root-directory option is used, then grub-install will copy
|
||||||
|
images into the operating system installation rooted at that directory.
|
||||||
|
|
||||||
Report bugs to <bug-grub@gnu.org>.
|
Report bugs to <bug-grub@gnu.org>.
|
||||||
EOF
|
EOF
|
||||||
|
|
|
@ -123,9 +123,8 @@ main (int argc, char *argv[])
|
||||||
int tty_changed;
|
int tty_changed;
|
||||||
|
|
||||||
set_program_name (argv[0]);
|
set_program_name (argv[0]);
|
||||||
setlocale (LC_ALL, "");
|
|
||||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
grub_util_init_nls ();
|
||||||
textdomain (PACKAGE);
|
|
||||||
|
|
||||||
/* Check for options. */
|
/* Check for options. */
|
||||||
while (1)
|
while (1)
|
||||||
|
|
23
util/misc.c
23
util/misc.c
|
@ -479,6 +479,19 @@ fail:
|
||||||
|
|
||||||
#endif /* __MINGW32__ */
|
#endif /* __MINGW32__ */
|
||||||
|
|
||||||
|
char *
|
||||||
|
canonicalize_file_name (const char *path)
|
||||||
|
{
|
||||||
|
char *ret;
|
||||||
|
#ifdef PATH_MAX
|
||||||
|
ret = xmalloc (PATH_MAX);
|
||||||
|
(void) realpath (path, ret);
|
||||||
|
#else
|
||||||
|
ret = realpath (path, NULL);
|
||||||
|
#endif
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* This function never prints trailing slashes (so that its output
|
/* This function never prints trailing slashes (so that its output
|
||||||
can be appended a slash unconditionally). */
|
can be appended a slash unconditionally). */
|
||||||
char *
|
char *
|
||||||
|
@ -491,15 +504,11 @@ make_system_path_relative_to_its_root (const char *path)
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
/* canonicalize. */
|
/* canonicalize. */
|
||||||
p = realpath (path, NULL);
|
p = canonicalize_file_name (path);
|
||||||
|
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
{
|
grub_util_error ("failed to get canonical path of %s", path);
|
||||||
if (errno != EINVAL)
|
|
||||||
grub_util_error ("failed to get realpath of %s", path);
|
|
||||||
else
|
|
||||||
grub_util_error ("realpath not supporting (path, NULL)");
|
|
||||||
}
|
|
||||||
len = strlen (p) + 1;
|
len = strlen (p) + 1;
|
||||||
buf = strdup (p);
|
buf = strdup (p);
|
||||||
free (p);
|
free (p);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
Copyright 1993 Yggdrasil Computing, Incorporated
|
Copyright 1993 Yggdrasil Computing, Incorporated
|
||||||
|
|
||||||
Copyright (C) 2009 Free Software Foundation, Inc.
|
Copyright (C) 2009,2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -306,7 +306,7 @@ int deep_opt;
|
||||||
* the symbolic link won't fit into one SL System Use Field
|
* the symbolic link won't fit into one SL System Use Field
|
||||||
* print an error message and continue with splited one
|
* print an error message and continue with splited one
|
||||||
*/
|
*/
|
||||||
fprintf(stderr, _("symbolic link ``%s'' to long for one SL System Use Field, splitting"), cpnt);
|
fprintf (stderr, _("symbolic link ``%s'' too long for one SL System Use Field, splitting"), cpnt);
|
||||||
}
|
}
|
||||||
if(MAYBE_ADD_CE_ENTRY(SL_SIZE + sl_bytes)) add_CE_entry();
|
if(MAYBE_ADD_CE_ENTRY(SL_SIZE + sl_bytes)) add_CE_entry();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue