Fix serial output for OpenBSD current

2014-02-02 Thread Markus Müller
Hi all,

attached is a patch that fixes serial console output with OpenBSD
current (will be 5.5). Grub uses an old struct for providing the kernel
with information about the serial console that is now gone [1]. Since
the new way is in OpenBSD since 5.2, even older versions are still
supported with this patch.

Regards,
Markus


[1] http://marc.info/?l=openbsd-cvs&m=138340457301045
diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c
index ea0edfa..c1d2856 100644
--- a/grub-core/loader/i386/bsd.c
+++ b/grub-core/loader/i386/bsd.c
@@ -1646,6 +1646,7 @@ grub_cmd_openbsd (grub_extcmd_context_t ctxt, int argc, char *argv[])
 
   serial.device = (GRUB_OPENBSD_COM_MAJOR << 8) | port;
   serial.speed = speed;
+  serial.address = -1;
 	  
   grub_bsd_add_meta (OPENBSD_BOOTARG_CONSOLE, &serial, sizeof (serial));
   bootflags |= OPENBSD_RB_SERCONS;
@@ -1656,6 +1657,7 @@ grub_cmd_openbsd (grub_extcmd_context_t ctxt, int argc, char *argv[])
 
   grub_memset (&serial, 0, sizeof (serial));
   serial.device = (GRUB_OPENBSD_VGA_MAJOR << 8);
+  serial.address = -1;
   grub_bsd_add_meta (OPENBSD_BOOTARG_CONSOLE, &serial, sizeof (serial));
   bootflags &= ~OPENBSD_RB_SERCONS;
 }
diff --git a/include/grub/i386/openbsd_bootarg.h b/include/grub/i386/openbsd_bootarg.h
index 01ca486..0166e3f 100644
--- a/include/grub/i386/openbsd_bootarg.h
+++ b/include/grub/i386/openbsd_bootarg.h
@@ -73,9 +73,11 @@ struct grub_openbsd_bootargs
 
 struct grub_openbsd_bootarg_console
 {
-  grub_uint32_t device;
-  grub_uint32_t speed;
-};
+  grub_int32_t device;
+  grub_int32_t speed;
+  grub_int32_t address;
+  grub_int32_t frequency;
+} GRUB_PACKED;
 
 struct grub_openbsd_bootarg_pcibios
 {
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Bootable raid1 on UEFI

2014-02-02 Thread Chris Murphy
Simple case on BIOS: two disks that we want to boot linux from reliably even in 
the face of a one disk failure. 

Therefore /boot is on an md raid1 device. All of the md raid1 member disks have 
sufficient MBR gap for grub-install to be executed on each disk. Only one 
grub.cfg is needed at /boot/grub and as that single file is updated, it's 
mirrored on all member disks. It's very straight forward with existing 
grub-install and grub-mkconfig tools.

However, it's not so straightforward on UEFI with Secure Boot. I can manually 
create an ESP on each member disk, and copy signed grubx64.efi to each ESP, and 
place a grub.cfg [1] on each ESP that forwards to the "real" 
/boot/grub/grub.cfg on the md device. But how does upstream intend this to be 
done with existing tools? 


Chris Murphy


[1]

# forward to real config
  search --no-floppy --fs-uuid --set=root --hint-bios=hd$d,gpt2 
--hint-efi=hd$d,gpt2 --hint-baremetal=ahci$d,gpt2  
d7bc9d0e-7706-44f9-b1a7-ff24b7c360a7
  configfile /boot/grub2/grub.cfg


$d is for each disk so that the hint is only looking for the fs-uuid on the 
local disk first. The /boot/grub2/grub.cfg is on md raid1 (it could also be 
raid10, or raid5 or Btrfs raid1, 10 so there are many other use cases.) 
Alternatively the ESPs each have a "real" grub.cfg, both of which need to be 
updated any time there's a kernel update, which is a problem because only one 
ESP is mounted at /boot/efi.
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


grub2 code

2014-02-02 Thread Robert Parnell
Hi

I was just looking at the grub2 source code and saw that
https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/grub2/trusty/view/head:/TODO

says to contact with questions.
I was looking at the source because I encountered a bug on my machine 
that has been previously reported
(https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1027694) and
thought I'd have a look to see if I could find the problem.
So I have 2 questions:
1. Is the code on launchpad the up to date code?
2. Line 177 of
https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/grub2/trusty/view/head:/grub-core/boot/i386/pc/startup_raw.S

is a function that flushes the keyboard buffer, could this be what is
causing the bug?

Sorry if 2 seems like a stupid question- I've never looked at the grub
source code before.

Thanks

Rob


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


Re: grub2 code

2014-02-02 Thread SevenBits
On Sunday, February 2, 2014, Robert Parnell  wrote:

> Hi
>
> I was just looking at the grub2 source code and saw that
>
> https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/grub2/trusty/view/head:/TODO
> <
> https://bazaar.launchpad.net/%7Eubuntu-branches/ubuntu/trusty/grub2/trusty/view/head:/TODO
> >
> says to contact with questions.
> I was looking at the source because I encountered a bug on my machine
> that has been previously reported
> (https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1027694) and
> thought I'd have a look to see if I could find the problem.
> So I have 2 questions:
> 1. Is the code on launchpad the up to date code?


That is probably maintained by the Ubuntu people, so I'd consult them. This
list is generally for general and not distribution specific code since
every distro can potentially use their own modified copies of GRUB.


> 2. Line 177 of
>
> https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/grub2/trusty/view/head:/grub-core/boot/i386/pc/startup_raw.S
> <
> https://bazaar.launchpad.net/%7Eubuntu-branches/ubuntu/trusty/grub2/trusty/view/head:/grub-core/boot/i386/pc/startup_raw.S
> >
> is a function that flushes the keyboard buffer, could this be what is
> causing the bug?
>
> Sorry if 2 seems like a stupid question- I've never looked at the grub
> source code before.
>
> Thanks
>
> Rob
>
>
> ___
> Grub-devel mailing list
> Grub-devel@gnu.org 
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel