RE: about an grub 2.00 installation error

2014-10-28 Thread Sun, Ning
Another hint is that currently my linux system use gummiboot as default 
bootloader…

Regards,
Sun Ning

From: grub-devel-bounces+ning.sun=intel@gnu.org 
[mailto:grub-devel-bounces+ning.sun=intel@gnu.org] On Behalf Of Sun, Ning
Sent: Monday, October 27, 2014 5:35 PM
To: Grub-devel@gnu.org
Subject: about an grub 2.00 installation error
Importance: High

Hi,
I encountered an error when installing grub 2.00 on my Linux system(boot from 
EFI BIOS), the error showed “source_dir doesn't exist. Please specify --target 
or -directory”
The error occurred after I run this command:
#grub-install -boot-directory=/boot /dev/sda

Is there anyone encountered the similar error and have a solution to it?

Regards,
Sun Ning



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


Re: about an grub 2.00 installation error

2014-10-28 Thread Chris Murphy

On Oct 27, 2014, at 6:34 PM, "Sun, Ning"  wrote:

> Hi,
> I encountered an error when installing grub 2.00 on my Linux system(boot from 
> EFI BIOS), the error showed “source_dir doesn't exist. Please specify 
> --target or –directory”
> The error occurred after I run this command:
> #grub-install –boot-directory=/boot /dev/sda

On EFI just run grub-install with no options, it finds /boot/efi/EFI and if 
necessary creates /boot/efi/EFI/grub and puts grubx64.efi there, and also 
writes an entry in NVRAM so it should get used by default instead of gummiboot.

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


[PATCH] Add support for passing EFI framebuffer into FreeBSD 10.1 and later

2014-10-28 Thread Kris Moore

Got another patch for review today.

This patch adds support for FreeBSD's new VT console driver when booting
in EFI mode on FreeBSD 10.1 and later.

Please let me know any comments, or things that need addressed to get
this merged in.

Thanks!

-- 
Kris Moore
PC-BSD Software
iXsystems

From a9c20c1640cdea0ba902095cb18760f5ebe98875 Mon Sep 17 00:00:00 2001
From: Kris Moore 
Date: Tue, 28 Oct 2014 15:59:59 -0400
Subject: [PATCH 1/2] Add support for passing EFI framebuffer information to
 FreeBSD kernel on FreeBSD 10.1 and later.

---
 grub-core/loader/i386/bsd.c  | 75 
 grub-core/video/efi_gop.c| 14 +++
 include/grub/i386/bsd.h  |  1 +
 include/grub/i386/freebsd_bootinfo.h | 33 
 include/grub/video.h | 18 +
 5 files changed, 141 insertions(+)
 create mode 100644 include/grub/i386/freebsd_bootinfo.h

diff --git grub-core/loader/i386/bsd.c grub-core/loader/i386/bsd.c
index 8f691e0..c685552 100644
--- grub-core/loader/i386/bsd.c
+++ grub-core/loader/i386/bsd.c
@@ -48,6 +48,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
 #ifdef GRUB_MACHINE_EFI
 #include 
 #define NETBSD_DEFAULT_VIDEO_MODE "800x600"
+#define FREEBSD_DEFAULT_VIDEO_MODE "800x600"
 #else
 #define NETBSD_DEFAULT_VIDEO_MODE "text"
 #include 
@@ -584,6 +585,63 @@ freebsd_get_zfs (void)
   grub_free (uuid);
 }
 
+#ifdef GRUB_MACHINE_EFI
+
+static grub_err_t
+grub_freebsd_setup_video (void)
+{
+  struct grub_video_mode_info mode_info;
+  void *framebuffer;
+  const char *modevar;
+  struct grub_freebsd_btinfo_framebuf efifb;
+  grub_err_t err;
+  grub_video_driver_id_t driv_id;
+
+  modevar = grub_env_get ("gfxpayload");
+
+  /* Now all graphical modes are acceptable.
+ May change in future if we have modes without framebuffer.  */
+  if (modevar && *modevar != 0)
+{
+  char *tmp;
+  tmp = grub_xasprintf ("%s;" FREEBSD_DEFAULT_VIDEO_MODE, modevar);
+  if (! tmp)
+   return grub_errno;
+  err = grub_video_set_mode (tmp, 0, 0);
+  grub_free (tmp);
+}
+  else
+err = grub_video_set_mode (FREEBSD_DEFAULT_VIDEO_MODE, 0, 0);
+
+  if (err)
+return err;
+
+  driv_id = grub_video_get_driver_id ();
+  if (driv_id == GRUB_VIDEO_DRIVER_NONE)
+return GRUB_ERR_NONE;
+
+  err = grub_video_get_info_and_fini (&mode_info, &framebuffer);
+
+  if (err)
+return err;
+
+  efifb.fb_width = mode_info.width;
+  efifb.fb_height = mode_info.height;
+  efifb.fb_stride = mode_info.stride;
+
+  efifb.fb_addr = (grub_addr_t) framebuffer;
+  efifb.fb_size = ALIGN_UP (mode_info.pitch * efifb.fb_height, 65536);
+
+  efifb.fb_mask_red = mode_info.red_mask;
+  efifb.fb_mask_green = mode_info.green_mask;
+  efifb.fb_mask_blue = mode_info.blue_mask;
+  efifb.fb_mask_reserved = mode_info.reserved_mask;
+
+  err = grub_bsd_add_meta ( FREEBSD_MODINFO_METADATA | 
FREEBSD_BTINFO_FRAMEBUF, &efifb, sizeof (efifb));
+  return err;
+}
+#endif
+
 static grub_err_t
 grub_freebsd_boot (void)
 {
@@ -687,6 +745,10 @@ grub_freebsd_boot (void)
*(grub_uint32_t *) p_tag = bootflags;
  break;
 
+   case FREEBSD_MODINFO_METADATA | FREEBSD_BTINFO_FRAMEBUF:
+ grub_memcpy (p_tag, tag->data, tag->len);
+ break;
+
case FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_ENVP:
  if (is_64bit)
*(grub_uint64_t *) p_tag = bi.environment;
@@ -716,7 +778,10 @@ grub_freebsd_boot (void)
 
   bi.kern_end = kern_end;
 
+#ifndef GRUB_MACHINE_EFI
+  /* Don't set text mode on EFI boot */
   grub_video_set_mode ("text", 0, 0);
+#endif
 
   if (is_64bit)
 {
@@ -1560,6 +1625,16 @@ grub_cmd_freebsd (grub_extcmd_context_t ctxt, int argc, 
char *argv[])
   FREEBSD_MODINFOMD_KERNEND, &data, len);
  if (err)
return err;
+
+#ifdef GRUB_MACHINE_EFI
+ err = grub_freebsd_setup_video ();
+ if (err)
+ {
+   grub_print_error ();
+   grub_puts_ (N_("Booting in EFI blind mode"));
+   grub_errno = GRUB_ERR_NONE;
+ }
+#endif
}
   grub_bsd_get_device (&freebsd_biosdev, &unit, &slice, &part);
   freebsd_zfsguid = 0;
