aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzr/README3
-rw-r--r--.bzr/branch-format1
-rw-r--r--.bzr/branch/branch.conf1
-rw-r--r--.bzr/branch/format1
-rw-r--r--.bzr/branch/last-revision1
-rw-r--r--.bzr/branch/tags1
-rw-r--r--.bzr/checkout/conflicts1
-rw-r--r--.bzr/checkout/dirstatebin0 -> 322100 bytes
-rw-r--r--.bzr/checkout/format1
-rw-r--r--.bzr/checkout/views0
-rw-r--r--.bzr/repository/format1
-rw-r--r--.bzr/repository/indices/21eed38863b95e047c05b09028452571.cixbin0 -> 1312577 bytes
-rw-r--r--.bzr/repository/indices/21eed38863b95e047c05b09028452571.iixbin0 -> 272536 bytes
-rw-r--r--.bzr/repository/indices/21eed38863b95e047c05b09028452571.rixbin0 -> 275485 bytes
-rw-r--r--.bzr/repository/indices/21eed38863b95e047c05b09028452571.sixbin0 -> 123450 bytes
-rw-r--r--.bzr/repository/indices/21eed38863b95e047c05b09028452571.tixbin0 -> 1287938 bytes
-rw-r--r--.bzr/repository/pack-names6
-rw-r--r--.bzr/repository/packs/21eed38863b95e047c05b09028452571.packbin0 -> 14715352 bytes
-rw-r--r--.bzrignore176
-rw-r--r--ChangeLog82
-rw-r--r--Makefile.util.def1
-rw-r--r--configure.ac2
-rw-r--r--docs/grub.texi35
-rw-r--r--grub-core/Makefile.core.def11
-rw-r--r--grub-core/disk/cryptodisk.c12
-rw-r--r--grub-core/fs/ufs.c105
-rw-r--r--grub-core/fs/ufs_be.c2
-rw-r--r--grub-core/gfxmenu/view.c40
-rw-r--r--grub-core/kern/ieee1275/init.c21
-rw-r--r--grub-core/loader/arm/linux.c (renamed from grub-core/loader/arm/uboot/linux.c)5
-rw-r--r--grub-core/net/bootp.c2
-rw-r--r--grub-core/term/gfxterm.c18
-rw-r--r--include/grub/arm/linux.h11
-rw-r--r--include/grub/gfxterm.h3
-rw-r--r--include/grub/types.h2
-rw-r--r--util/getroot.c12
-rw-r--r--util/grub-install.in4
-rw-r--r--util/grub-mkfont.c2
-rw-r--r--util/grub.d/20_linux_xen.in2
39 files changed, 479 insertions, 86 deletions
diff --git a/.bzr/README b/.bzr/README
new file mode 100644
index 0000000..f82dc1c
--- /dev/null
+++ b/.bzr/README
@@ -0,0 +1,3 @@
+This is a Bazaar control directory.
+Do not change any files in this directory.
+See http://bazaar.canonical.com/ for more information about Bazaar.
diff --git a/.bzr/branch-format b/.bzr/branch-format
new file mode 100644
index 0000000..9eb09b7
--- /dev/null
+++ b/.bzr/branch-format
@@ -0,0 +1 @@
+Bazaar-NG meta directory, format 1
diff --git a/.bzr/branch/branch.conf b/.bzr/branch/branch.conf
new file mode 100644
index 0000000..ac398d8
--- /dev/null
+++ b/.bzr/branch/branch.conf
@@ -0,0 +1 @@
+parent_location = http://bazaar.launchpad.net/~leif-lindholm/linaro-grub/arm-uboot/
diff --git a/.bzr/branch/format b/.bzr/branch/format
new file mode 100644
index 0000000..dc392f4
--- /dev/null
+++ b/.bzr/branch/format
@@ -0,0 +1 @@
+Bazaar Branch Format 7 (needs bzr 1.6)
diff --git a/.bzr/branch/last-revision b/.bzr/branch/last-revision
new file mode 100644
index 0000000..68f77a2
--- /dev/null
+++ b/.bzr/branch/last-revision
@@ -0,0 +1 @@
+4615 leif.lindholm@linaro.org-20121214130050-zqwt2roanb508g2f
diff --git a/.bzr/branch/tags b/.bzr/branch/tags
new file mode 100644
index 0000000..3aa3d02
--- /dev/null
+++ b/.bzr/branch/tags
@@ -0,0 +1 @@
+d4:1.9949:phcoder@gmail.com-20110514204953-z0pozky4dagt6ff44:2.0049:phcoder@gmail.com-20120628000636-gujxzbli71mifg6g15:initial-release53:leif.lindholm@arm.com-20121207132742-lb2l9tbw9t1axzeee \ No newline at end of file
diff --git a/.bzr/checkout/conflicts b/.bzr/checkout/conflicts
new file mode 100644
index 0000000..0dc2d3a
--- /dev/null
+++ b/.bzr/checkout/conflicts
@@ -0,0 +1 @@
+BZR conflict list format 1
diff --git a/.bzr/checkout/dirstate b/.bzr/checkout/dirstate
new file mode 100644
index 0000000..7ff7af2
--- /dev/null
+++ b/.bzr/checkout/dirstate
Binary files differ
diff --git a/.bzr/checkout/format b/.bzr/checkout/format
new file mode 100644
index 0000000..e0261c7
--- /dev/null
+++ b/.bzr/checkout/format
@@ -0,0 +1 @@
+Bazaar Working Tree Format 6 (bzr 1.14)
diff --git a/.bzr/checkout/views b/.bzr/checkout/views
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.bzr/checkout/views
diff --git a/.bzr/repository/format b/.bzr/repository/format
new file mode 100644
index 0000000..b200528
--- /dev/null
+++ b/.bzr/repository/format
@@ -0,0 +1 @@
+Bazaar repository format 2a (needs bzr 1.16 or later)
diff --git a/.bzr/repository/indices/21eed38863b95e047c05b09028452571.cix b/.bzr/repository/indices/21eed38863b95e047c05b09028452571.cix
new file mode 100644
index 0000000..8802692
--- /dev/null
+++ b/.bzr/repository/indices/21eed38863b95e047c05b09028452571.cix
Binary files differ
diff --git a/.bzr/repository/indices/21eed38863b95e047c05b09028452571.iix b/.bzr/repository/indices/21eed38863b95e047c05b09028452571.iix
new file mode 100644
index 0000000..918e0e5
--- /dev/null
+++ b/.bzr/repository/indices/21eed38863b95e047c05b09028452571.iix
Binary files differ
diff --git a/.bzr/repository/indices/21eed38863b95e047c05b09028452571.rix b/.bzr/repository/indices/21eed38863b95e047c05b09028452571.rix
new file mode 100644
index 0000000..1f84957
--- /dev/null
+++ b/.bzr/repository/indices/21eed38863b95e047c05b09028452571.rix
Binary files differ
diff --git a/.bzr/repository/indices/21eed38863b95e047c05b09028452571.six b/.bzr/repository/indices/21eed38863b95e047c05b09028452571.six
new file mode 100644
index 0000000..c27d962
--- /dev/null
+++ b/.bzr/repository/indices/21eed38863b95e047c05b09028452571.six
Binary files differ
diff --git a/.bzr/repository/indices/21eed38863b95e047c05b09028452571.tix b/.bzr/repository/indices/21eed38863b95e047c05b09028452571.tix
new file mode 100644
index 0000000..41f2c69
--- /dev/null
+++ b/.bzr/repository/indices/21eed38863b95e047c05b09028452571.tix
Binary files differ
diff --git a/.bzr/repository/pack-names b/.bzr/repository/pack-names
new file mode 100644
index 0000000..72cabc8
--- /dev/null
+++ b/.bzr/repository/pack-names
@@ -0,0 +1,6 @@
+B+Tree Graph Index 2
+node_ref_lists=0
+key_elements=1
+len=1
+row_lengths=1
+x ʫ0 N{M*BP:sv~US#΁$0iA\8,KX+[_ \ No newline at end of file
diff --git a/.bzr/repository/packs/21eed38863b95e047c05b09028452571.pack b/.bzr/repository/packs/21eed38863b95e047c05b09028452571.pack
new file mode 100644
index 0000000..16a9bd1
--- /dev/null
+++ b/.bzr/repository/packs/21eed38863b95e047c05b09028452571.pack
Binary files differ
diff --git a/.bzrignore b/.bzrignore
new file mode 100644
index 0000000..f89141c
--- /dev/null
+++ b/.bzrignore
@@ -0,0 +1,176 @@
+00_header
+10_*
+20_linux_xen
+30_os-prober
+40_custom
+41_custom
+*.1
+*.8
+aclocal.m4
+ascii.bitmaps
+ascii.h
+autom4te.cache
+build_env.mk
+.bzrignore
+config.cache
+config.guess
+config.h
+config-util.h
+config-util.h.in
+config.log
+config.status
+config.sub
+configure
+DISTLIST
+docs/*.info
+docs/stamp-vti
+docs/version.texi
+*.elf
+example_grub_script_test
+example_scripted_test
+example_unit_test
+*.exec
+genkernsyms.sh
+gensymlist.sh
+gentrigtables
+grub-bin2h
+grub-bios-setup
+grub_cmd_echo
+grub_cmd_regexp
+grub-editenv
+grub-emu
+grub_emu_init.c
+grub_emu_init.h
+grub-fstest
+grub_fstest_init.c
+grub_fstest_init.h
+grub-install
+grub-kbdcomp
+grub-macho2img
+grub-menulst2cfg
+grub-mk*
+grub-mount
+grub-ofpathname
+grub-pe2elf
+grub-probe
+grub_probe_init.c
+grub_probe_init.h
+grub-reboot
+grub_script_blanklines
+grub_script_blockarg
+grub_script_break
+grub-script-check
+grub_script_check_init.c
+grub_script_check_init.h
+grub_script_comments
+grub_script_continue
+grub_script_dollar
+grub_script_echo1
+grub_script_echo_keywords
+grub_script_expansion
+grub_script_final_semicolon
+grub_script_for1
+grub_script_functions
+grub_script_if
+grub_script_not
+grub_script_return
+grub_script_setparams
+grub_script_shift
+grub_script_vars1
+grub_script_while1
+grub_script.tab.c
+grub_script.tab.h
+grub_script.yy.c
+grub_script.yy.h
+grub-set-default
+grub-setup
+grub_setup_init.c
+grub_setup_init.h
+grub-shell
+grub-shell-tester
+grub-sparc64-setup
+*.img
+*.image
+include/grub/cpu
+include/grub/machine
+install-sh
+lib/libgcrypt-grub
+libgrub_a_init.c
+*.lst
+*.marker
+Makefile
+*.mod
+mod-*.c
+missing
+partmap_test
+*.pf2
+*.pp
+po/*.mo
+po/grub.pot
+po/POTFILES
+po/stamp-po
+stamp-h
+stamp-h1
+stamp-h.in
+symlist.c
+symlist.h
+trigtables.c
+update-grub_lib
+unidata.c
+Makefile.in
+GPATH
+GRTAGS
+GSYMS
+GTAGS
+Makefile.tpl
+compile
+depcomp
+mdate-sh
+texinfo.tex
+grub-core/lib/libgcrypt-grub
+grub-core/lib/dtc-grub
+**/.deps
+**/.deps-util
+**/.deps-core
+**/.dirstamp
+Makefile.util.am
+contrib
+grub-core/Makefile.core.am
+grub-core/Makefile.gcry.def
+grub-core/Makefile.libfdt.def
+grub-core/contrib
+grub-core/gdb_grub
+grub-core/genmod.sh
+grub-core/gensyminfo.sh
+grub-core/gmodule.pl
+grub-core/modinfo.sh
+grub-core/*.module
+grub-core/*.pp
+util/bash-completion.d/grub
+grub-core/gnulib/alloca.h
+grub-core/gnulib/arg-nonnull.h
+grub-core/gnulib/c++defs.h
+grub-core/gnulib/charset.alias
+grub-core/gnulib/configmake.h
+grub-core/gnulib/getopt.h
+grub-core/gnulib/langinfo.h
+grub-core/gnulib/ref-add.sed
+grub-core/gnulib/ref-del.sed
+grub-core/gnulib/stdio.h
+grub-core/gnulib/stdlib.h
+grub-core/gnulib/string.h
+grub-core/gnulib/strings.h
+grub-core/gnulib/sys
+grub-core/gnulib/unistd.h
+grub-core/gnulib/warn-on-use.h
+grub-core/gnulib/wchar.h
+grub-core/gnulib/wctype.h
+grub-core/rs_decoder.S
+widthspec.bin
+widthspec.h
+docs/stamp-1
+docs/version-dev.texi
+Makefile.utilgcry.def
+po/*.po
+po/*.gmo
+po/LINGUAS
diff --git a/ChangeLog b/ChangeLog
index caea96d..9104a46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,85 @@
+2012-12-11 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * util/grub.d/20_linux_xen.in: Addmissing assignment to machine.
+ Reported by: Eriks Latosheks <foresterlv>.
+
+2012-12-10 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * docs/grub.texi (Network): Update instructions on generating netboot
+ image.
+
+2012-12-10 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/disk/cryptodisk.c (grub_cmd_cryptomount): Strip brackets
+ around device name if necessarry.
+
+2012-12-10 Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
+
+ * util/grub-install.in: Follow the symbolic link parameter added
+ to the file command.
+
+2012-12-10 Andrey Borzenkov <arvidjaar@gmail.com>
+
+ * util/grub-install.in: Remove stale TODO.
+
+2012-12-10 Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
+
+ * grub-core/kern/ieee1275/init.c (grub_machine_get_bootlocation): Use
+ dynamic allocation for the bootpath buffer.
+
+2012-12-10 Dr. Tilmann Bubeck <t.bubeck@reinform.de>
+
+ * grub-core/gfxmenu/view.c (init_terminal): Avoid making terminal
+ window too small.
+
+2012-12-10 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/term/gfxterm.c (grub_virtual_screen_setup): Get font as
+ argument rather than font name. All users updated.
+ (grub_gfxterm_set_window): Likewise.
+
+2012-12-10 Vladimir Testov <vladimir.testov@rosalab.ru>
+
+ * util/grub-mkfont.c (argp_parser): Fix a typo which prevented --asce
+ from working.
+
+2012-12-10 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * util/getroot.c (convert_system_partition_to_system_disk): Support
+ nbd disks.
+
+2012-12-10 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/fs/ufs.c (grub_ufs_dir): Stop if direntlen is 0 to avoid
+ infinite loop on corrupted FS.
+
+2012-12-08 Vladimir Serbinenko <phcoder@gmail.com>
+
+ Fix big-endian mtime.
+
+ * grub-core/fs/ufs.c (grub_ufs_inode): Split improperly attached
+ together sec and usec.
+ (grub_ufs_dir): Use correct byteswapping for UFS time.
+
+2012-12-08 Vladimir Serbinenko <phcoder@gmail.com>
+
+ Support big-endian UFS1.
+
+ * Makefile.util.def (libgrubmods): Add ufs_be.c
+ * grub-core/Makefile.core.def (ufs1_be): New module.
+ * grub-core/fs/ufs_be.c: New file.
+ * grub-core/fs/ufs.c: Declare grub_ufs_to_le* and use them throughout
+ the file.
+
+2012-11-28 Leif Lindholm <leif.lindholm@arm.com>
+
+ * include/grub/types.h: Fix functionality unaffecting typo in
+ GRUB_TARGET_WORDSIZE conditional macro.
+
+2012-11-28 Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
+
+ * grub-core/net/bootp.c (parse_dhcp_vendor): Fix double increment.
+
2012-10-28 Grégoire Sutre <gregoire.sutre@gmail.com>
* util/grub.d/10_netbsd.in: Fix tab indentation and make sure
diff --git a/Makefile.util.def b/Makefile.util.def
index 0c09deb..6a123ff 100644
--- a/Makefile.util.def
+++ b/Makefile.util.def
@@ -90,6 +90,7 @@ library = {
common = grub-core/fs/udf.c;
common = grub-core/fs/ufs2.c;
common = grub-core/fs/ufs.c;
+ common = grub-core/fs/ufs_be.c;
common = grub-core/fs/xfs.c;
common = grub-core/fs/zfs/zfscrypt.c;
common = grub-core/fs/zfs/zfs.c;
diff --git a/configure.ac b/configure.ac
index e042c5b..4b5d92d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,7 +137,7 @@ case "$target_cpu"-"$platform" in
mipsel-yeeloong) platform=loongson ;;
mipsel-fuloong) platform=loongson ;;
mipsel-loongson) ;;
- arm-uboot) platform=uboot ;;
+ arm-uboot) ;;
*-emu) ;;
*) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
esac
diff --git a/docs/grub.texi b/docs/grub.texi
index b0e7f59..39d9614 100644
--- a/docs/grub.texi
+++ b/docs/grub.texi
@@ -2080,34 +2080,35 @@ The following properties are supported by all components:
@node Network
@chapter Booting GRUB from the network
-The following instructions only work on PC BIOS systems where the Preboot
-eXecution Environment (PXE) is available.
+The following instructions don't work for *-emu, i386-qemu, i386-coreboot,
+i386-multiboot, mips_loongson, mips-arc and mips_qemu_mips
-To generate a PXE boot image, run:
+To generate a netbootable directory, run:
@example
@group
-grub-mkimage --format=i386-pc-pxe --output=grub.pxe --prefix='(pxe)/boot/grub' pxe pxecmd
+grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/<platform>
@end group
@end example
-Copy @file{grub.pxe}, @file{/boot/grub/*.mod}, and @file{/boot/grub/*.lst}
-to the PXE (TFTP) server, ensuring that @file{*.mod} and @file{*.lst} are
-accessible via the @file{/boot/grub/} path from the TFTP server root. Set
-the DHCP server configuration to offer @file{grub.pxe} as the boot file (the
-@samp{filename} option in ISC dhcpd).
+E.g. for i386-pc:
-You can also use the @command{grub-mknetdir} utility to generate an image
-and a GRUB directory tree, rather than copying files around manually.
+@example
+@group
+grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/i386-pc
+@end group
+@end example
+
+Then follow instructions printed out by grub-mknetdir on configuring your DHCP
+server.
After GRUB has started, files on the TFTP server will be accessible via the
-@samp{(pxe)} device.
+@samp{(tftp)} device.
-The server and gateway IP address can be controlled by changing the
-@samp{(pxe)} device name to @samp{(pxe:@var{server-ip})} or
-@samp{(pxe:@var{server-ip}:@var{gateway-ip})}. Note that this should be
-changed both in the prefix and in any references to the device name in the
-configuration file.
+The server IP address can be controlled by changing the
+@samp{(tftp)} device name to @samp{(tftp,@var{server-ip})}. Note that
+this should be changed both in the prefix and in any references to the
+device name in the configuration file.
GRUB provides several environment variables which may be used to inspect or
change the behaviour of the PXE device:
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index 80a9dcb..8704d23 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -608,8 +608,8 @@ module = {
module = {
name = cat;
common = commands/cat.c;
- arm = lib/arg.c;
- arm = commands/extcmd.c;
+ arm_uboot = lib/arg.c;
+ arm_uboot = commands/extcmd.c;
};
module = {
@@ -1198,6 +1198,11 @@ module = {
};
module = {
+ name = ufs1_be;
+ common = fs/ufs_be.c;
+};
+
+module = {
name = ufs2;
common = fs/ufs2.c;
};
@@ -1416,7 +1421,7 @@ module = {
powerpc_ieee1275 = loader/powerpc/ieee1275/linux.c;
sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c;
ia64_efi = loader/ia64/efi/linux.c;
- arm_uboot = loader/arm/uboot/linux.c;
+ arm = loader/arm/linux.c;
common = lib/cmdline.c;
enable = noemu;
diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c
index 1ac906d..3de3b86 100644
--- a/grub-core/disk/cryptodisk.c
+++ b/grub-core/disk/cryptodisk.c
@@ -928,10 +928,20 @@ grub_cmd_cryptomount (grub_extcmd_context_t ctxt, int argc, char **args)
grub_err_t err;
grub_disk_t disk;
grub_cryptodisk_t dev;
+ char *devname;
+ char *devlast;
search_uuid = NULL;
check_boot = state[2].set;
- disk = grub_disk_open (args[0]);
+ devname = args[0];
+ if (devname[0] == '(' && *(devlast = &devname[grub_strlen (devname) - 1]) == ')')
+ {
+ *devlast = '\0';
+ disk = grub_disk_open (devname + 1);
+ *devlast = ')';
+ }
+ else
+ disk = grub_disk_open (devname);
if (!disk)
return grub_errno;
diff --git a/grub-core/fs/ufs.c b/grub-core/fs/ufs.c
index bd0cd1f..74a4a40 100644
--- a/grub-core/fs/ufs.c
+++ b/grub-core/fs/ufs.c
@@ -49,18 +49,30 @@ GRUB_MOD_LICENSE ("GPLv3+");
#define GRUB_UFS_VOLNAME_LEN 32
+#ifdef MODE_BIGENDIAN
+#define grub_ufs_to_cpu16 grub_be_to_cpu16
+#define grub_ufs_to_cpu32 grub_be_to_cpu32
+#define grub_ufs_to_cpu64 grub_be_to_cpu64
+#define grub_cpu_to_ufs32_compile_time grub_cpu_to_be32_compile_time
+#else
+#define grub_ufs_to_cpu16 grub_le_to_cpu16
+#define grub_ufs_to_cpu32 grub_le_to_cpu32
+#define grub_ufs_to_cpu64 grub_le_to_cpu64
+#define grub_cpu_to_ufs32_compile_time grub_cpu_to_le32_compile_time
+#endif
+
/* Calculate in which group the inode can be found. */
-#define UFS_BLKSZ(sblock) (grub_le_to_cpu32 (sblock->bsize))
+#define UFS_BLKSZ(sblock) (grub_ufs_to_cpu32 (sblock->bsize))
#define UFS_LOG_BLKSZ(sblock) (data->log2_blksz)
#ifdef MODE_UFS2
-#define INODE_ENDIAN(data,field,bits1,bits2) grub_le_to_cpu##bits2 (data->inode.field)
+#define INODE_ENDIAN(data,field,bits1,bits2) grub_ufs_to_cpu##bits2 (data->inode.field)
#else
-#define INODE_ENDIAN(data,field,bits1,bits2) grub_le_to_cpu##bits1 (data->inode.field)
+#define INODE_ENDIAN(data,field,bits1,bits2) grub_ufs_to_cpu##bits1 (data->inode.field)
#endif
-#define INODE_SIZE(data) grub_le_to_cpu64 (data->inode.size)
-#define INODE_MODE(data) grub_le_to_cpu16 (data->inode.mode)
+#define INODE_SIZE(data) grub_ufs_to_cpu64 (data->inode.size)
+#define INODE_MODE(data) grub_ufs_to_cpu16 (data->inode.mode)
#ifdef MODE_UFS2
#define LOG_INODE_BLKSZ 3
#else
@@ -139,9 +151,9 @@ struct grub_ufs_inode
grub_uint64_t mtime;
grub_uint64_t ctime;
grub_uint64_t create_time;
- grub_uint32_t atime_sec;
- grub_uint32_t mtime_sec;
- grub_uint32_t ctime_sec;
+ grub_uint32_t atime_usec;
+ grub_uint32_t mtime_usec;
+ grub_uint32_t ctime_usec;
grub_uint32_t create_time_sec;
grub_uint32_t gen;
grub_uint32_t kernel_flags;
@@ -169,9 +181,12 @@ struct grub_ufs_inode
grub_uint16_t uid;
grub_uint16_t gid;
grub_uint64_t size;
- grub_uint64_t atime;
- grub_uint64_t mtime;
- grub_uint64_t ctime;
+ grub_uint32_t atime;
+ grub_uint32_t atime_usec;
+ grub_uint32_t mtime;
+ grub_uint32_t mtime_usec;
+ grub_uint32_t ctime;
+ grub_uint32_t ctime_usec;
union
{
struct
@@ -234,7 +249,7 @@ grub_ufs_get_file_block (struct grub_ufs_data *data, grub_disk_addr_t blk)
if (blk < GRUB_UFS_DIRBLKS)
return INODE_DIRBLOCKS (data, blk);
- log2_blksz = grub_le_to_cpu32 (data->sblock.log2_blksz);
+ log2_blksz = grub_ufs_to_cpu32 (data->sblock.log2_blksz);
blk -= GRUB_UFS_DIRBLKS;
@@ -366,7 +381,7 @@ grub_ufs_read_file (struct grub_ufs_data *data,
{
data->disk->read_hook = read_hook;
grub_disk_read (data->disk,
- blknr << grub_le_to_cpu32 (data->sblock.log2_blksz),
+ blknr << grub_ufs_to_cpu32 (data->sblock.log2_blksz),
skipfirst, blockend, buf);
data->disk->read_hook = 0;
if (grub_errno)
@@ -389,17 +404,17 @@ grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode)
struct grub_ufs_sblock *sblock = &data->sblock;
/* Determine the group the inode is in. */
- int group = ino / grub_le_to_cpu32 (sblock->ino_per_group);
+ int group = ino / grub_ufs_to_cpu32 (sblock->ino_per_group);
/* Determine the inode within the group. */
- int grpino = ino % grub_le_to_cpu32 (sblock->ino_per_group);
+ int grpino = ino % grub_ufs_to_cpu32 (sblock->ino_per_group);
/* The first block of the group. */
- int grpblk = group * (grub_le_to_cpu32 (sblock->frags_per_group));
+ int grpblk = group * (grub_ufs_to_cpu32 (sblock->frags_per_group));
#ifndef MODE_UFS2
- grpblk += grub_le_to_cpu32 (sblock->cylg_offset)
- * (group & (~grub_le_to_cpu32 (sblock->cylg_mask)));
+ grpblk += grub_ufs_to_cpu32 (sblock->cylg_offset)
+ * (group & (~grub_ufs_to_cpu32 (sblock->cylg_mask)));
#endif
if (!inode)
@@ -409,8 +424,8 @@ grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode)
}
grub_disk_read (data->disk,
- ((grub_le_to_cpu32 (sblock->inoblk_offs) + grpblk)
- << grub_le_to_cpu32 (data->sblock.log2_blksz))
+ ((grub_ufs_to_cpu32 (sblock->inoblk_offs) + grpblk)
+ << grub_ufs_to_cpu32 (data->sblock.log2_blksz))
+ grpino / UFS_INODE_PER_BLOCK,
(grpino % UFS_INODE_PER_BLOCK)
* sizeof (struct grub_ufs_inode),
@@ -501,7 +516,7 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path)
#ifdef MODE_UFS2
namelen = dirent.namelen_bsd;
#else
- namelen = grub_le_to_cpu16 (dirent.namelen);
+ namelen = grub_ufs_to_cpu16 (dirent.namelen);
#endif
{
char filename[namelen + 1];
@@ -515,7 +530,7 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path)
if (!grub_strcmp (name, filename))
{
dirino = data->ino;
- grub_ufs_read_inode (data, grub_le_to_cpu32 (dirent.ino), 0);
+ grub_ufs_read_inode (data, grub_ufs_to_cpu32 (dirent.ino), 0);
if ((INODE_MODE(data) & GRUB_UFS_ATTR_TYPE)
== GRUB_UFS_ATTR_LNK)
@@ -547,7 +562,7 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path)
}
}
- pos += grub_le_to_cpu16 (dirent.direntlen);
+ pos += grub_ufs_to_cpu16 (dirent.direntlen);
} while (pos < INODE_SIZE (data));
grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), path);
@@ -576,12 +591,12 @@ grub_ufs_mount (grub_disk_t disk)
/* No need to byteswap bsize in this check. It works the same on both
endiannesses. */
- if (grub_le_to_cpu32 (data->sblock.magic) == GRUB_UFS_MAGIC
+ if (data->sblock.magic == grub_cpu_to_ufs32_compile_time (GRUB_UFS_MAGIC)
&& data->sblock.bsize != 0
&& ((data->sblock.bsize & (data->sblock.bsize - 1)) == 0))
{
for (data->log2_blksz = 0;
- (1U << data->log2_blksz) < grub_le_to_cpu32 (data->sblock.bsize);
+ (1U << data->log2_blksz) < grub_ufs_to_cpu32 (data->sblock.bsize);
data->log2_blksz++);
data->disk = disk;
@@ -649,10 +664,13 @@ grub_ufs_dir (grub_device_t device, const char *path,
(char *) &dirent) < 0)
break;
+ if (dirent.direntlen == 0)
+ break;
+
#ifdef MODE_UFS2
namelen = dirent.namelen_bsd;
#else
- namelen = grub_le_to_cpu16 (dirent.namelen);
+ namelen = grub_ufs_to_cpu16 (dirent.namelen);
#endif
{
@@ -667,18 +685,23 @@ grub_ufs_dir (grub_device_t device, const char *path,
break;
filename[namelen] = '\0';
- grub_ufs_read_inode (data, dirent.ino, (char *) &inode);
+ grub_ufs_read_inode (data, grub_ufs_to_cpu32 (dirent.ino),
+ (char *) &inode);
- info.dir = ((grub_le_to_cpu16 (inode.mode) & GRUB_UFS_ATTR_TYPE)
+ info.dir = ((grub_ufs_to_cpu16 (inode.mode) & GRUB_UFS_ATTR_TYPE)
== GRUB_UFS_ATTR_DIR);
- info.mtime = grub_le_to_cpu64 (inode.mtime);
+#ifdef MODE_UFS2
+ info.mtime = grub_ufs_to_cpu64 (inode.mtime);
+#else
+ info.mtime = grub_ufs_to_cpu32 (inode.mtime);
+#endif
info.mtimeset = 1;
if (hook (filename, &info))
break;
}
- pos += grub_le_to_cpu16 (dirent.direntlen);
+ pos += grub_ufs_to_cpu16 (dirent.direntlen);
}
fail:
@@ -773,8 +796,8 @@ grub_ufs_uuid (grub_device_t device, char **uuid)
data = grub_ufs_mount (disk);
if (data && (data->sblock.uuidhi != 0 || data->sblock.uuidlow != 0))
*uuid = grub_xasprintf ("%08x%08x",
- (unsigned) grub_le_to_cpu32 (data->sblock.uuidhi),
- (unsigned) grub_le_to_cpu32 (data->sblock.uuidlow));
+ (unsigned) grub_ufs_to_cpu32 (data->sblock.uuidhi),
+ (unsigned) grub_ufs_to_cpu32 (data->sblock.uuidlow));
else
*uuid = NULL;
@@ -799,10 +822,10 @@ grub_ufs_mtime (grub_device_t device, grub_int32_t *tm)
*tm = 0;
else
{
- *tm = grub_le_to_cpu32 (data->sblock.mtime);
+ *tm = grub_ufs_to_cpu32 (data->sblock.mtime);
#ifdef MODE_UFS2
- if (*tm < (grub_int64_t) grub_le_to_cpu64 (data->sblock.mtime2))
- *tm = grub_le_to_cpu64 (data->sblock.mtime2);
+ if (*tm < (grub_int64_t) grub_ufs_to_cpu64 (data->sblock.mtime2))
+ *tm = grub_ufs_to_cpu64 (data->sblock.mtime2);
#endif
}
@@ -820,8 +843,12 @@ static struct grub_fs grub_ufs_fs =
#ifdef MODE_UFS2
.name = "ufs2",
#else
+#ifdef MODE_BIGENDIAN
+ .name = "ufs1_be",
+#else
.name = "ufs1",
#endif
+#endif
.dir = grub_ufs_dir,
.open = grub_ufs_open,
.read = grub_ufs_read,
@@ -839,8 +866,12 @@ static struct grub_fs grub_ufs_fs =
#ifdef MODE_UFS2
GRUB_MOD_INIT(ufs2)
#else
+#ifdef MODE_BIGENDIAN
+GRUB_MOD_INIT(ufs1_be)
+#else
GRUB_MOD_INIT(ufs1)
#endif
+#endif
{
grub_fs_register (&grub_ufs_fs);
my_mod = mod;
@@ -849,8 +880,12 @@ GRUB_MOD_INIT(ufs1)
#ifdef MODE_UFS2
GRUB_MOD_FINI(ufs2)
#else
+#ifdef MODE_BIGENDIAN
+GRUB_MOD_FINI(ufs1_be)
+#else
GRUB_MOD_FINI(ufs1)
#endif
+#endif
{
grub_fs_unregister (&grub_ufs_fs);
}
diff --git a/grub-core/fs/ufs_be.c b/grub-core/fs/ufs_be.c
new file mode 100644
index 0000000..a58f75a
--- /dev/null
+++ b/grub-core/fs/ufs_be.c
@@ -0,0 +1,2 @@
+#define MODE_BIGENDIAN 1
+#include "ufs.c"
diff --git a/grub-core/gfxmenu/view.c b/grub-core/gfxmenu/view.c
index 9023fd3..1918ea4 100644
--- a/grub-core/gfxmenu/view.c
+++ b/grub-core/gfxmenu/view.c
@@ -361,11 +361,42 @@ grub_gfxmenu_draw_terminal_box (void)
static void
init_terminal (grub_gfxmenu_view_t view)
{
- term_rect.width = view->screen.width * 7 / 10;
+ const int border_width = 3;
+
+ grub_font_t terminal_font;
+
+ unsigned int line_width;
+
+ struct grub_font_glyph *glyph;
+
+ terminal_font = grub_font_get (view->terminal_font_name);
+ if (!terminal_font)
+ {
+ grub_error (GRUB_ERR_BAD_FONT, "no font loaded");
+ return;
+ }
+
+ glyph = grub_font_get_glyph (terminal_font, 'M');
+
+ line_width = ((glyph ? glyph->device_width : 8) * 80 + 2 * border_width);
+
+ if (view->screen.width <= line_width)
+ /* The screen is too small. Use all space, except a small border
+ to show the user, it is a window and not full screen: */
+ term_rect.width = view->screen.width - 6 * border_width;
+ else
+ {
+ /* The screen is big enough. Try 70% of the screen width: */
+ term_rect.width = view->screen.width * 7 / 10;
+ /* Make sure, that we use at least the line_width: */
+ if ( term_rect.width < line_width )
+ term_rect.width = line_width;
+ }
+
term_rect.height = view->screen.height * 7 / 10;
- term_rect.x = view->screen.x + view->screen.width * (10 - 7) / 10 / 2;
- term_rect.y = view->screen.y + view->screen.height * (10 - 7) / 10 / 2;
+ term_rect.x = view->screen.x + (view->screen.width - term_rect.width) / 2;
+ term_rect.y = view->screen.y + (view->screen.height - term_rect.height) / 2;
term_view = view;
@@ -375,7 +406,8 @@ init_terminal (grub_gfxmenu_view_t view)
grub_gfxterm_set_window (GRUB_VIDEO_RENDER_TARGET_DISPLAY, term_rect.x,
term_rect.y,
term_rect.width, term_rect.height,
- view->double_repaint, view->terminal_font_name, 3);
+ view->double_repaint, terminal_font,
+ border_width);
grub_gfxterm_decorator_hook = grub_gfxmenu_draw_terminal_box;
}
diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
index 7d03a8a..14dcdf0 100644
--- a/grub-core/kern/ieee1275/init.c
+++ b/grub-core/kern/ieee1275/init.c
@@ -82,18 +82,30 @@ void (*grub_ieee1275_net_config) (const char *dev,
void
grub_machine_get_bootlocation (char **device, char **path)
{
- char bootpath[64]; /* XXX check length */
+ char *bootpath;
+ grub_ssize_t bootpath_size;
char *filename;
char *type;
-
- if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", &bootpath,
- sizeof (bootpath), 0))
+
+ if (grub_ieee1275_get_property_length (grub_ieee1275_chosen, "bootpath",
+ &bootpath_size)
+ || bootpath_size <= 0)
{
/* Should never happen. */
grub_printf ("/chosen/bootpath property missing!\n");
return;
}
+ bootpath = (char *) grub_malloc ((grub_size_t) bootpath_size + 64);
+ if (! bootpath)
+ {
+ grub_print_error ();
+ return;
+ }
+ grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", bootpath,
+ (grub_size_t) bootpath_size + 1, 0);
+ bootpath[bootpath_size] = '\0';
+
/* Transform an OF device path to a GRUB path. */
type = grub_ieee1275_get_device_type (bootpath);
@@ -132,6 +144,7 @@ grub_machine_get_bootlocation (char **device, char **path)
*path = filename;
}
}
+ grub_free (bootpath);
}
/* Claim some available memory in the first /memory node. */
diff --git a/grub-core/loader/arm/uboot/linux.c b/grub-core/loader/arm/linux.c
index 610809d..f480450 100644
--- a/grub-core/loader/arm/uboot/linux.c
+++ b/grub-core/loader/arm/linux.c
@@ -26,7 +26,6 @@
#include <grub/cache.h>
#include <grub/cpu/linux.h>
#include <grub/lib/cmdline.h>
-#include <grub/uboot/uboot.h>
#include <libfdt.h>
@@ -365,10 +364,10 @@ GRUB_MOD_INIT (linux)
cmd_devicetree = grub_register_command ("devicetree", grub_cmd_devicetree,
0, N_("Load DTB file."));
my_mod = mod;
- firmware_boot_data = uboot_get_boot_data ();
+ firmware_boot_data = firmware_get_boot_data ();
boot_data = (grub_addr_t) NULL;
- machine_type = uboot_get_machine_type ();
+ machine_type = firmware_get_machine_type ();
}
GRUB_MOD_FINI (linux)
diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c
index bc07d53..f36d4cd 100644
--- a/grub-core/net/bootp.c
+++ b/grub-core/net/bootp.c
@@ -122,7 +122,7 @@ parse_dhcp_vendor (const char *name, void *vend, int limit, int *mask)
ptr += 4;
}
}
- break;
+ continue;
case GRUB_NET_BOOTP_HOSTNAME:
set_env_limn_ro (name, "hostname", (char *) ptr, taglength);
break;
diff --git a/grub-core/term/gfxterm.c b/grub-core/term/gfxterm.c
index c995b84..12567d1 100644
--- a/grub-core/term/gfxterm.c
+++ b/grub-core/term/gfxterm.c
@@ -201,7 +201,7 @@ grub_virtual_screen_free (void)
static grub_err_t
grub_virtual_screen_setup (unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
- const char *font_name)
+ grub_font_t font)
{
unsigned int i;
@@ -209,10 +209,7 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y,
grub_virtual_screen_free ();
/* Initialize with default data. */
- virtual_screen.font = grub_font_get (font_name);
- if (!virtual_screen.font)
- return grub_error (GRUB_ERR_BAD_FONT,
- "no font loaded");
+ virtual_screen.font = font;
virtual_screen.width = width;
virtual_screen.height = height;
virtual_screen.offset_x = x;
@@ -282,7 +279,7 @@ grub_err_t
grub_gfxterm_set_window (struct grub_video_render_target *target,
int x, int y, int width, int height,
int double_repaint,
- const char *font_name, int border_width)
+ grub_font_t font, int border_width)
{
/* Clean up any prior instance. */
destroy_window ();
@@ -294,7 +291,7 @@ grub_gfxterm_set_window (struct grub_video_render_target *target,
if (grub_virtual_screen_setup (border_width, border_width,
width - 2 * border_width,
height - 2 * border_width,
- font_name)
+ font)
!= GRUB_ERR_NONE)
{
return grub_errno;
@@ -321,6 +318,7 @@ grub_gfxterm_fullscreen (void)
grub_video_color_t color;
grub_err_t err;
int double_redraw;
+ grub_font_t font;
err = grub_video_get_info (&mode_info);
/* Figure out what mode we ended up. */
@@ -346,12 +344,16 @@ grub_gfxterm_fullscreen (void)
if (! font_name)
font_name = ""; /* Allow fallback to any font. */
+ font = grub_font_get (font_name);
+ if (!font)
+ return grub_error (GRUB_ERR_BAD_FONT, "no font loaded");
+
grub_gfxterm_decorator_hook = NULL;
return grub_gfxterm_set_window (GRUB_VIDEO_RENDER_TARGET_DISPLAY,
0, 0, mode_info.width, mode_info.height,
double_redraw,
- font_name, DEFAULT_BORDER_WIDTH);
+ font, DEFAULT_BORDER_WIDTH);
}
static grub_err_t
diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h
index ab7b593..043994b 100644
--- a/include/grub/arm/linux.h
+++ b/include/grub/arm/linux.h
@@ -23,9 +23,14 @@
#define LINUX_ZIMAGE_OFFSET 0x24
#define LINUX_ZIMAGE_MAGIC 0x016f2818
-#define LINUX_ADDRESS (start_of_ram + 0x8000)
-#define LINUX_INITRD_ADDRESS (start_of_ram + 0x02000000)
-#define LINUX_FDT_ADDRESS (LINUX_INITRD_ADDRESS - 0x10000)
+#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 uboot_get_boot_data
+# define firmware_get_machine_type uboot_get_machine_type
+#endif
#define FDT_ADDITIONAL_ENTRIES_SIZE 0x300
diff --git a/include/grub/gfxterm.h b/include/grub/gfxterm.h
index 3fc8d92..361f73e 100644
--- a/include/grub/gfxterm.h
+++ b/include/grub/gfxterm.h
@@ -23,12 +23,13 @@
#include <grub/types.h>
#include <grub/term.h>
#include <grub/video.h>
+#include <grub/font.h>
grub_err_t
EXPORT_FUNC (grub_gfxterm_set_window) (struct grub_video_render_target *target,
int x, int y, int width, int height,
int double_repaint,
- const char *font_name, int border_width);
+ grub_font_t font, int border_width);
typedef void (*grub_gfxterm_repaint_callback_t)(int x, int y,
int width, int height);
diff --git a/include/grub/types.h b/include/grub/types.h
index 3e677c6..22d1be7 100644
--- a/include/grub/types.h
+++ b/include/grub/types.h
@@ -50,7 +50,7 @@
# error "This architecture is not supported because sizeof(void *) != 4 and sizeof(void *) != 8"
#endif
-#if !defined (GRUB_UTIL) & !defined (GRUB_TARGET_WORDSIZE)
+#if !defined (GRUB_UTIL) && !defined (GRUB_TARGET_WORDSIZE)
# if GRUB_TARGET_SIZEOF_VOID_P == 4
# define GRUB_TARGET_WORDSIZE 32
# elif GRUB_TARGET_SIZEOF_VOID_P == 8
diff --git a/util/getroot.c b/util/getroot.c
index c2a25c9..24ce6aa 100644
--- a/util/getroot.c
+++ b/util/getroot.c
@@ -1796,6 +1796,18 @@ convert_system_partition_to_system_disk (const char *os_dev, struct stat *st,
return path;
}
+ if (strncmp ("nbd", p, 3) == 0
+ && p[3] >= '0' && p[3] <= '9')
+ {
+ char *ptr = p + 3;
+ while (*ptr >= '0' && *ptr <= '9')
+ ptr++;
+ if (*ptr)
+ *is_part = 1;
+ *ptr = 0;
+ return path;
+ }
+
/* If this is an IDE, SCSI or Virtio disk. */
if (strncmp ("vdisk", p, 5) == 0
&& p[5] >= 'a' && p[5] <= 'z')
diff --git a/util/grub-install.in b/util/grub-install.in
index 1c34508..6754da0 100644
--- a/util/grub-install.in
+++ b/util/grub-install.in
@@ -488,8 +488,6 @@ if [ x"$grub_modinfo_platform" = xefi ]; then
*)
efi_file=grub.efi ;;
esac
- # TODO: We should also use efibootmgr, if available, to add a Boot
- # entry for ourselves.
fi
efidir="$efidir/EFI/$efi_distributor"
mkdir -p "$efidir" || exit 1
@@ -752,7 +750,7 @@ elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ]
exit 1
fi
- if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" = ELF ] || [ x$("${grub_probe}" -m "${device_map}" -d "${install_device}" -t zero_check) = xtrue ]; then
+ if [ "$(file -s -b -L "${install_device}" | awk '{ print $1 }')" = ELF ] || [ x$("${grub_probe}" -m "${device_map}" -d "${install_device}" -t zero_check) = xtrue ]; then
dd if="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" of="${install_device}" status=noxfer || {
gettext "Failed to copy Grub to the PReP partition." 1>&2
echo 1>&2
diff --git a/util/grub-mkfont.c b/util/grub-mkfont.c
index 4e2c5e4..83fb2d2 100644
--- a/util/grub-mkfont.c
+++ b/util/grub-mkfont.c
@@ -1101,7 +1101,7 @@ argp_parser (int key, char *arg, struct argp_state *state)
arguments->font_info.desc = strtoul (arg, NULL, 0);
break;
- case 'e':
+ case 'c':
arguments->font_info.asce = strtoul (arg, NULL, 0);
break;
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
index d4d0110..ac05ee4 100644
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -174,6 +174,8 @@ boot_device_id=
title_correction_code=
+machine=`uname -m`
+
case "$machine" in
i?86) GENKERNEL_ARCH="x86" ;;
mips|mips64) GENKERNEL_ARCH="mips" ;;