mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-28 10:10:29 +00:00
Compare commits
79
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8f07821cc | ||
|
|
dc3286ade4 | ||
|
|
46f8d358ef | ||
|
|
09c479006c | ||
|
|
4d6c69536e | ||
|
|
faf4a65e1e | ||
|
|
e5fa26e573 | ||
|
|
569766e49b | ||
|
|
4127206896 | ||
|
|
f7c7c4d4ad | ||
|
|
57bc5d431b | ||
|
|
6a7957f9f5 | ||
|
|
e88f0420b9 | ||
|
|
da98622662 | ||
|
|
fba31b5f69 | ||
|
|
72f099578e | ||
|
|
808e97c4e7 | ||
|
|
e388db904c | ||
|
|
cef394032d | ||
|
|
a4d610026f | ||
|
|
0c930a841e | ||
|
|
3d369a01ac | ||
|
|
5b83ef97e5 | ||
|
|
16f7455b04 | ||
|
|
74fa9ac1a6 | ||
|
|
62956fe7b9 | ||
|
|
260632161f | ||
|
|
4cd0b55fd0 | ||
|
|
95b56e3a97 | ||
|
|
bbc52c228f | ||
|
|
943981ff65 | ||
|
|
adabfb5418 | ||
|
|
77ec462a56 | ||
|
|
3bf2db8959 | ||
|
|
30a9ab952f | ||
|
|
c415eaa98f | ||
|
|
313fb3cef8 | ||
|
|
37f617c025 | ||
|
|
3deedfc033 | ||
|
|
5ad9f728eb | ||
|
|
eeb8499721 | ||
|
|
0d8b81f89a | ||
|
|
bf082198e2 | ||
|
|
0b602bf9ad | ||
|
|
96650a82ec | ||
|
|
ca3e20886e | ||
|
|
27db1a9b64 | ||
|
|
8a913e664e | ||
|
|
ae558c2ccf | ||
|
|
bbac6789aa | ||
|
|
ab216512d7 | ||
|
|
0d4aa91d0d | ||
|
|
a997af68e3 | ||
|
|
36bcaf2903 | ||
|
|
74763e9615 | ||
|
|
80b29fc9b4 | ||
|
|
6e327fcd4c | ||
|
|
62ce03cf40 | ||
|
|
f4d70fd02b | ||
|
|
93bf55e616 | ||
|
|
579ee114b1 | ||
|
|
ee5283d66b | ||
|
|
5dbde526a8 | ||
|
|
d88ae4f0a4 | ||
|
|
17b4355943 | ||
|
|
76a2a43011 | ||
|
|
0d26164edd | ||
|
|
2622b1e8a8 | ||
|
|
05126706b0 | ||
|
|
2f9c48041a | ||
|
|
0438ebf1c3 | ||
|
|
065adc346c | ||
|
|
496a6b3024 | ||
|
|
971038be55 | ||
|
|
bfdfeb2508 | ||
|
|
c00c34efe1 | ||
|
|
d642d76197 | ||
|
|
871aa709af | ||
|
|
3bc1b2daab |
No files matched your search
@@ -1,3 +1,363 @@
|
||||
2013-12-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* configure.ac: Set version to 2.02~beta2.
|
||||
|
||||
2013-12-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/disk/efi/efidisk.c (name_devices): Skip Apple ghosts.
|
||||
|
||||
2013-12-24 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
* util/grub-probe.c: Improve help message and simplify list handling.
|
||||
|
||||
2013-12-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Fix buffer overflow in grub_efi_print_device_path.
|
||||
|
||||
2013-12-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Show SATA device path.
|
||||
|
||||
2013-12-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Revert grub-file usage in grub-mkconfig.
|
||||
|
||||
2013-12-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Make newly-created files other than grub.cfg world-readable.
|
||||
|
||||
2013-12-24 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
* util/grub.d/00_header.in: Improve compatibility with old config.
|
||||
|
||||
2013-12-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Make rijndael.c respect aliasing rules.
|
||||
|
||||
Trivial backport of dfb4673da8ee52d95e0a62c9f49ca8599943f22e.
|
||||
|
||||
2013-12-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Make grub_util_device_is_mapped_stat available in grub-emu core.
|
||||
|
||||
2013-12-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Add -Qn to TARGET_CFLAGS if it's supported.
|
||||
Fixes compilation on cygwin.
|
||||
|
||||
Reported by: Andrey Borzenkov.
|
||||
Suggested by: Andrey Borzenkov.
|
||||
|
||||
2013-12-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Save TARGET_CC version in modinfo.sh.
|
||||
|
||||
Suggested by: Andrey Borzenkov.
|
||||
|
||||
2013-12-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Make grub_util_devmapper_part_to_disk and grub_util_find_partition_start
|
||||
follow the same algorithm to avoid method mismatch. Don't assume
|
||||
DMRAID- UUID to mean full disk but instead check that mapping is linear.
|
||||
|
||||
2013-12-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Declare GRUB_EFI_VENDOR_APPLE_GUID.
|
||||
|
||||
2013-12-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Dump type and vendor specific data when printing device path.
|
||||
|
||||
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.
|
||||
|
||||
2013-12-22 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/loader/arm/linux.c: Pass arguments through on ATAG
|
||||
platforms.
|
||||
|
||||
2013-12-22 Lars Wendler <polynomial-c@gentoo.org>
|
||||
|
||||
* util/grub-mkconfig.in: Skip non-executable files.
|
||||
|
||||
2013-12-22 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Workaround buggy timer in raspberry pie by using our own timer
|
||||
implementation.
|
||||
|
||||
2013-12-22 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* include/grub/arm/uboot/kernel.h (GRUB_KERNEL_MACHINE_HEAP_SIZE):
|
||||
Increase to 16 MiB to allow loading the whole memdisk.
|
||||
|
||||
2013-12-22 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Fix ARM Linux Loader on non-FDT platforms.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* configure.ac: Choose link format based on host_os on emu.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/osdep/unix/getroot.c: Non-unix build fix.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/kern/emu/main.c: Build fix for emu.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Build fixes for argp.h with older gcc.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-glue-efi.c: Use "universal binary" rather "fat binary"
|
||||
in strings.
|
||||
|
||||
Suggested by: David Prévot.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* include/grub/crypto.h (grub_crypto_xor): Fix cast-align warning.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Enable -Wformat=2 if it's supported.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* configure.ac: Add -Wmissing-include-dirs -Wmissing-prototypes
|
||||
-Wmissing-declarations if supported.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/commands/macbless.c (grub_mac_bless_inode): Pass inode as
|
||||
u32 as both HFS and HFS+ have 32-bit inodes.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* include/grub/misc.h (grub_strtol): Fix overflow.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* include/grub/term.h (grub_unicode_estimate_width): Use grub_size_t
|
||||
as return type in both conditionals.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* include/grub/video.h (grub_video_rgba_color_rgb): Fix prototype
|
||||
to use uint8_t for color.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/misc.c (grub_util_get_image_size): Check for overflow.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/disk/raid6_recover.c (grub_raid_block_mulx): Use grub_size_t
|
||||
for size.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/disk/lvm.c: Use grub_size_t for sizes and grub_ssize_t
|
||||
for pointer difference.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/import_gcry.py: Skip sample keys.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/misc.c (grub_qsort_strcmp): Don't discard const attribute.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* configure.ac: Remove duplicate warning arguments.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Add missing static qualifiers.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Add missing includes.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Inline printf templates when possible to enable format checking.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* include/grub/crypto.h: Don't discard const attribute.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/net/bootp.c (grub_cmd_dhcpopt): Use snprintf where it
|
||||
was intended.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/lib/crypto.c: Don't discard const attribute.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/lib/disk.c: Fix potential overflow.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/lib/arg.c: Don't discard const attribute.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/kern/dl.c: Don't discard const attribute.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/kern/disk.c: Fix potential overflow.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* conf/Makefile.common: Don't include non-existing directory
|
||||
grub-core/lib/libgcrypt-grub/include.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Clarify several translatable messages.
|
||||
|
||||
2013-12-21 David Prévot <david@tilapin.org>
|
||||
|
||||
Correct some translatable strings.
|
||||
|
||||
2013-12-21 Colin Watson <cjwatson@ubuntu.com>
|
||||
|
||||
* util/grub-mkrescue.c: Rephrase mkrescue description.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
2013-12-21 Colin Watson <cjwatson@ubuntu.com>
|
||||
|
||||
Clarify several translatable messages.
|
||||
|
||||
2013-12-20 Colin Watson <cjwatson@ubuntu.com>
|
||||
|
||||
Be more verbose about some configure failures.
|
||||
|
||||
2013-12-20 Colin Watson <cjwatson@ubuntu.com>
|
||||
|
||||
Fix various build problems on GNU/Hurd.
|
||||
|
||||
* grub-core/osdep/unix/getroot.c (strip_extra_slashes): Move inside
|
||||
!defined (__GNU__).
|
||||
(xgetcwd): Likewise.
|
||||
* include/grub/emu/hostdisk.h (grub_util_hurd_get_disk_info)
|
||||
[__GNU__]: Add prototype.
|
||||
* util/getroot.c (grub_util_biosdisk_get_grub_dev) [__GNU__]: Format
|
||||
long int using %ld rather than %d.
|
||||
|
||||
2013-12-18 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-install.c: Inform user about install platform.
|
||||
|
||||
2013-12-18 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* configure.ac: Set version to 2.02~beta1.
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
@@ -439,42 +439,49 @@ script = {
|
||||
name = '10_hurd';
|
||||
common = util/grub.d/10_hurd.in;
|
||||
installdir = grubconf;
|
||||
condition = COND_HOST_HURD;
|
||||
};
|
||||
|
||||
script = {
|
||||
name = '10_kfreebsd';
|
||||
common = util/grub.d/10_kfreebsd.in;
|
||||
installdir = grubconf;
|
||||
condition = COND_HOST_KFREEBSD;
|
||||
};
|
||||
|
||||
script = {
|
||||
name = '10_illumos';
|
||||
common = util/grub.d/10_illumos.in;
|
||||
installdir = grubconf;
|
||||
condition = COND_HOST_ILLUMOS;
|
||||
};
|
||||
|
||||
script = {
|
||||
name = '10_netbsd';
|
||||
common = util/grub.d/10_netbsd.in;
|
||||
installdir = grubconf;
|
||||
condition = COND_HOST_NETBSD;
|
||||
};
|
||||
|
||||
script = {
|
||||
name = '10_linux';
|
||||
common = util/grub.d/10_linux.in;
|
||||
installdir = grubconf;
|
||||
condition = COND_HOST_LINUX;
|
||||
};
|
||||
|
||||
script = {
|
||||
name = '10_xnu';
|
||||
common = util/grub.d/10_xnu.in;
|
||||
installdir = grubconf;
|
||||
condition = COND_HOST_XNU;
|
||||
};
|
||||
|
||||
script = {
|
||||
name = '20_linux_xen';
|
||||
common = util/grub.d/20_linux_xen.in;
|
||||
installdir = grubconf;
|
||||
condition = COND_HOST_LINUX;
|
||||
};
|
||||
|
||||
script = {
|
||||
|
||||
@@ -35,7 +35,6 @@ CPPFLAGS_DEFAULT += -I$(top_builddir)
|
||||
CPPFLAGS_DEFAULT += -I$(top_srcdir)
|
||||
CPPFLAGS_DEFAULT += -I$(top_srcdir)/include
|
||||
CPPFLAGS_DEFAULT += -I$(top_builddir)/include
|
||||
CPPFLAGS_DEFAULT += -I$(top_srcdir)/grub-core/lib/libgcrypt-grub/include
|
||||
CPPFLAGS_DEFAULT += -I$(top_srcdir)/grub-core/lib/libgcrypt-grub/src/
|
||||
CCASFLAGS_DEFAULT = $(CPPFLAGS_DEFAULT) -DASM_FILE=1
|
||||
BUILD_CPPFLAGS += $(CPPFLAGS_DEFAULT)
|
||||
|
||||
@@ -51,12 +51,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@"
|
||||
|
||||
+68
-28
@@ -32,7 +32,7 @@ dnl type, so there is no conflict. Variables with the prefix "TARGET_"
|
||||
dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target
|
||||
dnl type.
|
||||
|
||||
AC_INIT([GRUB],[2.02~beta1],[bug-grub@gnu.org])
|
||||
AC_INIT([GRUB],[2.02~beta2],[bug-grub@gnu.org])
|
||||
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
|
||||
@@ -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
|
||||
@@ -432,8 +426,8 @@ esac
|
||||
# For gnulib.
|
||||
gl_INIT
|
||||
|
||||
WARN_FLAGS="-Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wpointer-arith -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes"
|
||||
EXTRA_WARN_FLAGS="-Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign"
|
||||
WARN_FLAGS="-Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes"
|
||||
EXTRA_WARN_FLAGS="-Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2"
|
||||
|
||||
HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS -Wcast-align"
|
||||
|
||||
@@ -509,6 +503,8 @@ if test "x$target_cpu" != xi386 && test "x$target_cpu" != xx86_64; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -Wcast-align"
|
||||
fi
|
||||
|
||||
TARGET_CC_VERSION="$(LC_ALL=C $TARGET_CC --version | head -n1)"
|
||||
|
||||
AC_CACHE_CHECK([which extra warnings work], [grub_cv_target_cc_w_extra_flags], [
|
||||
LDFLAGS="$TARGET_LDFLAGS -nostdlib -static"
|
||||
|
||||
@@ -745,7 +741,7 @@ if test x"$efiemu_excuse" = x ; then
|
||||
fi
|
||||
fi
|
||||
if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then
|
||||
AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled])
|
||||
AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled ($efiemu_excuse)])
|
||||
fi
|
||||
if test x"$efiemu_excuse" = x ; then
|
||||
enable_efiemu=yes
|
||||
@@ -757,14 +753,35 @@ AC_SUBST([EFIEMU64_LINK_FORMAT])
|
||||
|
||||
CFLAGS="$TARGET_CFLAGS"
|
||||
|
||||
if test x"$target_cpu" = xi386 || test x"$target_cpu" = xx86_64; then
|
||||
|
||||
if test x"$platform" = xemu ; then
|
||||
TARGET_OBJ2ELF=
|
||||
grub_cv_target_cc_link_format=
|
||||
case "$host_os" in
|
||||
*darwin* | *mac*)
|
||||
grub_cv_target_cc_link_format="-arch,${target_cpu}"
|
||||
TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$grub_cv_target_cc_link_format"
|
||||
;;
|
||||
*windows* | *cygwin* | *mingw*)
|
||||
if test x${target_cpu} = xi386 ; then
|
||||
grub_cv_target_cc_link_format=-mi386pe;
|
||||
TARGET_OBJ2ELF='./build-grub-pe2elf';
|
||||
fi
|
||||
if test x${target_cpu} = xx86_64 ; then
|
||||
grub_cv_target_cc_link_format=-mi386pep;
|
||||
TARGET_OBJ2ELF='./build-grub-pep2elf';
|
||||
fi
|
||||
TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$grub_cv_target_cc_link_format"
|
||||
;;
|
||||
esac
|
||||
elif test x"$target_cpu" = xi386 || test x"$target_cpu" = xx86_64; then
|
||||
AC_CACHE_CHECK([for target linking format], [grub_cv_target_cc_link_format], [
|
||||
grub_cv_target_cc_link_format=unknown
|
||||
for format in -melf_${target_cpu} -melf_${target_cpu}_fbsd -melf_${target_cpu}_obsd -melf_${target_cpu}_haiku -mi386pe -mi386pep -arch,${target_cpu}; do
|
||||
if test x${target_cpu} != xi386 && test x$format = xi386pe; then
|
||||
if test x${target_cpu} != xi386 && test x$format = x-mi386pe; then
|
||||
continue
|
||||
fi
|
||||
if test x${target_cpu} != xx86_64 && test x$format = xi386pep; then
|
||||
if test x${target_cpu} != xx86_64 && test x$format = x-mi386pep; then
|
||||
continue
|
||||
fi
|
||||
CFLAGS="$TARGET_CFLAGS"
|
||||
@@ -896,6 +913,15 @@ if test "x$target_cpu" = xarm; then
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([whether option -Qn works], grub_cv_target_cc_qn, [
|
||||
CFLAGS="$TARGET_CFLAGS -Qn -Werror"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
[grub_cv_target_cc_qn=yes],
|
||||
[grub_cv_target_cc_qn=no])])
|
||||
if test "x$grub_cv_target_cc_qn" = xyes; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -Qn"
|
||||
fi
|
||||
|
||||
#
|
||||
# Compiler features.
|
||||
#
|
||||
@@ -1144,7 +1170,7 @@ AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"],
|
||||
[grub_emu_usb_excuse=["need libusb headers"]])
|
||||
[fi]
|
||||
if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then
|
||||
AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled])
|
||||
AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled ($grub_emu_usb_excuse)])
|
||||
fi
|
||||
if test x"$grub_emu_usb_excuse" = x ; then
|
||||
enable_grub_emu_usb=yes
|
||||
@@ -1153,7 +1179,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.]
|
||||
@@ -1169,7 +1195,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])
|
||||
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
|
||||
@@ -1249,7 +1275,7 @@ if test x"$grub_mkfont_excuse" = x ; then
|
||||
fi
|
||||
|
||||
if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then
|
||||
AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled])
|
||||
AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled ($grub_mkfont_excuse)])
|
||||
fi
|
||||
if test x"$grub_mkfont_excuse" = x ; then
|
||||
enable_grub_mkfont=yes
|
||||
@@ -1308,7 +1334,7 @@ if test x"$grub_build_mkfont_excuse" = x ; then
|
||||
fi
|
||||
|
||||
if test x"$enable_build_grub_mkfont" = xyes && test x"$grub_build_mkfont_excuse" != x ; then
|
||||
AC_MSG_ERROR([build-grub-mkfont was explicitly requested but can't be compiled])
|
||||
AC_MSG_ERROR([build-grub-mkfont was explicitly requested but can't be compiled ($grub_build_mkfont_excuse)])
|
||||
fi
|
||||
if test x"$grub_build_mkfont_excuse" = x ; then
|
||||
enable_build_grub_mkfont=yes
|
||||
@@ -1316,7 +1342,11 @@ else
|
||||
enable_build_grub_mkfont=no
|
||||
fi
|
||||
if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$platform" = xcoreboot ); then
|
||||
AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports needs build-time grub-mkfont])
|
||||
if test x"$grub_build_mkfont_excuse" = x ; then
|
||||
AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports needs build-time grub-mkfont])
|
||||
else
|
||||
AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports needs build-time grub-mkfont ($grub_build_mkfont_excuse)])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST([build_freetype_cflags])
|
||||
@@ -1359,7 +1389,7 @@ if test x"$starfield_excuse" = x; then
|
||||
fi
|
||||
|
||||
if test x"$enable_grub_themes" = xyes && test x"$starfield_excuse" != x; then
|
||||
AC_MSG_ERROR([themes were explicitly requested but requirements are not satisfied])
|
||||
AC_MSG_ERROR([themes were explicitly requested but requirements are not satisfied ($starfield_excuse)])
|
||||
fi
|
||||
|
||||
AC_SUBST([DJVU_FONT_SOURCE])
|
||||
@@ -1385,7 +1415,11 @@ if test x"$enable_build_grub_mkfont" = xno ; then
|
||||
fi
|
||||
|
||||
if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$platform" = xcoreboot ); then
|
||||
AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports need unifont])
|
||||
if test x"$grub_build_mkfont_excuse" = x ; then
|
||||
AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports need unifont])
|
||||
else
|
||||
AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports need unifont ($grub_build_mkfont_excuse)])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST([FONT_SOURCE])
|
||||
@@ -1417,7 +1451,7 @@ if test x"$grub_mount_excuse" = x ; then
|
||||
fi
|
||||
|
||||
if test x"$enable_grub_mount" = xyes && test x"$grub_mount_excuse" != x ; then
|
||||
AC_MSG_ERROR([grub-mount was explicitly requested but can't be compiled])
|
||||
AC_MSG_ERROR([grub-mount was explicitly requested but can't be compiled ($grub_mount_excuse)])
|
||||
fi
|
||||
if test x"$grub_mount_excuse" = x ; then
|
||||
enable_grub_mount=yes
|
||||
@@ -1485,7 +1519,7 @@ AC_CHECK_HEADER([lzma.h], [], [liblzma_excuse="need lzma header"])
|
||||
fi
|
||||
|
||||
if test x"$enable_liblzma" = xyes && test x"$liblzma_excuse" != x ; then
|
||||
AC_MSG_ERROR([liblzma support was explicitly requested but requirements are not satisfied])
|
||||
AC_MSG_ERROR([liblzma support was explicitly requested but requirements are not satisfied ($liblzma_excuse)])
|
||||
fi
|
||||
|
||||
|
||||
@@ -1522,7 +1556,7 @@ if test x"$libzfs_excuse" = x ; then
|
||||
fi
|
||||
|
||||
if test x"$enable_libzfs" = xyes && test x"$libzfs_excuse" != x ; then
|
||||
AC_MSG_ERROR([libzfs support was explicitly requested but requirements are not satisfied])
|
||||
AC_MSG_ERROR([libzfs support was explicitly requested but requirements are not satisfied ($libzfs_excuse)])
|
||||
fi
|
||||
|
||||
if test x"$libzfs_excuse" = x ; then
|
||||
@@ -1551,7 +1585,6 @@ 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],
|
||||
@@ -1583,6 +1616,7 @@ AC_SUBST(TARGET_CPP)
|
||||
AC_SUBST(TARGET_CCAS)
|
||||
AC_SUBST(TARGET_OBJ2ELF)
|
||||
AC_SUBST(TARGET_MODULE_FORMAT)
|
||||
AC_SUBST(TARGET_CC_VERSION)
|
||||
|
||||
AC_SUBST(TARGET_CFLAGS)
|
||||
AC_SUBST(TARGET_LDFLAGS)
|
||||
@@ -1632,7 +1666,13 @@ AM_CONDITIONAL([COND_arm_efi], [test x$target_cpu = xarm -a x$platform = xefi])
|
||||
AM_CONDITIONAL([COND_arm64], [test x$target_cpu = xarm64 ])
|
||||
AM_CONDITIONAL([COND_arm64_efi], [test x$target_cpu = xarm64 -a x$platform = xefi])
|
||||
|
||||
AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd])
|
||||
AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux])
|
||||
AM_CONDITIONAL([COND_HOST_NETBSD], [test x$host_kernel = xnetbsd])
|
||||
AM_CONDITIONAL([COND_HOST_WINDOWS], [test x$host_kernel = xwindows])
|
||||
AM_CONDITIONAL([COND_HOST_KFREEBSD], [test x$host_kernel = xkfreebsd])
|
||||
AM_CONDITIONAL([COND_HOST_XNU], [test x$host_kernel = xxnu])
|
||||
AM_CONDITIONAL([COND_HOST_ILLUMOS], [test x$host_kernel = xillumos])
|
||||
|
||||
AM_CONDITIONAL([COND_MAN_PAGES], [test x$cross_compiling = xno -a x$HELP2MAN != x])
|
||||
AM_CONDITIONAL([COND_GRUB_EMU_USB], [test x$enable_grub_emu_usb = xyes])
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1672,7 +1672,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;
|
||||
|
||||
@@ -56,7 +56,7 @@ GRUB_MOD_INIT(boottime)
|
||||
{
|
||||
cmd_boottime =
|
||||
grub_register_command ("boottime", grub_cmd_boottime,
|
||||
0, N_("Get boot time statistics."));
|
||||
0, N_("Show boot time statistics."));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(boottime)
|
||||
|
||||
+62
-25
@@ -36,62 +36,66 @@ GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static const struct grub_arg_option options[] = {
|
||||
{"is-i386-xen-pae-domu", 0, 0,
|
||||
N_("Check if FILE can be booted as i386 PAE xen unprivilegied guest"),
|
||||
N_("Check if FILE can be booted as i386 PAE Xen unprivileged guest kernel"),
|
||||
0, 0},
|
||||
{"is-x86_64-xen-domu", 0, 0,
|
||||
N_("Check if FILE can be booted as x86_64 xen unprivilegied guest"), 0, 0},
|
||||
N_("Check if FILE can be booted as x86_64 Xen unprivileged guest kernel"), 0, 0},
|
||||
{"is-x86-xen-dom0", 0, 0,
|
||||
N_("Check if FILE can be used as xen x86 privilegied guest kernel"), 0, 0},
|
||||
N_("Check if FILE can be used as Xen x86 privileged guest kernel"), 0, 0},
|
||||
{"is-x86-multiboot", 0, 0,
|
||||
N_("Check if FILE can be used as x86 multiboot kernel"), 0, 0},
|
||||
{"is-x86-multiboot2", 0, 0,
|
||||
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},
|
||||
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},
|
||||
N_("Check if FILE is IA64 Linux"), 0, 0},
|
||||
{"is-mips-linux", 0, 0,
|
||||
N_("Check if FILE is MIPS linux"), 0, 0},
|
||||
N_("Check if FILE is MIPS Linux"), 0, 0},
|
||||
{"is-mipsel-linux", 0, 0,
|
||||
N_("Check if FILE is MIPSEL linux"), 0, 0},
|
||||
N_("Check if FILE is MIPSEL Linux"), 0, 0},
|
||||
{"is-sparc64-linux", 0, 0,
|
||||
N_("Check if FILE is SPARC64 linux"), 0, 0},
|
||||
N_("Check if FILE is SPARC64 Linux"), 0, 0},
|
||||
{"is-powerpc-linux", 0, 0,
|
||||
N_("Check if FILE is POWERPC linux"), 0, 0},
|
||||
N_("Check if FILE is POWERPC Linux"), 0, 0},
|
||||
{"is-x86-linux", 0, 0,
|
||||
N_("Check if FILE is x86 linux"), 0, 0},
|
||||
N_("Check if FILE is x86 Linux"), 0, 0},
|
||||
{"is-x86-linux32", 0, 0,
|
||||
N_("Check if FILE is x86 linux supporting 32-bit protocol"), 0, 0},
|
||||
N_("Check if FILE is x86 Linux supporting 32-bit protocol"), 0, 0},
|
||||
{"is-x86-kfreebsd", 0, 0,
|
||||
N_("Check if FILE is x86 kfreebsd"), 0, 0},
|
||||
N_("Check if FILE is x86 kFreeBSD"), 0, 0},
|
||||
{"is-i386-kfreebsd", 0, 0,
|
||||
N_("Check if FILE is i386 kfreebsd"), 0, 0},
|
||||
N_("Check if FILE is i386 kFreeBSD"), 0, 0},
|
||||
{"is-x86_64-kfreebsd", 0, 0,
|
||||
N_("Check if FILE is x86_64 kfreebsd"), 0, 0},
|
||||
N_("Check if FILE is x86_64 kFreeBSD"), 0, 0},
|
||||
|
||||
{"is-x86-knetbsd", 0, 0,
|
||||
N_("Check if FILE is x86 knetbsd"), 0, 0},
|
||||
N_("Check if FILE is x86 kNetBSD"), 0, 0},
|
||||
{"is-i386-knetbsd", 0, 0,
|
||||
N_("Check if FILE is i386 knetbsd"), 0, 0},
|
||||
N_("Check if FILE is i386 kNetBSD"), 0, 0},
|
||||
{"is-x86_64-knetbsd", 0, 0,
|
||||
N_("Check if FILE is x86_64 knetbsd"), 0, 0},
|
||||
N_("Check if FILE is x86_64 kNetBSD"), 0, 0},
|
||||
|
||||
{"is-i386-efi", 0, 0,
|
||||
N_("Check if FILE is i386 EFI file"), 0, 0},
|
||||
{"is-x86_64-efi", 0, 0,
|
||||
N_("Check if FILE is x86-64 EFI file"), 0, 0},
|
||||
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,
|
||||
N_("Check if FILE is hiberfil.sys in hibernated state"), 0, 0},
|
||||
{"is-x86_64-xnu", 0, 0,
|
||||
N_("Check if FILE is x86_64 xnu (Mac OS X kernel)"), 0, 0},
|
||||
N_("Check if FILE is x86_64 XNU (Mac OS X kernel)"), 0, 0},
|
||||
{"is-i386-xnu", 0, 0,
|
||||
N_("Check if FILE is i386 xnu (Mac OS X kernel)"), 0, 0},
|
||||
N_("Check if FILE is i386 XNU (Mac OS X kernel)"), 0, 0},
|
||||
{"is-xnu-hibr", 0, 0,
|
||||
N_("Check if FILE is xnu (Mac OS X kernel) hibernated image"), 0, 0},
|
||||
N_("Check if FILE is XNU (Mac OS X kernel) hibernated image"), 0, 0},
|
||||
{"is-x86-bios-bootsector", 0, 0,
|
||||
N_("Check if FILE is BIOS bootsector"), 0, 0},
|
||||
{0, 0, 0, 0, 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))
|
||||
|
||||
@@ -55,7 +55,7 @@ GRUB_MOD_INIT(cmosdump)
|
||||
{
|
||||
cmd = grub_register_command ("cmosdump", grub_cmd_cmosdump,
|
||||
0,
|
||||
N_("Dump CMOS contents."));
|
||||
N_("Show raw dump of the CMOS contents."));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(cmosdump)
|
||||
|
||||
@@ -109,9 +109,10 @@ GRUB_MOD_INIT(cmostest)
|
||||
N_("Test bit at BYTE:BIT in CMOS."));
|
||||
cmd_clean = grub_register_command ("cmosclean", grub_cmd_cmosclean,
|
||||
N_("BYTE:BIT"),
|
||||
N_("Clean bit at BYTE:BIT in CMOS."));
|
||||
N_("Clear bit at BYTE:BIT in CMOS."));
|
||||
cmd_set = grub_register_command ("cmosset", grub_cmd_cmosset,
|
||||
N_("BYTE:BIT"),
|
||||
/* TRANSLATORS: A bit may be either set (1) or clear (0). */
|
||||
N_("Set bit at BYTE:BIT in CMOS."));
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ GRUB_MOD_INIT(cbtime)
|
||||
{
|
||||
cmd_boottime =
|
||||
grub_register_command ("coreboot_boottime", grub_cmd_coreboot_boottime,
|
||||
0, N_("Get coreboot boot time statistics."));
|
||||
0, N_("Show coreboot boot time statistics."));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(cbtime)
|
||||
|
||||
@@ -455,7 +455,7 @@ GRUB_MOD_INIT(loadenv)
|
||||
{
|
||||
cmd_load =
|
||||
grub_register_extcmd ("load_env", grub_cmd_load_env, 0,
|
||||
N_("[-f FILE] [-s|--skip-sig] [whitelisted_variable_name] [...]"),
|
||||
N_("[-f FILE] [-s|--skip-sig] [variable_name_to_whitelist] [...]"),
|
||||
N_("Load variables from environment block file."),
|
||||
options);
|
||||
cmd_list =
|
||||
|
||||
@@ -59,7 +59,7 @@ find_inode (const char *filename,
|
||||
}
|
||||
|
||||
grub_err_t
|
||||
grub_mac_bless_inode (grub_device_t dev, grub_uint64_t inode, int is_dir,
|
||||
grub_mac_bless_inode (grub_device_t dev, grub_uint32_t inode, int is_dir,
|
||||
int intel)
|
||||
{
|
||||
grub_err_t err;
|
||||
@@ -174,8 +174,8 @@ grub_mac_bless_file (grub_device_t dev, const char *path_in, int intel)
|
||||
}
|
||||
grub_free (path);
|
||||
|
||||
return grub_mac_bless_inode (dev, ctx.inode_found, (ctx.found == DIR),
|
||||
intel);
|
||||
return grub_mac_bless_inode (dev, (grub_uint32_t) ctx.inode_found,
|
||||
(ctx.found == DIR), intel);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ GRUB_MOD_INIT(pcidump)
|
||||
{
|
||||
cmd = grub_register_extcmd ("pcidump", grub_cmd_pcidump, 0,
|
||||
N_("[-s POSITION] [-d DEVICE]"),
|
||||
N_("Dump PCI configuration space."), options);
|
||||
N_("Show raw dump of the PCI configuration space."), options);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(pcidump)
|
||||
|
||||
@@ -47,14 +47,14 @@ syslinux_file_getline (char **line, int cont __attribute__ ((unused)),
|
||||
static const struct grub_arg_option options[] =
|
||||
{
|
||||
{"root", 'r', 0,
|
||||
N_("root directory of the syslinux disk (default /)."),
|
||||
N_("root directory of the syslinux disk [default=/]."),
|
||||
N_("DIR"), ARG_TYPE_STRING},
|
||||
{"cwd", 'c', 0,
|
||||
N_("home directory of the syslinux config (default directory of configfile)."),
|
||||
N_("current directory of the syslinux [default is parent directory of input file]."),
|
||||
N_("DIR"), ARG_TYPE_STRING},
|
||||
{"isolinux", 'i', 0, N_("assume isolinux."), 0, 0},
|
||||
{"pxelinux", 'p', 0, N_("assume pxelinux."), 0, 0},
|
||||
{"syslinux", 's', 0, N_("assume syslinux."), 0, 0},
|
||||
{"isolinux", 'i', 0, N_("assume input is an isolinux configuration file."), 0, 0},
|
||||
{"pxelinux", 'p', 0, N_("assume input is a pxelinux configuration file."), 0, 0},
|
||||
{"syslinux", 's', 0, N_("assume input is a syslinux configuration file."), 0, 0},
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@@ -183,25 +183,25 @@ GRUB_MOD_INIT(syslinuxcfg)
|
||||
N_("FILE"),
|
||||
/* TRANSLATORS: "syslinux config" means
|
||||
"config as used by syslinux". */
|
||||
N_("Parse syslinux config in same context"),
|
||||
N_("Execute syslinux config in same context"),
|
||||
options);
|
||||
cmd_configfile
|
||||
= grub_register_extcmd ("syslinux_configfile",
|
||||
grub_cmd_syslinux_source, 0,
|
||||
N_("FILE"),
|
||||
N_("Parse syslinux config in new context"),
|
||||
N_("Execute syslinux config in new context"),
|
||||
options);
|
||||
cmd_source_extract
|
||||
= grub_register_extcmd ("extract_syslinux_entries_source",
|
||||
grub_cmd_syslinux_source, 0,
|
||||
N_("FILE"),
|
||||
N_("Parse syslinux config in same context taking only menu entries"),
|
||||
N_("Execute syslinux config in same context taking only menu entries"),
|
||||
options);
|
||||
cmd_configfile_extract
|
||||
= grub_register_extcmd ("extract_syslinux_entries_configfile",
|
||||
grub_cmd_syslinux_source, 0,
|
||||
N_("FILE"),
|
||||
N_("Parse syslinux config in new context taking only menu entries"),
|
||||
N_("Execute syslinux config in new context taking only menu entries"),
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ enum
|
||||
static const struct grub_arg_option options[] =
|
||||
{
|
||||
{"skip-sig", 's', 0,
|
||||
N_("Skip signature-checking of the signature file."), 0, ARG_TYPE_NONE},
|
||||
N_("Skip signature-checking of the public key file."), 0, ARG_TYPE_NONE},
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@@ -966,14 +966,14 @@ GRUB_MOD_INIT(verify)
|
||||
options);
|
||||
cmd_trust = grub_register_extcmd ("trust", grub_cmd_trust, 0,
|
||||
N_("[-s|--skip-sig] PUBKEY_FILE"),
|
||||
N_("Add PKFILE to trusted keys."),
|
||||
N_("Add PUBKEY_FILE to trusted keys."),
|
||||
options);
|
||||
cmd_list = grub_register_command ("list_trusted", grub_cmd_list,
|
||||
0,
|
||||
N_("List trusted keys."));
|
||||
N_("Show the list of trusted keys."));
|
||||
cmd_distrust = grub_register_command ("distrust", grub_cmd_distrust,
|
||||
N_("PUBKEY_ID"),
|
||||
N_("Remove KEYID from trusted keys."));
|
||||
N_("Remove PUBKEY_ID from trusted keys."));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(verify)
|
||||
|
||||
@@ -78,9 +78,9 @@ static grub_command_t cmd_ls, cmd_cat;
|
||||
GRUB_MOD_INIT (lsxen)
|
||||
{
|
||||
cmd_ls = grub_register_command ("xen_ls", grub_cmd_lsxen, N_("[DIR]"),
|
||||
N_("List XEN storage."));
|
||||
N_("List Xen storage."));
|
||||
cmd_cat = grub_register_command ("xen_cat", grub_cmd_catxen, N_("[DIR]"),
|
||||
N_("List XEN storage."));
|
||||
N_("List Xen storage."));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI (lsxen)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -65,7 +65,7 @@ grub_lvm_checkvalue (char **p, char *str, char *tmpl)
|
||||
static int
|
||||
grub_lvm_check_flag (char *p, const char *str, const char *flag)
|
||||
{
|
||||
int len_str = grub_strlen (str), len_flag = grub_strlen (flag);
|
||||
grub_size_t len_str = grub_strlen (str), len_flag = grub_strlen (flag);
|
||||
while (1)
|
||||
{
|
||||
char *q;
|
||||
@@ -111,7 +111,8 @@ grub_lvm_detect (grub_disk_t disk,
|
||||
struct grub_lvm_disk_locn *dlocn;
|
||||
struct grub_lvm_mda_header *mdah;
|
||||
struct grub_lvm_raw_locn *rlocn;
|
||||
unsigned int i, j, vgname_len;
|
||||
unsigned int i, j;
|
||||
grub_size_t vgname_len;
|
||||
struct grub_diskfilter_vg *vg;
|
||||
struct grub_diskfilter_pv *pv;
|
||||
|
||||
@@ -273,7 +274,7 @@ grub_lvm_detect (grub_disk_t disk,
|
||||
/* Add all the pvs to the volume group. */
|
||||
while (1)
|
||||
{
|
||||
int s;
|
||||
grub_ssize_t s;
|
||||
while (grub_isspace (*p))
|
||||
p++;
|
||||
|
||||
@@ -340,7 +341,7 @@ grub_lvm_detect (grub_disk_t disk,
|
||||
/* And add all the lvs to the volume group. */
|
||||
while (1)
|
||||
{
|
||||
int s;
|
||||
grub_ssize_t s;
|
||||
int skip_lv = 0;
|
||||
struct grub_diskfilter_lv *lv;
|
||||
struct grub_diskfilter_segment *seg;
|
||||
|
||||
@@ -34,9 +34,9 @@ static unsigned powx_inv[256];
|
||||
static const grub_uint8_t poly = 0x1d;
|
||||
|
||||
static void
|
||||
grub_raid_block_mulx (unsigned mul, char *buf, int size)
|
||||
grub_raid_block_mulx (unsigned mul, char *buf, grub_size_t size)
|
||||
{
|
||||
int i;
|
||||
grub_size_t i;
|
||||
grub_uint8_t *p;
|
||||
|
||||
p = (grub_uint8_t *) buf;
|
||||
|
||||
@@ -154,6 +154,8 @@ label_get_minimal_size (void *vself, unsigned *width, unsigned *height)
|
||||
+ grub_font_get_descent (self->font));
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
|
||||
static void
|
||||
label_set_state (void *vself, int visible, int start __attribute__ ((unused)),
|
||||
int current, int end __attribute__ ((unused)))
|
||||
@@ -235,6 +237,8 @@ label_set_property (void *vself, const char *name, const char *value)
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic error "-Wformat-nonliteral"
|
||||
|
||||
static struct grub_gui_component_ops label_ops =
|
||||
{
|
||||
.destroy = label_destroy,
|
||||
|
||||
@@ -183,6 +183,8 @@ draw_pixmap_bar (grub_gui_progress_bar_t self)
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
|
||||
static void
|
||||
draw_text (grub_gui_progress_bar_t self)
|
||||
{
|
||||
@@ -212,6 +214,8 @@ draw_text (grub_gui_progress_bar_t self)
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic error "-Wformat-nonliteral"
|
||||
|
||||
static void
|
||||
progress_bar_paint (void *vself, const grub_video_rect_t *region)
|
||||
{
|
||||
|
||||
+12
-32
@@ -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
|
||||
|
||||
+152
-9
@@ -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:
|
||||
|
||||
@@ -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
|
||||
@@ -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;
|
||||
}
|
||||
@@ -342,9 +342,9 @@ grub_disk_read_small_real (grub_disk_t disk, grub_disk_addr_t sector,
|
||||
{
|
||||
grub_err_t err;
|
||||
err = (disk->dev->read) (disk, transform_sector (disk, sector),
|
||||
1 << (GRUB_DISK_CACHE_BITS
|
||||
+ GRUB_DISK_SECTOR_BITS
|
||||
- disk->log_sector_size), tmp_buf);
|
||||
1U << (GRUB_DISK_CACHE_BITS
|
||||
+ GRUB_DISK_SECTOR_BITS
|
||||
- disk->log_sector_size), tmp_buf);
|
||||
if (!err)
|
||||
{
|
||||
/* Copy it and store it in the disk cache. */
|
||||
@@ -366,11 +366,11 @@ grub_disk_read_small_real (grub_disk_t disk, grub_disk_addr_t sector,
|
||||
|
||||
sector += (offset >> GRUB_DISK_SECTOR_BITS);
|
||||
offset &= ((1 << GRUB_DISK_SECTOR_BITS) - 1);
|
||||
aligned_sector = (sector & ~((1 << (disk->log_sector_size
|
||||
- GRUB_DISK_SECTOR_BITS))
|
||||
aligned_sector = (sector & ~((1ULL << (disk->log_sector_size
|
||||
- GRUB_DISK_SECTOR_BITS))
|
||||
- 1));
|
||||
offset += ((sector - aligned_sector) << GRUB_DISK_SECTOR_BITS);
|
||||
num = ((size + offset + (1 << (disk->log_sector_size))
|
||||
num = ((size + offset + (1ULL << (disk->log_sector_size))
|
||||
- 1) >> (disk->log_sector_size));
|
||||
|
||||
tmp_buf = grub_malloc (num << disk->log_sector_size);
|
||||
@@ -431,7 +431,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
|
||||
grub_err_t err;
|
||||
grub_size_t len;
|
||||
|
||||
start_sector = sector & ~(GRUB_DISK_CACHE_SIZE - 1);
|
||||
start_sector = sector & ~((grub_disk_addr_t) GRUB_DISK_CACHE_SIZE - 1);
|
||||
pos = (sector - start_sector) << GRUB_DISK_SECTOR_BITS;
|
||||
len = ((GRUB_DISK_SECTOR_SIZE << GRUB_DISK_CACHE_BITS)
|
||||
- pos - offset);
|
||||
|
||||
+7
-3
@@ -223,7 +223,7 @@ static grub_err_t
|
||||
grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e)
|
||||
{
|
||||
unsigned i;
|
||||
Elf_Shdr *s;
|
||||
const Elf_Shdr *s;
|
||||
grub_size_t tsize = 0, talign = 1;
|
||||
#if !defined (__i386__) && !defined (__x86_64__)
|
||||
grub_size_t tramp;
|
||||
@@ -232,9 +232,9 @@ grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e)
|
||||
#endif
|
||||
char *ptr;
|
||||
|
||||
for (i = 0, s = (Elf_Shdr *)((char *) e + e->e_shoff);
|
||||
for (i = 0, s = (const Elf_Shdr *)((const char *) e + e->e_shoff);
|
||||
i < e->e_shnum;
|
||||
i++, s = (Elf_Shdr *)((char *) s + e->e_shentsize))
|
||||
i++, s = (const Elf_Shdr *)((const char *) s + e->e_shentsize))
|
||||
{
|
||||
tsize = ALIGN_UP (tsize, s->sh_addralign) + s->sh_size;
|
||||
if (talign < s->sh_addralign)
|
||||
@@ -657,6 +657,8 @@ grub_dl_load_core (void *addr, grub_size_t size)
|
||||
{
|
||||
grub_dl_t mod;
|
||||
|
||||
grub_boot_time ("Parsing module");
|
||||
|
||||
mod = grub_dl_load_core_noinit (addr, size);
|
||||
|
||||
if (!mod)
|
||||
@@ -678,6 +680,8 @@ grub_dl_load_file (const char *filename)
|
||||
void *core = 0;
|
||||
grub_dl_t mod = 0;
|
||||
|
||||
grub_boot_time ("Loading module %s", filename);
|
||||
|
||||
file = grub_file_open (filename);
|
||||
if (! file)
|
||||
return 0;
|
||||
|
||||
+177
-178
@@ -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)
|
||||
@@ -419,53 +447,40 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp)
|
||||
{
|
||||
case GRUB_EFI_PCI_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_pci_device_path_t pci;
|
||||
grub_memcpy (&pci, dp, len);
|
||||
grub_efi_pci_device_path_t *pci
|
||||
= (grub_efi_pci_device_path_t *) dp;
|
||||
grub_printf ("/PCI(%x,%x)",
|
||||
(unsigned) pci.function, (unsigned) pci.device);
|
||||
(unsigned) pci->function, (unsigned) pci->device);
|
||||
}
|
||||
break;
|
||||
case GRUB_EFI_PCCARD_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_pccard_device_path_t pccard;
|
||||
grub_memcpy (&pccard, dp, len);
|
||||
grub_efi_pccard_device_path_t *pccard
|
||||
= (grub_efi_pccard_device_path_t *) dp;
|
||||
grub_printf ("/PCCARD(%x)",
|
||||
(unsigned) pccard.function);
|
||||
(unsigned) pccard->function);
|
||||
}
|
||||
break;
|
||||
case GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_memory_mapped_device_path_t mmapped;
|
||||
grub_memcpy (&mmapped, dp, len);
|
||||
grub_efi_memory_mapped_device_path_t *mmapped
|
||||
= (grub_efi_memory_mapped_device_path_t *) dp;
|
||||
grub_printf ("/MMap(%x,%llx,%llx)",
|
||||
(unsigned) mmapped.memory_type,
|
||||
(unsigned long long) mmapped.start_address,
|
||||
(unsigned long long) mmapped.end_address);
|
||||
(unsigned) mmapped->memory_type,
|
||||
(unsigned long long) mmapped->start_address,
|
||||
(unsigned long long) mmapped->end_address);
|
||||
}
|
||||
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:
|
||||
{
|
||||
grub_efi_controller_device_path_t controller;
|
||||
grub_memcpy (&controller, dp, len);
|
||||
grub_efi_controller_device_path_t *controller
|
||||
= (grub_efi_controller_device_path_t *) dp;
|
||||
grub_printf ("/Ctrl(%x)",
|
||||
(unsigned) controller.controller_number);
|
||||
(unsigned) controller->controller_number);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -479,31 +494,31 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp)
|
||||
{
|
||||
case GRUB_EFI_ACPI_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_acpi_device_path_t acpi;
|
||||
grub_memcpy (&acpi, dp, len);
|
||||
grub_efi_acpi_device_path_t *acpi
|
||||
= (grub_efi_acpi_device_path_t *) dp;
|
||||
grub_printf ("/ACPI(%x,%x)",
|
||||
(unsigned) acpi.hid,
|
||||
(unsigned) acpi.uid);
|
||||
(unsigned) acpi->hid,
|
||||
(unsigned) acpi->uid);
|
||||
}
|
||||
break;
|
||||
case GRUB_EFI_EXPANDED_ACPI_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_expanded_acpi_device_path_t eacpi;
|
||||
grub_memcpy (&eacpi, dp, sizeof (eacpi));
|
||||
grub_efi_expanded_acpi_device_path_t *eacpi
|
||||
= (grub_efi_expanded_acpi_device_path_t *) dp;
|
||||
grub_printf ("/ACPI(");
|
||||
|
||||
if (GRUB_EFI_EXPANDED_ACPI_HIDSTR (dp)[0] == '\0')
|
||||
grub_printf ("%x,", (unsigned) eacpi.hid);
|
||||
grub_printf ("%x,", (unsigned) eacpi->hid);
|
||||
else
|
||||
grub_printf ("%s,", GRUB_EFI_EXPANDED_ACPI_HIDSTR (dp));
|
||||
|
||||
if (GRUB_EFI_EXPANDED_ACPI_UIDSTR (dp)[0] == '\0')
|
||||
grub_printf ("%x,", (unsigned) eacpi.uid);
|
||||
grub_printf ("%x,", (unsigned) eacpi->uid);
|
||||
else
|
||||
grub_printf ("%s,", GRUB_EFI_EXPANDED_ACPI_UIDSTR (dp));
|
||||
|
||||
if (GRUB_EFI_EXPANDED_ACPI_CIDSTR (dp)[0] == '\0')
|
||||
grub_printf ("%x)", (unsigned) eacpi.cid);
|
||||
grub_printf ("%x)", (unsigned) eacpi->cid);
|
||||
else
|
||||
grub_printf ("%s)", GRUB_EFI_EXPANDED_ACPI_CIDSTR (dp));
|
||||
}
|
||||
@@ -519,167 +534,165 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp)
|
||||
{
|
||||
case GRUB_EFI_ATAPI_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_atapi_device_path_t atapi;
|
||||
grub_memcpy (&atapi, dp, len);
|
||||
grub_efi_atapi_device_path_t *atapi
|
||||
= (grub_efi_atapi_device_path_t *) dp;
|
||||
grub_printf ("/ATAPI(%x,%x,%x)",
|
||||
(unsigned) atapi.primary_secondary,
|
||||
(unsigned) atapi.slave_master,
|
||||
(unsigned) atapi.lun);
|
||||
(unsigned) atapi->primary_secondary,
|
||||
(unsigned) atapi->slave_master,
|
||||
(unsigned) atapi->lun);
|
||||
}
|
||||
break;
|
||||
case GRUB_EFI_SCSI_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_scsi_device_path_t scsi;
|
||||
grub_memcpy (&scsi, dp, len);
|
||||
grub_efi_scsi_device_path_t *scsi
|
||||
= (grub_efi_scsi_device_path_t *) dp;
|
||||
grub_printf ("/SCSI(%x,%x)",
|
||||
(unsigned) scsi.pun,
|
||||
(unsigned) scsi.lun);
|
||||
(unsigned) scsi->pun,
|
||||
(unsigned) scsi->lun);
|
||||
}
|
||||
break;
|
||||
case GRUB_EFI_FIBRE_CHANNEL_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_fibre_channel_device_path_t fc;
|
||||
grub_memcpy (&fc, dp, len);
|
||||
grub_efi_fibre_channel_device_path_t *fc
|
||||
= (grub_efi_fibre_channel_device_path_t *) dp;
|
||||
grub_printf ("/FibreChannel(%llx,%llx)",
|
||||
(unsigned long long) fc.wwn,
|
||||
(unsigned long long) fc.lun);
|
||||
(unsigned long long) fc->wwn,
|
||||
(unsigned long long) fc->lun);
|
||||
}
|
||||
break;
|
||||
case GRUB_EFI_1394_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_1394_device_path_t firewire;
|
||||
grub_memcpy (&firewire, dp, len);
|
||||
grub_printf ("/1394(%llx)", (unsigned long long) firewire.guid);
|
||||
grub_efi_1394_device_path_t *firewire
|
||||
= (grub_efi_1394_device_path_t *) dp;
|
||||
grub_printf ("/1394(%llx)",
|
||||
(unsigned long long) firewire->guid);
|
||||
}
|
||||
break;
|
||||
case GRUB_EFI_USB_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_usb_device_path_t usb;
|
||||
grub_memcpy (&usb, dp, len);
|
||||
grub_efi_usb_device_path_t *usb
|
||||
= (grub_efi_usb_device_path_t *) dp;
|
||||
grub_printf ("/USB(%x,%x)",
|
||||
(unsigned) usb.parent_port_number,
|
||||
(unsigned) usb.usb_interface);
|
||||
(unsigned) usb->parent_port_number,
|
||||
(unsigned) usb->usb_interface);
|
||||
}
|
||||
break;
|
||||
case GRUB_EFI_USB_CLASS_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_usb_class_device_path_t usb_class;
|
||||
grub_memcpy (&usb_class, dp, len);
|
||||
grub_efi_usb_class_device_path_t *usb_class
|
||||
= (grub_efi_usb_class_device_path_t *) dp;
|
||||
grub_printf ("/USBClass(%x,%x,%x,%x,%x)",
|
||||
(unsigned) usb_class.vendor_id,
|
||||
(unsigned) usb_class.product_id,
|
||||
(unsigned) usb_class.device_class,
|
||||
(unsigned) usb_class.device_subclass,
|
||||
(unsigned) usb_class.device_protocol);
|
||||
(unsigned) usb_class->vendor_id,
|
||||
(unsigned) usb_class->product_id,
|
||||
(unsigned) usb_class->device_class,
|
||||
(unsigned) usb_class->device_subclass,
|
||||
(unsigned) usb_class->device_protocol);
|
||||
}
|
||||
break;
|
||||
case GRUB_EFI_I2O_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_i2o_device_path_t i2o;
|
||||
grub_memcpy (&i2o, dp, len);
|
||||
grub_printf ("/I2O(%x)", (unsigned) i2o.tid);
|
||||
grub_efi_i2o_device_path_t *i2o
|
||||
= (grub_efi_i2o_device_path_t *) dp;
|
||||
grub_printf ("/I2O(%x)", (unsigned) i2o->tid);
|
||||
}
|
||||
break;
|
||||
case GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_mac_address_device_path_t mac;
|
||||
grub_memcpy (&mac, dp, len);
|
||||
grub_efi_mac_address_device_path_t *mac
|
||||
= (grub_efi_mac_address_device_path_t *) dp;
|
||||
grub_printf ("/MacAddr(%02x:%02x:%02x:%02x:%02x:%02x,%x)",
|
||||
(unsigned) mac.mac_address[0],
|
||||
(unsigned) mac.mac_address[1],
|
||||
(unsigned) mac.mac_address[2],
|
||||
(unsigned) mac.mac_address[3],
|
||||
(unsigned) mac.mac_address[4],
|
||||
(unsigned) mac.mac_address[5],
|
||||
(unsigned) mac.if_type);
|
||||
(unsigned) mac->mac_address[0],
|
||||
(unsigned) mac->mac_address[1],
|
||||
(unsigned) mac->mac_address[2],
|
||||
(unsigned) mac->mac_address[3],
|
||||
(unsigned) mac->mac_address[4],
|
||||
(unsigned) mac->mac_address[5],
|
||||
(unsigned) mac->if_type);
|
||||
}
|
||||
break;
|
||||
case GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_ipv4_device_path_t ipv4;
|
||||
grub_memcpy (&ipv4, dp, len);
|
||||
grub_efi_ipv4_device_path_t *ipv4
|
||||
= (grub_efi_ipv4_device_path_t *) dp;
|
||||
grub_printf ("/IPv4(%u.%u.%u.%u,%u.%u.%u.%u,%u,%u,%x,%x)",
|
||||
(unsigned) ipv4.local_ip_address[0],
|
||||
(unsigned) ipv4.local_ip_address[1],
|
||||
(unsigned) ipv4.local_ip_address[2],
|
||||
(unsigned) ipv4.local_ip_address[3],
|
||||
(unsigned) ipv4.remote_ip_address[0],
|
||||
(unsigned) ipv4.remote_ip_address[1],
|
||||
(unsigned) ipv4.remote_ip_address[2],
|
||||
(unsigned) ipv4.remote_ip_address[3],
|
||||
(unsigned) ipv4.local_port,
|
||||
(unsigned) ipv4.remote_port,
|
||||
(unsigned) ipv4.protocol,
|
||||
(unsigned) ipv4.static_ip_address);
|
||||
(unsigned) ipv4->local_ip_address[0],
|
||||
(unsigned) ipv4->local_ip_address[1],
|
||||
(unsigned) ipv4->local_ip_address[2],
|
||||
(unsigned) ipv4->local_ip_address[3],
|
||||
(unsigned) ipv4->remote_ip_address[0],
|
||||
(unsigned) ipv4->remote_ip_address[1],
|
||||
(unsigned) ipv4->remote_ip_address[2],
|
||||
(unsigned) ipv4->remote_ip_address[3],
|
||||
(unsigned) ipv4->local_port,
|
||||
(unsigned) ipv4->remote_port,
|
||||
(unsigned) ipv4->protocol,
|
||||
(unsigned) ipv4->static_ip_address);
|
||||
}
|
||||
break;
|
||||
case GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_ipv6_device_path_t ipv6;
|
||||
grub_memcpy (&ipv6, dp, len);
|
||||
grub_efi_ipv6_device_path_t *ipv6
|
||||
= (grub_efi_ipv6_device_path_t *) dp;
|
||||
grub_printf ("/IPv6(%x:%x:%x:%x:%x:%x:%x:%x,%x:%x:%x:%x:%x:%x:%x:%x,%u,%u,%x,%x)",
|
||||
(unsigned) ipv6.local_ip_address[0],
|
||||
(unsigned) ipv6.local_ip_address[1],
|
||||
(unsigned) ipv6.local_ip_address[2],
|
||||
(unsigned) ipv6.local_ip_address[3],
|
||||
(unsigned) ipv6.local_ip_address[4],
|
||||
(unsigned) ipv6.local_ip_address[5],
|
||||
(unsigned) ipv6.local_ip_address[6],
|
||||
(unsigned) ipv6.local_ip_address[7],
|
||||
(unsigned) ipv6.remote_ip_address[0],
|
||||
(unsigned) ipv6.remote_ip_address[1],
|
||||
(unsigned) ipv6.remote_ip_address[2],
|
||||
(unsigned) ipv6.remote_ip_address[3],
|
||||
(unsigned) ipv6.remote_ip_address[4],
|
||||
(unsigned) ipv6.remote_ip_address[5],
|
||||
(unsigned) ipv6.remote_ip_address[6],
|
||||
(unsigned) ipv6.remote_ip_address[7],
|
||||
(unsigned) ipv6.local_port,
|
||||
(unsigned) ipv6.remote_port,
|
||||
(unsigned) ipv6.protocol,
|
||||
(unsigned) ipv6.static_ip_address);
|
||||
(unsigned) ipv6->local_ip_address[0],
|
||||
(unsigned) ipv6->local_ip_address[1],
|
||||
(unsigned) ipv6->local_ip_address[2],
|
||||
(unsigned) ipv6->local_ip_address[3],
|
||||
(unsigned) ipv6->local_ip_address[4],
|
||||
(unsigned) ipv6->local_ip_address[5],
|
||||
(unsigned) ipv6->local_ip_address[6],
|
||||
(unsigned) ipv6->local_ip_address[7],
|
||||
(unsigned) ipv6->remote_ip_address[0],
|
||||
(unsigned) ipv6->remote_ip_address[1],
|
||||
(unsigned) ipv6->remote_ip_address[2],
|
||||
(unsigned) ipv6->remote_ip_address[3],
|
||||
(unsigned) ipv6->remote_ip_address[4],
|
||||
(unsigned) ipv6->remote_ip_address[5],
|
||||
(unsigned) ipv6->remote_ip_address[6],
|
||||
(unsigned) ipv6->remote_ip_address[7],
|
||||
(unsigned) ipv6->local_port,
|
||||
(unsigned) ipv6->remote_port,
|
||||
(unsigned) ipv6->protocol,
|
||||
(unsigned) ipv6->static_ip_address);
|
||||
}
|
||||
break;
|
||||
case GRUB_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_infiniband_device_path_t ib;
|
||||
grub_memcpy (&ib, dp, len);
|
||||
grub_efi_infiniband_device_path_t *ib
|
||||
= (grub_efi_infiniband_device_path_t *) dp;
|
||||
grub_printf ("/InfiniBand(%x,%llx,%llx,%llx)",
|
||||
(unsigned) ib.port_gid[0], /* XXX */
|
||||
(unsigned long long) ib.remote_id,
|
||||
(unsigned long long) ib.target_port_id,
|
||||
(unsigned long long) ib.device_id);
|
||||
(unsigned) ib->port_gid[0], /* XXX */
|
||||
(unsigned long long) ib->remote_id,
|
||||
(unsigned long long) ib->target_port_id,
|
||||
(unsigned long long) ib->device_id);
|
||||
}
|
||||
break;
|
||||
case GRUB_EFI_UART_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_uart_device_path_t uart;
|
||||
grub_memcpy (&uart, dp, len);
|
||||
grub_efi_uart_device_path_t *uart
|
||||
= (grub_efi_uart_device_path_t *) dp;
|
||||
grub_printf ("/UART(%llu,%u,%x,%x)",
|
||||
(unsigned long long) uart.baud_rate,
|
||||
uart.data_bits,
|
||||
uart.parity,
|
||||
uart.stop_bits);
|
||||
(unsigned long long) uart->baud_rate,
|
||||
uart->data_bits,
|
||||
uart->parity,
|
||||
uart->stop_bits);
|
||||
}
|
||||
break;
|
||||
case GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE:
|
||||
case GRUB_EFI_SATA_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]);
|
||||
grub_efi_sata_device_path_t *sata;
|
||||
sata = (grub_efi_sata_device_path_t *) dp;
|
||||
grub_printf ("/Sata(%x,%x,%x)",
|
||||
sata->hba_port,
|
||||
sata->multiplier_port,
|
||||
sata->lun);
|
||||
}
|
||||
break;
|
||||
|
||||
case GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE:
|
||||
dump_vendor_path ("Messaging",
|
||||
(grub_efi_vendor_device_path_t *) dp);
|
||||
break;
|
||||
default:
|
||||
grub_printf ("/UnknownMessaging(%x)", (unsigned) subtype);
|
||||
break;
|
||||
@@ -710,31 +723,17 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp)
|
||||
break;
|
||||
case GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_cdrom_device_path_t cd;
|
||||
grub_memcpy (&cd, dp, len);
|
||||
grub_efi_cdrom_device_path_t *cd
|
||||
= (grub_efi_cdrom_device_path_t *) dp;
|
||||
grub_printf ("/CD(%u,%llx,%llx)",
|
||||
cd.boot_entry,
|
||||
(unsigned long long) cd.partition_start,
|
||||
(unsigned long long) cd.partition_size);
|
||||
cd->boot_entry,
|
||||
(unsigned long long) cd->partition_start,
|
||||
(unsigned long long) cd->partition_size);
|
||||
}
|
||||
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:
|
||||
{
|
||||
@@ -754,20 +753,20 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp)
|
||||
break;
|
||||
case GRUB_EFI_PROTOCOL_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_protocol_device_path_t proto;
|
||||
grub_memcpy (&proto, dp, sizeof (proto));
|
||||
grub_efi_protocol_device_path_t *proto
|
||||
= (grub_efi_protocol_device_path_t *) dp;
|
||||
grub_printf ("/Protocol(%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)",
|
||||
(unsigned) proto.guid.data1,
|
||||
(unsigned) proto.guid.data2,
|
||||
(unsigned) proto.guid.data3,
|
||||
(unsigned) proto.guid.data4[0],
|
||||
(unsigned) proto.guid.data4[1],
|
||||
(unsigned) proto.guid.data4[2],
|
||||
(unsigned) proto.guid.data4[3],
|
||||
(unsigned) proto.guid.data4[4],
|
||||
(unsigned) proto.guid.data4[5],
|
||||
(unsigned) proto.guid.data4[6],
|
||||
(unsigned) proto.guid.data4[7]);
|
||||
(unsigned) proto->guid.data1,
|
||||
(unsigned) proto->guid.data2,
|
||||
(unsigned) proto->guid.data3,
|
||||
(unsigned) proto->guid.data4[0],
|
||||
(unsigned) proto->guid.data4[1],
|
||||
(unsigned) proto->guid.data4[2],
|
||||
(unsigned) proto->guid.data4[3],
|
||||
(unsigned) proto->guid.data4[4],
|
||||
(unsigned) proto->guid.data4[5],
|
||||
(unsigned) proto->guid.data4[6],
|
||||
(unsigned) proto->guid.data4[7]);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -781,11 +780,11 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp)
|
||||
{
|
||||
case GRUB_EFI_BIOS_DEVICE_PATH_SUBTYPE:
|
||||
{
|
||||
grub_efi_bios_device_path_t bios;
|
||||
grub_memcpy (&bios, dp, sizeof (bios));
|
||||
grub_efi_bios_device_path_t *bios
|
||||
= (grub_efi_bios_device_path_t *) dp;
|
||||
grub_printf ("/BIOS(%x,%x,%s)",
|
||||
(unsigned) bios.device_type,
|
||||
(unsigned) bios.status_flags,
|
||||
(unsigned) bios->device_type,
|
||||
(unsigned) bios->status_flags,
|
||||
(char *) (dp + 1));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <config-util.h>
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic ignored "-Wmissing-declarations"
|
||||
|
||||
#define _GNU_SOURCE 1
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -98,6 +98,8 @@ static struct argp_option options[] = {
|
||||
{ 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
|
||||
static char *
|
||||
help_filter (int key, const char *text, void *input __attribute__ ((unused)))
|
||||
{
|
||||
@@ -112,6 +114,8 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused)))
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic error "-Wformat-nonliteral"
|
||||
|
||||
struct arguments
|
||||
{
|
||||
const char *dev_map;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#include <grub/uboot/disk.h>
|
||||
#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[];
|
||||
@@ -69,6 +71,19 @@ uboot_timer_ms (void)
|
||||
return (((grub_uint64_t) high) << 32) | cur;
|
||||
}
|
||||
|
||||
#ifdef __arm__
|
||||
static grub_uint64_t
|
||||
rpi_timer_ms (void)
|
||||
{
|
||||
static grub_uint32_t last = 0, high = 0;
|
||||
grub_uint32_t cur = *(volatile grub_uint32_t *) 0x20003004;
|
||||
if (cur < last)
|
||||
high++;
|
||||
last = cur;
|
||||
return grub_divmod64 ((((grub_uint64_t) high) << 32) | cur, 1000, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
grub_machine_init (void)
|
||||
{
|
||||
@@ -93,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);
|
||||
@@ -106,8 +126,17 @@ grub_machine_init (void)
|
||||
grub_uboot_probe_hardware ();
|
||||
|
||||
/* Initialise timer */
|
||||
timer_start = grub_uboot_get_timer (0);
|
||||
grub_install_get_time_ms (uboot_timer_ms);
|
||||
#ifdef __arm__
|
||||
if (grub_uboot_get_machine_type () == GRUB_ARM_MACHINE_TYPE_RASPBERRY_PI)
|
||||
{
|
||||
grub_install_get_time_ms (rpi_timer_ms);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
timer_start = grub_uboot_get_timer (0);
|
||||
grub_install_get_time_ms (uboot_timer_ms);
|
||||
}
|
||||
|
||||
/* Initialize */
|
||||
grub_ubootdisk_init ();
|
||||
|
||||
+11
-11
@@ -35,22 +35,22 @@ static const struct grub_arg_option help_options[] =
|
||||
};
|
||||
|
||||
/* Helper for find_short. */
|
||||
static struct grub_arg_option *
|
||||
static const struct grub_arg_option *
|
||||
fnd_short (const struct grub_arg_option *opt, char c)
|
||||
{
|
||||
while (opt->doc)
|
||||
{
|
||||
if (opt->shortarg == c)
|
||||
return (struct grub_arg_option *) opt;
|
||||
return opt;
|
||||
opt++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct grub_arg_option *
|
||||
static const struct grub_arg_option *
|
||||
find_short (const struct grub_arg_option *options, char c)
|
||||
{
|
||||
struct grub_arg_option *found = 0;
|
||||
const struct grub_arg_option *found = 0;
|
||||
|
||||
if (options)
|
||||
found = fnd_short (options, c);
|
||||
@@ -60,11 +60,11 @@ find_short (const struct grub_arg_option *options, char c)
|
||||
switch (c)
|
||||
{
|
||||
case 'h':
|
||||
found = (struct grub_arg_option *) help_options;
|
||||
found = help_options;
|
||||
break;
|
||||
|
||||
case 'u':
|
||||
found = (struct grub_arg_option *) (help_options + 1);
|
||||
found = (help_options + 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -76,23 +76,23 @@ find_short (const struct grub_arg_option *options, char c)
|
||||
}
|
||||
|
||||
/* Helper for find_long. */
|
||||
static struct grub_arg_option *
|
||||
static const struct grub_arg_option *
|
||||
fnd_long (const struct grub_arg_option *opt, const char *s, int len)
|
||||
{
|
||||
while (opt->doc)
|
||||
{
|
||||
if (opt->longarg && ! grub_strncmp (opt->longarg, s, len) &&
|
||||
opt->longarg[len] == '\0')
|
||||
return (struct grub_arg_option *) opt;
|
||||
return opt;
|
||||
opt++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct grub_arg_option *
|
||||
static const struct grub_arg_option *
|
||||
find_long (const struct grub_arg_option *options, const char *s, int len)
|
||||
{
|
||||
struct grub_arg_option *found = 0;
|
||||
const struct grub_arg_option *found = 0;
|
||||
|
||||
if (options)
|
||||
found = fnd_long (options, s, len);
|
||||
@@ -240,7 +240,7 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv,
|
||||
for (curarg = 0; curarg < argc; curarg++)
|
||||
{
|
||||
char *arg = argv[curarg];
|
||||
struct grub_arg_option *opt;
|
||||
const struct grub_arg_option *opt;
|
||||
char *option = 0;
|
||||
|
||||
/* No option is used. */
|
||||
|
||||
+13
-12
@@ -203,13 +203,13 @@ gcry_err_code_t
|
||||
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
|
||||
void *out, const void *in, grub_size_t size)
|
||||
{
|
||||
const grub_uint8_t *inptr;
|
||||
grub_uint8_t *outptr, *end;
|
||||
const grub_uint8_t *inptr, *end;
|
||||
grub_uint8_t *outptr;
|
||||
if (!cipher->cipher->decrypt)
|
||||
return GPG_ERR_NOT_SUPPORTED;
|
||||
if (size % cipher->cipher->blocksize != 0)
|
||||
return GPG_ERR_INV_ARG;
|
||||
end = (grub_uint8_t *) in + size;
|
||||
end = (const grub_uint8_t *) in + size;
|
||||
for (inptr = in, outptr = out; inptr < end;
|
||||
inptr += cipher->cipher->blocksize, outptr += cipher->cipher->blocksize)
|
||||
cipher->cipher->decrypt (cipher->ctx, outptr, inptr);
|
||||
@@ -220,13 +220,13 @@ gcry_err_code_t
|
||||
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
|
||||
void *out, const void *in, grub_size_t size)
|
||||
{
|
||||
const grub_uint8_t *inptr;
|
||||
grub_uint8_t *outptr, *end;
|
||||
const grub_uint8_t *inptr, *end;
|
||||
grub_uint8_t *outptr;
|
||||
if (!cipher->cipher->encrypt)
|
||||
return GPG_ERR_NOT_SUPPORTED;
|
||||
if (size % cipher->cipher->blocksize != 0)
|
||||
return GPG_ERR_INV_ARG;
|
||||
end = (grub_uint8_t *) in + size;
|
||||
end = (const grub_uint8_t *) in + size;
|
||||
for (inptr = in, outptr = out; inptr < end;
|
||||
inptr += cipher->cipher->blocksize, outptr += cipher->cipher->blocksize)
|
||||
cipher->cipher->encrypt (cipher->ctx, outptr, inptr);
|
||||
@@ -235,16 +235,17 @@ grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
|
||||
|
||||
gcry_err_code_t
|
||||
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
|
||||
void *out, void *in, grub_size_t size,
|
||||
void *out, const void *in, grub_size_t size,
|
||||
void *iv_in)
|
||||
{
|
||||
grub_uint8_t *inptr, *outptr, *end;
|
||||
grub_uint8_t *outptr;
|
||||
const grub_uint8_t *inptr, *end;
|
||||
void *iv;
|
||||
if (!cipher->cipher->decrypt)
|
||||
return GPG_ERR_NOT_SUPPORTED;
|
||||
if (size % cipher->cipher->blocksize != 0)
|
||||
return GPG_ERR_INV_ARG;
|
||||
end = (grub_uint8_t *) in + size;
|
||||
end = (const grub_uint8_t *) in + size;
|
||||
iv = iv_in;
|
||||
for (inptr = in, outptr = out; inptr < end;
|
||||
inptr += cipher->cipher->blocksize, outptr += cipher->cipher->blocksize)
|
||||
@@ -262,8 +263,8 @@ grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
|
||||
void *out, const void *in, grub_size_t size,
|
||||
void *iv)
|
||||
{
|
||||
const grub_uint8_t *inptr;
|
||||
grub_uint8_t *outptr, *end;
|
||||
const grub_uint8_t *inptr, *end;
|
||||
grub_uint8_t *outptr;
|
||||
grub_uint8_t ivt[GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE];
|
||||
if (!cipher->cipher->decrypt)
|
||||
return GPG_ERR_NOT_SUPPORTED;
|
||||
@@ -271,7 +272,7 @@ grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
|
||||
return GPG_ERR_INV_ARG;
|
||||
if (cipher->cipher->blocksize > GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE)
|
||||
return GPG_ERR_INV_ARG;
|
||||
end = (grub_uint8_t *) in + size;
|
||||
end = (const grub_uint8_t *) in + size;
|
||||
for (inptr = in, outptr = out; inptr < end;
|
||||
inptr += cipher->cipher->blocksize, outptr += cipher->cipher->blocksize)
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ grub_disk_cache_invalidate (unsigned long dev_id, unsigned long disk_id,
|
||||
unsigned cache_index;
|
||||
struct grub_disk_cache *cache;
|
||||
|
||||
sector &= ~(GRUB_DISK_CACHE_SIZE - 1);
|
||||
sector &= ~((grub_disk_addr_t) GRUB_DISK_CACHE_SIZE - 1);
|
||||
cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector);
|
||||
cache = grub_disk_cache_table + cache_index;
|
||||
|
||||
@@ -63,8 +63,8 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
|
||||
if (grub_disk_adjust_range (disk, §or, &offset, size) != GRUB_ERR_NONE)
|
||||
return -1;
|
||||
|
||||
aligned_sector = (sector & ~((1 << (disk->log_sector_size
|
||||
- GRUB_DISK_SECTOR_BITS)) - 1));
|
||||
aligned_sector = (sector & ~((1ULL << (disk->log_sector_size
|
||||
- GRUB_DISK_SECTOR_BITS)) - 1));
|
||||
real_offset = offset + ((sector - aligned_sector) << GRUB_DISK_SECTOR_BITS);
|
||||
sector = aligned_sector;
|
||||
|
||||
@@ -77,14 +77,14 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
|
||||
grub_size_t len;
|
||||
grub_partition_t part;
|
||||
|
||||
tmp_buf = grub_malloc (1 << disk->log_sector_size);
|
||||
tmp_buf = grub_malloc (1U << disk->log_sector_size);
|
||||
if (!tmp_buf)
|
||||
return grub_errno;
|
||||
|
||||
part = disk->partition;
|
||||
disk->partition = 0;
|
||||
if (grub_disk_read (disk, sector,
|
||||
0, (1 << disk->log_sector_size), tmp_buf)
|
||||
0, (1U << disk->log_sector_size), tmp_buf)
|
||||
!= GRUB_ERR_NONE)
|
||||
{
|
||||
disk->partition = part;
|
||||
@@ -93,7 +93,7 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
|
||||
}
|
||||
disk->partition = part;
|
||||
|
||||
len = (1 << disk->log_sector_size) - real_offset;
|
||||
len = (1U << disk->log_sector_size) - real_offset;
|
||||
if (len > size)
|
||||
len = size;
|
||||
|
||||
@@ -110,7 +110,7 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
|
||||
|
||||
grub_free (tmp_buf);
|
||||
|
||||
sector += (1 << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS));
|
||||
sector += (1U << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS));
|
||||
buf = (const char *) buf + len;
|
||||
size -= len;
|
||||
real_offset = 0;
|
||||
@@ -120,7 +120,7 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
|
||||
grub_size_t len;
|
||||
grub_size_t n;
|
||||
|
||||
len = size & ~((1 << disk->log_sector_size) - 1);
|
||||
len = size & ~((1ULL << disk->log_sector_size) - 1);
|
||||
n = size >> disk->log_sector_size;
|
||||
|
||||
if (n > (disk->max_agglomerate
|
||||
@@ -137,7 +137,7 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
|
||||
while (n--)
|
||||
{
|
||||
grub_disk_cache_invalidate (disk->dev->id, disk->id, sector);
|
||||
sector += (1 << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS));
|
||||
sector += (1U << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS));
|
||||
}
|
||||
|
||||
buf = (const char *) buf + len;
|
||||
|
||||
+39
-2
@@ -265,10 +265,9 @@ static grub_uint32_t *find_prop (void *fdt, unsigned int nodeoffset,
|
||||
the size allocated for the FDT; if this function is called before the other
|
||||
functions in this file and returns success, the other functions are
|
||||
guaranteed not to access memory locations outside the allocated memory. */
|
||||
int grub_fdt_check_header (void *fdt, unsigned int size)
|
||||
int grub_fdt_check_header_nosize (void *fdt)
|
||||
{
|
||||
if (((grub_addr_t) fdt & 0x7) || (grub_fdt_get_magic (fdt) != FDT_MAGIC)
|
||||
|| (grub_fdt_get_totalsize (fdt) > size)
|
||||
|| (grub_fdt_get_version (fdt) < FDT_SUPPORTED_VERSION)
|
||||
|| (grub_fdt_get_last_comp_version (fdt) > FDT_SUPPORTED_VERSION)
|
||||
|| (grub_fdt_get_off_dt_struct (fdt) & 0x00000003)
|
||||
@@ -284,6 +283,15 @@ int grub_fdt_check_header (void *fdt, unsigned int size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int grub_fdt_check_header (void *fdt, unsigned int size)
|
||||
{
|
||||
if (size < sizeof (grub_fdt_header_t)
|
||||
|| (grub_fdt_get_totalsize (fdt) > size)
|
||||
|| grub_fdt_check_header_nosize (fdt) == -1)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Find a direct sub-node of a given parent node. */
|
||||
int grub_fdt_find_subnode (const void *fdt, unsigned int parentoffset,
|
||||
const char *name)
|
||||
@@ -423,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;
|
||||
}
|
||||
@@ -24,6 +24,8 @@
|
||||
#include <grub/i386/pc/vesa_modes_table.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
|
||||
struct legacy_command
|
||||
{
|
||||
const char *name;
|
||||
|
||||
@@ -357,7 +357,7 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
|
||||
|
||||
for (j = KC-1; j >= 0; j--)
|
||||
{
|
||||
*((u32*)tk[j]) = *((u32*)k[j]);
|
||||
*((u32_a_t*)tk[j]) = *((u32_a_t*)k[j]);
|
||||
}
|
||||
r = 0;
|
||||
t = 0;
|
||||
@@ -366,7 +366,7 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
|
||||
{
|
||||
for (; (j < KC) && (t < 4); j++, t++)
|
||||
{
|
||||
*((u32*)W[r][t]) = *((u32*)tk[j]);
|
||||
*((u32_a_t*)W[r][t]) = *((u32_a_t*)tk[j]);
|
||||
}
|
||||
if (t == 4)
|
||||
{
|
||||
@@ -389,14 +389,14 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
|
||||
{
|
||||
for (j = 1; j < KC; j++)
|
||||
{
|
||||
*((u32*)tk[j]) ^= *((u32*)tk[j-1]);
|
||||
*((u32_a_t*)tk[j]) ^= *((u32_a_t*)tk[j-1]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (j = 1; j < KC/2; j++)
|
||||
{
|
||||
*((u32*)tk[j]) ^= *((u32*)tk[j-1]);
|
||||
*((u32_a_t*)tk[j]) ^= *((u32_a_t*)tk[j-1]);
|
||||
}
|
||||
tk[KC/2][0] ^= S[tk[KC/2 - 1][0]];
|
||||
tk[KC/2][1] ^= S[tk[KC/2 - 1][1]];
|
||||
@@ -404,7 +404,7 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
|
||||
tk[KC/2][3] ^= S[tk[KC/2 - 1][3]];
|
||||
for (j = KC/2 + 1; j < KC; j++)
|
||||
{
|
||||
*((u32*)tk[j]) ^= *((u32*)tk[j-1]);
|
||||
*((u32_a_t*)tk[j]) ^= *((u32_a_t*)tk[j-1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,7 +413,7 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
|
||||
{
|
||||
for (; (j < KC) && (t < 4); j++, t++)
|
||||
{
|
||||
*((u32*)W[r][t]) = *((u32*)tk[j]);
|
||||
*((u32_a_t*)W[r][t]) = *((u32_a_t*)tk[j]);
|
||||
}
|
||||
if (t == 4)
|
||||
{
|
||||
@@ -483,29 +483,29 @@ prepare_decryption( RIJNDAEL_context *ctx )
|
||||
|
||||
for (r=0; r < MAXROUNDS+1; r++ )
|
||||
{
|
||||
*((u32*)ctx->keyschdec[r][0]) = *((u32*)ctx->keyschenc[r][0]);
|
||||
*((u32*)ctx->keyschdec[r][1]) = *((u32*)ctx->keyschenc[r][1]);
|
||||
*((u32*)ctx->keyschdec[r][2]) = *((u32*)ctx->keyschenc[r][2]);
|
||||
*((u32*)ctx->keyschdec[r][3]) = *((u32*)ctx->keyschenc[r][3]);
|
||||
*((u32_a_t*)ctx->keyschdec[r][0]) = *((u32_a_t*)ctx->keyschenc[r][0]);
|
||||
*((u32_a_t*)ctx->keyschdec[r][1]) = *((u32_a_t*)ctx->keyschenc[r][1]);
|
||||
*((u32_a_t*)ctx->keyschdec[r][2]) = *((u32_a_t*)ctx->keyschenc[r][2]);
|
||||
*((u32_a_t*)ctx->keyschdec[r][3]) = *((u32_a_t*)ctx->keyschenc[r][3]);
|
||||
}
|
||||
#define W (ctx->keyschdec)
|
||||
for (r = 1; r < ctx->rounds; r++)
|
||||
{
|
||||
w = W[r][0];
|
||||
*((u32*)w) = *((u32*)U1[w[0]]) ^ *((u32*)U2[w[1]])
|
||||
^ *((u32*)U3[w[2]]) ^ *((u32*)U4[w[3]]);
|
||||
*((u32_a_t*)w) = *((u32_a_t*)U1[w[0]]) ^ *((u32_a_t*)U2[w[1]])
|
||||
^ *((u32_a_t*)U3[w[2]]) ^ *((u32_a_t*)U4[w[3]]);
|
||||
|
||||
w = W[r][1];
|
||||
*((u32*)w) = *((u32*)U1[w[0]]) ^ *((u32*)U2[w[1]])
|
||||
^ *((u32*)U3[w[2]]) ^ *((u32*)U4[w[3]]);
|
||||
*((u32_a_t*)w) = *((u32_a_t*)U1[w[0]]) ^ *((u32_a_t*)U2[w[1]])
|
||||
^ *((u32_a_t*)U3[w[2]]) ^ *((u32_a_t*)U4[w[3]]);
|
||||
|
||||
w = W[r][2];
|
||||
*((u32*)w) = *((u32*)U1[w[0]]) ^ *((u32*)U2[w[1]])
|
||||
^ *((u32*)U3[w[2]]) ^ *((u32*)U4[w[3]]);
|
||||
*((u32_a_t*)w) = *((u32_a_t*)U1[w[0]]) ^ *((u32_a_t*)U2[w[1]])
|
||||
^ *((u32_a_t*)U3[w[2]]) ^ *((u32_a_t*)U4[w[3]]);
|
||||
|
||||
w = W[r][3];
|
||||
*((u32*)w) = *((u32*)U1[w[0]]) ^ *((u32*)U2[w[1]])
|
||||
^ *((u32*)U3[w[2]]) ^ *((u32*)U4[w[3]]);
|
||||
*((u32_a_t*)w) = *((u32_a_t*)U1[w[0]]) ^ *((u32_a_t*)U2[w[1]])
|
||||
^ *((u32_a_t*)U3[w[2]]) ^ *((u32_a_t*)U4[w[3]]);
|
||||
}
|
||||
#undef W
|
||||
#undef w
|
||||
|
||||
+158
-27
@@ -44,15 +44,112 @@ static char *linux_args;
|
||||
static grub_uint32_t machine_type;
|
||||
static void *fdt_addr;
|
||||
|
||||
typedef void (*kernel_entry_t) (int, unsigned long, void *);
|
||||
|
||||
#define LINUX_ZIMAGE_OFFSET 0x24
|
||||
#define LINUX_ZIMAGE_MAGIC 0x016f2818
|
||||
|
||||
#define ARM_FDT_MACHINE_TYPE 0xFFFFFFFF
|
||||
|
||||
#define LINUX_PHYS_OFFSET (0x00008000)
|
||||
#define LINUX_INITRD_PHYS_OFFSET (LINUX_PHYS_OFFSET + 0x02000000)
|
||||
#define LINUX_FDT_PHYS_OFFSET (LINUX_INITRD_PHYS_OFFSET - 0x10000)
|
||||
|
||||
static grub_size_t
|
||||
get_atag_size (grub_uint32_t *atag)
|
||||
{
|
||||
grub_uint32_t *atag0 = atag;
|
||||
while (atag[0] && atag[1])
|
||||
atag += atag[0];
|
||||
return atag - atag0;
|
||||
}
|
||||
|
||||
/*
|
||||
* linux_prepare_fdt():
|
||||
* Prepares a loaded FDT for being passed to Linux.
|
||||
* Merges in command line parameters and sets up initrd addresses.
|
||||
*/
|
||||
static grub_err_t
|
||||
linux_prepare_atag (void)
|
||||
{
|
||||
grub_uint32_t *atag_orig = (grub_uint32_t *) fdt_addr;
|
||||
grub_uint32_t *tmp_atag, *from, *to;
|
||||
grub_size_t tmp_size;
|
||||
grub_size_t arg_size = grub_strlen (linux_args);
|
||||
char *cmdline_orig = NULL;
|
||||
grub_size_t cmdline_orig_len = 0;
|
||||
|
||||
/* some place for cmdline, initrd and terminator. */
|
||||
tmp_size = get_atag_size (atag_orig) + 20 + (arg_size) / 4;
|
||||
tmp_atag = grub_malloc (tmp_size * sizeof (grub_uint32_t));
|
||||
if (!tmp_atag)
|
||||
return grub_errno;
|
||||
|
||||
for (from = atag_orig, to = tmp_atag; from[0] && from[1];
|
||||
from += from[0])
|
||||
switch (from[1])
|
||||
{
|
||||
case 0x54410004:
|
||||
case 0x54410005:
|
||||
case 0x54420005:
|
||||
break;
|
||||
case 0x54410009:
|
||||
if (*(char *) (from + 2))
|
||||
{
|
||||
cmdline_orig = (char *) (from + 2);
|
||||
cmdline_orig_len = grub_strlen (cmdline_orig) + 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
grub_memcpy (to, from, sizeof (grub_uint32_t) * from[0]);
|
||||
to += from[0];
|
||||
break;
|
||||
}
|
||||
|
||||
grub_dprintf ("linux", "linux inherited args: '%s'\n",
|
||||
cmdline_orig ? : "");
|
||||
grub_dprintf ("linux", "linux_args: '%s'\n", linux_args);
|
||||
|
||||
/* Generate and set command line */
|
||||
to[0] = 3 + (arg_size + cmdline_orig_len) / 4;
|
||||
to[1] = 0x54410009;
|
||||
if (cmdline_orig)
|
||||
{
|
||||
grub_memcpy ((char *) to + 8, cmdline_orig, cmdline_orig_len - 1);
|
||||
*((char *) to + 8 + cmdline_orig_len - 1) = ' ';
|
||||
}
|
||||
grub_memcpy ((char *) to + 8 + cmdline_orig_len, linux_args, arg_size);
|
||||
grub_memset ((char *) to + 8 + cmdline_orig_len + arg_size, 0,
|
||||
4 - ((arg_size + cmdline_orig_len) & 3));
|
||||
to += to[0];
|
||||
|
||||
if (initrd_start && initrd_end)
|
||||
{
|
||||
/*
|
||||
* We're using physical addresses, so even if we have LPAE, we're
|
||||
* restricted to a 32-bit address space.
|
||||
*/
|
||||
grub_dprintf ("loader", "Initrd @ 0x%08x-0x%08x\n",
|
||||
initrd_start, initrd_end);
|
||||
|
||||
to[0] = 4;
|
||||
to[1] = 0x54420005;
|
||||
to[2] = initrd_start;
|
||||
to[3] = initrd_end - initrd_start;
|
||||
to += 4;
|
||||
}
|
||||
|
||||
to[0] = 0;
|
||||
to[1] = 0;
|
||||
to += 2;
|
||||
|
||||
/* Copy updated FDT to its launch location */
|
||||
grub_memcpy (atag_orig, tmp_atag, sizeof (grub_uint32_t) * (to - tmp_atag));
|
||||
grub_free (tmp_atag);
|
||||
|
||||
grub_dprintf ("loader", "ATAG updated for Linux boot\n");
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
/*
|
||||
* linux_prepare_fdt():
|
||||
* Prepares a loaded FDT for being passed to Linux.
|
||||
@@ -128,20 +225,44 @@ static grub_err_t
|
||||
linux_boot (void)
|
||||
{
|
||||
kernel_entry_t linuxmain;
|
||||
grub_err_t err;
|
||||
int fdt_valid, atag_valid;
|
||||
|
||||
if (!fdt_addr && machine_type == ARM_FDT_MACHINE_TYPE)
|
||||
fdt_valid = (fdt_addr && grub_fdt_check_header_nosize (fdt_addr) == 0);
|
||||
atag_valid = ((((grub_uint16_t *) fdt_addr)[3] & ~3) == 0x5440
|
||||
&& *((grub_uint32_t *) fdt_addr));
|
||||
grub_dprintf ("loader", "atag: %p, %x, %x, %s, %s\n",
|
||||
fdt_addr,
|
||||
((grub_uint16_t *) fdt_addr)[3],
|
||||
*((grub_uint32_t *) fdt_addr),
|
||||
(char *) fdt_addr,
|
||||
(char *) fdt_addr + 1);
|
||||
|
||||
if (!fdt_valid && machine_type == GRUB_ARM_MACHINE_TYPE_FDT)
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND,
|
||||
N_("device tree must be supplied"));
|
||||
N_("device tree must be supplied (see `devicetree' command)"));
|
||||
|
||||
grub_arch_sync_caches ((void *) linux_addr, linux_size);
|
||||
|
||||
grub_dprintf ("loader", "Kernel at: 0x%x\n", linux_addr);
|
||||
|
||||
err = linux_prepare_fdt ();
|
||||
if (err)
|
||||
return err;
|
||||
grub_dprintf ("loader", "FDT @ 0x%p\n", fdt_addr);
|
||||
if (fdt_valid)
|
||||
{
|
||||
grub_err_t err;
|
||||
|
||||
err = linux_prepare_fdt ();
|
||||
if (err)
|
||||
return err;
|
||||
grub_dprintf ("loader", "FDT @ 0x%p\n", fdt_addr);
|
||||
}
|
||||
else if (atag_valid)
|
||||
{
|
||||
grub_err_t err;
|
||||
|
||||
err = linux_prepare_atag ();
|
||||
if (err)
|
||||
return err;
|
||||
grub_dprintf ("loader", "ATAG @ 0x%p\n", fdt_addr);
|
||||
}
|
||||
|
||||
grub_dprintf ("loader", "Jumping to Linux...\n");
|
||||
|
||||
@@ -154,14 +275,19 @@ linux_boot (void)
|
||||
linuxmain = (kernel_entry_t) linux_addr;
|
||||
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
err = grub_efi_prepare_platform();
|
||||
if (err != GRUB_ERR_NONE)
|
||||
return err;
|
||||
{
|
||||
grub_err_t err;
|
||||
err = grub_efi_prepare_platform();
|
||||
if (err != GRUB_ERR_NONE)
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
grub_arm_disable_caches_mmu ();
|
||||
|
||||
linuxmain (0, machine_type, fdt_addr);
|
||||
|
||||
return err;
|
||||
return grub_error (GRUB_ERR_BAD_OS, "Linux call returned");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -173,8 +299,6 @@ linux_load (const char *filename, grub_file_t file)
|
||||
int size;
|
||||
|
||||
size = grub_file_size (file);
|
||||
if (size == 0)
|
||||
return grub_error (GRUB_ERR_BAD_OS, "empty kernel");
|
||||
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
linux_addr = (grub_addr_t) grub_efi_allocate_loader_memory (LINUX_PHYS_OFFSET, size);
|
||||
@@ -194,11 +318,16 @@ linux_load (const char *filename, grub_file_t file)
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
if (*(grub_uint32_t *) (linux_addr + LINUX_ZIMAGE_OFFSET)
|
||||
!= LINUX_ZIMAGE_MAGIC)
|
||||
{
|
||||
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("invalid zImage"));
|
||||
}
|
||||
if (size > LINUX_ZIMAGE_OFFSET + 4
|
||||
&& *(grub_uint32_t *) (linux_addr + LINUX_ZIMAGE_OFFSET)
|
||||
== LINUX_ZIMAGE_MAGIC)
|
||||
;
|
||||
else if (size > 0x8000 && *(grub_uint32_t *) (linux_addr) == 0xea000006
|
||||
&& machine_type == GRUB_ARM_MACHINE_TYPE_RASPBERRY_PI)
|
||||
grub_memmove ((void *) linux_addr, (void *) (linux_addr + 0x8000),
|
||||
size - 0x8000);
|
||||
else
|
||||
return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("invalid zImage"));
|
||||
|
||||
linux_size = size;
|
||||
|
||||
@@ -281,14 +410,15 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
||||
|
||||
size = grub_get_initrd_size (&initrd_ctx);
|
||||
|
||||
if (initrd_start)
|
||||
grub_free ((void *) initrd_start);
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
if (initrd_start)
|
||||
grub_efi_free_pages (initrd_start,
|
||||
(initrd_end - initrd_start + 0xfff) >> 12);
|
||||
initrd_start = (grub_addr_t) grub_efi_allocate_loader_memory (LINUX_INITRD_PHYS_OFFSET, size);
|
||||
|
||||
if (!initrd_start)
|
||||
{
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("memory allocation failed"));
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
|
||||
goto fail;
|
||||
}
|
||||
#else
|
||||
@@ -347,7 +477,7 @@ grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)),
|
||||
fdt_addr = grub_efi_allocate_loader_memory (LINUX_FDT_PHYS_OFFSET, size);
|
||||
if (!fdt_addr)
|
||||
{
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("memory allocation failed"));
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
|
||||
goto out;
|
||||
}
|
||||
#else
|
||||
@@ -367,7 +497,7 @@ grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)),
|
||||
* We've successfully loaded an FDT, so any machine type passed
|
||||
* from firmware is now obsolete.
|
||||
*/
|
||||
machine_type = ARM_FDT_MACHINE_TYPE;
|
||||
machine_type = GRUB_ARM_MACHINE_TYPE_FDT;
|
||||
|
||||
out:
|
||||
grub_file_close (dtb);
|
||||
@@ -384,10 +514,11 @@ GRUB_MOD_INIT (linux)
|
||||
cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd,
|
||||
0, N_("Load initrd."));
|
||||
cmd_devicetree = grub_register_command ("devicetree", grub_cmd_devicetree,
|
||||
/* TRANSLATORS: DTB stands for device tree blob. */
|
||||
0, N_("Load DTB file."));
|
||||
my_mod = mod;
|
||||
fdt_addr = (void *) firmware_get_boot_data ();
|
||||
machine_type = firmware_get_machine_type ();
|
||||
fdt_addr = (void *) grub_arm_firmware_get_boot_data ();
|
||||
machine_type = grub_arm_firmware_get_machine_type ();
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI (linux)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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 = \
|
||||
{ \
|
||||
|
||||
@@ -1,4 +1,36 @@
|
||||
#!/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_i8086_addr32="@ADDR32@"
|
||||
grub_i8086_data32="@DATA32@"
|
||||
grub_bss_start_symbol="@BSS_START_SYMBOL@"
|
||||
grub_end_symbol="@END_SYMBOL@"
|
||||
|
||||
# Build environment
|
||||
grub_target_cc='@TARGET_CC@'
|
||||
grub_target_cc_version='@TARGET_CC_VERSION@'
|
||||
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@"
|
||||
@@ -415,7 +415,7 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)),
|
||||
else
|
||||
{
|
||||
char valn[64];
|
||||
grub_printf (valn, sizeof (valn), "%lld\n", (unsigned long long) val);
|
||||
grub_snprintf (valn, sizeof (valn), "%lld\n", (unsigned long long) val);
|
||||
return grub_env_set (args[0], valn);
|
||||
}
|
||||
return GRUB_ERR_NONE;
|
||||
|
||||
@@ -194,14 +194,13 @@ grub_normal_init_page (struct grub_term_output *term,
|
||||
{
|
||||
grub_ssize_t msg_len;
|
||||
int posx;
|
||||
const char *msg = _("GNU GRUB version %s");
|
||||
char *msg_formatted;
|
||||
grub_uint32_t *unicode_msg;
|
||||
grub_uint32_t *last_position;
|
||||
|
||||
grub_term_cls (term);
|
||||
|
||||
msg_formatted = grub_xasprintf (msg, PACKAGE_VERSION);
|
||||
msg_formatted = grub_xasprintf (_("GNU GRUB version %s"), PACKAGE_VERSION);
|
||||
if (!msg_formatted)
|
||||
return;
|
||||
|
||||
@@ -350,13 +349,13 @@ static grub_err_t
|
||||
grub_normal_reader_init (int nested)
|
||||
{
|
||||
struct grub_term_output *term;
|
||||
const char *msg = _("Minimal BASH-like line editing is supported. For "
|
||||
"the first word, TAB lists possible command completions. Anywhere "
|
||||
"else TAB lists possible device or file completions. %s");
|
||||
const char *msg_esc = _("ESC at any time exits.");
|
||||
char *msg_formatted;
|
||||
|
||||
msg_formatted = grub_xasprintf (msg, nested ? msg_esc : "");
|
||||
msg_formatted = grub_xasprintf (_("Minimal BASH-like line editing is supported. For "
|
||||
"the first word, TAB lists possible command completions. Anywhere "
|
||||
"else TAB lists possible device or file completions. %s"),
|
||||
nested ? msg_esc : "");
|
||||
if (!msg_formatted)
|
||||
return grub_errno;
|
||||
|
||||
|
||||
@@ -165,11 +165,11 @@ command-line or ESC to discard edits and return to the GRUB menu."),
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *msg = _("Use the %C and %C keys to select which "
|
||||
"entry is highlighted.");
|
||||
char *msg_translated;
|
||||
|
||||
msg_translated = grub_xasprintf (msg, GRUB_UNICODE_UPARROW,
|
||||
msg_translated = grub_xasprintf (_("Use the %C and %C keys to select which "
|
||||
"entry is highlighted."),
|
||||
GRUB_UNICODE_UPARROW,
|
||||
GRUB_UNICODE_DOWNARROW);
|
||||
if (!msg_translated)
|
||||
return 0;
|
||||
@@ -430,9 +430,6 @@ grub_menu_init_page (int nested, int edit,
|
||||
static void
|
||||
menu_text_print_timeout (int timeout, void *dataptr)
|
||||
{
|
||||
const char *msg =
|
||||
_("The highlighted entry will be executed automatically in %ds.");
|
||||
const char *msg_terse = _("%ds");
|
||||
struct menu_viewer_data *data = dataptr;
|
||||
char *msg_translated = 0;
|
||||
|
||||
@@ -441,9 +438,9 @@ menu_text_print_timeout (int timeout, void *dataptr)
|
||||
|
||||
if (data->timeout_msg == TIMEOUT_TERSE
|
||||
|| data->timeout_msg == TIMEOUT_TERSE_NO_MARGIN)
|
||||
msg_translated = grub_xasprintf (msg_terse, timeout);
|
||||
msg_translated = grub_xasprintf (_("%ds"), timeout);
|
||||
else
|
||||
msg_translated = grub_xasprintf (msg, timeout);
|
||||
msg_translated = grub_xasprintf (_("The highlighted entry will be executed automatically in %ds."), timeout);
|
||||
if (!msg_translated)
|
||||
{
|
||||
grub_print_error ();
|
||||
@@ -459,7 +456,7 @@ menu_text_print_timeout (int timeout, void *dataptr)
|
||||
if (data->timeout_msg == TIMEOUT_TERSE)
|
||||
{
|
||||
grub_free (msg_translated);
|
||||
msg_translated = grub_xasprintf (msg_terse, timeout);
|
||||
msg_translated = grub_xasprintf (_("%ds"), timeout);
|
||||
if (grub_term_width (data->term) < 10)
|
||||
data->timeout_msg = TIMEOUT_TERSE_NO_MARGIN;
|
||||
}
|
||||
|
||||
@@ -80,11 +80,11 @@ grub_util_fd_open (const char *os_dev, int flags)
|
||||
flags |= O_BINARY;
|
||||
#endif
|
||||
|
||||
ret = open (os_dev, flags, S_IRUSR | S_IWUSR);
|
||||
ret = open (os_dev, flags, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR);
|
||||
|
||||
/* If we can't have exclusive access, try shared access */
|
||||
if (ret < 0)
|
||||
ret = open (os_dev, flags | O_SHLOCK, S_IRUSR | S_IWUSR);
|
||||
ret = open (os_dev, flags | O_SHLOCK, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -89,6 +89,6 @@ grub_util_load_config (struct grub_util_config *cfg)
|
||||
fclose (f);
|
||||
}
|
||||
else
|
||||
grub_util_warn (_("cannot open config file `%s': %s"),
|
||||
grub_util_warn (_("cannot open configuration file `%s': %s"),
|
||||
cfgfile, strerror (errno));
|
||||
}
|
||||
@@ -180,7 +180,7 @@ grub_util_fd_open (const char *dev, int flg)
|
||||
if (dev[0] != '/' || dev[1] != '/' || dev[2] != ':')
|
||||
{
|
||||
ret->type = GRUB_UTIL_FD_FILE;
|
||||
ret->fd = open (dev, flg, S_IRUSR | S_IWUSR);
|
||||
ret->fd = open (dev, flg, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR);
|
||||
if (ret->fd < 0)
|
||||
{
|
||||
free (ret);
|
||||
|
||||
@@ -37,5 +37,7 @@ grub_get_random (void *out, grub_size_t len)
|
||||
Some functions like grub-mkpaswd and installing on UUID-less disks will be \
|
||||
disabled."
|
||||
grub_util_error ("%s",
|
||||
/* TRANSLATORS: The OS itself may very well have a random
|
||||
number generator but GRUB doesn't know how to access it. */
|
||||
_("no random number generator is available for your OS"));
|
||||
}
|
||||
@@ -90,7 +90,7 @@ grub_util_fd_open (const char *os_dev, int flags)
|
||||
flags |= O_BINARY;
|
||||
#endif
|
||||
|
||||
ret = open (os_dev, flags, S_IRUSR | S_IWUSR);
|
||||
ret = open (os_dev, flags, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR);
|
||||
if (ret >= 0)
|
||||
configure_device_driver (fd);
|
||||
return ret;
|
||||
|
||||
@@ -198,140 +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;
|
||||
}
|
||||
|
||||
int
|
||||
grub_util_device_is_mapped_stat (struct stat *st)
|
||||
{
|
||||
#if GRUB_DISK_DEVS_ARE_CHAR
|
||||
if (! S_ISCHR (st->st_mode))
|
||||
#else
|
||||
if (! S_ISBLK (st->st_mode))
|
||||
#endif
|
||||
return 0;
|
||||
|
||||
if (!grub_device_mapper_supported ())
|
||||
return 0;
|
||||
|
||||
return dm_is_dm_major (major (st->st_rdev));
|
||||
*is_part = 0;
|
||||
return xstrdup (path);
|
||||
}
|
||||
|
||||
char *
|
||||
@@ -418,12 +295,6 @@ grub_util_pull_devmapper (const char *os_dev __attribute__ ((unused)))
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
grub_util_device_is_mapped_stat (struct stat *st __attribute__ ((unused)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
grub_util_devmapper_cleanup (void)
|
||||
{
|
||||
|
||||
@@ -83,7 +83,24 @@ grub_util_device_is_mapped (const char *dev)
|
||||
}
|
||||
|
||||
int
|
||||
grub_util_get_dm_node_linear_info (const char *dev,
|
||||
grub_util_device_is_mapped_stat (struct stat *st)
|
||||
{
|
||||
#if GRUB_DISK_DEVS_ARE_CHAR
|
||||
if (! S_ISCHR (st->st_mode))
|
||||
#else
|
||||
if (! S_ISBLK (st->st_mode))
|
||||
#endif
|
||||
return 0;
|
||||
|
||||
if (!grub_device_mapper_supported ())
|
||||
return 0;
|
||||
|
||||
return dm_is_dm_major (major (st->st_rdev));
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
grub_util_get_dm_node_linear_info (dev_t dev,
|
||||
int *maj, int *min,
|
||||
grub_disk_addr_t *st)
|
||||
{
|
||||
@@ -97,14 +114,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 +136,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 +208,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)))
|
||||
@@ -198,4 +216,10 @@ grub_util_get_dm_node_linear_info (const char *dev __attribute__ ((unused)),
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
grub_util_device_is_mapped_stat (struct stat *st __attribute__ ((unused)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -106,7 +106,7 @@ grub_util_fd_open (const char *os_dev, int flags)
|
||||
return GRUB_UTIL_FD_INVALID;
|
||||
}
|
||||
|
||||
ret = open (os_dev, flags, S_IRUSR | S_IWUSR);
|
||||
ret = open (os_dev, flags, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR);
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
if (! (sysctl_oldflags & 0x10)
|
||||
|
||||
@@ -70,12 +70,12 @@ grub_util_hurd_get_disk_info (const char *dev, grub_uint32_t *secsize, grub_disk
|
||||
&data, &data_len);
|
||||
|
||||
if (num_ints < 1)
|
||||
grub_util_error (_("Storage info for `%s' does not include type"), dev);
|
||||
grub_util_error (_("Storage information for `%s' does not include type"), dev);
|
||||
if (ints[0] != STORAGE_DEVICE)
|
||||
grub_util_error (_("`%s' is not a local disk"), dev);
|
||||
|
||||
if (num_offsets != 2)
|
||||
grub_util_error (_("Storage info for `%s' does indicate neither plain partition nor plain disk"), dev);
|
||||
grub_util_error (_("Storage information for `%s' indicates neither a plain partition nor a plain disk"), dev);
|
||||
if (parent)
|
||||
{
|
||||
*parent = NULL;
|
||||
|
||||
@@ -888,7 +888,7 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st,
|
||||
return path;
|
||||
}
|
||||
|
||||
char *
|
||||
static char *
|
||||
grub_util_get_raid_grub_dev (const char *os_dev)
|
||||
{
|
||||
char *grub_dev = NULL;
|
||||
|
||||
@@ -237,6 +237,8 @@ have_devfs (void)
|
||||
return dev_devfsd_exists;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
|
||||
static int
|
||||
grub_hostdisk_linux_find_partition (char *dev, grub_disk_addr_t sector)
|
||||
{
|
||||
@@ -286,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);
|
||||
|
||||
@@ -298,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;
|
||||
@@ -325,6 +330,8 @@ grub_hostdisk_linux_find_partition (char *dev, grub_disk_addr_t sector)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic error "-Wformat-nonliteral"
|
||||
|
||||
void
|
||||
grub_hostdisk_flush_initial_buffer (const char *os_dev)
|
||||
{
|
||||
|
||||
@@ -134,6 +134,6 @@ grub_util_load_config (struct grub_util_config *cfg)
|
||||
fclose (f);
|
||||
}
|
||||
else
|
||||
grub_util_warn (_("cannot open config file `%s': %s"),
|
||||
grub_util_warn (_("cannot open configuration file `%s': %s"),
|
||||
cfgfile, strerror (errno));
|
||||
}
|
||||
@@ -116,6 +116,7 @@
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
|
||||
#if !defined (__GNU__)
|
||||
static void
|
||||
strip_extra_slashes (char *dir)
|
||||
{
|
||||
@@ -155,7 +156,6 @@ xgetcwd (void)
|
||||
return path;
|
||||
}
|
||||
|
||||
#if !defined (__GNU__)
|
||||
char **
|
||||
grub_util_find_root_devices_from_poolname (char *poolname)
|
||||
{
|
||||
@@ -443,17 +443,18 @@ grub_find_device (const char *dir, dev_t dev)
|
||||
/* Found! */
|
||||
char *res;
|
||||
char *cwd;
|
||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
/* Convert this block device to its character (raw) device. */
|
||||
const char *template = "%s/r%s";
|
||||
#else
|
||||
/* Keep the device name as it is. */
|
||||
const char *template = "%s/%s";
|
||||
#endif
|
||||
|
||||
cwd = xgetcwd ();
|
||||
res = xmalloc (strlen (cwd) + strlen (ent->d_name) + 3);
|
||||
sprintf (res, template, cwd, ent->d_name);
|
||||
sprintf (res,
|
||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
/* Convert this block device to its character (raw) device. */
|
||||
"%s/r%s",
|
||||
#else
|
||||
/* Keep the device name as it is. */
|
||||
"%s/%s",
|
||||
#endif
|
||||
cwd, ent->d_name);
|
||||
strip_extra_slashes (res);
|
||||
free (cwd);
|
||||
|
||||
@@ -763,6 +764,8 @@ grub_util_biosdisk_is_floppy (grub_disk_t disk)
|
||||
|
||||
#else
|
||||
|
||||
#include <grub/emu/getroot.h>
|
||||
|
||||
void
|
||||
grub_util_pull_lvm_by_command (const char *os_dev __attribute__ ((unused)))
|
||||
{
|
||||
|
||||
@@ -181,7 +181,7 @@ grub_util_fd_open (const char *os_dev, int flags)
|
||||
flags |= O_BINARY;
|
||||
#endif
|
||||
|
||||
return open (os_dev, flags, S_IRUSR | S_IWUSR);
|
||||
return open (os_dev, flags, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ get_ofpathname (const char *dev)
|
||||
return ret;
|
||||
|
||||
fail:
|
||||
grub_util_error (_("couldn't find IEEE1275 device tree path for %s.\nYou will have to set `boot-device' variable manually"),
|
||||
grub_util_error (_("couldn't find IEEE1275 device path for %s.\nYou will have to set `boot-device' variable manually"),
|
||||
dev);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,6 @@ grub_util_load_config (struct grub_util_config *cfg)
|
||||
fclose (f);
|
||||
}
|
||||
else
|
||||
grub_util_warn (_("cannot open config file `%s': %s"),
|
||||
grub_util_warn (_("cannot open configuration file `%s': %s"),
|
||||
cfgfile, strerror (errno));
|
||||
}
|
||||
@@ -94,7 +94,7 @@ get_platform (void)
|
||||
|
||||
if (!get_efi_privilegies ())
|
||||
{
|
||||
grub_util_warn (_("Insufficient privilegies to access firmware, assuming BIOS"));
|
||||
grub_util_warn (_("Insufficient privileges to access firmware, assuming BIOS"));
|
||||
platform = PLAT_BIOS;
|
||||
}
|
||||
|
||||
|
||||
@@ -229,6 +229,9 @@ grub_partition_msdos_iterate (grub_disk_t disk,
|
||||
}
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
|
||||
static grub_err_t
|
||||
pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors,
|
||||
unsigned int max_nsectors,
|
||||
@@ -401,6 +404,9 @@ pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors,
|
||||
N_("your embedding area is unusually small. "
|
||||
"core.img won't fit in it."));
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic error "-Wformat-nonliteral"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ static const struct grub_arg_option options[] =
|
||||
{"word", 'w', 0, N_("Set the serial port word length."), 0, ARG_TYPE_INT},
|
||||
{"parity", 'r', 0, N_("Set the serial port parity."), 0, ARG_TYPE_STRING},
|
||||
{"stop", 't', 0, N_("Set the serial port stop bits."), 0, ARG_TYPE_INT},
|
||||
{"base-clock", 'b', 0, N_("Set the base clock."), 0, ARG_TYPE_STRING},
|
||||
{"base-clock", 'b', 0, N_("Set the base frequency."), 0, ARG_TYPE_STRING},
|
||||
{"rtscts", 'f', 0, N_("Enable/disable RTS/CTS."), "on|off", ARG_TYPE_STRING},
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
@@ -247,7 +247,7 @@ grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
config.rtscts = 0;
|
||||
else
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
N_("unsupported serial port flow"));
|
||||
N_("unsupported serial port flow control"));
|
||||
}
|
||||
|
||||
if (state[OPTION_STOP].set)
|
||||
|
||||
@@ -158,6 +158,8 @@ get_space(grub_size_t need)
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
|
||||
static inline void
|
||||
save_text(const char *fmt, const char *s, int len)
|
||||
{
|
||||
@@ -183,6 +185,8 @@ save_number(const char *fmt, int number, int len)
|
||||
out_used += grub_strlen(out_buff + out_used);
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic error "-Wformat-nonliteral"
|
||||
|
||||
static inline void
|
||||
save_char(int c)
|
||||
{
|
||||
|
||||
@@ -23,15 +23,15 @@
|
||||
#define LINUX_ZIMAGE_OFFSET 0x24
|
||||
#define LINUX_ZIMAGE_MAGIC 0x016f2818
|
||||
|
||||
#define ARM_FDT_MACHINE_TYPE 0xFFFFFFFF
|
||||
#include "system.h"
|
||||
|
||||
#if defined GRUB_MACHINE_UBOOT
|
||||
# include <grub/uboot/uboot.h>
|
||||
# define LINUX_ADDRESS (start_of_ram + 0x8000)
|
||||
# define LINUX_INITRD_ADDRESS (start_of_ram + 0x02000000)
|
||||
# define LINUX_FDT_ADDRESS (LINUX_INITRD_ADDRESS - 0x10000)
|
||||
# define firmware_get_boot_data grub_uboot_get_boot_data
|
||||
# define firmware_get_machine_type grub_uboot_get_machine_type
|
||||
# define grub_arm_firmware_get_boot_data grub_uboot_get_boot_data
|
||||
# define grub_arm_firmware_get_machine_type grub_uboot_get_machine_type
|
||||
#elif defined GRUB_MACHINE_EFI
|
||||
# include <grub/efi/efi.h>
|
||||
# include <grub/machine/loader.h>
|
||||
@@ -41,19 +41,17 @@
|
||||
# define LINUX_INITRD_PHYS_OFFSET (LINUX_PHYS_OFFSET + 0x02000000)
|
||||
# define LINUX_FDT_PHYS_OFFSET (LINUX_INITRD_PHYS_OFFSET - 0x10000)
|
||||
static inline grub_addr_t
|
||||
firmware_get_boot_data (void)
|
||||
grub_arm_firmware_get_boot_data (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline grub_uint32_t
|
||||
firmware_get_machine_type (void)
|
||||
grub_arm_firmware_get_machine_type (void)
|
||||
{
|
||||
return ARM_FDT_MACHINE_TYPE;
|
||||
return GRUB_ARM_MACHINE_TYPE_FDT;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define FDT_ADDITIONAL_ENTRIES_SIZE 0x300
|
||||
|
||||
typedef void (*kernel_entry_t) (int, unsigned long, void *);
|
||||
|
||||
#endif /* ! GRUB_LINUX_CPU_HEADER */
|
||||
@@ -1,7 +1,18 @@
|
||||
#ifndef GRUB_SYSTEM_CPU_HEADER
|
||||
#define GRUB_SYSTEM_CPU_HEADER
|
||||
|
||||
void grub_arm_disable_caches_mmu (void);
|
||||
#include <grub/types.h>
|
||||
|
||||
enum
|
||||
{
|
||||
GRUB_ARM_MACHINE_TYPE_RASPBERRY_PI = 3138,
|
||||
GRUB_ARM_MACHINE_TYPE_FDT = 0xFFFFFFFF
|
||||
};
|
||||
|
||||
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 */
|
||||
|
||||
@@ -27,6 +27,6 @@
|
||||
#endif /* ! ASM_FILE */
|
||||
|
||||
#define GRUB_KERNEL_MACHINE_STACK_SIZE 0x40000
|
||||
#define GRUB_KERNEL_MACHINE_HEAP_SIZE (grub_size_t) (2 * 1024 * 1024)
|
||||
#define GRUB_KERNEL_MACHINE_HEAP_SIZE (grub_size_t) (16 * 1024 * 1024)
|
||||
|
||||
#endif /* ! GRUB_KERNEL_MACHINE_HEADER */
|
||||
@@ -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 */
|
||||
@@ -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 */
|
||||
@@ -293,9 +293,10 @@ grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
|
||||
}
|
||||
while (size >= sizeof (grub_uint64_t))
|
||||
{
|
||||
/* We've already checked that all pointers are aligned. */
|
||||
*(grub_uint64_t *) (void *) outptr
|
||||
= (*(grub_uint64_t *) (void *) in1ptr
|
||||
^ *(grub_uint64_t *) (void *) in2ptr);
|
||||
= (*(const grub_uint64_t *) (const void *) in1ptr
|
||||
^ *(const grub_uint64_t *) (const void *) in2ptr);
|
||||
in1ptr += sizeof (grub_uint64_t);
|
||||
in2ptr += sizeof (grub_uint64_t);
|
||||
outptr += sizeof (grub_uint64_t);
|
||||
@@ -320,7 +321,7 @@ grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
|
||||
void *out, const void *in, grub_size_t size);
|
||||
gcry_err_code_t
|
||||
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
|
||||
void *out, void *in, grub_size_t size,
|
||||
void *out, const void *in, grub_size_t size,
|
||||
void *iv_in);
|
||||
gcry_err_code_t
|
||||
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
|
||||
|
||||
+18
-5
@@ -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;
|
||||
@@ -809,15 +819,18 @@ struct grub_efi_uart_device_path
|
||||
} GRUB_PACKED;
|
||||
typedef struct grub_efi_uart_device_path grub_efi_uart_device_path_t;
|
||||
|
||||
#define GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE 10
|
||||
#define GRUB_EFI_SATA_DEVICE_PATH_SUBTYPE 18
|
||||
|
||||
struct grub_efi_vendor_messaging_device_path
|
||||
struct grub_efi_sata_device_path
|
||||
{
|
||||
grub_efi_device_path_t header;
|
||||
grub_efi_packed_guid_t vendor_guid;
|
||||
grub_efi_uint8_t vendor_defined_data[0];
|
||||
grub_efi_uint16_t hba_port;
|
||||
grub_efi_uint16_t multiplier_port;
|
||||
grub_efi_uint16_t lun;
|
||||
} GRUB_PACKED;
|
||||
typedef struct grub_efi_vendor_messaging_device_path grub_efi_vendor_messaging_device_path_t;
|
||||
typedef struct grub_efi_sata_device_path grub_efi_sata_device_path_t;
|
||||
|
||||
#define GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE 10
|
||||
|
||||
/* Media Device Path. */
|
||||
#define GRUB_EFI_MEDIA_DEVICE_PATH_TYPE 4
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -75,6 +75,12 @@ grub_hostdisk_find_partition_start_os (const char *dev);
|
||||
void
|
||||
grub_hostdisk_flush_initial_buffer (const char *os_dev);
|
||||
|
||||
#ifdef __GNU__
|
||||
int
|
||||
grub_util_hurd_get_disk_info (const char *dev, grub_uint32_t *secsize, grub_disk_addr_t *offset,
|
||||
grub_disk_addr_t *size, char **parent);
|
||||
#endif
|
||||
|
||||
struct grub_util_hostdisk_data
|
||||
{
|
||||
char *dev;
|
||||
|
||||
@@ -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,7 +95,9 @@ 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,
|
||||
const char *name);
|
||||
int grub_fdt_add_subnode (void *fdt, unsigned int parentoffset,
|
||||
@@ -96,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 */
|
||||
@@ -247,7 +247,7 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree,
|
||||
struct grub_hfsplus_btnode **matchnode,
|
||||
grub_off_t *keyoffset);
|
||||
grub_err_t
|
||||
grub_mac_bless_inode (grub_device_t dev, grub_uint64_t inode, int is_dir,
|
||||
grub_mac_bless_inode (grub_device_t dev, grub_uint32_t inode, int is_dir,
|
||||
int intel);
|
||||
grub_err_t
|
||||
grub_mac_bless_file (grub_device_t dev, const char *path_in, int intel);
|
||||
+1
-1
@@ -296,7 +296,7 @@ static inline long
|
||||
grub_strtol (const char *str, char **end, int base)
|
||||
{
|
||||
int negative = 0;
|
||||
unsigned long magnitude;
|
||||
unsigned long long magnitude;
|
||||
|
||||
while (*str && grub_isspace (*str))
|
||||
str++;
|
||||
|
||||
@@ -68,7 +68,7 @@ grub_util_rename (const char *from, const char *to)
|
||||
return rename (from, to);
|
||||
}
|
||||
|
||||
#define grub_util_mkdir(a) mkdir (a, 0700)
|
||||
#define grub_util_mkdir(a) mkdir ((a), 0755)
|
||||
|
||||
struct grub_util_fd
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@ grub_util_rename (const char *from, const char *to)
|
||||
return rename (from, to);
|
||||
}
|
||||
|
||||
#define grub_util_mkdir(a) mkdir ((a), 0700)
|
||||
#define grub_util_mkdir(a) mkdir ((a), 0755)
|
||||
|
||||
#if defined (__NetBSD__)
|
||||
/* NetBSD uses /boot for its boot block. */
|
||||
|
||||
+1
-1
@@ -405,7 +405,7 @@ grub_unicode_estimate_width (const struct grub_unicode_glyph *c);
|
||||
|
||||
#else
|
||||
|
||||
static inline grub_ssize_t
|
||||
static inline grub_size_t
|
||||
grub_unicode_estimate_width (const struct grub_unicode_glyph *c __attribute__ ((unused)))
|
||||
{
|
||||
if (grub_unicode_get_comb_type (c->base))
|
||||
|
||||
@@ -552,7 +552,7 @@ grub_video_check_mode_flag (grub_video_mode_type_t flags,
|
||||
grub_video_driver_id_t EXPORT_FUNC (grub_video_get_driver_id) (void);
|
||||
|
||||
static __inline grub_video_rgba_color_t
|
||||
grub_video_rgba_color_rgb (int r, int g, int b)
|
||||
grub_video_rgba_color_rgb (grub_uint8_t r, grub_uint8_t g, grub_uint8_t b)
|
||||
{
|
||||
grub_video_rgba_color_t c;
|
||||
c.red = r;
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <grub/types.h>
|
||||
#include <grub/emu/misc.h>
|
||||
#include <grub/util/misc.h>
|
||||
#include <grub/util/install.h>
|
||||
#include <grub/lib/envblk.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/emu/hostfile.h>
|
||||
|
||||
+9
-4
@@ -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);
|
||||
}
|
||||
@@ -363,9 +368,9 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
|
||||
char *t;
|
||||
t = dri;
|
||||
if (*q >= 'a' && *q <= 'g')
|
||||
dri = xasprintf ("%s,%d,%d", t, n, *q - 'a' + 1);
|
||||
dri = xasprintf ("%s,%ld,%d", t, n, *q - 'a' + 1);
|
||||
else
|
||||
dri = xasprintf ("%s,%d", t, n);
|
||||
dri = xasprintf ("%s,%ld", t, n);
|
||||
free (t);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -19,6 +19,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <grub/util/misc.h>
|
||||
#include <grub/util/install.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/term.h>
|
||||
#include <grub/macho.h>
|
||||
@@ -28,7 +29,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <argp.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
@@ -30,7 +30,12 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic ignored "-Wmissing-declarations"
|
||||
#include <argp.h>
|
||||
#pragma GCC diagnostic error "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic error "-Wmissing-declarations"
|
||||
|
||||
|
||||
#include "progname.h"
|
||||
|
||||
@@ -87,6 +92,8 @@ static error_t argp_parser (int key, char *arg, struct argp_state *state)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
|
||||
static char *
|
||||
help_filter (int key, const char *text, void *input __attribute__ ((unused)))
|
||||
{
|
||||
@@ -100,6 +107,8 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused)))
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic error "-Wformat-nonliteral"
|
||||
|
||||
struct argp argp = {
|
||||
options, argp_parser, N_("FILENAME COMMAND"),
|
||||
"\n"N_("\
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <argp.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
@@ -41,7 +41,11 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "progname.h"
|
||||
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic ignored "-Wmissing-declarations"
|
||||
#include "argp.h"
|
||||
#pragma GCC diagnostic error "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic error "-Wmissing-declarations"
|
||||
|
||||
static grub_err_t
|
||||
execute_command (const char *name, int n, char **args)
|
||||
|
||||
@@ -29,10 +29,15 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <argp.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic ignored "-Wmissing-declarations"
|
||||
#include <argp.h>
|
||||
#pragma GCC diagnostic error "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic error "-Wmissing-declarations"
|
||||
|
||||
#include "progname.h"
|
||||
|
||||
struct arguments
|
||||
@@ -87,7 +92,7 @@ argp_parser (int key, char *arg, struct argp_state *state)
|
||||
|
||||
static struct argp argp = {
|
||||
options, argp_parser, N_("[OPTIONS]"),
|
||||
N_("Glue 32-bit and 64-binary into Apple fat one."),
|
||||
N_("Glue 32-bit and 64-bit binary into Apple universal one."),
|
||||
NULL, NULL, NULL
|
||||
};
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
|
||||
char *
|
||||
grub_install_help_filter (int key, const char *text,
|
||||
void *input __attribute__ ((unused)))
|
||||
@@ -67,6 +69,8 @@ grub_install_help_filter (int key, const char *text,
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic error "-Wformat-nonliteral"
|
||||
|
||||
static int (*compress_func) (const char *src, const char *dest) = NULL;
|
||||
char *grub_install_copy_buffer;
|
||||
|
||||
@@ -120,7 +124,7 @@ grub_install_copy_file (const char *src,
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
grub_install_compress_file (const char *in_name,
|
||||
const char *out_name,
|
||||
int is_needed)
|
||||
@@ -737,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++)
|
||||
|
||||
+19
-5
@@ -45,7 +45,11 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "argp.h"
|
||||
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic ignored "-Wmissing-declarations"
|
||||
#include <argp.h>
|
||||
#pragma GCC diagnostic error "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic error "-Wmissing-declarations"
|
||||
|
||||
#include "progname.h"
|
||||
|
||||
@@ -326,6 +330,8 @@ get_default_platform (void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
|
||||
static char *
|
||||
help_filter (int key, const char *text, void *input __attribute__ ((unused)))
|
||||
{
|
||||
@@ -342,6 +348,8 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused)))
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic error "-Wformat-nonliteral"
|
||||
|
||||
/* TRANSLATORS: INSTALL_DEVICE isn't an identifier and is the DEVICE you
|
||||
install to. */
|
||||
struct argp argp = {
|
||||
@@ -536,7 +544,7 @@ is_same_disk (const char *a, const char *b)
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
static char *
|
||||
get_rndstr (void)
|
||||
{
|
||||
grub_uint8_t rnd[15];
|
||||
@@ -862,6 +870,12 @@ main (int argc, char *argv[])
|
||||
|
||||
platform = grub_install_get_target (grub_install_source_directory);
|
||||
|
||||
{
|
||||
char *platname = grub_install_get_platform_name (platform);
|
||||
fprintf (stderr, _("Installing for %s platform.\n"), platname);
|
||||
free (platname);
|
||||
}
|
||||
|
||||
switch (platform)
|
||||
{
|
||||
case GRUB_INSTALL_PLATFORM_I386_PC:
|
||||
@@ -1176,7 +1190,7 @@ main (int argc, char *argv[])
|
||||
if (grub_strcmp (fs->name, "hfs") != 0
|
||||
&& grub_strcmp (fs->name, "hfsplus") != 0
|
||||
&& !is_guess)
|
||||
grub_util_error (_("%s is neither hfs nor hfsplus"),
|
||||
grub_util_error (_("filesystem on %s is neither HFS nor HFS+"),
|
||||
macppcdir);
|
||||
if (grub_strcmp (fs->name, "hfs") == 0
|
||||
|| grub_strcmp (fs->name, "hfsplus") == 0)
|
||||
@@ -1244,7 +1258,7 @@ main (int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (!config.is_cryptodisk_enabled && have_cryptodisk)
|
||||
grub_util_error (_("attempt to install to cryptodisk without cryptodisk enabled. "
|
||||
grub_util_error (_("attempt to install to encrypted disk without cryptodisk enabled. "
|
||||
"Set `%s' in file `%s'."), "GRUB_ENABLE_CRYPTODISK=1",
|
||||
grub_util_get_config_filename ());
|
||||
|
||||
@@ -1839,7 +1853,7 @@ main (int argc, char *argv[])
|
||||
|
||||
/* Try to make this image bootable using the EFI Boot Manager, if available. */
|
||||
if (!efi_distributor || efi_distributor[0] == '\0')
|
||||
grub_util_error ("%s", _("EFI distributor id isn't specified."));
|
||||
grub_util_error ("%s", _("EFI bootloader id isn't specified."));
|
||||
efifile_path = xasprintf ("\\EFI\\%s\\%s",
|
||||
efi_distributor,
|
||||
efi_file);
|
||||
|
||||
@@ -45,7 +45,11 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define _GNU_SOURCE 1
|
||||
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic ignored "-Wmissing-declarations"
|
||||
#include <argp.h>
|
||||
#pragma GCC diagnostic error "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic error "-Wmissing-declarations"
|
||||
|
||||
#include "progname.h"
|
||||
|
||||
|
||||
+8
-44
@@ -55,7 +55,6 @@ usage () {
|
||||
gettext "Generate a grub config file"; echo
|
||||
echo
|
||||
print_option_help "-o, --output=$(gettext FILE)" "$(gettext "output generated config to FILE [default=stdout]")"
|
||||
print_option_help "-r, --root-directory=$(gettext DIR)" "$(gettext "use DIR as root directory [default=/]")"
|
||||
print_option_help "-h, --help" "$(gettext "print this message and exit")"
|
||||
print_option_help "-v, --version" "$(gettext "print the version information and exit")"
|
||||
echo
|
||||
@@ -73,8 +72,6 @@ argument () {
|
||||
echo $1
|
||||
}
|
||||
|
||||
GRUB_ROOT=
|
||||
|
||||
# Check the arguments.
|
||||
while test $# -gt 0
|
||||
do
|
||||
@@ -93,11 +90,6 @@ do
|
||||
--output=*)
|
||||
grub_cfg=`echo "$option" | sed 's/--output=//'`
|
||||
;;
|
||||
-r | --root-directory)
|
||||
GRUB_ROOT=`argument $option "$@"`; shift;;
|
||||
--root-directory=*)
|
||||
GRUB_ROOT=`echo "$option" | sed 's/--output=//'`
|
||||
;;
|
||||
-*)
|
||||
gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2
|
||||
usage
|
||||
@@ -137,19 +129,19 @@ else
|
||||
fi
|
||||
|
||||
# Device containing our userland. Typically used for root= parameter.
|
||||
GRUB_DEVICE="`${grub_probe} --target=device "$GRUB_ROOT"/`"
|
||||
GRUB_DEVICE="`${grub_probe} --target=device /`"
|
||||
GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
|
||||
|
||||
# Device containing our /boot partition. Usually the same as GRUB_DEVICE.
|
||||
GRUB_DEVICE_BOOT="`${grub_probe} --target=device "$GRUB_ROOT"/boot`"
|
||||
GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`"
|
||||
GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true
|
||||
|
||||
# Filesystem for the device containing our userland. Used for stuff like
|
||||
# choosing Hurd filesystem module.
|
||||
GRUB_FS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2> /dev/null || echo unknown`"
|
||||
|
||||
if [ x"$GRUB_FS" = x ] || [ x"$GRUB_FS" = xunknown ]; then
|
||||
GRUB_FS="$(stat -f --printf=%T "$GRUB_ROOT"/ || echo unknown)"
|
||||
if [ x"$GRUB_FS" = xunknown ]; then
|
||||
GRUB_FS="$(stat -f --printf=%T / || echo unknown)"
|
||||
fi
|
||||
|
||||
if test -f ${sysconfdir}/default/grub ; then
|
||||
@@ -186,7 +178,6 @@ if [ "x${GRUB_ACTUAL_DEFAULT}" = "xsaved" ] ; then GRUB_ACTUAL_DEFAULT="`"${grub
|
||||
# These are defined in this script, export them here so that user can
|
||||
# override them.
|
||||
export GRUB_DEVICE \
|
||||
GRUB_ROOT \
|
||||
GRUB_DEVICE_UUID \
|
||||
GRUB_DEVICE_BOOT \
|
||||
GRUB_DEVICE_BOOT_UUID \
|
||||
@@ -256,43 +247,16 @@ EOF
|
||||
|
||||
for i in "${grub_mkconfig_dir}"/* ; do
|
||||
case "$i" in
|
||||
"${grub_mkconfig_dir}"/00_header \
|
||||
| "${grub_mkconfig_dir}"/30_os-prober \
|
||||
| "${grub_mkconfig_dir}"/40_custom \
|
||||
| "${grub_mkconfig_dir}"/41_custom)
|
||||
echo
|
||||
echo "### BEGIN $i ###"
|
||||
"$i"
|
||||
echo "### END $i ###"
|
||||
;;
|
||||
# emacsen backup files. FIXME: support other editors
|
||||
*~) ;;
|
||||
# emacsen autosave files. FIXME: support other editors
|
||||
*/\#*\#) ;;
|
||||
*)
|
||||
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
|
||||
GRUB_PLATFORM=$platform
|
||||
export GRUB_PLATFORM
|
||||
buf="$($i)"
|
||||
if [ x"$buf" != x ]; then
|
||||
echo
|
||||
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" ;;
|
||||
xi386-xen-pae)
|
||||
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\" = x$platform -o x\"\$grub_platform\" = x ]; then" ;;
|
||||
esac
|
||||
echo "$buf"
|
||||
echo "fi"
|
||||
echo "### END $i ($platform) ###"
|
||||
fi
|
||||
done
|
||||
echo
|
||||
echo "### BEGIN $i ###"
|
||||
"$i"
|
||||
echo "### END $i ###"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
+12
-2
@@ -48,7 +48,13 @@
|
||||
#include <grub/emu/config.h>
|
||||
|
||||
#define _GNU_SOURCE 1
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic ignored "-Wmissing-declarations"
|
||||
#include <argp.h>
|
||||
#pragma GCC diagnostic error "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic error "-Wmissing-declarations"
|
||||
|
||||
|
||||
#include "progname.h"
|
||||
|
||||
@@ -63,8 +69,8 @@ static struct argp_option options[] = {
|
||||
/* TRANSLATORS: "memdisk" here isn't an identifier, it can be translated.
|
||||
"embed" is a verb (command description). "*/
|
||||
N_("embed FILE as a memdisk image\n"
|
||||
"Implies `-p (memdisk)/boot/grub' but prefix can be overridden by "
|
||||
"later options"), 0},
|
||||
"Implies `-p (memdisk)/boot/grub' and overrides any prefix supplied previously,"
|
||||
" but the prefix itself can be overridden by later options"), 0},
|
||||
/* TRANSLATORS: "embed" is a verb (command description). "*/
|
||||
{"config", 'c', N_("FILE"), 0, N_("embed FILE as an early config"), 0},
|
||||
/* TRANSLATORS: "embed" is a verb (command description). "*/
|
||||
@@ -78,6 +84,8 @@ static struct argp_option options[] = {
|
||||
{ 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
|
||||
static char *
|
||||
help_filter (int key, const char *text, void *input __attribute__ ((unused)))
|
||||
{
|
||||
@@ -100,6 +108,8 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused)))
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic error "-Wformat-nonliteral"
|
||||
|
||||
struct arguments
|
||||
{
|
||||
size_t nmodules;
|
||||
|
||||
@@ -1379,7 +1379,7 @@ SUFFIX (locate_sections) (const char *kernel_path,
|
||||
!= image_target->link_addr)
|
||||
{
|
||||
char *msg
|
||||
= grub_xasprintf (_("`%s' is miscompiled: it's start address is 0x%llx"
|
||||
= grub_xasprintf (_("`%s' is miscompiled: its start address is 0x%llx"
|
||||
" instead of 0x%llx: ld.gold bug?"),
|
||||
kernel_path,
|
||||
(unsigned long long) grub_host_to_target_addr (s->sh_addr),
|
||||
|
||||
Loaded 100 of 122 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user