GRUB countdown in VirtualBox

2018-01-25 Thread microsoft gaofei
https://www.virtualbox.org/ticket/17473 . Does GRUB have such a bug which 
causes some sentences missing or invisible ? If you answer me yes ,then the bug 
ticket is invalid . If you answer me no ,then VirtualBox developers should fix 
the bug .
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[HELP] cryptomount is slow, what is the proper way to [PATCH] libgcrypt-grub?

2018-01-25 Thread tomli
phcoder and everyone else on the list, hello.

As many of you know, the builtin LUKS decryption in GRUB is a major feature
that enables many advanced setups, such as coreboot-based Full Disk Encryption.

However, it has been reported [1] the speed of cryptomount is extremely slow.
On my box, if a large number of iterations is used (by default), GNU/Linux takes
2 seconds to derive the LUKS master key, while on GRUB, it takes about 40 
seconds. 

It strongly affects the usability of LUKS on GRUB. On one hand, if user chooses
a large number of iterations, GRUB will take at least 40 seconds to unlock an
encrypted partition. If a typo is made while entering the passphrase, it will
be even slower. It forces many users to choose a smaller number of iterations, 
but
it makes the passphrase more vulnerable to brute-force attacks from modern CPUs
and GPUs with their ever-increasing computational power, and thus discouraged by
LUKS developers. The performance issue must be solved.

I've investigated the cause of the issue, and I found the culprit is the
C-implementation of SHA-512 hash function, which is essential for a 256-bit
encryption setup. Since SHA-512 manipulates 64-bit integers, its performance is
very poor on x86.

Now, I'm working on some GRUB hacking to integrate a SSE2-optimized version of
SHA512 hash function for GRUB on x86. It would boost the performance of key
derivation by 400%. I've already added the implementation to libgcrypt-grub, and
it would be automatically selected based on CPUID, in the same way as libgcrypt
does it in the upstream.

The problem is, when I has finished these improvements, and tried to compile
GRUB, I realized the libgcrypt in GRUB is somehow automatically imported from
the upstream, and preprocessed by import_gcry.py. I've read import_gcry.py and
found it was complicated, it generates new code, compiler flags, etc, and pack
different algorithms to loadable modules.

I have no idea about how to integrate my changes. For example, how to link .c
and .S assembly together in the same GRUB module by changing import_gcry.py?
I can't understand. From some comments, modifications of libgcrypt itself is not
allowed at all, and import_gcry.py should do all the additional fixups?

So what is the proper way to add new code and optimizations to libgcrypt-grub,
and integrate it to GRUB?

Happy Hacking,
Tom Li

[1] http://lists.gnu.org/archive/html/grub-devel/2016-10/msg00018.html

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH] build: Use pkg-config to find Freetype

2018-01-25 Thread Colin Watson
pkg-config is apparently preferred over freetype-config these days (see
the BUGS section of freetype-config(1)).  pkg-config support was added
to Freetype in version 2.1.5, which was released in 2003, so it should
comfortably be available everywhere by now.

Fixes Debian bug #887721.

Reported-by: Hugh McMaster 
Signed-off-by: Colin Watson 
---
 INSTALL   |  9 ---
 Makefile.am   |  6 ++---
 Makefile.util.def |  4 +--
 configure.ac  | 74 +++
 4 files changed, 41 insertions(+), 52 deletions(-)

diff --git a/INSTALL b/INSTALL
index f3c20edc8..899b9cac5 100644
--- a/INSTALL
+++ b/INSTALL
@@ -38,6 +38,7 @@ configuring the GRUB.
 * GNU binutils 2.9.1.0.23 or later
 * Flex 2.5.35 or later
 * Other standard GNU/Unix tools
+* pkg-config
 * a libc with large file support (e.g. glibc 2.1 or later)
 
 On GNU/Linux, you also need:
@@ -158,8 +159,8 @@ For this example the configure line might look like (more 
details below)
 (some options are optional and included here for completeness but some rarely
 used options are omitted):
 
