Compare commits

..

36 Commits

Author SHA1 Message Date
Vladimir Serbinenko
3635094bf4 .org simplification 2013-12-24 02:48:31 +01:00
Vladimir Serbinenko
aeebec13ab Fix .org 2013-12-24 02:31:44 +01:00
Vladimir Serbinenko
3863ea6088 Replace .= with .org 2013-12-24 01:22:27 +01:00
Vladimir Serbinenko
0290aa8596 Check for .code16 support 2013-12-24 01:17:34 +01:00
Vladimir Serbinenko
09f5da1df6 Remove addr32 2013-12-24 01:11:32 +01:00
Vladimir Serbinenko
002ba123eb Remove useless addr32 2013-12-24 00:47:58 +01:00
Vladimir Serbinenko
a7831929d3 remove data32 2013-12-24 00:44:07 +01:00
Vladimir Serbinenko
2cbee7340c Merge branch 'master' into phcoder/scratch
Conflicts:
	grub-core/kern/arm/cache_armv6.S
	grub-core/kern/uboot/init.c
	include/grub/arm/system.h
2013-12-24 00:33:47 +01:00
Vladimir Serbinenko
850da8e056 dmraid 2013-12-24 00:32:40 +01:00
Colin Watson
f9fa053b69 mkconfig fix by Colin 2013-12-24 00:32:20 +01:00
Vladimir Serbinenko
2f1fd54c38 Skip apple ghosts 2013-12-24 00:05:22 +01:00
Vladimir Serbinenko
df056a2788 Gain more info about vendor path 2013-12-23 22:45:56 +01:00
Vladimir Serbinenko
72f099578e Merge branch 'master' of git.sv.gnu.org:/srv/git/grub 2013-12-23 18:17:29 +01:00
Vladimir Serbinenko
808e97c4e7 ARM64 support for grub-mkrescue. 2013-12-23 18:17:09 +01:00
Vladimir Serbinenko
e388db904c Install modinfo.sh to keep build information around. 2013-12-23 18:17:09 +01:00
Vladimir Serbinenko
cef394032d * grub-core/modinfo.sh.in: Add build config information. 2013-12-23 18:17:09 +01:00
Vladimir Serbinenko
a4d610026f ARM64 grub-file and grub-mkconfig support. 2013-12-23 18:17:09 +01:00
Vladimir Serbinenko
0c930a841e Remove leftover options defines. 2013-12-23 18:17:02 +01:00
Colin Watson
3d369a01ac Update some documentation to refer to Git rather than Bazaar.
* docs/grub.texi (Obtaining and Building GRUB): Refer to Git rather
than Bazaar.
* po/README: Likewise.  Fix spelling mistake.
2013-12-23 14:43:41 +00:00
Colin Watson
5b83ef97e5 Don't distribute config.h.
* Makefile.am (platform_HEADERS): Move to ...
(nodist_platform_HEADERS): ... here.  Fixes gettext_strings_test
failure when building from a distributed tarball.
2013-12-23 14:30:35 +00:00
Colin Watson
16f7455b04 * configure.ac: Fix spelling.
* grub-core/commands/parttool.c: Fix grammar.
* grub-core/disk/ldm.c: Use consistent capitalisation for "LDM
Embedding Partition".
2013-12-23 13:32:35 +00:00
Vladimir Serbinenko
74fa9ac1a6 * include/grub/arm64/linux.h: Remove leftovers. Add missing prefixes. 2013-12-23 05:56:31 +01:00
Vladimir Serbinenko
62956fe7b9 * grub-core/loader/arm64/linux.c: Add missing bracket. 2013-12-23 05:34:13 +01:00
Vladimir Serbinenko
260632161f Add arm64-efi recognition to grub-file. 2013-12-23 05:33:44 +01:00
Vladimir Serbinenko
4cd0b55fd0 Fix ia64-efi recognition in grub-file. 2013-12-23 05:27:04 +01:00
Vladimir Serbinenko
95b56e3a97 Recognize raspberry pi kernel in grub-file. 2013-12-23 05:19:42 +01:00
Vladimir Serbinenko
bbc52c228f Enable cache on ARM U-Boot port.
Without it the port is reidiculously slow.
2013-12-23 05:01:58 +01:00
Vladimir Serbinenko
943981ff65 Fix ARM cache maintainance.
More code was converted from ASM to C for easier handling.
2013-12-23 04:27:53 +01:00
Vladimir Serbinenko
1d83f4d467 Merge branch 'master' into phcoder/scratch 2013-12-23 04:16:55 +01:00
Vladimir Serbinenko
b2b8ed7032 ARM cache 2013-12-23 04:14:24 +01:00
Vladimir Serbinenko
4b03082fa9 EFI debug 2013-12-22 23:15:43 +01:00
Vladimir Serbinenko
adabfb5418 * grub-core/kern/arm/cache.c (grub_arm_disable_caches_mmu): Use v6
algorithm on v5.

	Suggested by: Leif Lindholm.
2013-12-22 22:33:35 +01:00
Andrey Borzenkov
77ec462a56 grub-mkconfig: fix Xen platform conditions 2013-12-22 23:47:26 +04:00
Andrey Borzenkov
3bf2db8959 split grub-mkresecue help text to facilitate translations
Split single string in help message into several strings used before in shell
grub-mkrescue to minimize changes to existing translations.

Reported by Benno Schulenberg
2013-12-22 22:51:54 +04:00
Leif Lindholm
30a9ab952f arm64: add EFI Linux loader
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
2013-12-22 18:38:44 +00:00
Leif Lindholm
c415eaa98f fdt: additions required for arm64 Linux loader
- Add grub_fdt_create_empty_tree() function.
- Add 64-bit setprop.
2013-12-22 18:38:44 +00:00
59 changed files with 1196 additions and 413 deletions

View File

@@ -1,3 +1,102 @@
2013-12-23 Colin Watson <cjwatson@debian.org>
Update some documentation to refer to Git rather than Bazaar.
* docs/grub.texi (Obtaining and Building GRUB): Refer to Git rather
than Bazaar.
* po/README: Likewise. Fix spelling mistake.
2013-12-23 Colin Watson <cjwatson@ubuntu.com>
Don't distribute config.h.
* Makefile.am (platform_HEADERS): Move to ...
(nodist_platform_HEADERS): ... here. Fixes gettext_strings_test
failure when building from a distributed tarball.
2013-12-23 Colin Watson <cjwatson@ubuntu.com>
* configure.ac: Fix spelling.
* grub-core/commands/parttool.c: Fix grammar.
* grub-core/disk/ldm.c: Use consistent capitalisation for "LDM
Embedding Partition".
2013-12-23 Vladimir Serbinenko <phcoder@gmail.com>
ARM64 support for grub-mkrescue.
2013-12-23 Vladimir Serbinenko <phcoder@gmail.com>
Install modinfo.sh to keep build information around.
2013-12-23 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/modinfo.sh.in: Add build config information.
2013-12-23 Vladimir Serbinenko <phcoder@gmail.com>
ARM64 grub-file and grub-mkconfig support.
2013-12-23 Vladimir Serbinenko <phcoder@gmail.com>
Remove leftover options defines.
2013-12-23 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/arm64/linux.h: Remove leftovers. Add missing prefixes.
2013-12-23 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/loader/arm64/linux.c: Add missing bracket.
2013-12-23 Vladimir Serbinenko <phcoder@gmail.com>
Add arm64-efi recognition to grub-file.
2013-12-23 Vladimir Serbinenko <phcoder@gmail.com>
Fix ia64-efi recognition in grub-file.
2013-12-23 Vladimir Serbinenko <phcoder@gmail.com>
Recognize raspberry pi kernel in grub-file.
2013-12-23 Vladimir Serbinenko <phcoder@gmail.com>
Enable cache on ARM U-Boot port.
Without it the port is reidiculously slow.
2013-12-23 Vladimir Serbinenko <phcoder@gmail.com>
Fix ARM cache maintainance.
More code was converted from ASM to C for easier handling.
2013-12-22 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/arm/cache.c (grub_arm_disable_caches_mmu): Use v6
algorithm on v5.
Suggested by: Leif Lindholm.
2013-12-22 Andrey Borzenkov <arvidjaar@gmail.com>
* util/grub-mkconfig.in: Fix Xen platform conditions.
2013-12-22 Andrey Borzenkov <arvidjaar@gmail.com>
* util/grub-mkrescue.c: Split single help message string in several
strings used in previous shell version.
2013-12-22 Leif Lindholm <leif.lindholm@linaro.org>
Add arm64 Linux loader.
2013-12-22 Leif Lindholm <leif.lindholm@linaro.org>
Add grub_fdt_create_empty_tree() and grub_fdt_set_prop64().
2013-12-22 Vladimir Serbinenko <phcoder@gmail.com>
Add module loading and parsing boot time checkpoints.

View File

@@ -127,7 +127,7 @@ widthspec.h: $(FONT_SOURCE) build-grub-gen-widthspec
CLEANFILES += widthspec.h
# Install config.h into platformdir
platform_HEADERS = config.h
nodist_platform_HEADERS = config.h
pkgdata_DATA += grub-mkconfig_lib

View File

