mirror of
https://git.proxmox.com/git/grub2
synced 2025-07-31 22:34:02 +00:00
Merge upstream
This commit is contained in:
commit
5da63ce4ba
44
ChangeLog
44
ChangeLog
@ -1,3 +1,45 @@
|
|||||||
|
2010-01-26 Robert Millan <rmh.grub@aybabtu.com>
|
||||||
|
|
||||||
|
* include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_PXE_DL): New macro.
|
||||||
|
|
||||||
|
* boot/i386/pc/pxeboot.S: Include `<grub/machine/boot.h>'.
|
||||||
|
(_start): Macroify `0x7F'.
|
||||||
|
|
||||||
|
* kern/i386/pc/init.c: Include `<grub/machine/boot.h>'.
|
||||||
|
(make_install_device): Use "(pxe)" as fallback prefix when booting
|
||||||
|
via PXE.
|
||||||
|
|
||||||
|
2010-01-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* configure.ac: Reset LIBS after check for libgcc symbols.
|
||||||
|
|
||||||
|
2010-01-25 Colin Watson <cjwatson@ubuntu.com>
|
||||||
|
|
||||||
|
* util/hostdisk.c (open_device): Add trailing newline to debug
|
||||||
|
message.
|
||||||
|
|
||||||
|
2010-01-25 Grégoire Sutre <gregoire.sutre@gmail.com>
|
||||||
|
|
||||||
|
* configure.ac: Check for `limits.h'.
|
||||||
|
* util/misc.c: Include `<limits.h>' (for PATH_MAX).
|
||||||
|
|
||||||
|
2010-01-24 Robert Millan <rmh.grub@aybabtu.com>
|
||||||
|
|
||||||
|
* loader/mips/linux.c (grub_cmd_linux, grub_cmd_initrd): Don't
|
||||||
|
capitalize error strings.
|
||||||
|
|
||||||
|
2010-01-24 Samuel Thibault <samuel.thibault@ens-lyon.org>
|
||||||
|
|
||||||
|
* util/grub.d/10_hurd.in: Add a recovery mode.
|
||||||
|
|
||||||
|
2010-01-23 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* configure.ac: Check for libgcc symbols with -nostdlib.
|
||||||
|
|
||||||
|
2010-01-23 BVK Chaitanya <bvk.groups@gmail.com>
|
||||||
|
|
||||||
|
* acinclude.m4: Quote underquoted AC_DEFUN parameters.
|
||||||
|
|
||||||
2010-01-22 Vladimir Serbinenko <phcoder@gmail.com>
|
2010-01-22 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* term/ieee1275/ofconsole.c (grub_ofconsole_setcolorstate): Allocate on
|
* term/ieee1275/ofconsole.c (grub_ofconsole_setcolorstate): Allocate on
|
||||||
@ -23816,7 +23858,7 @@
|
|||||||
|
|
||||||
* genmk.rb (PModule#rule): Make sure to get only symbol names
|
* genmk.rb (PModule#rule): Make sure to get only symbol names
|
||||||
from the output of nm.
|
from the output of nm.
|
||||||
Reported by Robert Millan <zeratul2@wanadoo.es>.
|
Reported by Robert Millan <rmh.grub@aybabtu.com>.
|
||||||
|
|
||||||
2003-09-25 Yoshinori K. Okuji <okuji@enbug.org>
|
2003-09-25 Yoshinori K. Okuji <okuji@enbug.org>
|
||||||
|
|
||||||
|
32
acinclude.m4
32
acinclude.m4
@ -14,7 +14,7 @@ $2
|
|||||||
|
|
||||||
|
|
||||||
dnl Check whether target compiler is working
|
dnl Check whether target compiler is working
|
||||||
AC_DEFUN(grub_PROG_TARGET_CC,
|
AC_DEFUN([grub_PROG_TARGET_CC],
|
||||||
[AC_MSG_CHECKING([whether target compiler is working])
|
[AC_MSG_CHECKING([whether target compiler is working])
|
||||||
AC_CACHE_VAL(grub_cv_prog_target_cc,
|
AC_CACHE_VAL(grub_cv_prog_target_cc,
|
||||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||||
@ -36,7 +36,7 @@ dnl grub_ASM_USCORE checks if C symbols get an underscore after
|
|||||||
dnl compiling to assembler.
|
dnl compiling to assembler.
|
||||||
dnl Written by Pavel Roskin. Based on grub_ASM_EXT_C written by
|
dnl Written by Pavel Roskin. Based on grub_ASM_EXT_C written by
|
||||||
dnl Erich Boleyn and modified by Yoshinori K. Okuji.
|
dnl Erich Boleyn and modified by Yoshinori K. Okuji.
|
||||||
AC_DEFUN(grub_ASM_USCORE,
|
AC_DEFUN([grub_ASM_USCORE],
|
||||||
[AC_REQUIRE([AC_PROG_CC])
|
[AC_REQUIRE([AC_PROG_CC])
|
||||||
AC_MSG_CHECKING([if C symbols get an underscore after compilation])
|
AC_MSG_CHECKING([if C symbols get an underscore after compilation])
|
||||||
AC_CACHE_VAL(grub_cv_asm_uscore,
|
AC_CACHE_VAL(grub_cv_asm_uscore,
|
||||||
@ -75,7 +75,7 @@ AC_MSG_RESULT([$grub_cv_asm_uscore])
|
|||||||
|
|
||||||
dnl Some versions of `objcopy -O binary' vary their output depending
|
dnl Some versions of `objcopy -O binary' vary their output depending
|
||||||
dnl on the link address.
|
dnl on the link address.
|
||||||
AC_DEFUN(grub_PROG_OBJCOPY_ABSOLUTE,
|
AC_DEFUN([grub_PROG_OBJCOPY_ABSOLUTE],
|
||||||
[AC_MSG_CHECKING([whether ${OBJCOPY} works for absolute addresses])
|
[AC_MSG_CHECKING([whether ${OBJCOPY} works for absolute addresses])
|
||||||
AC_CACHE_VAL(grub_cv_prog_objcopy_absolute,
|
AC_CACHE_VAL(grub_cv_prog_objcopy_absolute,
|
||||||
[cat > conftest.c <<\EOF
|
[cat > conftest.c <<\EOF
|
||||||
@ -119,7 +119,7 @@ fi
|
|||||||
|
|
||||||
dnl Supply --build-id=none to ld if building modules.
|
dnl Supply --build-id=none to ld if building modules.
|
||||||
dnl This suppresses warnings from ld on some systems
|
dnl This suppresses warnings from ld on some systems
|
||||||
AC_DEFUN(grub_PROG_LD_BUILD_ID_NONE,
|
AC_DEFUN([grub_PROG_LD_BUILD_ID_NONE],
|
||||||
[AC_MSG_CHECKING([whether linker accepts --build-id=none])
|
[AC_MSG_CHECKING([whether linker accepts --build-id=none])
|
||||||
AC_CACHE_VAL(grub_cv_prog_ld_build_id_none,
|
AC_CACHE_VAL(grub_cv_prog_ld_build_id_none,
|
||||||
[save_LDFLAGS="$LDFLAGS"
|
[save_LDFLAGS="$LDFLAGS"
|
||||||
@ -150,7 +150,7 @@ dnl
|
|||||||
dnl We only support the newer versions, because the old versions cause
|
dnl We only support the newer versions, because the old versions cause
|
||||||
dnl major pain, by requiring manual assembly to get 16-bit instructions into
|
dnl major pain, by requiring manual assembly to get 16-bit instructions into
|
||||||
dnl asm files.
|
dnl asm files.
|
||||||
AC_DEFUN(grub_I386_ASM_ADDR32,
|
AC_DEFUN([grub_I386_ASM_ADDR32],
|
||||||
[AC_REQUIRE([AC_PROG_CC])
|
[AC_REQUIRE([AC_PROG_CC])
|
||||||
AC_REQUIRE([grub_I386_ASM_PREFIX_REQUIREMENT])
|
AC_REQUIRE([grub_I386_ASM_PREFIX_REQUIREMENT])
|
||||||
AC_MSG_CHECKING([for .code16 addr32 assembler support])
|
AC_MSG_CHECKING([for .code16 addr32 assembler support])
|
||||||
@ -178,7 +178,7 @@ AC_MSG_RESULT([$grub_cv_i386_asm_addr32])])
|
|||||||
|
|
||||||
dnl check if our compiler is apple cc
|
dnl check if our compiler is apple cc
|
||||||
dnl because it requires numerous workarounds
|
dnl because it requires numerous workarounds
|
||||||
AC_DEFUN(grub_apple_cc,
|
AC_DEFUN([grub_apple_cc],
|
||||||
[AC_REQUIRE([AC_PROG_CC])
|
[AC_REQUIRE([AC_PROG_CC])
|
||||||
AC_MSG_CHECKING([whether our compiler is apple cc])
|
AC_MSG_CHECKING([whether our compiler is apple cc])
|
||||||
AC_CACHE_VAL(grub_cv_apple_cc,
|
AC_CACHE_VAL(grub_cv_apple_cc,
|
||||||
@ -193,7 +193,7 @@ AC_MSG_RESULT([$grub_cv_apple_cc])])
|
|||||||
|
|
||||||
dnl check if our target compiler is apple cc
|
dnl check if our target compiler is apple cc
|
||||||
dnl because it requires numerous workarounds
|
dnl because it requires numerous workarounds
|
||||||
AC_DEFUN(grub_apple_target_cc,
|
AC_DEFUN([grub_apple_target_cc],
|
||||||
[AC_REQUIRE([AC_PROG_CC])
|
[AC_REQUIRE([AC_PROG_CC])
|
||||||
AC_MSG_CHECKING([whether our target compiler is apple cc])
|
AC_MSG_CHECKING([whether our target compiler is apple cc])
|
||||||
AC_CACHE_VAL(grub_cv_apple_target_cc,
|
AC_CACHE_VAL(grub_cv_apple_target_cc,
|
||||||
@ -210,7 +210,7 @@ AC_MSG_RESULT([$grub_cv_apple_target_cc])])
|
|||||||
dnl Later versions of GAS requires that addr32 and data32 prefixes
|
dnl Later versions of GAS requires that addr32 and data32 prefixes
|
||||||
dnl appear in the same lines as the instructions they modify, while
|
dnl appear in the same lines as the instructions they modify, while
|
||||||
dnl earlier versions requires that they appear in separate lines.
|
dnl earlier versions requires that they appear in separate lines.
|
||||||
AC_DEFUN(grub_I386_ASM_PREFIX_REQUIREMENT,
|
AC_DEFUN([grub_I386_ASM_PREFIX_REQUIREMENT],
|
||||||
[AC_REQUIRE([AC_PROG_CC])
|
[AC_REQUIRE([AC_PROG_CC])
|
||||||
AC_MSG_CHECKING(dnl
|
AC_MSG_CHECKING(dnl
|
||||||
[whether addr32 must be in the same line as the instruction])
|
[whether addr32 must be in the same line as the instruction])
|
||||||
@ -246,7 +246,7 @@ AC_MSG_RESULT([$grub_cv_i386_asm_prefix_requirement])])
|
|||||||
|
|
||||||
dnl Older versions of GAS require that absolute indirect calls/jumps are
|
dnl Older versions of GAS require that absolute indirect calls/jumps are
|
||||||
dnl not prefixed with `*', while later versions warn if not prefixed.
|
dnl not prefixed with `*', while later versions warn if not prefixed.
|
||||||
AC_DEFUN(grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK,
|
AC_DEFUN([grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK],
|
||||||
[AC_REQUIRE([AC_PROG_CC])
|
[AC_REQUIRE([AC_PROG_CC])
|
||||||
AC_MSG_CHECKING(dnl
|
AC_MSG_CHECKING(dnl
|
||||||
[whether an absolute indirect call/jump must not be prefixed with an asterisk])
|
[whether an absolute indirect call/jump must not be prefixed with an asterisk])
|
||||||
@ -276,7 +276,7 @@ AC_MSG_RESULT([$grub_cv_i386_asm_absolute_without_asterisk])])
|
|||||||
|
|
||||||
dnl Check what symbol is defined as a bss start symbol.
|
dnl Check what symbol is defined as a bss start symbol.
|
||||||
dnl Written by Michael Hohmoth and Yoshinori K. Okuji.
|
dnl Written by Michael Hohmoth and Yoshinori K. Okuji.
|
||||||
AC_DEFUN(grub_CHECK_BSS_START_SYMBOL,
|
AC_DEFUN([grub_CHECK_BSS_START_SYMBOL],
|
||||||
[AC_REQUIRE([AC_PROG_CC])
|
[AC_REQUIRE([AC_PROG_CC])
|
||||||
AC_MSG_CHECKING([if __bss_start is defined by the compiler])
|
AC_MSG_CHECKING([if __bss_start is defined by the compiler])
|
||||||
AC_CACHE_VAL(grub_cv_check_uscore_uscore_bss_start_symbol,
|
AC_CACHE_VAL(grub_cv_check_uscore_uscore_bss_start_symbol,
|
||||||
@ -320,7 +320,7 @@ fi
|
|||||||
|
|
||||||
dnl Check what symbol is defined as an end symbol.
|
dnl Check what symbol is defined as an end symbol.
|
||||||
dnl Written by Yoshinori K. Okuji.
|
dnl Written by Yoshinori K. Okuji.
|
||||||
AC_DEFUN(grub_CHECK_END_SYMBOL,
|
AC_DEFUN([grub_CHECK_END_SYMBOL],
|
||||||
[AC_REQUIRE([AC_PROG_CC])
|
[AC_REQUIRE([AC_PROG_CC])
|
||||||
AC_MSG_CHECKING([if end is defined by the compiler])
|
AC_MSG_CHECKING([if end is defined by the compiler])
|
||||||
AC_CACHE_VAL(grub_cv_check_end_symbol,
|
AC_CACHE_VAL(grub_cv_check_end_symbol,
|
||||||
@ -352,7 +352,7 @@ fi
|
|||||||
])
|
])
|
||||||
|
|
||||||
dnl Check if the C compiler generates calls to `__enable_execute_stack()'.
|
dnl Check if the C compiler generates calls to `__enable_execute_stack()'.
|
||||||
AC_DEFUN(grub_CHECK_ENABLE_EXECUTE_STACK,[
|
AC_DEFUN([grub_CHECK_ENABLE_EXECUTE_STACK],[
|
||||||
AC_MSG_CHECKING([whether `$CC' generates calls to `__enable_execute_stack()'])
|
AC_MSG_CHECKING([whether `$CC' generates calls to `__enable_execute_stack()'])
|
||||||
AC_LANG_CONFTEST([[
|
AC_LANG_CONFTEST([[
|
||||||
void f (int (*p) (void));
|
void f (int (*p) (void));
|
||||||
@ -379,7 +379,7 @@ rm -f conftest*
|
|||||||
|
|
||||||
|
|
||||||
dnl Check if the C compiler supports `-fstack-protector'.
|
dnl Check if the C compiler supports `-fstack-protector'.
|
||||||
AC_DEFUN(grub_CHECK_STACK_PROTECTOR,[
|
AC_DEFUN([grub_CHECK_STACK_PROTECTOR],[
|
||||||
[# Smashing stack protector.
|
[# Smashing stack protector.
|
||||||
ssp_possible=yes]
|
ssp_possible=yes]
|
||||||
AC_MSG_CHECKING([whether `$CC' accepts `-fstack-protector'])
|
AC_MSG_CHECKING([whether `$CC' accepts `-fstack-protector'])
|
||||||
@ -398,7 +398,7 @@ else
|
|||||||
])
|
])
|
||||||
|
|
||||||
dnl Check if the C compiler supports `-mstack-arg-probe' (Cygwin).
|
dnl Check if the C compiler supports `-mstack-arg-probe' (Cygwin).
|
||||||
AC_DEFUN(grub_CHECK_STACK_ARG_PROBE,[
|
AC_DEFUN([grub_CHECK_STACK_ARG_PROBE],[
|
||||||
[# Smashing stack arg probe.
|
[# Smashing stack arg probe.
|
||||||
sap_possible=yes]
|
sap_possible=yes]
|
||||||
AC_MSG_CHECKING([whether `$CC' accepts `-mstack-arg-probe'])
|
AC_MSG_CHECKING([whether `$CC' accepts `-mstack-arg-probe'])
|
||||||
@ -414,7 +414,7 @@ else
|
|||||||
])
|
])
|
||||||
|
|
||||||
dnl Check if ln can handle directories properly (mingw).
|
dnl Check if ln can handle directories properly (mingw).
|
||||||
AC_DEFUN(grub_CHECK_LINK_DIR,[
|
AC_DEFUN([grub_CHECK_LINK_DIR],[
|
||||||
AC_MSG_CHECKING([whether ln can handle directories properly])
|
AC_MSG_CHECKING([whether ln can handle directories properly])
|
||||||
[mkdir testdir 2>/dev/null
|
[mkdir testdir 2>/dev/null
|
||||||
case $srcdir in
|
case $srcdir in
|
||||||
@ -432,7 +432,7 @@ rm -rf testdir]
|
|||||||
])
|
])
|
||||||
|
|
||||||
dnl Check if the C compiler supports `-fPIE'.
|
dnl Check if the C compiler supports `-fPIE'.
|
||||||
AC_DEFUN(grub_CHECK_PIE,[
|
AC_DEFUN([grub_CHECK_PIE],[
|
||||||
[# Position independent executable.
|
[# Position independent executable.
|
||||||
pie_possible=yes]
|
pie_possible=yes]
|
||||||
AC_MSG_CHECKING([whether `$CC' has `-fPIE' as default])
|
AC_MSG_CHECKING([whether `$CC' has `-fPIE' as default])
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* GRUB -- GRand Unified Bootloader
|
* GRUB -- GRand Unified Bootloader
|
||||||
* Copyright (C) 2000,2005,2007,2008,2009 Free Software Foundation, Inc.
|
* Copyright (C) 2000,2005,2007,2008,2009,2010 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* GRUB is free software: you can redistribute it and/or modify
|
* GRUB 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
|
||||||
@ -16,6 +16,8 @@
|
|||||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <grub/machine/boot.h>
|
||||||
|
|
||||||
.file "pxeboot.S"
|
.file "pxeboot.S"
|
||||||
.text
|
.text
|
||||||
|
|
||||||
@ -28,7 +30,7 @@ _start:
|
|||||||
start:
|
start:
|
||||||
|
|
||||||
/* Use drive number 0x7F for PXE */
|
/* Use drive number 0x7F for PXE */
|
||||||
movb $0x7F, %dl
|
movb $GRUB_BOOT_MACHINE_PXE_DL, %dl
|
||||||
|
|
||||||
/* Jump to the real world */
|
/* Jump to the real world */
|
||||||
ljmp $0, $0x8200
|
ljmp $0, $0x8200
|
||||||
|
20
configure.ac
20
configure.ac
@ -221,7 +221,7 @@ AC_HEADER_MAJOR
|
|||||||
AC_HEADER_DIRENT
|
AC_HEADER_DIRENT
|
||||||
AC_CHECK_FUNCS(memmove sbrk strdup lstat getuid getgid)
|
AC_CHECK_FUNCS(memmove sbrk strdup lstat getuid getgid)
|
||||||
AC_CHECK_HEADERS(sys/mkdev.h sys/sysmacros.h malloc.h termios.h sys/types.h)
|
AC_CHECK_HEADERS(sys/mkdev.h sys/sysmacros.h malloc.h termios.h sys/types.h)
|
||||||
AC_CHECK_HEADERS(unistd.h string.h strings.h sys/stat.h sys/fcntl.h)
|
AC_CHECK_HEADERS(unistd.h string.h strings.h sys/stat.h sys/fcntl.h limits.h)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check for target programs.
|
# Check for target programs.
|
||||||
@ -438,18 +438,26 @@ AC_SUBST(TARGET_ASFLAGS)
|
|||||||
AC_SUBST(TARGET_CPPFLAGS)
|
AC_SUBST(TARGET_CPPFLAGS)
|
||||||
AC_SUBST(TARGET_LDFLAGS)
|
AC_SUBST(TARGET_LDFLAGS)
|
||||||
|
|
||||||
# Check for libgcc symbols (must be performed before we add -nostdlib to LDFLAGS)
|
|
||||||
AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __trampoline_setup __ucmpdi2 _restgpr_14_x)
|
|
||||||
|
|
||||||
# Set them to their new values for the tests below.
|
# Set them to their new values for the tests below.
|
||||||
CC="$TARGET_CC"
|
CC="$TARGET_CC"
|
||||||
|
if test "x$TARGET_APPLE_CC" = x1 ; then
|
||||||
|
CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error"
|
||||||
|
else
|
||||||
|
CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100 -Wl,--defsym,abort=main -Wno-error"
|
||||||
|
fi
|
||||||
|
CPPFLAGS="$TARGET_CPPFLAGS"
|
||||||
|
LDFLAGS="$TARGET_LDFLAGS"
|
||||||
|
LIBS=-lgcc
|
||||||
|
|
||||||
|
# Check for libgcc symbols
|
||||||
|
AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __trampoline_setup __ucmpdi2 _restgpr_14_x)
|
||||||
|
|
||||||
if test "x$TARGET_APPLE_CC" = x1 ; then
|
if test "x$TARGET_APPLE_CC" = x1 ; then
|
||||||
CFLAGS="$TARGET_CFLAGS -nostdlib"
|
CFLAGS="$TARGET_CFLAGS -nostdlib"
|
||||||
else
|
else
|
||||||
CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100"
|
CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100"
|
||||||
fi
|
fi
|
||||||
CPPFLAGS="$TARGET_CPPFLAGS"
|
LIBS=""
|
||||||
LDFLAGS="$TARGET_LDFLAGS"
|
|
||||||
|
|
||||||
# Defined in aclocal.m4.
|
# Defined in aclocal.m4.
|
||||||
grub_PROG_TARGET_CC
|
grub_PROG_TARGET_CC
|
||||||
|
2
debian/changelog
vendored
2
debian/changelog
vendored
@ -1,4 +1,4 @@
|
|||||||
grub2 (1.98~20100120-1) unstable; urgency=low
|
grub2 (1.98~20100126-1) unstable; urgency=low
|
||||||
|
|
||||||
* New Bazaar snapshot.
|
* New Bazaar snapshot.
|
||||||
- Includes mipsel-yeeloong port.
|
- Includes mipsel-yeeloong port.
|
||||||
|
@ -66,6 +66,8 @@
|
|||||||
/* The size of a block list used in the kernel startup code. */
|
/* The size of a block list used in the kernel startup code. */
|
||||||
#define GRUB_BOOT_MACHINE_LIST_SIZE 12
|
#define GRUB_BOOT_MACHINE_LIST_SIZE 12
|
||||||
|
|
||||||
|
#define GRUB_BOOT_MACHINE_PXE_DL 0x7f
|
||||||
|
|
||||||
#ifndef ASM_FILE
|
#ifndef ASM_FILE
|
||||||
|
|
||||||
/* This is the blocklist used in the diskboot image. */
|
/* This is the blocklist used in the diskboot image. */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* GRUB -- GRand Unified Bootloader
|
* GRUB -- GRand Unified Bootloader
|
||||||
* Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
|
* Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* GRUB is free software: you can redistribute it and/or modify
|
* GRUB 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
|
||||||
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include <grub/kernel.h>
|
#include <grub/kernel.h>
|
||||||
#include <grub/mm.h>
|
#include <grub/mm.h>
|
||||||
|
#include <grub/machine/boot.h>
|
||||||
#include <grub/machine/init.h>
|
#include <grub/machine/init.h>
|
||||||
#include <grub/machine/memory.h>
|
#include <grub/machine/memory.h>
|
||||||
#include <grub/machine/console.h>
|
#include <grub/machine/console.h>
|
||||||
@ -62,22 +63,28 @@ make_install_device (void)
|
|||||||
{
|
{
|
||||||
/* No hardcoded root partition - make it from the boot drive and the
|
/* No hardcoded root partition - make it from the boot drive and the
|
||||||
partition number encoded at the install time. */
|
partition number encoded at the install time. */
|
||||||
grub_snprintf (dev, sizeof (dev),
|
if (grub_boot_drive == GRUB_BOOT_MACHINE_PXE_DL)
|
||||||
"(%cd%u", (grub_boot_drive & 0x80) ? 'h' : 'f',
|
{
|
||||||
grub_boot_drive & 0x7f);
|
grub_strcpy (dev, "(pxe");
|
||||||
ptr += grub_strlen (ptr);
|
ptr += sizeof ("(pxe") - 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
grub_snprintf (dev, sizeof (dev),
|
||||||
|
"(%cd%u", (grub_boot_drive & 0x80) ? 'h' : 'f',
|
||||||
|
grub_boot_drive & 0x7f);
|
||||||
|
ptr += grub_strlen (ptr);
|
||||||
|
|
||||||
if (grub_install_dos_part >= 0)
|
if (grub_install_dos_part >= 0)
|
||||||
grub_snprintf (ptr, sizeof (dev) - (ptr - dev),
|
grub_snprintf (ptr, sizeof (dev) - (ptr - dev),
|
||||||
",%u", grub_install_dos_part + 1);
|
",%u", grub_install_dos_part + 1);
|
||||||
|
ptr += grub_strlen (ptr);
|
||||||
|
|
||||||
ptr += grub_strlen (ptr);
|
if (grub_install_bsd_part >= 0)
|
||||||
|
grub_snprintf (ptr, sizeof (dev) - (ptr - dev), ",%c",
|
||||||
if (grub_install_bsd_part >= 0)
|
grub_install_bsd_part + 'a');
|
||||||
grub_snprintf (ptr, sizeof (dev) - (ptr - dev), ",%c",
|
ptr += grub_strlen (ptr);
|
||||||
grub_install_bsd_part + 'a');
|
}
|
||||||
|
|
||||||
ptr += grub_strlen (ptr);
|
|
||||||
|
|
||||||
grub_snprintf (ptr, sizeof (dev) - (ptr - dev), ")%s", grub_prefix);
|
grub_snprintf (ptr, sizeof (dev) - (ptr - dev), ")%s", grub_prefix);
|
||||||
grub_strcpy (grub_prefix, dev);
|
grub_strcpy (grub_prefix, dev);
|
||||||
|
@ -196,7 +196,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||||||
{
|
{
|
||||||
grub_elf_close (elf);
|
grub_elf_close (elf);
|
||||||
return grub_error (GRUB_ERR_UNKNOWN_OS,
|
return grub_error (GRUB_ERR_UNKNOWN_OS,
|
||||||
"This ELF file is not of the right type\n");
|
"this ELF file is not of the right type\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release the previously used memory. */
|
/* Release the previously used memory. */
|
||||||
@ -236,7 +236,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||||||
if (grub_elf_is_elf64 (elf))
|
if (grub_elf_is_elf64 (elf))
|
||||||
err = grub_linux_load64 (elf, &extra, size);
|
err = grub_linux_load64 (elf, &extra, size);
|
||||||
else
|
else
|
||||||
err = grub_error (GRUB_ERR_BAD_FILE_TYPE, "Unknown ELF class");
|
err = grub_error (GRUB_ERR_BAD_FILE_TYPE, "unknown ELF class");
|
||||||
|
|
||||||
grub_elf_close (elf);
|
grub_elf_close (elf);
|
||||||
|
|
||||||
@ -325,13 +325,13 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||||||
grub_size_t overhead;
|
grub_size_t overhead;
|
||||||
|
|
||||||
if (argc == 0)
|
if (argc == 0)
|
||||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "No initrd specified");
|
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no initrd specified");
|
||||||
|
|
||||||
if (!loaded)
|
if (!loaded)
|
||||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load Linux first.");
|
return grub_error (GRUB_ERR_BAD_ARGUMENT, "you need to load Linux first.");
|
||||||
|
|
||||||
if (initrd_loaded)
|
if (initrd_loaded)
|
||||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Only one initrd can be loaded.");
|
return grub_error (GRUB_ERR_BAD_ARGUMENT, "only one initrd can be loaded.");
|
||||||
|
|
||||||
file = grub_file_open (argv[0]);
|
file = grub_file_open (argv[0]);
|
||||||
if (! file)
|
if (! file)
|
||||||
@ -353,7 +353,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||||||
|
|
||||||
if (grub_file_read (file, playground + linux_size + overhead, size) != size)
|
if (grub_file_read (file, playground + linux_size + overhead, size) != size)
|
||||||
{
|
{
|
||||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||||
grub_file_close (file);
|
grub_file_close (file);
|
||||||
|
|
||||||
return grub_errno;
|
return grub_errno;
|
||||||
|
@ -89,3 +89,25 @@ cat << EOF
|
|||||||
module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
|
module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
cat << EOF
|
||||||
|
menuentry "${OS} (recovery mode)" {
|
||||||
|
EOF
|
||||||
|
prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
|
||||||
|
cat << EOF
|
||||||
|
echo $(gettext "Loading GNU Mach ...")
|
||||||
|
multiboot ${kernel} root=device:${GRUB_DEVICE#/dev/} -s
|
||||||
|
EOF
|
||||||
|
save_default_entry | sed -e "s/^/\t/"
|
||||||
|
prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/"
|
||||||
|
cat << EOF
|
||||||
|
echo $(gettext "Loading the Hurd ...")
|
||||||
|
module /hurd/${hurd_fs}.static ${hurd_fs} \\
|
||||||
|
--multiboot-command-line='\${kernel-command-line}' \\
|
||||||
|
--host-priv-port='\${host-port}' \\
|
||||||
|
--device-master-port='\${device-port}' \\
|
||||||
|
--exec-server-task='\${exec-task}' -T typed '\${root}' \\
|
||||||
|
'\$(task-create)' '\$(task-resume)'
|
||||||
|
module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
@ -340,7 +340,7 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags)
|
|||||||
is_partition = linux_find_partition (dev, disk->partition->start);
|
is_partition = linux_find_partition (dev, disk->partition->start);
|
||||||
|
|
||||||
/* Open the partition. */
|
/* Open the partition. */
|
||||||
grub_dprintf ("hostdisk", "opening the device `%s' in open_device()", dev);
|
grub_dprintf ("hostdisk", "opening the device `%s' in open_device()\n", dev);
|
||||||
fd = open (dev, flags);
|
fd = open (dev, flags);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
{
|
{
|
||||||
|
@ -30,6 +30,9 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#ifdef HAVE_LIMITS_H
|
||||||
|
#include <limits.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <grub/kernel.h>
|
#include <grub/kernel.h>
|
||||||
#include <grub/misc.h>
|
#include <grub/misc.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user