-./configure BUILD_CC=gcc BUILD_FREETYPE=freetype-config --host=amd64-linux-gnu
-CC=amd64-linux-gnu-gcc CFLAGS="-g -O2" FREETYPE=amd64-linux-gnu-freetype-config
+./configure BUILD_CC=gcc BUILD_PKG_CONFIG=pkg-config --host=amd64-linux-gnu
+CC=amd64-linux-gnu-gcc CFLAGS="-g -O2" PKG_CONFIG=amd64-linux-gnu-pkg-config
 --target=arm --with-platform=uboot TARGET_CC=arm-elf-gcc
 TARGET_CFLAGS="-Os -march=armv6" TARGET_CCASFLAGS="-march=armv6"
 TARGET_OBJCOPY="arm-elf-objcopy" TARGET_STRIP="arm-elf-strip"
@@ -176,7 +177,7 @@ corresponding platform are not needed for the platform in 
question.
 2. BUILD_CFLAGS= for C options for build.
 3. BUILD_CPPFLAGS= for C preprocessor options for build.
 4. BUILD_LDFLAGS= for linker options for build.
-5. BUILD_FREETYPE= for freetype-config for build (optional).
+5. BUILD_PKG_CONFIG= for pkg-config for build (optional).
 
   - For host
 1. --host= to autoconf name of host.
@@ -184,7 +185,7 @@ corresponding platform are not needed for the platform in 
question.
 3. HOST_CFLAGS= for C options for host.
 4. HOST_CPPFLAGS= for C preprocessor options for host.
 5. HOST_LDFLAGS= for linker options for host.
-6. FREETYPE= for freetype-config for host (optional).
+6. PKG_CONFIG= for pkg-config for host (optional).
 7. Libdevmapper if any must be in standard linker folders (-ldevmapper) 
(optional).
 8. Libfuse if any must be in standard linker folders (-lfuse) (optional).
 9. Libzfs if any must be in standard linker folders (-lzfs) (optional).
diff --git a/Makefile.am b/Makefile.am
index 7795baeb6..da4e65bcc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -71,7 +71,7 @@ endif
 starfield_theme_files = $(srcdir)/themes/starfield/blob_w.png 
$(srcdir)/themes/starfield/boot_menu_c.png 
$(srcdir)/themes/starfield/boot_menu_e.png 
$(srcdir)/themes/starfield/boot_menu_ne.png 
$(srcdir)/themes/starfield/boot_menu_n.png 
$(srcdir)/themes/starfield/boot_menu_nw.png 
$(srcdir)/themes/starfield/boot_menu_se.png 
$(srcdir)/themes/starfield/boot_menu_s.png 
$(srcdir)/themes/starfield/boot_menu_sw.png 
$(srcdir)/themes/starfield/boot_menu_w.png 
$(srcdir)/themes/starfield/slider_c.png $(srcdir)/themes/starfield/slider_n.png 
$(srcdir)/themes/starfield/slider_s.png 
$(srcdir)/themes/starfield/starfield.png 
$(srcdir)/themes/starfield/terminal_box_c.png 
$(srcdir)/themes/starfield/terminal_box_e.png 
$(srcdir)/themes/starfield/terminal_box_ne.png 
$(srcdir)/themes/starfield/terminal_box_n.png 
$(srcdir)/themes/starfield/terminal_box_nw.png 
$(srcdir)/themes/starfield/terminal_box_se.png 
$(srcdir)/themes/starfield/terminal_box_s.png 
$(srcdir)/themes/starfield/terminal_box_sw.png 
$(srcdir)/themes/starfield/terminal_box_w.png 
$(srcdir)/themes/starfield/theme.txt $(srcdir)/themes/starfield/README 
$(srcdir)/themes/starfield/COPYING.CC-BY-SA-3.0
 
 build-grub-mkfont$(BUILD_EXEEXT): util/grub-mkfont.c grub-core/unidata.c 
grub-core/kern/emu/misc.c util/misc.c
-   $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) 
$(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 
-DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(build_freetype_cflags) 
$(build_freetype_libs)
+   $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) 
$(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 
-DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(build_freetype_CFLAGS) 
$(build_freetype_LIBS)
 CLEANFILES += build-grub-mkfont$(BUILD_EXEEXT)
 
 garbage-gen$(BUILD_EXEEXT): util/garbage-gen.c
@@ -80,11 +80,11 @@ CLEANFILES += garbage-gen$(BUILD_EXEEXT)
 EXTRA_DIST += util/garbage-gen.c
 
 build-grub-gen-asciih$(BUILD_EXEEXT): util/grub-gen-asciih.c
-   $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) 
$(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1