@@ -210,80 +210,6 @@ fi
])
dnl Mass confusion!
dnl Older versions of GAS interpret `.code16' to mean ``generate 32-bit
dnl instructions, but implicitly insert addr32 and data32 bytes so
dnl that the code works in real mode''.
dnl
dnl Newer versions of GAS interpret `.code16' to mean ``generate 16-bit
dnl instructions,'' which seems right. This requires the programmer
dnl to explicitly insert addr32 and data32 instructions when they want
dnl them.
dnl
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 asm files.
AC_DEFUN([grub_I386_ASM_ADDR32],
[AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([grub_I386_ASM_PREFIX_REQUIREMENT])
AC_MSG_CHECKING([for .code16 addr32 assembler support])
AC_CACHE_VAL(grub_cv_i386_asm_addr32,
[cat > conftest.s.in <<\EOF
.code16
l1: @ADDR32@ movb %al, l1
EOF
if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then
sed -e s/@ADDR32@/addr32/ < conftest.s.in > conftest.s
else
sed -e s/@ADDR32@/addr32\;/ < conftest.s.in > conftest.s
fi
if AC_TRY_COMMAND([${CC-cc} ${TARGET_CCASFLAGS} ${CFLAGS} -c conftest.s]) && test -s conftest.o; then
grub_cv_i386_asm_addr32=yes
else
grub_cv_i386_asm_addr32=no
fi
rm -f conftest*])
AC_MSG_RESULT([$grub_cv_i386_asm_addr32])])
dnl Later versions of GAS requires that addr32 and data32 prefixes
dnl appear in the same lines as the instructions they modify, while
dnl earlier versions requires that they appear in separate lines.
AC_DEFUN([grub_I386_ASM_PREFIX_REQUIREMENT],
[AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING(dnl
[whether addr32 must be in the same line as the instruction])
AC_CACHE_VAL(grub_cv_i386_asm_prefix_requirement,
[cat > conftest.s <<\EOF
.code16
l1: addr32 movb %al, l1
EOF
if AC_TRY_COMMAND([${CC-cc} ${TARGET_CCASFLAGS} ${CFLAGS} -c conftest.s]) && test -s conftest.o; then
grub_cv_i386_asm_prefix_requirement=yes
else
grub_cv_i386_asm_prefix_requirement=no
fi
rm -f conftest*])
if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then
grub_tmp_addr32="addr32"
grub_tmp_data32="data32"
else
grub_tmp_addr32="addr32;"
grub_tmp_data32="data32;"
fi
ADDR32=$grub_tmp_addr32
DATA32=$grub_tmp_data32
AC_MSG_RESULT([$grub_cv_i386_asm_prefix_requirement])])
dnl Check what symbol is defined as a bss start symbol.
dnl Written by Michael Hohmoth and Yoshinori K. Okuji.
AC_DEFUN([grub_CHECK_BSS_START_SYMBOL],

View File

@@ -31,10 +31,6 @@
#define HAVE_FONT_SOURCE @HAVE_FONT_SOURCE@
/* Define if C symbols get an underscore after compilation. */
#define HAVE_ASM_USCORE @HAVE_ASM_USCORE@
/* Define it to \"addr32\" or \"addr32;\" to make GAS happy. */
#define ADDR32 @ADDR32@
/* Define it to \"data32\" or \"data32;\" to make GAS happy. */
#define DATA32 @DATA32@
/* Define it to one of __bss_start, edata and _edata. */
#define BSS_START_SYMBOL @BSS_START_SYMBOL@
/* Define it to either end or _end. */
@@ -51,12 +47,6 @@
#define PACKAGE_NAME "@PACKAGE_NAME@"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
/* Default boot directory name" */
#define GRUB_BOOT_DIR_NAME "@bootdirname@"
/* Default grub directory name */
#define GRUB_DIR_NAME "@grubdirname@"
/* Define to 1 if GCC generates calls to __register_frame_info(). */
#define NEED_REGISTER_FRAME_INFO @NEED_REGISTER_FRAME_INFO@
#define GRUB_TARGET_CPU "@GRUB_TARGET_CPU@"
#define GRUB_PLATFORM "@GRUB_PLATFORM@"

View File

@@ -214,20 +214,14 @@ case "$platform" in
qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;;
pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;;
emu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=1" ;;
loongson) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
qemu_mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
loongson) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_LOONGSON=1" ;;
qemu_mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_QEMU_MIPS=1" ;;
arc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARC=1" ;;
esac
case "$target_cpu" in
arm) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARM=1" ;;
arm64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARM64=1" ;;
mips |mipsel) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;;
sparc64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
esac
if test x${target_cpu} = xmipsel ; then
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo mips_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
else
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,` -DGRUB_TARGET_CPU_`echo ${target_cpu} | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`=1"
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
fi
case "${target_cpu}-$platform" in
@@ -544,12 +538,33 @@ AC_COMPILE_IFELSE(
# on arm clang doesn't support .arch directive
# on mips clang doesn't support privilegied instructions, doubleword store/load
# and crashes with hand-written assembly
if test "x$grub_cv_cc_target_clang" = xyes && ( test "x$target_cpu" = xi386 \
|| test "x$target_cpu" = xx86_64 || test "x$target_cpu" = xarm \
if test "x$grub_cv_cc_target_clang" = xyes && ( test "x$target_cpu" = xarm \
|| test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ); then
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -no-integrated-as"
fi
if test "x$grub_cv_cc_target_clang" = xyes && ( test "x$target_cpu" = xi386 \
|| test "x$target_cpu" = xx86_64 ); then
AC_CACHE_CHECK([if clang can handle .code16], [grub_cv_cc_target_clang_code16]
[
CFLAGS="$TARGET_CCASFLAGS"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [[
asm volatile (".code16\n"
"xorw %ax, %ax\n"
#ifdef __x86_64__
".code64\n"
#else
".code32\n"
#endif
);
]])],
[grub_cv_cc_target_clang_code16=yes], [grub_cv_cc_target_clang_code16=no])])
if test x$grub_cv_cc_target_clang_code16 = xno ; then
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -no-integrated-as"
fi
fi
if test "x$grub_cv_cc_target_clang" = xyes && test "x$target_cpu" = xpowerpc; then
AC_CACHE_CHECK([if clang can handle ame instruction], [grub_cv_cc_target_clang_ame]
[
@@ -1052,8 +1067,6 @@ if test "x$target_cpu" = xi386; then
grub_CHECK_END_SYMBOL
fi
CFLAGS="$TARGET_CFLAGS"
grub_I386_ASM_PREFIX_REQUIREMENT
grub_I386_ASM_ADDR32
fi
grub_PROG_NM_WORKS
@@ -1174,7 +1187,7 @@ enable_grub_emu_usb=no
fi
if test x"$enable_grub_emu_sdl" = xno ; then
grub_emu_sdl_excuse="explicitely disabled"
grub_emu_sdl_excuse="explicitly disabled"
fi
[if [ x"$grub_emu_sdl_excuse" = x ]; then
# Check for libSDL libraries.]
@@ -1190,7 +1203,7 @@ AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"],
[fi]
if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then
AC_MSG_ERROR([SDL support for grub-emu was explicitely requested but can't be compiled ($grub_emu_sdl_excuse)])
AC_MSG_ERROR([SDL support for grub-emu was explicitly requested but can't be compiled ($grub_emu_sdl_excuse)])
fi
if test x"$grub_emu_sdl_excuse" = x ; then
enable_grub_emu_sdl=yes
@@ -1574,13 +1587,10 @@ AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu],
[AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)])
AC_SUBST(HAVE_ASM_USCORE)
AC_SUBST(ADDR32)
AC_SUBST(DATA32)
AC_SUBST(BSS_START_SYMBOL)
AC_SUBST(END_SYMBOL)
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(NEED_REGISTER_FRAME_INFO)
AC_ARG_ENABLE([werror],
[AS_HELP_STRING([--disable-werror],

View File

@@ -6385,7 +6385,7 @@ just do:
@end group
@end example
Also, the latest version is available using Bazaar. See
Also, the latest version is available using Git. See
@uref{http://www.gnu.org/software/grub/grub-download.html} for more
information.

View File

@@ -221,12 +221,14 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/uboot/uboot.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/uboot/disk.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.h
endif
if COND_arm_efi
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/efi/loader.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.h
endif
if COND_arm64_efi

View File

@@ -1677,7 +1677,8 @@ module = {
sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c;
ia64_efi = loader/ia64/efi/linux.c;
arm = loader/arm/linux.c;
arm = lib/fdt.c;
arm64 = loader/arm64/linux.c;
fdt = lib/fdt.c;
common = loader/linux.c;
common = lib/cmdline.c;
enable = noemu;

View File

@@ -165,8 +165,8 @@ start:
* this area.
*/
. = _start + GRUB_BOOT_MACHINE_BPB_START
. = _start + 4
.org GRUB_BOOT_MACHINE_BPB_START
.org 4
#endif
#ifdef HYBRID_BOOT
floppy
@@ -174,7 +174,7 @@ start:
scratch
#endif
. = _start + GRUB_BOOT_MACHINE_BPB_END
.org GRUB_BOOT_MACHINE_BPB_END
/*
* End of BIOS parameter block.
*/
@@ -183,14 +183,14 @@ kernel_address:
.word GRUB_BOOT_MACHINE_KERNEL_ADDR
#ifndef HYBRID_BOOT
. = _start + GRUB_BOOT_MACHINE_KERNEL_SECTOR
.org GRUB_BOOT_MACHINE_KERNEL_SECTOR
kernel_sector:
.long 1
kernel_sector_high:
.long 0
#endif
. = _start + GRUB_BOOT_MACHINE_BOOT_DRIVE
.org GRUB_BOOT_MACHINE_BOOT_DRIVE
boot_drive:
.byte 0xff /* the disk to load kernel from */
/* 0xff means use the boot drive */
@@ -208,7 +208,7 @@ LOCAL(after_BPB):
* possible boot drive. If GRUB is installed into a floppy,
* this does nothing (only jump).
*/
. = _start + GRUB_BOOT_MACHINE_DRIVE_CHECK
.org GRUB_BOOT_MACHINE_DRIVE_CHECK
boot_drive_check:
jmp 3f /* grub-setup may overwrite this jump */
testb $0x80, %dl
@@ -511,13 +511,13 @@ LOCAL(message):
*/
#ifdef HYBRID_BOOT
. = _start + 0x1b0
.org 0x1b0
kernel_sector:
.long 1
kernel_sector_high:
.long 0
#endif
. = _start + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC
.org GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC
nt_magic:
.long 0
.word 0
@@ -528,7 +528,7 @@ nt_magic:
* sneaky, huh?
*/
. = _start + GRUB_BOOT_MACHINE_PART_START
.org GRUB_BOOT_MACHINE_PART_START
#ifndef HYBRID_BOOT
floppy
@@ -536,7 +536,7 @@ nt_magic:
scratch
#endif
. = _start + GRUB_BOOT_MACHINE_PART_END
.org GRUB_BOOT_MACHINE_PART_END
/* the last 2 bytes in the sector 0 contain the signature */
.word GRUB_BOOT_MACHINE_SIGNATURE

View File

@@ -43,7 +43,7 @@ _start:
LOCAL(next):
jmp 1f
. = start + 8
.org 8
bi_pvd:
.long 0 /* LBA of primary volume descriptor. */
@@ -168,6 +168,6 @@ err_noboot_msg:
err_cdfail_msg:
.ascii "cdrom read fails\0"
. = start + 0x7FF
.org 0x7FF
.byte 0

View File

@@ -362,7 +362,7 @@ LOCAL(message):
.word 0
.word 0
. = _start + 0x200 - GRUB_BOOT_MACHINE_LIST_SIZE
.org 0x200 - GRUB_BOOT_MACHINE_LIST_SIZE
LOCAL(firstlist): /* this label has to be before the first list entry!!! */
/* fill the first data listing with the default */
blocklist_default_start:

View File

@@ -41,7 +41,7 @@ data_start:
xorl %ebp, %ebp
jmp LOCAL(linux_next)
. = data_start + 0x1F1
.org 0x1F1
setup_sects:
.byte CODE_SECTORS
@@ -292,4 +292,4 @@ LOCAL(fail):
err_int15_msg:
.ascii "move memory fails\0"
. = _start + CODE_SECTORS * 512
.org (CODE_SECTORS + 1) * 512

View File

@@ -38,5 +38,5 @@ start:
/* This region is a junk. Do you say that this is wasteful?
But I like that the memory layout of the body is consistent
among different kernels rather than scamping just for 1.5KB. */
. = _start + 0x8200 - 0x7C00 - 0x200 - 1
.org 0x8200 - 0x7C00 - 0x200 - 1
.byte 0

View File

@@ -50,23 +50,23 @@ LOCAL (base):
* This is a special data area.
*/
. = _start + GRUB_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE
.org GRUB_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE
LOCAL(compressed_size):
.long 0
. = _start + GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE
.org GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE
LOCAL(uncompressed_size):
.long 0
. = _start + GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY
.org GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY
reed_solomon_redundancy:
.long 0
. = _start + GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH
.org GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH
.short (LOCAL(reed_solomon_part) - _start)
/*
* This is the area for all of the special variables.
*/
. = _start + GRUB_DECOMPRESSOR_I386_PC_BOOT_DEVICE
.org GRUB_DECOMPRESSOR_I386_PC_BOOT_DEVICE
LOCAL(boot_dev):
.byte 0xFF, 0xFF, 0xFF
LOCAL(boot_drive):
@@ -89,13 +89,13 @@ LOCAL (codestart):
sti /* we're safe again */
/* save the boot drive */
ADDR32 movb %dl, LOCAL(boot_drive)
movb %dl, LOCAL(boot_drive)
/* reset disk system (%ah = 0) */
int $0x13
/* transition to protected mode */
DATA32 call real_to_prot
calll real_to_prot
/* The ".code32" directive takes GAS out of 16-bit mode. */
.code32
@@ -149,7 +149,7 @@ gate_a20_try_bios:
movw $0x2401, %ax
int $0x15
DATA32 call real_to_prot
calll real_to_prot
.code32
popl %ebp

View File

@@ -31,7 +31,7 @@ _start:
jmp 1f
. = _start + GRUB_BOOT_I386_QEMU_CORE_ENTRY_ADDR
.org GRUB_BOOT_I386_QEMU_CORE_ENTRY_ADDR
VARIABLE(grub_core_entry_addr)
.long 0
1:
@@ -48,7 +48,7 @@ VARIABLE(grub_core_entry_addr)
/* Transition to protected mode. We use pushl to force generation
of a flat return address. */
pushl $1f
DATA32 jmp real_to_prot
jmpl real_to_prot
.code32
/* Ensure A20 is enabled. We're in qemu, so control port A works
and there is no need to wait since there is no real logic, it's
@@ -66,9 +66,9 @@ VARIABLE(grub_core_entry_addr)
/* Intel, in its infinite wisdom, decided to put the i8086 entry point
*right here* and this is why we need this kludge. */
. = GRUB_BOOT_MACHINE_SIZE - 16
.org GRUB_BOOT_MACHINE_SIZE - 16
.code16
jmp _start
. = GRUB_BOOT_MACHINE_SIZE
.org GRUB_BOOT_MACHINE_SIZE

View File

@@ -162,7 +162,7 @@ retry_cs5536:
b continue
. = start + GRUB_CPU_LOONGSON_FLASH_TLB_REFILL - GRUB_CPU_LOONGSON_FLASH_START
.org GRUB_CPU_LOONGSON_FLASH_TLB_REFILL - GRUB_CPU_LOONGSON_FLASH_START
tlb_refill:
mfc0 $s1, GRUB_CPU_LOONGSON_COP0_EPC
mfc0 $s2, GRUB_CPU_LOONGSON_COP0_BADVADDR
@@ -196,13 +196,13 @@ tlb_refill:
b fatal
addiu $a0, $a0, %lo(unhandled_tlb_refill)
. = start + GRUB_CPU_LOONGSON_FLASH_CACHE_ERROR - GRUB_CPU_LOONGSON_FLASH_START
.org GRUB_CPU_LOONGSON_FLASH_CACHE_ERROR - GRUB_CPU_LOONGSON_FLASH_START
cache_error:
lui $a0, %hi(unhandled_cache_error)
b fatal
addiu $a0, $a0, %lo(unhandled_cache_error)
. = start + GRUB_CPU_LOONGSON_FLASH_OTHER_EXCEPTION - GRUB_CPU_LOONGSON_FLASH_START
.org GRUB_CPU_LOONGSON_FLASH_OTHER_EXCEPTION - GRUB_CPU_LOONGSON_FLASH_START
other_exception:
mfc0 $s0, GRUB_CPU_LOONGSON_COP0_CAUSE
mfc0 $s1, GRUB_CPU_LOONGSON_COP0_EPC

View File

@@ -39,13 +39,13 @@ start:
bal codestart
nop
base:
. = _start + GRUB_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE
.org GRUB_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE
compressed_size:
.long 0
. = _start + GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE
.org GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE
uncompressed_size:
.long 0
. = _start + GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_ADDR
.org GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_ADDR
uncompressed_addr:
.long 0
codestart:

View File

@@ -41,9 +41,9 @@ pic_base:
* After loading in that block we will execute it by jumping to the
* load address plus the size of the prepended A.OUT header (32 bytes).
*/
. = _start + GRUB_BOOT_MACHINE_BOOT_DEVPATH
.org GRUB_BOOT_MACHINE_BOOT_DEVPATH
boot_path:
. = _start + GRUB_BOOT_MACHINE_KERNEL_BYTE
.org GRUB_BOOT_MACHINE_KERNEL_BYTE
boot_path_end:
kernel_byte: .xword (2 << 9)
kernel_address: .word GRUB_BOOT_MACHINE_KERNEL_ADDR
@@ -52,7 +52,7 @@ kernel_address: .word GRUB_BOOT_MACHINE_KERNEL_ADDR
#define boot_path_end (_start + 1024)
#include <grub/offsets.h>
. = _start + 8
.org 8
kernel_byte: .xword (2 << 9)
kernel_size: .word 512
kernel_address: .word GRUB_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS
@@ -224,7 +224,7 @@ bootpath_known:
#else
nop
#endif
. = _start + GRUB_BOOT_MACHINE_CODE_END
.org GRUB_BOOT_MACHINE_CODE_END
/* the last 4 bytes in the sector 0 contain the signature */
.word GRUB_BOOT_MACHINE_SIGNATURE

View File

@@ -136,7 +136,7 @@ lastlist:
.word 0
.word 0
. = _start + (0x200 - GRUB_BOOT_SPARC64_IEEE1275_LIST_SIZE)
.org (0x200 - GRUB_BOOT_SPARC64_IEEE1275_LIST_SIZE)
blocklist_default_start:
.word 0
.word 2

View File

@@ -48,6 +48,8 @@ static const struct grub_arg_option options[] = {
N_("Check if FILE can be used as x86 multiboot2 kernel"), 0, 0},
{"is-arm-linux", 0, 0,
N_("Check if FILE is ARM Linux"), 0, 0},
{"is-arm64-linux", 0, 0,
N_("Check if FILE is ARM64 Linux"), 0, 0},
{"is-ia64-linux", 0, 0,
N_("Check if FILE is IA64 Linux"), 0, 0},
{"is-mips-linux", 0, 0,
@@ -82,6 +84,8 @@ static const struct grub_arg_option options[] = {
N_("Check if FILE is x86_64 EFI file"), 0, 0},
{"is-ia64-efi", 0, 0,
N_("Check if FILE is IA64 EFI file"), 0, 0},
{"is-arm64-efi", 0, 0,
N_("Check if FILE is ARM64 EFI file"), 0, 0},
{"is-arm-efi", 0, 0,
N_("Check if FILE is ARM EFI file"), 0, 0},
{"is-hibernated-hiberfil", 0, 0,
@@ -105,6 +109,7 @@ enum
IS_MULTIBOOT,
IS_MULTIBOOT2,
IS_ARM_LINUX,
IS_ARM64_LINUX,
IS_IA64_LINUX,
IS_MIPS_LINUX,
IS_MIPSEL_LINUX,
@@ -121,6 +126,7 @@ enum
IS_32_EFI,
IS_64_EFI,
IS_IA_EFI,
IS_ARM64_EFI,
IS_ARM_EFI,
IS_HIBERNATED,
IS_XNU64,
@@ -377,14 +383,40 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args)
}
case IS_ARM_LINUX:
{
grub_uint32_t sig;
grub_uint32_t sig, sig_pi;
if (grub_file_read (file, &sig_pi, 4) != 4)
break;
/* Raspberry pi. */
if (sig_pi == grub_cpu_to_le32_compile_time (0xea000006))
{
ret = 1;
break;
}
if (grub_file_seek (file, 0x24) == (grub_size_t) -1)
break;
if (grub_file_read (file, &sig, 4) != 4)
break;
if (sig != grub_cpu_to_le32_compile_time (0x016f2818))
if (sig == grub_cpu_to_le32_compile_time (0x016f2818))
{
ret = 1;
break;
}
break;
}
case IS_ARM64_LINUX:
{
grub_uint32_t sig;
if (grub_file_seek (file, 0x38) == (grub_size_t) -1)
break;
ret = 1;
if (grub_file_read (file, &sig, 4) != 4)
break;
if (sig == grub_cpu_to_le32_compile_time (0x644d5241))
{
ret = 1;
break;
}
break;
}
case IS_PAE_DOMU ... IS_DOM0:
@@ -535,6 +567,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args)
case IS_32_EFI:
case IS_64_EFI:
case IS_IA_EFI:
case IS_ARM64_EFI:
case IS_ARM_EFI:
{
char signature[4];
@@ -573,11 +606,15 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args)
&& coff_head.machine !=
grub_cpu_to_le16_compile_time (GRUB_PE32_MACHINE_IA64))
break;
if (type == IS_ARM64_EFI
&& coff_head.machine !=
grub_cpu_to_le16_compile_time (GRUB_PE32_MACHINE_ARM64))
break;
if (type == IS_ARM_EFI
&& coff_head.machine !=
grub_cpu_to_le16_compile_time (GRUB_PE32_MACHINE_ARMTHUMB_MIXED))
break;
if (type == IS_64_EFI || type == IS_64_EFI)
if (type == IS_IA_EFI || type == IS_64_EFI || type == IS_ARM64_EFI)
{
struct grub_pe64_optional_header o64;
if (grub_file_read (file, &o64, sizeof (o64)) != sizeof (o64))

View File

@@ -133,7 +133,7 @@ show_help (grub_device_t dev)
}
}
if (! found)
grub_printf_ (N_("Sorry no parttool is available for %s\n"),
grub_printf_ (N_("Sorry, no parttool is available for %s\n"),
dev->disk->partition->partmap->name);
return GRUB_ERR_NONE;
}

View File

@@ -333,6 +333,21 @@ name_devices (struct grub_efidisk_data *devices)
if (! dp)
continue;
/* Ghosts proudly presented by Apple. */
if (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE
&& GRUB_EFI_DEVICE_PATH_SUBTYPE (dp)
== GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE)
{
grub_efi_vendor_device_path_t *vendor = (grub_efi_vendor_device_path_t *) dp;
const struct grub_efi_guid apple = GRUB_EFI_VENDOR_APPLE_GUID;
if (vendor->header.length == sizeof (*vendor)
&& grub_memcmp (&vendor->vendor_guid, &apple,
sizeof (vendor->vendor_guid)) == 0
&& find_parent_device (devices, d))
continue;
}
m = d->block_io->media;
if (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_ACPI_DEVICE_PATH_TYPE
&& GRUB_EFI_DEVICE_PATH_SUBTYPE (dp)
@@ -654,6 +669,7 @@ grub_efidisk_get_device_handle (grub_disk_t disk)
case 'h':
/* If this is the whole disk, just return its own data. */
grub_printf ("parent handle = %p\n", d->handle);
if (! disk->partition)
return d->handle;
@@ -664,13 +680,24 @@ grub_efidisk_get_device_handle (grub_disk_t disk)
struct grub_efidisk_data *c;
devices = make_devices ();
FOR_CHILDREN (c, devices)
grub_efi_print_device_path (d->device_path);
for (c = devices; c; c = c->next)
{
grub_efi_hard_drive_device_path_t *hd;
hd = (grub_efi_hard_drive_device_path_t *) c->last_device_path;
if ((GRUB_EFI_DEVICE_PATH_TYPE (c->last_device_path)
grub_efi_print_device_path (c->device_path);
grub_printf ("part %d = %x, %x, %x, %x, %x, %x\n",
is_child (c, d),
(int) GRUB_EFI_DEVICE_PATH_TYPE (c->last_device_path),
(int) GRUB_EFI_DEVICE_PATH_SUBTYPE (c->last_device_path),
(int) hd->partition_start, (int) hd->partition_size,
(int) grub_partition_get_start (disk->partition),
(int) grub_partition_get_len (disk->partition));
if (is_child (c, d)
&& (GRUB_EFI_DEVICE_PATH_TYPE (c->last_device_path)
== GRUB_EFI_MEDIA_DEVICE_PATH_TYPE)
&& (GRUB_EFI_DEVICE_PATH_SUBTYPE (c->last_device_path)
== GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE)

View File

@@ -1012,7 +1012,7 @@ grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
usable for bootloaders (called generically
"embedding zone") and this operation is
called "embedding". */
N_("your LDM embedding Partition is too small;"
N_("your LDM Embedding Partition is too small;"
" embedding won't be possible"));
*nsectors = lv->size;
if (*nsectors > max_nsectors)

View File

@@ -37,20 +37,16 @@
* Simple cache maintenance functions
*/
dlinesz_addr:
.long EXT_C(grub_arch_cache_dlinesz)
ilinesz_addr:
.long EXT_C(grub_arch_cache_ilinesz)
@ r0 - *beg (inclusive)
@ r1 - *end (exclusive)
clean_dcache_range:
@void grub_arm_clean_dcache_range (grub_addr_t start, grub_addr_t end, grub_addr_t dlinesz)
#ifdef ARMV6
FUNCTION(grub_arm_clean_dcache_range_armv6)
#else
FUNCTION(grub_arm_clean_dcache_range_armv7)
#endif
DSB
@ Clean data cache for range to point-of-unification
ldr r2, dlinesz_addr
ldr r2, [r2]
sub r3, r2, #1 @ align "beg" to start of line
mvn r3, r3
and r0, r0, r3
1: cmp r0, r1
bge 2f
#ifdef ARMV6
@@ -65,13 +61,12 @@ clean_dcache_range:
@ r0 - *beg (inclusive)
@ r1 - *end (exclusive)
invalidate_icache_range:
#ifdef ARMV6
FUNCTION(grub_arm_invalidate_icache_range_armv6)
#else
FUNCTION(grub_arm_invalidate_icache_range_armv7)
#endif
@ Invalidate instruction cache for range to point-of-unification
ldr r2, ilinesz_addr
ldr r2, [r2]
sub r3, r2, #1 @ align "beg" to start of line
mvn r3, r3
and r0, r0, r3
1: cmp r0, r1
bge 2f
mcr p15, 0, r0, c7, c5, 1 @ ICIMVAU
@@ -83,21 +78,6 @@ invalidate_icache_range:
ISB
bx lr
@void grub_arch_sync_caches (void *address, grub_size_t len)
#ifdef ARMV6
FUNCTION(grub_arch_sync_caches_armv6)
#else
FUNCTION(grub_arch_sync_caches_armv7)
#endif
DSB
add r1, r0, r1
push {r0-r2, lr}
bl clean_dcache_range
pop {r0, r1}
bl invalidate_icache_range
pop {r2, lr}
bx lr
#ifdef ARMV6
FUNCTION(grub_arm_disable_caches_mmu_armv6)
#else

View File

@@ -1,6 +1,11 @@
#include <grub/dl.h>
#include <grub/cache.h>
#include <grub/arm/system.h>
#ifdef GRUB_MACHINE_UBOOT
#include <grub/uboot/uboot.h>
#include <grub/uboot/api_public.h>
#include <grub/mm.h>
#endif
/* This is only about cache architecture. It doesn't imply
the CPU architecture. */
@@ -13,12 +18,21 @@ static enum
ARCH_ARMV7
} type = ARCH_UNKNOWN;
grub_uint32_t grub_arch_cache_dlinesz;
grub_uint32_t grub_arch_cache_ilinesz;
static int is_v6_mmu;
static grub_uint32_t grub_arch_cache_dlinesz;
static grub_uint32_t grub_arch_cache_ilinesz;
static grub_uint32_t grub_arch_cache_max_linesz;
/* Prototypes for asm functions. */
void grub_arch_sync_caches_armv6 (void *address, grub_size_t len);
void grub_arch_sync_caches_armv7 (void *address, grub_size_t len);
void grub_arm_clean_dcache_range_armv6 (grub_addr_t start, grub_addr_t end,
grub_addr_t dlinesz);
void grub_arm_clean_dcache_range_armv7 (grub_addr_t start, grub_addr_t end,
grub_addr_t dlinesz);
void grub_arm_invalidate_icache_range_armv6 (grub_addr_t start, grub_addr_t end,
grub_addr_t dlinesz);
void grub_arm_invalidate_icache_range_armv7 (grub_addr_t start, grub_addr_t end,
grub_addr_t dlinesz);
void grub_arm_disable_caches_mmu_armv6 (void);
void grub_arm_disable_caches_mmu_armv7 (void);
grub_uint32_t grub_arm_main_id (void);
@@ -38,8 +52,11 @@ probe_caches (void)
case 0x4:
case 0x5:
case 0x6:
is_v6_mmu = 0;
break;
case 0x7:
case 0xf:
is_v6_mmu = 1;
break;
default:
grub_fatal ("Unsupported ARM ID 0x%x", main_id);
@@ -82,20 +99,148 @@ probe_caches (void)
default:
grub_fatal ("Unsupported cache type 0x%x", cache_type);
}
if (grub_arch_cache_dlinesz > grub_arch_cache_ilinesz)
grub_arch_cache_max_linesz = grub_arch_cache_dlinesz;
else
grub_arch_cache_max_linesz = grub_arch_cache_ilinesz;
}
#ifdef GRUB_MACHINE_UBOOT
static void subdivide (grub_uint32_t *table, grub_uint32_t *subtable,
grub_uint32_t addr)
{
grub_uint32_t j;
addr = addr >> 20 << 20;
table[addr >> 20] = (grub_addr_t) subtable | 1;
for (j = 0; j < 256; j++)
subtable[j] = addr | (j << 12)
| (3 << 4) | (3 << 6) | (3 << 8) | (3 << 10)
| (0 << 3) | (1 << 2) | 2;
}
void
grub_arm_enable_caches_mmu (void)
{
grub_uint32_t *table;
grub_uint32_t i;
grub_uint32_t border_crossing = 0;
grub_uint32_t *subtable;
struct sys_info *si = grub_uboot_get_sys_info ();
if (!si || (si->mr_no == 0))
{
grub_printf ("couldn't get memory map, not enabling caches");
grub_errno = GRUB_ERR_NONE;
return;
}
if (type == ARCH_UNKNOWN)
probe_caches ();
for (i = 0; (signed) i < si->mr_no; i++)
{
if (si->mr[i].start & ((1 << 20) - 1))
border_crossing++;
if ((si->mr[i].start + si->mr[i].size) & ((1 << 20) - 1))
border_crossing++;
}
grub_printf ("%d crossers\n", border_crossing);
table = grub_memalign (1 << 14, (1 << 14) + (border_crossing << 10));
if (!table)
{
grub_printf ("couldn't allocate place for MMU table, not enabling caches");
grub_errno = GRUB_ERR_NONE;
return;
}
subtable = table + (1 << 12);
/* Map all unknown as device. */
for (i = 0; i < (1 << 12); i++)
table[i] = (i << 20) | (3 << 10) | (0 << 3) | (1 << 2) | 2;
/*
Device: TEX= 0, C=0, B=1
normal: TEX= 0, C=1, B=1
AP = 3
IMP = 0
Domain = 0
*/
for (i = 0; (signed) i < si->mr_no; i++)
{
if (si->mr[i].start & ((1 << 20) - 1))
{
subdivide (table, subtable, si->mr[i].start);
subtable += (1 << 8);
}
if ((si->mr[i].start + si->mr[i].size) & ((1 << 20) - 1))
{
subdivide (table, subtable, si->mr[i].start + si->mr[i].size);
subtable += (1 << 8);
}
}
for (i = 0; (signed) i < si->mr_no; i++)
if ((si->mr[i].flags & MR_ATTR_MASK) == MR_ATTR_DRAM
|| (si->mr[i].flags & MR_ATTR_MASK) == MR_ATTR_SRAM
|| (si->mr[i].flags & MR_ATTR_MASK) == MR_ATTR_FLASH)
{
grub_uint32_t cur, end;
cur = si->mr[i].start;
end = si->mr[i].start + si->mr[i].size;
while (cur < end)
{
grub_uint32_t *st;
if ((table[cur >> 20] & 3) == 2)
{
cur = cur >> 20 << 20;
table[cur >> 20] = cur | (3 << 10) | (1 << 3) | (1 << 2) | 2;
cur += (1 << 20);
continue;
}
cur = cur >> 12 << 12;
st = (grub_uint32_t *) (table[cur >> 20] & ~0x3ff);
st[(cur >> 12) & 0xff] = cur | (3 << 4) | (3 << 6)
| (3 << 8) | (3 << 10)
| (1 << 3) | (1 << 2) | 2;
cur += (1 << 12);
}
}
grub_printf ("MMU tables generated\n");
if (is_v6_mmu)
grub_arm_clear_mmu_v6 ();
grub_printf ("enabling MMU\n");
grub_arm_enable_mmu (table);
grub_printf ("MMU enabled\n");
}
#endif
void
grub_arch_sync_caches (void *address, grub_size_t len)
{
grub_addr_t start = (grub_addr_t) address;
grub_addr_t end = start + len;
if (type == ARCH_UNKNOWN)
probe_caches ();
start = ALIGN_DOWN (start, grub_arch_cache_max_linesz);
end = ALIGN_UP (end, grub_arch_cache_max_linesz);
switch (type)
{
case ARCH_ARMV6:
grub_arch_sync_caches_armv6 (address, len);
grub_arm_clean_dcache_range_armv6 (start, end, grub_arch_cache_dlinesz);
grub_arm_invalidate_icache_range_armv6 (start, end,
grub_arch_cache_ilinesz);
break;
case ARCH_ARMV7:
grub_arch_sync_caches_armv7 (address, len);
grub_arm_clean_dcache_range_armv7 (start, end, grub_arch_cache_dlinesz);
grub_arm_invalidate_icache_range_armv7 (start, end,
grub_arch_cache_ilinesz);
break;
/* Nothing to do. */
case ARCH_ARMV5_WRITE_THROUGH:
@@ -114,15 +259,13 @@ grub_arm_disable_caches_mmu (void)
probe_caches ();
switch (type)
{
case ARCH_ARMV5_WRITE_THROUGH:
case ARCH_ARMV6_UNIFIED:
case ARCH_ARMV6:
grub_arm_disable_caches_mmu_armv6 ();
break;
case ARCH_ARMV7:
grub_arm_disable_caches_mmu_armv7 ();
break;
/* Nothing to do. */
case ARCH_ARMV5_WRITE_THROUGH:
break;
/* Pacify GCC. */
case ARCH_UNKNOWN:

View File

@@ -41,4 +41,33 @@ FUNCTION(grub_arm_main_id)
FUNCTION(grub_arm_cache_type)
mrc p15, 0, r0, c0, c0, 1
bx lr
bx lr
FUNCTION(grub_arm_clear_mmu_v6)
mov r0, #0
mcr p15, 0, r0, c2, c0, 2
bx lr
FUNCTION(grub_arm_enable_mmu)
mcr p15, 0, r0, c2, c0, 0
mvn r0, #0
mcr p15, 0, r0, c3, c0, 0
mrc p15, 0, r0, c1, c0, 0
bic r0, r0, #(1 << 23)
mcr p15, 0, r0, c1, c0, 0
mrc p15, 0, r0, c1, c0, 0
orr r0, r0, #(1 << 0)
mcr p15, 0, r0, c1, c0, 0
mrc p15, 0, r0, c1, c0, 0
orr r0, r0, #(1 << 2)
mcr p15, 0, r0, c1, c0, 0
mrc p15, 0, r0, c1, c0, 0
orr r0, r0, #(1 << 12)
mcr p15, 0, r0, c1, c0, 0
bx lr

View File

@@ -198,6 +198,5 @@ grub_efi_prepare_platform (void)
if (err != GRUB_ERR_NONE)
return err;
grub_arm_disable_caches_mmu();
return GRUB_ERR_NONE;
}

View File

@@ -51,7 +51,7 @@ FUNCTION(_start)
b codestart
@ Size of final image integrated module blob - set by grub-mkimage
.org _start + GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE
.org GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE
VARIABLE(grub_total_module_size)
.long 0

View File

@@ -385,6 +385,34 @@ grub_efi_get_device_path (grub_efi_handle_t handle)
GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
}
static void
dump_vendor_path (const char *type, grub_efi_vendor_device_path_t *vendor)
{
grub_uint32_t vendor_data_len = vendor->header.length - sizeof (*vendor);
grub_printf ("/%sVendor(%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)[%x: ",
type,
(unsigned) vendor->vendor_guid.data1,
(unsigned) vendor->vendor_guid.data2,
(unsigned) vendor->vendor_guid.data3,
(unsigned) vendor->vendor_guid.data4[0],
(unsigned) vendor->vendor_guid.data4[1],
(unsigned) vendor->vendor_guid.data4[2],
(unsigned) vendor->vendor_guid.data4[3],
(unsigned) vendor->vendor_guid.data4[4],
(unsigned) vendor->vendor_guid.data4[5],
(unsigned) vendor->vendor_guid.data4[6],
(unsigned) vendor->vendor_guid.data4[7],
vendor_data_len);
if (vendor->header.length > sizeof (*vendor))
{
grub_uint32_t i;
for (i = 0; i < vendor_data_len; i++)
grub_printf ("%02x ", vendor->vendor_defined_data[i]);
}
grub_printf ("]");
}
/* Print the chain of Device Path nodes. This is mainly for debugging. */
void
grub_efi_print_device_path (grub_efi_device_path_t *dp)
@@ -444,21 +472,8 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp)
}
break;
case GRUB_EFI_VENDOR_DEVICE_PATH_SUBTYPE:
{
grub_efi_vendor_device_path_t *vendor = (grub_efi_vendor_device_path_t *) dp;
grub_printf ("/Vendor(%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)",
(unsigned) vendor->vendor_guid.data1,
(unsigned) vendor->vendor_guid.data2,
(unsigned) vendor->vendor_guid.data3,
(unsigned) vendor->vendor_guid.data4[0],
(unsigned) vendor->vendor_guid.data4[1],
(unsigned) vendor->vendor_guid.data4[2],
(unsigned) vendor->vendor_guid.data4[3],
(unsigned) vendor->vendor_guid.data4[4],
(unsigned) vendor->vendor_guid.data4[5],
(unsigned) vendor->vendor_guid.data4[6],
(unsigned) vendor->vendor_guid.data4[7]);
}
dump_vendor_path ("Hardware",
(grub_efi_vendor_device_path_t *) dp);
break;
case GRUB_EFI_CONTROLLER_DEVICE_PATH_SUBTYPE:
{
@@ -663,22 +678,8 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp)
}
break;
case GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE:
{
grub_efi_vendor_messaging_device_path_t *vendor
= (grub_efi_vendor_messaging_device_path_t *) dp;
grub_printf ("/Vendor(%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)",
(unsigned) vendor->vendor_guid.data1,
(unsigned) vendor->vendor_guid.data2,
(unsigned) vendor->vendor_guid.data3,
(unsigned) vendor->vendor_guid.data4[0],
(unsigned) vendor->vendor_guid.data4[1],
(unsigned) vendor->vendor_guid.data4[2],
(unsigned) vendor->vendor_guid.data4[3],
(unsigned) vendor->vendor_guid.data4[4],
(unsigned) vendor->vendor_guid.data4[5],
(unsigned) vendor->vendor_guid.data4[6],
(unsigned) vendor->vendor_guid.data4[7]);
}
dump_vendor_path ("Messaging",
(grub_efi_vendor_device_path_t *) dp);
break;
default:
grub_printf ("/UnknownMessaging(%x)", (unsigned) subtype);
@@ -719,22 +720,8 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp)
}
break;
case GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE:
{
grub_efi_vendor_device_path_t *vendor = (grub_efi_vendor_device_path_t *) dp;
grub_printf ("/Vendor(%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)",
(unsigned) vendor->vendor_guid.data1,
(unsigned) vendor->vendor_guid.data2,
(unsigned) vendor->vendor_guid.data3,
(unsigned) vendor->vendor_guid.data4[0],
(unsigned) vendor->vendor_guid.data4[1],
(unsigned) vendor->vendor_guid.data4[2],
(unsigned) vendor->vendor_guid.data4[3],
(unsigned) vendor->vendor_guid.data4[4],
(unsigned) vendor->vendor_guid.data4[5],
(unsigned) vendor->vendor_guid.data4[6],
(unsigned) vendor->vendor_guid.data4[7]);
}
dump_vendor_path ("Media",
(grub_efi_vendor_device_path_t *) dp);
break;
case GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE:
{

View File

@@ -67,6 +67,8 @@ grub_file_open (const char *name)
const char *file_name;
grub_file_filter_id_t filter;
grub_boot_time ("Opening '%s'", name);
device_name = grub_file_get_device_name (name);
if (grub_errno)
goto fail;

View File

@@ -135,7 +135,7 @@ LOCAL(prot_to_real_addr):
.macro REAL_TO_PROT
movl LOCAL(real_to_prot_addr), %eax
DATA32 call *%ax
calll *%eax
.endm
/*

View File

@@ -28,7 +28,7 @@
_start:
jmp codestart
. = _start + GRUB_KERNEL_I386_QEMU_CORE_ENTRY_ADDR
.org GRUB_KERNEL_I386_QEMU_CORE_ENTRY_ADDR
VARIABLE(grub_core_entry_addr)
.long 0

View File

@@ -54,7 +54,7 @@ protstack:
.endm
.macro REAL_TO_PROT
DATA32 call real_to_prot
calll real_to_prot
.endm
/*
@@ -137,7 +137,7 @@ real_to_prot:
/* load the GDT register */
xorw %ax, %ax
movw %ax, %ds
DATA32 ADDR32 lgdt gdtdesc
lgdtl gdtdesc
/* turn on protected mode */
movl %cr0, %eax
@@ -145,7 +145,7 @@ real_to_prot:
movl %eax, %cr0
/* jump to relocation, flush prefetch queue, and reload %cs */
DATA32 ljmp $GRUB_MEMORY_MACHINE_PROT_MODE_CSEG, $protcseg
ljmpl $GRUB_MEMORY_MACHINE_PROT_MODE_CSEG, $protcseg
.code32
protcseg:
@@ -237,7 +237,7 @@ tmpcseg:
movl %eax, %cr0
/* flush prefetch queue, reload %cs */
DATA32 ljmp $0, $realcseg
ljmpl $0, $realcseg
realcseg:
/* we are in real mode now
@@ -258,6 +258,6 @@ realcseg:
#endif
/* return on new stack! */
DATA32 ret
retl
.code32

View File

@@ -271,7 +271,7 @@ grub_ieee1275_map (grub_addr_t phys, grub_addr_t virt, grub_size_t size,
grub_ieee1275_cell_t mode;
grub_ieee1275_cell_t size;
grub_ieee1275_cell_t virt;
#ifdef GRUB_MACHINE_SPARC64
#ifdef __sparc__
grub_ieee1275_cell_t phys_high;
#endif
grub_ieee1275_cell_t phys_low;
@@ -279,7 +279,7 @@ grub_ieee1275_map (grub_addr_t phys, grub_addr_t virt, grub_size_t size,
} args;
INIT_IEEE1275_COMMON (&args.common, "call-method",
#ifdef GRUB_MACHINE_SPARC64
#ifdef __sparc__
7,
#else
6,
@@ -287,7 +287,7 @@ grub_ieee1275_map (grub_addr_t phys, grub_addr_t virt, grub_size_t size,
1);
args.method = (grub_ieee1275_cell_t) "map";
args.ihandle = grub_ieee1275_mmu;
#ifdef GRUB_MACHINE_SPARC64
#ifdef __sparc__
args.phys_high = 0;
#endif
args.phys_low = phys;

View File

@@ -36,7 +36,7 @@ start:
bal cont
nop
. = _start + GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE
.org GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE
VARIABLE(grub_total_modules_size)
.long 0

View File

@@ -27,7 +27,7 @@ _start:
ba codestart
mov %o4, %o0
. = EXT_C(_start) + GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE
.org GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE
VARIABLE(grub_total_module_size)
.word 0

View File

@@ -31,6 +31,7 @@
#include <grub/uboot/uboot.h>
#include <grub/uboot/api_public.h>
#include <grub/cpu/system.h>
#include <grub/cache.h>
extern char __bss_start[];
extern char _end[];
@@ -107,6 +108,11 @@ grub_machine_init (void)
/* Enumerate memory and initialize the memory management system. */
grub_uboot_mm_init ();
/* Should be earlier but it needs memalign. */
#ifdef __arm__
grub_arm_enable_caches_mmu ();
#endif
grub_dprintf ("init", "__bss_start: %p\n", __bss_start);
grub_dprintf ("init", "_end: %p\n", _end);
grub_dprintf ("init", "grub_modbase: %p\n", (void *) grub_modbase);

View File

@@ -431,3 +431,32 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name,
grub_memcpy (prop + 3, val, len);
return 0;
}
int
grub_fdt_create_empty_tree (void *fdt, unsigned int size)
{
struct grub_fdt_empty_tree *et;
if (size < GRUB_FDT_EMPTY_TREE_SZ)
return -1;
grub_memset (fdt, 0, size);
et = fdt;
et->empty_node.tree_end = grub_cpu_to_be32_compile_time (FDT_END);
et->empty_node.node_end = grub_cpu_to_be32_compile_time (FDT_END_NODE);
et->empty_node.node_start = grub_cpu_to_be32_compile_time (FDT_BEGIN_NODE);
((struct grub_fdt_empty_tree *) fdt)->header.off_mem_rsvmap =
grub_cpu_to_be32 (ALIGN_UP (sizeof (grub_fdt_header_t), 8));
grub_fdt_set_off_dt_strings (fdt, sizeof (*et));
grub_fdt_set_off_dt_struct (fdt,
sizeof (et->header) + sizeof (et->empty_rsvmap));
grub_fdt_set_version (fdt, FDT_SUPPORTED_VERSION);
grub_fdt_set_last_comp_version (fdt, FDT_SUPPORTED_VERSION);
grub_fdt_set_size_dt_struct (fdt, sizeof (et->empty_node));
grub_fdt_set_totalsize (fdt, size);
grub_fdt_set_magic (fdt, FDT_MAGIC);
return 0;
}

View File

@@ -283,6 +283,8 @@ linux_boot (void)
}
#endif
grub_arm_disable_caches_mmu ();
linuxmain (0, machine_type, fdt_addr);
return grub_error (GRUB_ERR_BAD_OS, "Linux call returned");

View File

@@ -0,0 +1,487 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2013 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/charset.h>
#include <grub/command.h>
#include <grub/err.h>
#include <grub/file.h>
#include <grub/fdt.h>
#include <grub/linux.h>
#include <grub/loader.h>
#include <grub/mm.h>
#include <grub/types.h>
#include <grub/cpu/linux.h>
#include <grub/efi/efi.h>
#include <grub/efi/pe32.h>
#include <grub/i18n.h>
#include <grub/lib/cmdline.h>
GRUB_MOD_LICENSE ("GPLv3+");
#define GRUB_EFI_PAGE_SHIFT 12
#define BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> GRUB_EFI_PAGE_SHIFT)
#define GRUB_EFI_PE_MAGIC 0x5A4D
static grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID;
static grub_dl_t my_mod;
static int loaded;
static void *kernel_addr;
static grub_uint64_t kernel_size;
static char *linux_args;
static grub_uint32_t cmdline_size;
static grub_addr_t initrd_start;
static grub_addr_t initrd_end;
static void *loaded_fdt;
static void *fdt;
static void *
get_firmware_fdt (void)
{
grub_efi_configuration_table_t *tables;
void *firmware_fdt = NULL;
unsigned int i;
/* Look for FDT in UEFI config tables. */
tables = grub_efi_system_table->configuration_table;
for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
if (grub_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0)
{
firmware_fdt = tables[i].vendor_table;
grub_dprintf ("linux", "found registered FDT @ 0x%p\n", firmware_fdt);
break;
}
return firmware_fdt;
}
static void
get_fdt (void)
{
void *raw_fdt;
grub_size_t size;
if (fdt)
{
size = BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt));
grub_efi_free_pages ((grub_efi_physical_address_t) fdt, size);
}
if (loaded_fdt)
raw_fdt = loaded_fdt;
else
raw_fdt = get_firmware_fdt();
size =
raw_fdt ? grub_fdt_get_totalsize (raw_fdt) : GRUB_FDT_EMPTY_TREE_SZ;
size += 0x400;
grub_dprintf ("linux", "allocating %ld bytes for fdt\n", size);
fdt = grub_efi_allocate_pages (0, BYTES_TO_PAGES (size));
if (!fdt)
return;
if (raw_fdt)
{
grub_memmove (fdt, raw_fdt, size);
grub_fdt_set_totalsize (fdt, size);
}
else
{
grub_fdt_create_empty_tree (fdt, size);
}
}
static grub_err_t
check_kernel (struct grub_arm64_linux_kernel_header *lh)
{
if (lh->magic != GRUB_ARM64_LINUX_MAGIC)
return grub_error(GRUB_ERR_BAD_OS, "invalid magic number");
if ((lh->code0 & 0xffff) != GRUB_EFI_PE_MAGIC)
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
N_("plain Image kernel not supported - rebuild with CONFIG_(U)EFI_STUB enabled"));
grub_dprintf ("linux", "UEFI stub kernel:\n");
grub_dprintf ("linux", "text_offset = 0x%012llx\n",
(long long unsigned) lh->text_offset);
grub_dprintf ("linux", "PE/COFF header @ %08x\n", lh->hdr_offset);
return GRUB_ERR_NONE;
}
static grub_err_t
finalize_params (void)
{
grub_efi_boot_services_t *b;
grub_efi_status_t status;
int node, retval;
get_fdt ();
if (!fdt)
goto failure;
node = grub_fdt_find_subnode (fdt, 0, "chosen");
if (node < 0)
node = grub_fdt_add_subnode (fdt, 0, "chosen");
if (node < 1)
goto failure;
/* Set initrd info */
if (initrd_start && initrd_end > initrd_start)
{
grub_dprintf ("linux", "Initrd @ 0x%012lx-0x%012lx\n",
initrd_start, initrd_end);
retval = grub_fdt_set_prop64 (fdt, node, "linux,initrd-start",
initrd_start);
if (retval)
goto failure;
retval = grub_fdt_set_prop64 (fdt, node, "linux,initrd-end",
initrd_end);
if (retval)
goto failure;
}
b = grub_efi_system_table->boot_services;
status = b->install_configuration_table (&fdt_guid, fdt);
if (status != GRUB_EFI_SUCCESS)
goto failure;
grub_dprintf ("linux", "Installed/updated FDT configuration table @ %p\n",
fdt);
return GRUB_ERR_NONE;
failure:
grub_efi_free_pages ((grub_efi_physical_address_t) fdt,
BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt)));
fdt = NULL;
return grub_error(GRUB_ERR_BAD_OS, "failed to install/update FDT");
}
static grub_err_t
grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)),
int argc, char *argv[])
{
grub_file_t dtb;
void *blob = NULL;
int size;
if (!loaded)
{
grub_error (GRUB_ERR_BAD_ARGUMENT,
N_("you need to load the kernel first"));
return GRUB_ERR_BAD_OS;
}
if (argc != 1)
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
if (loaded_fdt)
grub_free (loaded_fdt);
loaded_fdt = NULL;
dtb = grub_file_open (argv[0]);
if (!dtb)
goto out;
size = grub_file_size (dtb);
blob = grub_malloc (size);
if (!blob)
goto out;
if (grub_file_read (dtb, blob, size) < size)
{
if (!grub_errno)
grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), argv[0]);
goto out;
}
if (grub_fdt_check_header (blob, size) != 0)
{
grub_error (GRUB_ERR_BAD_OS, N_("invalid device tree"));
goto out;
}
out:
if (dtb)
grub_file_close (dtb);
if (blob)
{
if (grub_errno == GRUB_ERR_NONE)
loaded_fdt = blob;
else
grub_free (blob);
}
return grub_errno;
}
static grub_err_t
grub_linux_boot (void)
{
grub_efi_memory_mapped_device_path_t *mempath;
grub_efi_handle_t image_handle;
grub_efi_boot_services_t *b;
grub_efi_status_t status;
grub_err_t retval;
grub_efi_loaded_image_t *loaded_image;
int len;
retval = finalize_params();
if (retval != GRUB_ERR_NONE)
return retval;
mempath = grub_malloc (2 * sizeof (grub_efi_memory_mapped_device_path_t));
if (!mempath)
return grub_errno;
mempath[0].header.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE;
mempath[0].header.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE;
mempath[0].header.length = grub_cpu_to_le16_compile_time (sizeof (*mempath));
mempath[0].memory_type = GRUB_EFI_LOADER_DATA;
mempath[0].start_address = (grub_addr_t) kernel_addr;
mempath[0].end_address = (grub_addr_t) kernel_addr + kernel_size;
mempath[1].header.type = GRUB_EFI_END_DEVICE_PATH_TYPE;
mempath[1].header.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE;
mempath[1].header.length = 0;
b = grub_efi_system_table->boot_services;
status = b->load_image (0, grub_efi_image_handle,
(grub_efi_device_path_t *) mempath,
kernel_addr, kernel_size, &image_handle);
if (status != GRUB_EFI_SUCCESS)
return grub_error (GRUB_ERR_BAD_OS, "cannot load image");
grub_dprintf ("linux", "linux command line: '%s'\n", linux_args);
/* Convert command line to UCS-2 */
loaded_image = grub_efi_get_loaded_image (image_handle);
loaded_image->load_options_size = len =
(grub_strlen (linux_args) + 1) * sizeof (grub_efi_char16_t);
loaded_image->load_options =
grub_efi_allocate_pages (0,
BYTES_TO_PAGES (loaded_image->load_options_size));
if (!loaded_image->load_options)
return grub_errno;
loaded_image->load_options_size =
2 * grub_utf8_to_utf16 (loaded_image->load_options, len,
(grub_uint8_t *) linux_args, len, NULL);
grub_dprintf("linux", "starting image %p\n", image_handle);
status = b->start_image (image_handle, 0, NULL);
/* When successful, not reached */
b->unload_image (image_handle);
grub_efi_free_pages ((grub_efi_physical_address_t) loaded_image->load_options,
BYTES_TO_PAGES (loaded_image->load_options_size));
return grub_errno;
}
static grub_err_t
grub_linux_unload (void)
{
grub_dl_unref (my_mod);
loaded = 0;
if (initrd_start)
grub_efi_free_pages ((grub_efi_physical_address_t) initrd_start,
BYTES_TO_PAGES (initrd_end - initrd_start));
initrd_start = initrd_end = 0;
grub_free (linux_args);
if (kernel_addr)
grub_efi_free_pages ((grub_efi_physical_address_t) kernel_addr,
BYTES_TO_PAGES (kernel_size));
if (fdt)
grub_efi_free_pages ((grub_efi_physical_address_t) fdt,
BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt)));
return GRUB_ERR_NONE;
}
static grub_err_t
grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
int argc, char *argv[])
{
struct grub_linux_initrd_context initrd_ctx;
int initrd_size, initrd_pages;
void *initrd_mem = NULL;
if (argc == 0)
{
grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
goto fail;
}
if (!loaded)
{
grub_error (GRUB_ERR_BAD_ARGUMENT,
N_("you need to load the kernel first"));
goto fail;
}
if (grub_initrd_init (argc, argv, &initrd_ctx))
goto fail;
initrd_size = grub_get_initrd_size (&initrd_ctx);
grub_dprintf ("linux", "Loading initrd\n");
initrd_pages = (BYTES_TO_PAGES (initrd_size));
initrd_mem = grub_efi_allocate_pages (0, initrd_pages);
if (!initrd_mem)
{
grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
goto fail;
}
if (grub_initrd_load (&initrd_ctx, argv, initrd_mem))
goto fail;
initrd_start = (grub_addr_t) initrd_mem;
initrd_end = initrd_start + initrd_size;
grub_dprintf ("linux", "[addr=%p, size=0x%x]\n",
(void *) initrd_start, initrd_size);
fail:
grub_initrd_close (&initrd_ctx);
if (initrd_mem && !initrd_start)
grub_efi_free_pages ((grub_efi_physical_address_t) initrd_mem,
initrd_pages);
return grub_errno;
}
static grub_err_t
grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
int argc, char *argv[])
{
grub_file_t file = 0;
struct grub_arm64_linux_kernel_header lh;
grub_dl_ref (my_mod);
if (argc == 0)
{
grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
goto fail;
}
file = grub_file_open (argv[0]);
if (!file)
goto fail;
kernel_size = grub_file_size (file);
if (grub_file_read (file, &lh, sizeof (lh)) < (long) sizeof (lh))
return grub_errno;
if (check_kernel (&lh) != GRUB_ERR_NONE)
goto fail;
grub_loader_unset();
grub_dprintf ("linux", "kernel file size: %lld\n", (long long) kernel_size);
kernel_addr = grub_efi_allocate_pages (0, BYTES_TO_PAGES (kernel_size));
grub_dprintf ("linux", "kernel numpages: %lld\n",
(long long) BYTES_TO_PAGES (kernel_size));
if (!kernel_addr)
{
grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
goto fail;
}
grub_file_seek (file, 0);
if (grub_file_read (file, kernel_addr, kernel_size)
< (grub_int64_t) kernel_size)
{
if (!grub_errno)
grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), argv[0]);
goto fail;
}
grub_dprintf ("linux", "kernel @ %p\n", kernel_addr);
cmdline_size = grub_loader_cmdline_size (argc, argv) + sizeof (LINUX_IMAGE);
linux_args = grub_malloc (cmdline_size);
if (!linux_args)
{
grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
goto fail;
}
grub_memcpy (linux_args, LINUX_IMAGE, sizeof (LINUX_IMAGE));
grub_create_loader_cmdline (argc, argv,
linux_args + sizeof (LINUX_IMAGE) - 1,
cmdline_size);
if (grub_errno == GRUB_ERR_NONE)
{
grub_loader_set (grub_linux_boot, grub_linux_unload, 0);
loaded = 1;
}
fail:
if (file)
grub_file_close (file);
if (grub_errno != GRUB_ERR_NONE)
{
grub_dl_unref (my_mod);
loaded = 0;
}
if (linux_args && !loaded)
grub_free (linux_args);
if (kernel_addr && !loaded)
grub_efi_free_pages ((grub_efi_physical_address_t) kernel_addr,
BYTES_TO_PAGES (kernel_size));
return grub_errno;
}
static grub_command_t cmd_linux, cmd_initrd, cmd_devicetree;
GRUB_MOD_INIT (linux)
{
cmd_linux = grub_register_command ("linux", grub_cmd_linux, 0,
N_("Load Linux."));
cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, 0,
N_("Load initrd."));
cmd_devicetree =
grub_register_command ("devicetree", grub_cmd_devicetree, 0,
N_("Load DTB file."));
my_mod = mod;
}
GRUB_MOD_FINI (linux)
{
grub_unregister_command (cmd_linux);
grub_unregister_command (cmd_initrd);
grub_unregister_command (cmd_devicetree);
}

View File

@@ -89,8 +89,7 @@ struct piwg_full_device_path
.subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE, \
.length = sizeof (struct grub_efi_piwg_device_path) \
}, \
.guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B, \
0x01, 0xAE, 0xF2, 0xB7}} \
.guid = GRUB_EFI_VENDOR_APPLE_GUID \
}, \
.end = \
{ \

View File

@@ -249,7 +249,8 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
if (! dp)
{
grub_error (GRUB_ERR_BAD_DEVICE, "not a valid root device");
grub_error (GRUB_ERR_BAD_DEVICE, "not a valid root device (%p, %p)",
dev_handle, dp);
goto fail;
}

View File

@@ -1,4 +1,33 @@
#!/bin/sh
# User-controllable options
grub_modinfo_target_cpu=@target_cpu@
grub_modinfo_platform=@platform@
grub_disk_cache_stats=@DISK_CACHE_STATS@
grub_boot_time_stats=@BOOT_TIME_STATS@
grub_have_font_source=@HAVE_FONT_SOURCE@
# Autodetected config
grub_have_asm_uscore=@HAVE_ASM_USCORE@
grub_bss_start_symbol="@BSS_START_SYMBOL@"
grub_end_symbol="@END_SYMBOL@"
# Build environment
grub_target_cc='@TARGET_CC@'
grub_target_cflags='@TARGET_CFLAGS@'
grub_target_cppflags='@TARGET_CPPFLAGS@'
grub_target_ccasflags='@TARGET_CCASFLAGS@'
grub_target_ldflags='@TARGET_LDFLAGS@'
grub_target_strip='@TARGET_STRIP@'
grub_target_nm='@TARGET_NM@'
grub_target_ranlib='@TARGET_RANLIB@'
grub_target_objconf='@TARGET_OBJCONV@'
grub_target_obj2elf='@TARGET_OBJ2ELF@'
# Version
grub_version="@VERSION@"
grub_package="@PACKAGE@"
grub_package_string="@PACKAGE_STRING@"
grub_package_version="@PACKAGE_VERSION@"
grub_package_name="@PACKAGE_NAME@"
grub_package_bugreport="@PACKAGE_BUGREPORT@"

View File

@@ -230,12 +230,18 @@ read_lists (const char *val)
{
if (! grub_no_modules)
{
grub_boot_time ("Reading commands");
read_command_list (val);
grub_boot_time ("Reading filesystems");
read_fs_list (val);
grub_boot_time ("Reading crypto");
read_crypto_list (val);
grub_boot_time ("Reading terminal");
read_terminal_list (val);
}
grub_boot_time ("Reading gettext");
grub_gettext_reread_prefix (val);
grub_boot_time ("Lists reread");
}
static char *

View File

@@ -198,124 +198,17 @@ char *
grub_util_devmapper_part_to_disk (struct stat *st,
int *is_part, const char *path)
{
struct dm_tree *tree;
uint32_t maj, min;
struct dm_tree_node *node = NULL, *child;
void *handle;
const char *node_uuid, *mapper_name = NULL, *child_uuid, *child_name;
int major, minor;
tree = dm_tree_create ();
if (! tree)
if (grub_util_get_dm_node_linear_info (st->st_rdev,
&major, &minor, 0))
{
grub_util_info ("dm_tree_create failed");
goto devmapper_out;
*is_part = 1;
return grub_find_device ("/dev",
(major << 8) | minor);
}
maj = major (st->st_rdev);
min = minor (st->st_rdev);
if (! dm_tree_add_dev (tree, maj, min))
{
grub_util_info ("dm_tree_add_dev failed");
goto devmapper_out;
}
node = dm_tree_find_node (tree, maj, min);
if (! node)
{
grub_util_info ("dm_tree_find_node failed");
goto devmapper_out;
}
reiterate:
node_uuid = dm_tree_node_get_uuid (node);
if (! node_uuid)
{
grub_util_info ("%s has no DM uuid", path);
goto devmapper_out;
}
if (strncmp (node_uuid, "LVM-", 4) == 0)
{
grub_util_info ("%s is an LVM", path);
goto devmapper_out;
}
if (strncmp (node_uuid, "mpath-", 6) == 0)
{
/* Multipath partitions have partN-mpath-* UUIDs, and are
linear mappings so are handled by
grub_util_get_dm_node_linear_info. Multipath disks are not
linear mappings and must be handled specially. */
grub_util_info ("%s is a multipath disk", path);
goto devmapper_out;
}
if (strncmp (node_uuid, "DMRAID-", 7) != 0)
{
int major, minor;
const char *node_name;
grub_util_info ("%s is not DM-RAID", path);
if ((node_name = dm_tree_node_get_name (node))
&& grub_util_get_dm_node_linear_info (node_name,
&major, &minor, 0))
{
*is_part = 1;
if (tree)
dm_tree_free (tree);
char *ret = grub_find_device ("/dev",
(major << 8) | minor);
return ret;
}
goto devmapper_out;
}
handle = NULL;
/* Counter-intuitively, device-mapper refers to the disk-like
device containing a DM-RAID partition device as a "child" of
the partition device. */
child = dm_tree_next_child (&handle, node, 0);
if (! child)
{
grub_util_info ("%s has no DM children", path);
goto devmapper_out;
}
child_uuid = dm_tree_node_get_uuid (child);
if (! child_uuid)
{
grub_util_info ("%s child has no DM uuid", path);
goto devmapper_out;
}
else if (strncmp (child_uuid, "DMRAID-", 7) != 0)
{
grub_util_info ("%s child is not DM-RAID", path);
goto devmapper_out;
}
child_name = dm_tree_node_get_name (child);
if (! child_name)
{
grub_util_info ("%s child has no DM name", path);
goto devmapper_out;
}
mapper_name = child_name;
*is_part = 1;
node = child;
goto reiterate;
devmapper_out:
if (! mapper_name && node)
{
/* This is a DM-RAID disk, not a partition. */
mapper_name = dm_tree_node_get_name (node);
if (! mapper_name)
grub_util_info ("%s has no DM name", path);
}
char *ret;
if (mapper_name)
ret = xasprintf ("/dev/mapper/%s", mapper_name);
else
ret = NULL;
if (tree)
dm_tree_free (tree);
return ret;
*is_part = 0;
return xstrdup (path);
}
int

View File

@@ -83,7 +83,7 @@ grub_util_device_is_mapped (const char *dev)
}
int
grub_util_get_dm_node_linear_info (const char *dev,
grub_util_get_dm_node_linear_info (dev_t dev,
int *maj, int *min,
grub_disk_addr_t *st)
{
@@ -97,14 +97,16 @@ grub_util_get_dm_node_linear_info (const char *dev,
grub_disk_addr_t partstart = 0;
const char *node_uuid;
major = major (dev);
minor = minor (dev);
while (1)
{
dmt = dm_task_create(DM_DEVICE_TABLE);
if (!dmt)
break;
if (! (first ? dm_task_set_name (dmt, dev)
: dm_task_set_major_minor (dmt, major, minor, 0)))
if (! (dm_task_set_major_minor (dmt, major, minor, 0)))
{
dm_task_destroy (dmt);
break;
@@ -117,8 +119,7 @@ grub_util_get_dm_node_linear_info (const char *dev,
}
node_uuid = dm_task_get_uuid (dmt);
if (node_uuid && (strncmp (node_uuid, "LVM-", 4) == 0
|| strncmp (node_uuid, "mpath-", 6) == 0
|| strncmp (node_uuid, "DMRAID-", 7) == 0))
|| strncmp (node_uuid, "mpath-", 6) == 0))
{
dm_task_destroy (dmt);
break;
@@ -190,7 +191,7 @@ grub_util_device_is_mapped (const char *dev __attribute__ ((unused)))
}
int
grub_util_get_dm_node_linear_info (const char *dev __attribute__ ((unused)),
grub_util_get_dm_node_linear_info (dev_t dev __attribute__ ((unused)),
int *maj __attribute__ ((unused)),
int *min __attribute__ ((unused)),
grub_disk_addr_t *st __attribute__ ((unused)))

View File

@@ -288,6 +288,7 @@ grub_hostdisk_linux_find_partition (char *dev, grub_disk_addr_t sector)
{
grub_util_fd_t fd;
grub_disk_addr_t start;
struct stat st;
sprintf (p, format, i);
@@ -300,14 +301,16 @@ grub_hostdisk_linux_find_partition (char *dev, grub_disk_addr_t sector)
return 0;
}
missing = 0;
close (fd);
if (!grub_util_device_is_mapped (real_dev)
|| !grub_util_get_dm_node_linear_info (real_dev, 0, 0, &start))
if (fstat (fd, &st) < 0
|| !grub_util_device_is_mapped_stat (&st)
|| !grub_util_get_dm_node_linear_info (st.st_rdev, 0, 0, &start))
start = grub_util_find_partition_start_os (real_dev);
/* We don't care about errors here. */
grub_errno = GRUB_ERR_NONE;
close (fd);
if (start == sector)
{
struct linux_partition_cache *new_cache_item;

View File

@@ -46,5 +46,5 @@ message:
.ascii "Boot Test Passed Successfully\n" SUCCESSFUL_BOOT_STRING "\n"
.byte 0
. = base + 510
.org 510
.short 0xaa55

View File

@@ -1,13 +1,18 @@
#ifndef GRUB_SYSTEM_CPU_HEADER
#define GRUB_SYSTEM_CPU_HEADER
#include <grub/types.h>
enum
{
GRUB_ARM_MACHINE_TYPE_RASPBERRY_PI = 3138,
GRUB_ARM_MACHINE_TYPE_FDT = 0xFFFFFFFF
};
void grub_arm_disable_caches_mmu (void);
void EXPORT_FUNC(grub_arm_disable_caches_mmu) (void);
void grub_arm_enable_caches_mmu (void);
void grub_arm_enable_mmu (grub_uint32_t *mmu_tables);
void grub_arm_clear_mmu_v6 (void);
#endif /* ! GRUB_SYSTEM_CPU_HEADER */

View File

@@ -0,0 +1,41 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2013 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/>.
*/
#ifndef GRUB_LINUX_CPU_HEADER
#define GRUB_LINUX_CPU_HEADER 1
#include <grub/efi/efi.h>
#define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */
/* From linux/Documentation/arm64/booting.txt */
struct grub_arm64_linux_kernel_header
{
grub_uint32_t code0; /* Executable code */
grub_uint32_t code1; /* Executable code */
grub_uint64_t text_offset; /* Image load offset */
grub_uint64_t res0; /* reserved */
grub_uint64_t res1; /* reserved */
grub_uint64_t res2; /* reserved */
grub_uint64_t res3; /* reserved */
grub_uint64_t res4; /* reserved */
grub_uint32_t magic; /* Magic number, little endian, "ARM\x64" */
grub_uint32_t hdr_offset; /* Offset of PE/COFF header */
};
#endif /* ! GRUB_LINUX_CPU_HEADER */

View File

@@ -45,4 +45,9 @@ grub_arch_sync_dma_caches (void *address __attribute__ ((unused)),
#endif
#endif
#ifdef __arm__
void
grub_arm_cache_enable (void);
#endif
#endif /* ! GRUB_CACHE_HEADER */

View File

@@ -276,6 +276,16 @@
{ 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 } \
}
#define GRUB_EFI_DEVICE_TREE_GUID \
{ 0xb1b621d5, 0xf19c, 0x41a5, \
{ 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } \
}
#define GRUB_EFI_VENDOR_APPLE_GUID \
{ 0x2B0585EB, 0xD8B8, 0x49A9, \
{ 0x8B, 0x8C, 0xE2, 0x1B, 0x01, 0xAE, 0xF2, 0xB7 } \
}
struct grub_efi_sal_system_table
{
grub_uint32_t signature;
@@ -811,14 +821,6 @@ typedef struct grub_efi_uart_device_path grub_efi_uart_device_path_t;
#define GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE 10
struct grub_efi_vendor_messaging_device_path
{
grub_efi_device_path_t header;
grub_efi_packed_guid_t vendor_guid;
grub_efi_uint8_t vendor_defined_data[0];
} GRUB_PACKED;
typedef struct grub_efi_vendor_messaging_device_path grub_efi_vendor_messaging_device_path_t;
/* Media Device Path. */
#define GRUB_EFI_MEDIA_DEVICE_PATH_TYPE 4

View File

@@ -61,7 +61,7 @@ char *
grub_util_get_os_disk (const char *os_dev);
int
grub_util_get_dm_node_linear_info (const char *dev,
grub_util_get_dm_node_linear_info (dev_t dev,
int *maj, int *min,
grub_disk_addr_t *st);

View File

@@ -36,6 +36,19 @@ typedef struct {
grub_uint32_t size_dt_struct;
} grub_fdt_header_t;
struct grub_fdt_empty_tree {
grub_fdt_header_t header;
grub_uint64_t empty_rsvmap[2];
struct {
grub_uint32_t node_start;
grub_uint8_t name[1];
grub_uint32_t node_end;
grub_uint32_t tree_end;
} empty_node;
};
#define GRUB_FDT_EMPTY_TREE_SZ sizeof (struct grub_fdt_empty_tree)
#define grub_fdt_get_header(fdt, field) \
grub_be_to_cpu32(((const grub_fdt_header_t *)(fdt))->field)
#define grub_fdt_set_header(fdt, field, value) \
@@ -82,6 +95,7 @@ typedef struct {
#define grub_fdt_set_size_dt_struct(fdt, value) \
grub_fdt_set_header(fdt, size_dt_struct, value)
int grub_fdt_create_empty_tree (void *fdt, unsigned int size);
int grub_fdt_check_header (void *fdt, unsigned int size);
int grub_fdt_check_header_nosize (void *fdt);
int grub_fdt_find_subnode (const void *fdt, unsigned int parentoffset,
@@ -97,4 +111,10 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name,
grub_fdt_set_prop ((fdt), (nodeoffset), (name), &_val, 4); \
})
#define grub_fdt_set_prop64(fdt, nodeoffset, name, val) \
({ \
grub_uint64_t _val = grub_cpu_to_be64(val); \
grub_fdt_set_prop ((fdt), (nodeoffset), (name), &_val, 8); \
})
#endif /* ! GRUB_FDT_HEADER */

View File

@@ -1,6 +1,6 @@
If you checked out this source tree directly from GRUB Bazaar, you might
be wondering where are the POT and PO files. Here are some instructions
If you checked out this source tree directly from GRUB Git, you might be
wondering where are the POT and PO files. Here are some instructions
that will hopefully clarify the situation.
- If you're a user or a distributor, simply fill the po directory by
@@ -16,7 +16,7 @@ that will hopefully clarify the situation.
(http://translationproject.org/). The GRUB project doesn't interact
with translators directly (but we dearly appreciate your work!).
- If you're a developer adding/removing/modifiing translatable strings,
- If you're a developer adding/removing/modifying translatable strings,
you can check that these turn into a sane POT file by using the
`po/grub.pot' make rule.