diff --git grub-core/video/efi_gop.c grub-core/video/efi_gop.c
index 7f9d1c2..cfe0119 100644
--- grub-core/video/efi_gop.c
+++ grub-core/video/efi_gop.c
@@ -180,6 +180,8 @@ grub_video_gop_fill_real_mode_info (unsigned mode,
   out->mode_type = GRUB_VIDEO_MODE_TYPE_RGB;
   out->bpp = grub_video_gop_get_bpp (in);
   out->bytes_per_pixel = out->bpp >> 3;
+  out->stride = in->pixels_per_scanline;
+  out->pixel_format = in->pixel_format;
   if (!out->bpp)
 return grub_error (GRUB_ERR_IO, "unsupported video mode");
   out->pitch = in->pixels_per_scanline * out->bytes_per_pixel;
@@ -195,6 +197,10 @@ grub_video_gop_fill_real_mode_info (unsigned mode,
   out->blue_field_pos = 16;
   out->reserved_mask_size = 8;
   out->reserved_field_pos = 24;
+  out->red_mask

Re: about an grub 2.00 installation error

2014-10-28 Thread Jordan Uggla
On Mon, Oct 27, 2014 at 5:34 PM, Sun, Ning  wrote:
> Hi,
> I encountered an error when installing grub 2.00 on my Linux system(boot
> from EFI BIOS), the error showed “source_dir doesn't exist. Please specify
> --target or –directory”
> The error occurred after I run this command:
> #grub-install –boot-directory=/boot /dev/sda
>
> Is there anyone encountered the similar error and have a solution to it?

grub-devel is for discussion related to the development of GNU GRUB,
not user support. Please send support questions to help-g...@gnu.org
instead.

-- 
Jordan Uggla (Jordan_U on irc.freenode.net)

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


RE: about an grub 2.00 installation error

2014-10-28 Thread Sun, Ning
Same message printed on the screen when just run grub-install, suspect it is 
grub 2.0 bug or defect….

Regards,
Sun Ning

From: grub-devel-bounces+ning.sun=intel@gnu.org 
[mailto:grub-devel-bounces+ning.sun=intel@gnu.org] On Behalf Of Chris Murphy
Sent: Tuesday, October 28, 2014 11:20 AM
To: The development of GNU GRUB
Subject: Re: about an grub 2.00 installation error
Importance: High


On Oct 27, 2014, at 6:34 PM, "Sun, Ning" 
mailto:ning@intel.com>> wrote:


Hi,
I encountered an error when installing grub 2.00 on my Linux system(boot from 
EFI BIOS), the error showed “source_dir doesn't exist. Please specify --target 
or -directory”
The error occurred after I run this command:
#grub-install -boot-directory=/boot /dev/sda

On EFI just run grub-install with no options, it finds /boot/efi/EFI and if 
necessary creates /boot/efi/EFI/grub and puts grubx64.efi there, and also 
writes an entry in NVRAM so it should get used by default instead of gummiboot.

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


Error when building module with efi's "grub_efi_get_variable" function

2014-10-28 Thread Mat Troi
Hi,

This is my Makefile.core.def:
...
...
module = {
  name = mymod;
  common = net/mymod.c;
};
...
...

When I tried to build I get:
mv syminfo.lst.new syminfo.lst
cat syminfo.lst | sort | gawk -f
/build/boot_project/src/grub/grub2/grub-core/genmoddep.awk >
moddep.lst || (rm -f moddep.lst; exit 1)
grub_efi_get_variable in mymod is not defined
make[5]: *** [moddep.lst] Error 1

mymod.c has "#include " and tries to use
"grub_efi_get_variable" function.  I see that in syminfo.lst
> more syminfo.lst
...
undefined mymod grub_efi_get_variable
...

Can someone shed a light on the error and how to fix?

Thanks,
Matt

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