[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Grub2 efi compiling

From: Mario
Subject: Re: Grub2 efi compiling
Date: Tue, 30 Dec 2014 20:56:01 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0

On 12/30/2014 04:22 AM, Andrei Borzenkov wrote:
В Mon, 29 Dec 2014 19:22:42 +0100
address@hidden пишет:


I use grub from debian on my tablet and it works fine (altough it need
external keyboard to select menu entries).

I'm trying to recompile grub-1.99 from debian source. I'd like add
tablet keys up/down to select grub menu items.

I made my changes to grub-core/menu.c and I done:

./configure --disable-werror

output ends with:

GRUB2 will be compiled with following components:
Platform: i386-pc

This is default platform on x86 (legacy BIOS).

With devmapper support: No (need libdevmapper header)
With memory debugging: No
efiemu runtime: Yes
grub-mkfont: No (need freetype2 library)

but debian original file
/boot/grub/normal.mod: ELF 64-bit LSB relocatable, x86-64, version 1
(SYSV), not stripped

I executed make (for test) and normal.mod was 32bit. Grub failed to start.

I tryed:

./configure --with-platform=x86_64-pc --disable-werror

This does not exist. "pc" platform is always 32 bit, so only i386-pc is
available. Also your subject says "EFI" so you probably want


It will default to 64 bit if you build on 64 bit system.

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
configure: error: platform "x86_64-pc" is not supported for target CPU

I also tried with the same

How can I configure grub soure for x86_64?

Thanks in advance

Help-grub mailing list

Help-grub mailing list


--with-platform=efi worked.

Below is my workaround for tablet side buttons vol up/down.


Tablet has only three physical buttons, which are power, vol-up and vol-down.

1) Power has no effect on edit screen of grub so I can't use it.

2) Vol-up and vol-down move cursor up and down with speed uncontrollably. I think uefi firmware is bugged and stroke delay and repeat are too short and too fast.


2) After you get character wait not less of 150mS before parse another.

1) Only for arrow keys (tablet vol-up, vol-down send arrow keys codes) GRUB timeout is not interrupted, so you can select item and at timeout start without use of another key.

Now I can start android or debian without external keyboard.

diff grub-core/normal/menu.c.orig grub-core/normal/menu.c
<   grub_uint64_t saved_time;
>   grub_uint64_t saved_time,lastkey_time;
<   int timeout;
>   int timeout,arrowskeys=0;
>   lastkey_time = grub_get_time_ms ();
<           *auto_boot = 1;
<      menu_fini ();
<      return default_entry;
>      if (!arrowskeys)
>            {
>              *auto_boot = 1;
>         menu_fini ();
>         return default_entry;
>            }
>           else
>            {
>         menu_fini ();
>              *auto_boot = 0;
>         return current_entry;
>            }
<      if (timeout >= 0)
>      if (timeout >= 0 )
<          grub_env_unset ("timeout");
<          grub_env_unset ("fallback");
<          clear_timeout ();
>          if (c==GRUB_TERM_KEY_UP||c==GRUB_TERM_KEY_DOWN) arrowskeys=1;
>            else
>                   {
>                     arrowskeys=0;
>                grub_env_unset ("timeout");
>                grub_env_unset ("fallback");
>                clear_timeout ();
>                   }
>      grub_uint64_t current_time;
>      current_time = grub_get_time_ms ();
>      if (current_time - lastkey_time > 150)
>        {
>          lastkey_time = grub_get_time_ms ();
>        }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]