View File

@@ -77,10 +77,15 @@
grub_disk_addr_t
grub_util_find_partition_start (const char *dev)
{
#if GRUB_UTIL_FD_STAT_IS_FUNCTIONAL
struct stat st;
grub_disk_addr_t partition_start;
if (grub_util_device_is_mapped (dev)
&& grub_util_get_dm_node_linear_info (dev, 0, 0, &partition_start))
if (stat (dev, &st) >= 0
&& grub_util_device_is_mapped_stat (&st)
&& grub_util_get_dm_node_linear_info (st.st_rdev, 0, 0, &partition_start))
return partition_start;
#endif
return grub_util_find_partition_start_os (dev);
}

View File

@@ -741,7 +741,7 @@ grub_install_copy_files (const char *src,
"fs.lst", "partmap.lst",
"parttool.lst",
"video.lst", "crypto.lst",
"terminal.lst" };
"terminal.lst", "modinfo.sh" };
size_t i;
for (i = 0; i < ARRAY_SIZE (pkglib_DATA); i++)

View File

@@ -273,7 +273,8 @@ for i in "${grub_mkconfig_dir}"/* ; do
*/\#*\#) ;;
*)
if grub_file_is_not_garbage "$i" && test -x "$i" ; then
for platform in x86 i386-xen-pae x86_64-xen mips mipsel sparc64 powerpc ia64 arm; do
for platform in x86 i386-xen-pae x86_64-xen mips mipsel sparc64 powerpc ia64 arm arm64; do
GRUB_PLATFORM=$platform
export GRUB_PLATFORM
buf="$($i)"
@@ -282,11 +283,11 @@ for i in "${grub_mkconfig_dir}"/* ; do
echo "### BEGIN $i ($platform) ###"
case x$platform in
xx86)
echo "if [ x\"\$grub_platform\" != xxen \\( x\"\$grub_cpu\" = xi386 -o x\"\$grub_cpu\" = xx86_64 -o x\"\$grub_platform\" = x \\) ]; then" ;;
echo "if [ x\"\$grub_platform\" != xxen -a \\( x\"\$grub_cpu\" = xi386 -o x\"\$grub_cpu\" = xx86_64 -o x\"\$grub_platform\" = x \\) ]; then" ;;
xi386-xen-pae)
echo "if [ x\"\$grub_cpu-\$grub_platform\" = xi386-xen -o x\"\$grub_cpu-\$grub_platform\" = x ]; then" ;;
echo "if [ x\"\$grub_cpu-\$grub_platform\" = xi386-xen -o x\"\$grub_cpu-\$grub_platform\" = x- ]; then" ;;
xx86_64-xen)
echo "if [ x\"\$grub_cpu-\$grub_platform\" = xx86_64-xen -o x\"\$grub_cpu-\$grub_platform\" = x ]; then" ;;
echo "if [ x\"\$grub_cpu-\$grub_platform\" = xx86_64-xen -o x\"\$grub_cpu-\$grub_platform\" = x- ]; then" ;;
*)
echo "if [ x\"\$grub_cpu\" = x$platform -o x\"\$grub_platform\" = x ]; then" ;;
esac

View File

@@ -119,8 +119,22 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused)))
{
switch (key)
{
case ARGP_KEY_HELP_PRE_DOC:
/* TRANSLATORS: it generates one single image which is bootable through any method. */
return strdup (_("Make GRUB CD-ROM, disk, pendrive and floppy bootable image."));
case ARGP_KEY_HELP_POST_DOC:
return xasprintf (text, "xorriso -as mkisofs -help");
{
char *p1, *out;
p1 = xasprintf (_("Generates a bootable CD/USB/floppy image. Arguments other than options to this program"
" are passed to xorriso, and indicate source files, source directories, or any of the "
"mkisofs options listed by the output of `%s'."), "xorriso -as mkisofs -help");
out = xasprintf ("%s\n\n%s\n\n%s", p1,
_("Option -- switches to native xorriso command mode."),
_("Mail xorriso support requests to <bug-xorriso@gnu.org>."));
free (p1);
return out;
}
default:
return grub_install_help_filter (key, text, input);
}
@@ -214,14 +228,7 @@ argp_parser (int key, char *arg, struct argp_state *state)
struct argp argp = {
options, argp_parser, N_("[OPTION] SOURCE..."),
/* TRANSLATORS: it generates one single image which is bootable through any method. */
N_("Make GRUB CD-ROM, disk, pendrive and floppy bootable image.")"\v"
N_("Generates a bootable CD/USB/floppy image. Arguments other than options to this program"
" are passed to xorriso, and indicate source files, source directories, or any of the "
"mkisofs options listed by the output of `%s'.\n\n"
"Option -- switches to native xorriso command mode.\n\n"
"Mail xorriso support requests to <bug-xorriso@gnu.org>."),
NULL, help_filter, NULL
NULL, NULL, help_filter, NULL
};
static void
@@ -434,6 +441,9 @@ main (int argc, char *argv[])
if (source_dirs[GRUB_INSTALL_PLATFORM_I386_PC]
|| source_dirs[GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275]
|| source_dirs[GRUB_INSTALL_PLATFORM_I386_EFI]
|| source_dirs[GRUB_INSTALL_PLATFORM_IA64_EFI]
|| source_dirs[GRUB_INSTALL_PLATFORM_ARM_EFI]
|| source_dirs[GRUB_INSTALL_PLATFORM_ARM64_EFI]
|| source_dirs[GRUB_INSTALL_PLATFORM_X86_64_EFI])
system_area = SYS_AREA_COMMON;
else if (source_dirs[GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275])
@@ -629,7 +639,8 @@ main (int argc, char *argv[])
if (source_dirs[GRUB_INSTALL_PLATFORM_I386_EFI]
|| source_dirs[GRUB_INSTALL_PLATFORM_X86_64_EFI]
|| source_dirs[GRUB_INSTALL_PLATFORM_IA64_EFI]
|| source_dirs[GRUB_INSTALL_PLATFORM_ARM_EFI])
|| source_dirs[GRUB_INSTALL_PLATFORM_ARM_EFI]
|| source_dirs[GRUB_INSTALL_PLATFORM_ARM64_EFI])
{
char *efidir = grub_util_make_temporary_dir ();
char *efidir_efi = grub_util_path_concat (2, efidir, "efi");
@@ -652,6 +663,11 @@ main (int argc, char *argv[])
make_image_fwdisk_abs (GRUB_INSTALL_PLATFORM_ARM_EFI, "arm-efi", imgname);
free (imgname);
imgname = grub_util_path_concat (2, efidir_efi_boot, "bootaarch64.efi");
make_image_fwdisk_abs (GRUB_INSTALL_PLATFORM_ARM64_EFI, "arm64-efi",
imgname);
free (imgname);
if (source_dirs[GRUB_INSTALL_PLATFORM_I386_EFI])
{
imgname = grub_util_path_concat (2, efidir_efi_boot, "boot.efi");