merge mainline into newreloc
This commit is contained in:
commit
a52dadc592
7 changed files with 65 additions and 147 deletions
31
ChangeLog
31
ChangeLog
|
@ -1,3 +1,34 @@
|
||||||
|
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
|
||||||
|
|
|
@ -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++;
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue