boot directory prefix in grub-install (even with --root-directory)

2009-12-22 Thread Grégoire Sutre

Hi,

grub-install copies GRUB images into ${rootdir}/boot/grub (where 
${rootdir} is empty by default and can be changed with --root-directory).


To install GRUB files on a partition that contains a /boot file, one 
must specify a non-empty --root-directory, and grub files are then 
copied into /DIR/boot/grub.  Or one could mount the partition on a mount 
point of the form DIR/boot and specify --root-directory=DIR to force 
installation into the /grub directory of the partition.  Both solutions 
are not completely satisfactory.  Is there a better one?


The problem arises e.g. with NetBSD which uses /boot for its own 
bootloader.  The script util/grub-install.in contains lines to take care 
of that situation (lines 160-172), but these lines rely on a variable 
${host_os} that is not set.  This might be deprecated code from GRUB 
Legacy's grub-install, where ${host_os} is set by a configure substitution.


An alternative solution would be to have grub-install install in 
${rootdir}/grub, with ${rootdir} equal to /boot by default.  The default 
behavior (with no --root-directory) would be the same.


The following patch implements this alternative.

Thanks for your time,

Grégoire

--- util/grub-install.in.orig   2009-12-22 11:26:01.538833717 +0100
+++ util/grub-install.in2009-12-22 12:48:55.979476412 +0100
@@ -39,8 +39,7 @@
 fi
 grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
 grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
-rootdir=
-grub_prefix=`echo /boot/grub | sed ${transform}`
+rootdir=/boot
 modules=

 install_device=
@@ -66,7 +65,7 @@
   -v, --version   print the version information and exit
   --modules=MODULES   pre-load specified modules MODULES
   --root-directory=DIRinstall GRUB images under the directory DIR
-  instead of the root directory
+  instead of ${rootdir}
   --grub-setup=FILE   use FILE as grub-setup
   --grub-mkimage=FILE use FILE as grub-mkimage
   --grub-mkdevicemap=FILE use FILE as grub-mkdevicemap
@@ -84,7 +83,7 @@

 INSTALL_DEVICE can be a GRUB device name or a system device filename.

-grub-install copies GRUB images into the DIR/boot directory specified by
+grub-install copies GRUB images into the DIR/`echo grub | sed 
${transform}` directory specified by

 --root-directory, and uses grub-setup to install grub into the boot
 sector.

@@ -157,21 +156,7 @@
 setup_verbose="--verbose"
 fi

-# Initialize these directories here, since ROOTDIR was initialized.
-case "$host_os" in
-netbsd* | openbsd*)
-# Because /boot is used for the boot block in NetBSD and OpenBSD, 
use /grub

-# instead of /boot/grub.
-grub_prefix=`echo /grub | sed ${transform}`
-bootdir=${rootdir}
-;;
-*)
-# Use /boot/grub by default.
-bootdir=${rootdir}/boot
-;;
-esac
-
-grubdir=${bootdir}/`echo grub | sed ${transform}`
+grubdir=${rootdir}/`echo grub | sed ${transform}`
 device_map=${grubdir}/device.map

 grub_probe="${grub_probe} --device-map=${device_map}"
@@ -204,8 +189,7 @@
 fi

 # Create the GRUB directory if it is not present.
-test -d "$bootdir" || mkdir "$bootdir" || exit 1
-test -d "$grubdir" || mkdir "$grubdir" || exit 1
+mkdir -p "$grubdir" || exit 1

 # If --recheck is specified, remove the device map, if present.
 if test $recheck = yes; then


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


Re: boot directory prefix in grub-install (even with --root-directory)

2009-12-22 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Grégoire Sutre wrote:
> Hi,
>
> grub-install copies GRUB images into ${rootdir}/boot/grub (where
> ${rootdir} is empty by default and can be changed with --root-directory).
>
> To install GRUB files on a partition that contains a /boot file, one
> must specify a non-empty --root-directory, and grub files are then
> copied into /DIR/boot/grub.  Or one could mount the partition on a
> mount point of the form DIR/boot and specify --root-directory=DIR to
> force installation into the /grub directory of the partition.  Both
> solutions are not completely satisfactory.  Is there a better one?
>
> The problem arises e.g. with NetBSD which uses /boot for its own
> bootloader.  The script util/grub-install.in contains lines to take
> care of that situation (lines 160-172), but these lines rely on a
> variable ${host_os} that is not set.  This might be deprecated code
> from GRUB Legacy's grub-install, where ${host_os} is set by a
> configure substitution.
>
> An alternative solution would be to have grub-install install in
> ${rootdir}/grub, with ${rootdir} equal to /boot by default.  The
> default behavior (with no --root-directory) would be the same.
The main problem is with scripts already using --root-directory and
relying on existing behaviour. I propose add a new option
--grub-directory=DIR
which defaults to ROOTDIR/boot/grub
What do you think about this?
>
> The following patch implements this alternative.
>
> Thanks for your time,
>
> Grégoire
>
> --- util/grub-install.in.orig2009-12-22 11:26:01.538833717 +0100
> +++ util/grub-install.in2009-12-22 12:48:55.979476412 +0100
> @@ -39,8 +39,7 @@
>  fi
>  grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
>  grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
> -rootdir=
> -grub_prefix=`echo /boot/grub | sed ${transform}`
> +rootdir=/boot
>  modules=
>
>  install_device=
> @@ -66,7 +65,7 @@
>-v, --version   print the version information and exit
>--modules=MODULES   pre-load specified modules MODULES
>--root-directory=DIRinstall GRUB images under the directory DIR
> -  instead of the root directory
> +  instead of ${rootdir}
>--grub-setup=FILE   use FILE as grub-setup
>--grub-mkimage=FILE use FILE as grub-mkimage
>--grub-mkdevicemap=FILE use FILE as grub-mkdevicemap
> @@ -84,7 +83,7 @@
>
>  INSTALL_DEVICE can be a GRUB device name or a system device filename.
>
> -grub-install copies GRUB images into the DIR/boot directory specified by
> +grub-install copies GRUB images into the DIR/`echo grub | sed
> ${transform}` directory specified by
>  --root-directory, and uses grub-setup to install grub into the boot
>  sector.
>
> @@ -157,21 +156,7 @@
>  setup_verbose="--verbose"
>  fi
>
> -# Initialize these directories here, since ROOTDIR was initialized.
> -case "$host_os" in
> -netbsd* | openbsd*)
> -# Because /boot is used for the boot block in NetBSD and OpenBSD,
> use /grub
> -# instead of /boot/grub.
> -grub_prefix=`echo /grub | sed ${transform}`
> -bootdir=${rootdir}
> -;;
> -*)
> -# Use /boot/grub by default.
> -bootdir=${rootdir}/boot
> -;;
> -esac
> -
> -grubdir=${bootdir}/`echo grub | sed ${transform}`
> +grubdir=${rootdir}/`echo grub | sed ${transform}`
>  device_map=${grubdir}/device.map
>
>  grub_probe="${grub_probe} --device-map=${device_map}"
> @@ -204,8 +189,7 @@
>  fi
>
>  # Create the GRUB directory if it is not present.
> -test -d "$bootdir" || mkdir "$bootdir" || exit 1
> -test -d "$grubdir" || mkdir "$grubdir" || exit 1
> +mkdir -p "$grubdir" || exit 1
>
>  # If --recheck is specified, remove the device map, if present.
>  if test $recheck = yes; then
>
>
> ___
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko




signature.asc
Description: OpenPGP digital signature
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


how 'default=saved' should work ?

2009-12-22 Thread Frédéric Boiteux
Hello,

  I've recently updated my grub-legacy bootloader to Grub2 (using
  latest grub-pc from Debian Sid), and I can't have the 'default=saved'
  option working with Grub2 :-(

  I've put following definition in /etc/default/grub :

GRUB_DEFAULT=saved

and I get it in the beginning of my /boot/grub/grub.cfg :

...
### BEGIN /etc/grub.d/00_header ###
set default=saved
...

but I don't have anything in each menuentry telling to save choice :

menuentry "Debian GNU/Linux, with Linux 2.6.32-trunk-686" {
insmod ext2
set root=(hd0,8)
search --no-floppy --fs-uuid --set 257cf3a6-a439-4bbd-9a71-e777eabe4a0e
linux   /boot/vmlinuz-2.6.32-trunk-686 
root=UUID=257cf3a6-a439-4bbd-9a71-e777eabe4a0e ro  quiet
initrd  /boot/initrd.img-2.6.32-trunk-686
}


and at every boot, I have the first choice hightlighted .

What does I miss ?

Fred


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


Re: how 'default=saved' should work ?

2009-12-22 Thread Felix Zielcke
Am Dienstag, den 22.12.2009, 13:25 +0100 schrieb Frédéric Boiteux:
>   Hello,
> 
>   I've recently updated my grub-legacy bootloader to Grub2 (using
>   latest grub-pc from Debian Sid), and I can't have the
> 'default=saved'
>   option working with Grub2 :-(

It's only in the experimental branch avaible, which is in Debian
experimental.
We only do trunk uploads to sid.

>   I've put following definition in /etc/default/grub :
> 
> GRUB_DEFAULT=saved
> 

That change would be enough then to enable it.

-- 
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer



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


Re: boot directory prefix in grub-install (even with --root-directory)

2009-12-22 Thread Grégoire Sutre

Vladimir 'φ-coder/phcoder' Serbinenko wrote:

The main problem is with scripts already using --root-directory and
relying on existing behaviour.


Yes, you're right.



I propose add a new option
--grub-directory=DIR
which defaults to ROOTDIR/boot/grub
What do you think about this?


Nice, I'm looking forward to it.  Thanks :-)

Grégoire


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


Re: how 'default=saved' should work ?

2009-12-22 Thread Frédéric Boiteux
Le Tue, 22 Dec 2009 13:28:02 +0100,
Felix Zielcke  a écrit :

> It's only in the experimental branch avaible, which is in Debian
> experimental.
> We only do trunk uploads to sid.
Ok, thanks for the precision : I found the doc on the Grub2 wiki, but
didn't notice it doesn't apply to current Sid package !

Fred.


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


Re: how 'default=saved' should work ?

2009-12-22 Thread Felix Zielcke
Am Dienstag, den 22.12.2009, 13:36 +0100 schrieb Frédéric Boiteux:
> Le Tue, 22 Dec 2009 13:28:02 +0100,
> Felix Zielcke  a écrit :
> 
> > It's only in the experimental branch avaible, which is in Debian
> > experimental.
> > We only do trunk uploads to sid.
> Ok, thanks for the precision : I found the doc on the Grub2 wiki, but
> didn't notice it doesn't apply to current Sid package !
> 
>   Fred.

Ah a french page on the wiki has this.
Unfortunately I don't know more then 1-2 french words.
Would be nice if someone could note there that this currently only
applies to the experimental branch.


-- 
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer



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


Re: how 'default=saved' should work ?

2009-12-22 Thread Frédéric Boiteux
Le Tue, 22 Dec 2009 13:47:23 +0100,
Felix Zielcke  a écrit :

> Am Dienstag, den 22.12.2009, 13:36 +0100 schrieb Frédéric Boiteux:
> > Le Tue, 22 Dec 2009 13:28:02 +0100,
> > Felix Zielcke  a écrit :
> > 
> > > It's only in the experimental branch avaible, which is in Debian
> > > experimental.
> > > We only do trunk uploads to sid.
> > Ok, thanks for the precision : I found the doc on the Grub2 wiki,
> > but didn't notice it doesn't apply to current Sid package !
> > 
> > Fred.
> 
> Ah a french page on the wiki has this.
> Unfortunately I don't know more then 1-2 french words.
> Would be nice if someone could note there that this currently only
> applies to the experimental branch.

  I'll try to do it !

Fred.


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


[PATCH] byte-addressable grub_pci_make_address

2009-12-22 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Hello, I noticed that grub_pci_make_address addresses register on dword
boundaries whereas some important byte registers aren't dword-aligned.
It's impossible to access such registers in opaque way which is required
when using grub-emu with PCI support. Here is a fix

-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko

=== added file 'ChangeLog.pciclean'
--- ChangeLog.pciclean	1970-01-01 00:00:00 +
+++ ChangeLog.pciclean	2009-12-22 14:07:47 +
@@ -0,0 +1,52 @@
+2009-12-22  Vladimir Serbinenko  
+
+	Byte-addressable PCI configuration space.
+
+	* bus/pci.c (grub_pci_make_address): Use byte address instead of
+	dword address.
+	(grub_pci_iterate): Use macroses GRUB_PCI_REG_PCI_ID and
+	GRUB_PCI_REG_CACHELINE.
+	* bus/usb/ohci.c (grub_ohci_pci_iter): Use macroses
+	GRUB_PCI_REG_CLASS and GRUB_PCI_REG_ADDRESS_REG0.
+	* bus/usb/uhci.c (grub_ohci_pci_iter): Use macroses
+	GRUB_PCI_REG_CLASS and GRUB_PCI_REG_ADDRESS_REG4.
+	* commands/efi/fixvideo.c (scan_card): Use macros GRUB_PCI_REG_CLASS.
+	* commands/efi/loadbios.c (enable_rom_area): Pass byte-address to
+	grub_pci_make_address.
+	(lock_rom_area): Likewise.
+	* commands/lspci.c (grub_lspci_iter): Use macroses
+	GRUB_PCI_REG_CLASS and GRUB_PCI_REG_ADDRESSES. Handle byte-addressing
+	of grub_pci_make_address.
+	* disk/ata.c (grub_ata_pciinit): Likewise.
+	* include/grub/pci.h (GRUB_PCI_REG_PCI_ID): New macro.
+	(GRUB_PCI_REG_VENDOR): Likewise.
+	(GRUB_PCI_REG_DEVICE): Likewise.
+	(GRUB_PCI_REG_COMMAND): Likewise.
+	(GRUB_PCI_REG_STATUS): Likewise.
+	(GRUB_PCI_REG_REVISION): Likewise.
+	(GRUB_PCI_REG_CLASS): Likewise.
+	(GRUB_PCI_REG_CACHELINE): Likewise.
+	(GRUB_PCI_REG_LAT_TIMER): Likewise.
+	(GRUB_PCI_REG_HEADER_TYPE): Likewise.
+	(GRUB_PCI_REG_BIST): Likewise.
+	(GRUB_PCI_REG_ADDRESSES): Likewise.
+	(GRUB_PCI_REG_ADDRESS_REG): Likewise.
+	(GRUB_PCI_REG_ADDRESS_REG): Likewise.
+	(GRUB_PCI_REG_ADDRESS_REG): Likewise.
+	(GRUB_PCI_REG_ADDRESS_REG): Likewise.
+	(GRUB_PCI_REG_ADDRESS_REG): Likewise.
+	(GRUB_PCI_REG_ADDRESS_REG): Likewise.
+	(GRUB_PCI_REG_CIS_POINTER): Likewise.
+	(GRUB_PCI_REG_SUBVENDOR): Likewise.
+	(GRUB_PCI_REG_SUBSYSTEM): Likewise.
+	(GRUB_PCI_REG_ROM_ADDRESS): Likewise.
+	(GRUB_PCI_REG_CAP_POINTER): Likewise.
+	(GRUB_PCI_REG_IRQ_LINE): Likewise.
+	(GRUB_PCI_REG_IRQ_PIN): Likewise.
+	(GRUB_PCI_REG_MIN_GNT): Likewise.
+	(GRUB_PCI_REG_MAX_LAT): Likewise.
+	* loader/i386/efi/linux.c (find_framebuf): Use GRUB_PCI_REG_CLASS.
+	* loader/i386/efi/xnu.c (find_framebuf): Likewise.
+	* video/efi_uga.c (find_framebuf): Likewise.
+	* util/pci.c (grub_pci_make_address): Use byte-addressed configuration
+	space.

=== modified file 'bus/pci.c'
--- bus/pci.c	2009-10-14 08:11:59 +
+++ bus/pci.c	2009-12-22 12:02:51 +
@@ -24,7 +24,7 @@
 grub_pci_make_address (grub_pci_device_t dev, int reg)
 {
   return (1 << 31) | (dev.bus << 16) | (dev.device << 11)
-| (dev.function << 8) | (reg << 2);
+| (dev.function << 8) | reg;
 }
 
 void
@@ -41,7 +41,7 @@
 	{
 	  for (dev.function = 0; dev.function < 8; dev.function++)
 	{
-	  addr = grub_pci_make_address (dev, 0);
+	  addr = grub_pci_make_address (dev, GRUB_PCI_REG_PCI_ID);
 	  id = grub_pci_read (addr);
 
 	  /* Check if there is a device present.  */
@@ -54,7 +54,7 @@
 	  /* Probe only func = 0 if the device if not multifunction */
 	  if (dev.function == 0)
 		{
-		  addr = grub_pci_make_address (dev, 3);
+		  addr = grub_pci_make_address (dev, GRUB_PCI_REG_CACHELINE);
 		  hdr = grub_pci_read (addr);
 		  if (!(hdr & 0x80))
 		break;

=== modified file 'bus/usb/ohci.c'
--- bus/usb/ohci.c	2009-10-14 08:11:59 +
+++ bus/usb/ohci.c	2009-12-22 11:52:59 +
@@ -126,7 +126,7 @@
   grub_uint32_t revision;
   grub_uint32_t frame_interval;
 
-  addr = grub_pci_make_address (dev, 2);
+  addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS);
   class_code = grub_pci_read (addr) >> 8;
 
   interf = class_code & 0xFF;
@@ -138,7 +138,7 @@
 return 0;
 
   /* Determine IO base address.  */
-  addr = grub_pci_make_address (dev, 4);
+  addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
   base = grub_pci_read (addr);
 
 #if 0

=== modified file 'bus/usb/uhci.c'
--- bus/usb/uhci.c	2009-12-22 09:15:59 +
+++ bus/usb/uhci.c	2009-12-22 11:51:58 +
@@ -150,7 +150,7 @@
   struct grub_uhci *u;
   int i;
 
-  addr = grub_pci_make_address (dev, 2);
+  addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS);
   class_code = grub_pci_read (addr) >> 8;
 
   interf = class_code & 0xFF;
@@ -162,7 +162,7 @@
 return 0;
 
   /* Determine IO base address.  */
-  addr = grub_pci_make_address (dev, 8);
+  addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG4);
   base = grub_pci_read (addr);
   /* Stop if there is no IO space base address defined.  */
   if (! (base & 1))

=== modified file 'commands/efi/fixvideo.c'
--- commands/efi/fixvideo.c	2009-11-30 18:09:11 +
+++ commands/efi/fixvideo.c	2009-12-22 11:54:44 +
@@ -42,7 +42,7 @@
 {
   grub_pci_addr

Re: PXE booting: no such disk

2009-12-22 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Alkis Georgopoulos wrote:
> I'm trying to follow the instructions on this wiki page:
>   http://grub.enbug.org/PXEBOOT
> and I'm getting "error: no such disk", followed by the "grub rescue>"
> prompt. If I try `pxe --info` on that prompt, I get:
>   "error: no pxe environment"
>
>   
gpxe detects grub as multiboot payload and boots it as such. Your options:
1) add .0 to pxe filename
2) compile gpxe w/o multiboot support
3) Replace 02 B0 AD 1B in core.img with something else
4) Wait till I import gpxe into grub-extras
> I'm using "grub-pc 1.97~beta3-1ubuntu7" from Ubuntu Karmic 9.10, and the
> latest gpxe boot disk as the PXE stack. If I try with my laptop's PXE
> stack instead, it hangs *before* the "grub rescue>" prompt.
>   
Where exactly does it hang. What kind of network card is it? What kind
of laptop is it?
> I've seen in moddep.lst that pxe depends on bufio, and pxecmd depends on
> extcmd, so I *also* tried with 
>   grub-mkimage --output=core.img --prefix="(pxe)/boot/grub" bufio pxe extcmd 
> pxecmd
> bug again, to no avail.
>
> Any ideas?
>
> Thank you,
> Alkis Georgopoulos 
>
>
>
> ___
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>   


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko




signature.asc
Description: OpenPGP digital signature
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: how 'default=saved' should work ?

2009-12-22 Thread Frédéric Boiteux
Le Tue, 22 Dec 2009 13:51:30 +0100,
Frédéric Boiteux  a écrit :

> > Ah a french page on the wiki has this.
> > Unfortunately I don't know more then 1-2 french words.
> > Would be nice if someone could note there that this currently only
> > applies to the experimental branch.
> 
Done.

Fred.


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


Fwd: Bug#562036: grub-pc: Add support for GFXPAYLOAD same as for GFXMODE

2009-12-22 Thread Jan Muszynski
-- Forwarded message --
From: Jan Muszynski 
To: Debian Bug Tracking System 
Date: Tue, 22 Dec 2009 01:12:54 -0500
Subject: Bug#562036: grub-pc: Add support for GFXPAYLOAD same as for GFXMODE
Package: grub-pc
Version: 1.98~20091210-1
Severity: normal
Tags: patch

Currently console resolution defaults to 640x480, even if GFXMODE is set.
Changing this requires modifying the scripts in /etc/grub.d, which is not
very user friendly and also makes it a pain when the scripts are changed due
to updates.

Instead I would propose to add support for GFXPAYLOAD in /etc/default/grub.
Attached patch should do the job. You'll notice I switched the -e from the
shebang line to an explicit set -e For why see:
 http://blog.andrew.net.au/2009/11/20#dash_e_shebang_bad

Need anything further, just holler. I'll have a few more bug reports
(some with patches)
coming up in the near future. I'll wait for the version currently in
incoming first.
(For starters the custom menu entry listed below is ignored, but I
need to look at things closer first)

 -jcm

- Start Patches -
--- /etc/grub.d/00_header       2009-12-14 09:05:26.0 -0500
+++ /etc/grub.d/00_header.new   2009-12-21 23:27:41.743930730 -0500
@@ -1,4 +1,5 @@
-#! /bin/sh -e
+#! /bin/sh
+set -e

 # grub-mkconfig helper script.
 # Copyright (C) 2006,2007,2008,2009  Free Software Foundation, Inc.
@@ -36,6 +37,7 @@
 if [ "x${GRUB_DEFAULT}" = "x" ] ; then GRUB_DEFAULT=0 ; fi
 if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi
 if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=640x480 ; fi
+if [ "x${GRUB_GFXPAYLOAD}" = "x" ] ; then GRUB_GFXPAYLOAD=${GRUB_GFXMODE} ; fi

 cat << EOF
 set default=${GRUB_DEFAULT}
@@ -78,6 +80,7 @@
    cat << EOF
 if loadfont `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then
  set gfxmode=${GRUB_GFXMODE}
+  set gfxpayload=${GRUB_GFXPAYLOAD}
  insmod gfxterm
  insmod ${GRUB_VIDEO_BACKEND}
  if terminal_output gfxterm ; then true ; else
--- /usr/sbin/grub-mkconfig     2009-12-14 09:05:26.0 -0500
+++ /usr/sbin/grub-mkconfig.new 2009-12-21 23:28:06.119931605 -0500
@@ -1,4 +1,5 @@
-#! /bin/sh -e
+#! /bin/sh
+set -e

 # Generate grub.cfg by inspecting /boot contents.
 # Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
@@ -224,6 +225,7 @@
  GRUB_DISABLE_LINUX_UUID \
  GRUB_DISABLE_LINUX_RECOVERY \
  GRUB_GFXMODE \
+  GRUB_GFXPAYLOAD \
  GRUB_DISABLE_OS_PROBER

 if test "x${grub_cfg}" != "x"; then
--- /usr/share/grub/default/grub        2009-12-09 18:47:36.0 -0500
+++ /usr/share/grub/default/grub.new    2009-12-21 23:55:39.510931300 -0500
@@ -15,6 +15,10 @@
 # you can see them in real GRUB with the command `vbeinfo'
 #GRUB_GFXMODE=640x480

+# The resolution used on the console. The default will be the same as
GRUB_GFXMODE
+# The same modes as for GRUB_GFXMODE are valid here, with the
addition of the "keep" keyword.
+#GRUB_GFXPAYLOAD=keep
+
 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
 #GRUB_DISABLE_LINUX_UUID=true
- End Patches -




-- Package-specific info:

*** BEGIN /proc/mounts
/dev/mapper/serenityVG1-debian--root / ext4
rw,noatime,errors=remount-ro,barrier=0,nodelalloc,stripe=48,data=journal
0 0
/dev/sde1 /boot ext3 rw,noatime,errors=continue,user_xattr,acl,data=journal 0 0
/dev/mapper/serenityVG2-home /home ext4
rw,noatime,barrier=0,nodelalloc,stripe=32,data=journal 0 0
/dev/mapper/serenityVG1-postgres.data /srv/postgresql ext4
rw,noatime,barrier=0,stripe=48,data=writeback 0 0
/dev/mapper/serenityVG1-postgres.xlog
/srv/postgresql/8.4/poker/pg_xlog ext4
rw,noatime,barrier=0,data=writeback 0 0
/dev/sda4 /var/lib/backuppc ext4
rw,nosuid,nodev,noatime,barrier=1,data=ordered 0 0
/dev/sdb5 /media/music ext4 rw,noatime,barrier=1,nodelalloc,data=journal 0 0
/dev/sde3 /media/music.work ext4
rw,noatime,barrier=1,nodelalloc,data=journal 0 0
*** END /proc/mounts

*** BEGIN /boot/grub/device.map
(hd0)   /dev/sde
(hd1)   /dev/sda
(hd2)   /dev/sdb
(hd3)   /dev/sdc
(hd4)   /dev/sdd
*** END /boot/grub/device.map

*** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
set default=0
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set f08bb834-f81c-4eac-bdf5-1847c411ad30
if loadfont /grub/unicode.pf2 ; then
 set gfxmode=640x480
 insmod gfxterm
 insmod vbe
 if terminal_output gfxterm ; then true ; else
   # For backward compatibility with versions of terminal.mod that don't
   # understand terminal_output
   terminal gfxterm
 fi
fi
set locale_dir=/boot/grub/locale
set lang=en
insmod gettext
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/00_header.new ###
set default=0
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set f08bb834-f81c-4

Re: how 'default=saved' should work ?

2009-12-22 Thread Felix Zielcke
Am Dienstag, den 22.12.2009, 15:15 +0100 schrieb Frédéric Boiteux:
> Le Tue, 22 Dec 2009 13:51:30 +0100,
> Frédéric Boiteux  a écrit :
> 
> > > Ah a french page on the wiki has this.
> > > Unfortunately I don't know more then 1-2 french words.
> > > Would be nice if someone could note there that this currently only
> > > applies to the experimental branch.
> > 
> Done.

Thanks.
>   Fred.



-- 
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer



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


Fix for grub_assert_fail undefined on NetBSD and other platforms

2009-12-22 Thread BVK Chaitanya
Hi


Attached is the patch, which removes use of undefined grub_assert_fail
function for catching bad-type-cast errors, with a better version
__attribute__((error("msg"))) gcc extension.  With this extension, gcc
can give the exact location of the bad type cast at compile time.

Unfortunately, I couldn't test this on NetBSD, where old technique was
reported failing as GCC optimizations didn't happen.  Can Grégoire
Sutr or anybody else try this out on NetBSD and confirm?


thanks,
-- 
bvk.chaitanya
=== modified file 'include/grub/handler.h'
--- include/grub/handler.h  2009-03-01 17:51:44 +
+++ include/grub/handler.h  2009-12-22 13:34:38 +
@@ -55,6 +55,6 @@
 GRUB_FIELD_MATCH (ptr, grub_handler_t, name) && \
 GRUB_FIELD_MATCH (ptr, grub_handler_t, init) && \
 GRUB_FIELD_MATCH (ptr, grub_handler_t, fini)) ? \
-   (grub_handler_t) ptr : grub_assert_fail ())
+   (grub_handler_t) ptr : grub_bad_type_cast ())
 
 #endif /* ! GRUB_HANDLER_HEADER */

=== modified file 'include/grub/list.h'
--- include/grub/list.h 2009-11-09 14:25:03 +
+++ include/grub/list.h 2009-12-22 13:33:08 +
@@ -22,6 +22,7 @@
 
 #include 
 #include 
+#include 
 
 struct grub_list
 {
@@ -39,31 +40,27 @@
 void EXPORT_FUNC(grub_list_insert) (grub_list_t *head, grub_list_t item,
grub_list_test_t test);
 
-/* This function doesn't exist, so if assertion is false for some reason, the
-   linker would fail.  */
-#ifdef APPLE_CC
-/* This approach fails with Apple's gcc. Use grub_abort.  */
-#include 
-static inline void *
-grub_assert_fail (void)
+static inline void *
+grub_bad_type_cast (void) __attribute__ ((error("bad type cast between 
incompatible grub types")));
+
+static inline void *
+grub_bad_type_cast (void)
 {
-   grub_abort ();
-   return 0;
+  grub_fatal ("bad type case between incompatible grub types detected");
+  grub_abort ();
+  return 0;
 }
-#else
-extern void* grub_assert_fail (void);
-#endif
 
 #define GRUB_FIELD_MATCH(ptr, type, field) \
   ((char *) &(ptr)->field == (char *) &((type) (ptr))->field)
 
 #define GRUB_AS_LIST(ptr) \
   (GRUB_FIELD_MATCH (ptr, grub_list_t, next) ? \
-   (grub_list_t) ptr : grub_assert_fail ())
+   (grub_list_t) ptr : grub_bad_type_cast ())
 
 #define GRUB_AS_LIST_P(pptr) \
   (GRUB_FIELD_MATCH (*pptr, grub_list_t, next) ? \
-   (grub_list_t *) (void *) pptr : grub_assert_fail ())
+   (grub_list_t *) (void *) pptr : grub_bad_type_cast ())
 
 struct grub_named_list
 {
@@ -78,12 +75,12 @@
 #define GRUB_AS_NAMED_LIST(ptr) \
   ((GRUB_FIELD_MATCH (ptr, grub_named_list_t, next) && \
 GRUB_FIELD_MATCH (ptr, grub_named_list_t, name))? \
-   (grub_named_list_t) ptr : grub_assert_fail ())
+   (grub_named_list_t) ptr : grub_bad_type_cast ())
 
 #define GRUB_AS_NAMED_LIST_P(pptr) \
   ((GRUB_FIELD_MATCH (*pptr, grub_named_list_t, next) && \
 GRUB_FIELD_MATCH (*pptr, grub_named_list_t, name))? \
-   (grub_named_list_t *) (void *) pptr : grub_assert_fail ())
+   (grub_named_list_t *) (void *) pptr : grub_bad_type_cast ())
 
 #define GRUB_PRIO_LIST_PRIO_MASK   0xff
 #define GRUB_PRIO_LIST_FLAG_ACTIVE 0x100
@@ -111,12 +108,12 @@
   ((GRUB_FIELD_MATCH (ptr, grub_prio_list_t, next) && \
 GRUB_FIELD_MATCH (ptr, grub_prio_list_t, name) && \
 GRUB_FIELD_MATCH (ptr, grub_prio_list_t, prio))? \
-   (grub_prio_list_t) ptr : grub_assert_fail ())
+   (grub_prio_list_t) ptr : grub_bad_type_cast ())
 
 #define GRUB_AS_PRIO_LIST_P(pptr) \
   ((GRUB_FIELD_MATCH (*pptr, grub_prio_list_t, next) && \
 GRUB_FIELD_MATCH (*pptr, grub_prio_list_t, name) && \
 GRUB_FIELD_MATCH (*pptr, grub_prio_list_t, prio))? \
-   (grub_prio_list_t *) (void *) pptr : grub_assert_fail ())
+   (grub_prio_list_t *) (void *) pptr : grub_bad_type_cast ())
 
 #endif /* ! GRUB_LIST_HEADER */

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


[PATCH] Re: Feature Request: 32-bit mem write and 'setpci -s' type command in menu.lst

2009-12-22 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Nando wrote:
> Hi everyone,
>
>
> 2/ Ability to do a setpci -s type command
> ==
>
> Also, if possible, could a small subset of 'setpci' be incorporated as
> well? I guess I could figure out the address I need to write to by
> calculation, but would be nice if I could do the equivalent of the
> following in grub, associated with a menu entry. This would help the
> DIY ViDock project that needs to setup PCI Bridge windows prior to
> Windows load, something that many bios doesn't do, neither does Windows.
>
> setpci -s 00:02.0 40l=20
>
I attach two patches. One iorw.diff for reading/writing I/O space.
Another one setpci.diff is self-explanatory. But it depends on pciclean
patch I posted today.


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko

=== added file 'commands/setpci.c'
--- commands/setpci.c	1970-01-01 00:00:00 +
+++ commands/setpci.c	2009-12-22 15:42:45 +
@@ -0,0 +1,340 @@
+/* lspci.c - List PCI devices.  */
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2008, 2009  Free Software Foundation, Inc.
+ *
+ *  GRUB is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB.  If not, see .
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct pci_register
+{
+  const char *name;
+  grub_uint16_t addr;
+  unsigned size;
+};
+
+struct pci_register pci_registers[] =
+  {
+{"VENDOR_ID",   GRUB_PCI_REG_VENDOR  , 2},
+{"DEVICE_ID",   GRUB_PCI_REG_DEVICE  , 2},
+{"COMMAND", GRUB_PCI_REG_COMMAND , 2},
+{"STATUS",  GRUB_PCI_REG_STATUS  , 2},
+{"REVISION",GRUB_PCI_REG_REVISION, 1},
+{"CLASS_PROG",  GRUB_PCI_REG_CLASS + 1   , 1},
+{"CLASS_DEVICE",GRUB_PCI_REG_CLASS + 2   , 2},
+{"CACHE_LINE_SIZE", GRUB_PCI_REG_CACHELINE   , 1},
+{"LATENCY_TIMER",   GRUB_PCI_REG_LAT_TIMER   , 1},
+{"HEADER_TYPE", GRUB_PCI_REG_HEADER_TYPE , 1},
+{"BIST",GRUB_PCI_REG_BIST, 1},
+{"BASE_ADDRESS_0",  GRUB_PCI_REG_ADDRESS_REG0, 4},
+{"BASE_ADDRESS_1",  GRUB_PCI_REG_ADDRESS_REG1, 4},
+{"BASE_ADDRESS_2",  GRUB_PCI_REG_ADDRESS_REG2, 4},
+{"BASE_ADDRESS_3",  GRUB_PCI_REG_ADDRESS_REG3, 4},
+{"BASE_ADDRESS_4",  GRUB_PCI_REG_ADDRESS_REG4, 4},
+{"BASE_ADDRESS_5",  GRUB_PCI_REG_ADDRESS_REG5, 4},
+{"CARDBUS_CIS", GRUB_PCI_REG_CIS_POINTER , 4},
+{"SUBVENDOR_ID",GRUB_PCI_REG_SUBVENDOR   , 2},
+{"SUBSYSTEM_ID",GRUB_PCI_REG_SUBSYSTEM   , 2},
+{"ROM_ADDRESS", GRUB_PCI_REG_ROM_ADDRESS , 4},
+{"CAP_POINTER", GRUB_PCI_REG_CAP_POINTER , 1},
+{"INTERRUPT_LINE",  GRUB_PCI_REG_IRQ_LINE, 1},
+{"INTERRUPT_PIN",   GRUB_PCI_REG_IRQ_PIN , 1},
+{"MIN_GNT", GRUB_PCI_REG_MIN_GNT , 1},
+{"MAX_LAT", GRUB_PCI_REG_MIN_GNT , 1},
+  };
+
+static const struct grub_arg_option options[] =
+  {
+{0, 'd', 0, "Select device by vendor and device IDs.",
+ "[vendor]:[device]", ARG_TYPE_STRING},
+{0, 's', 0, "Select device by its position on the bus.",
+ "[bus]:[slot][.func]", ARG_TYPE_STRING},
+{0, 'v', 0, "Save read value into variable VARNAME.",
+ "VARNAME", ARG_TYPE_STRING},
+{0, 0, 0, 0, 0, 0}
+  };
+
+static grub_uint32_t pciid_check_mask, pciid_check_value;
+static int bus, device, function;
+static int check_bus, check_device, check_function;
+static grub_uint32_t write_mask, regwrite;
+static int regsize;
+static grub_uint16_t regaddr;
+static const char *varname;
+
+static int NESTED_FUNC_ATTR
+grub_setpci_iter (grub_pci_device_t dev, grub_pci_id_t pciid)
+{
+  grub_uint32_t regval = 0;
+  grub_pci_address_t addr;
+
+  if ((pciid & pciid_check_mask) != pciid_check_value)
+return 0;
+
+  if (check_bus && grub_pci_get_bus (dev) != bus)
+return 0;
+
+  if (check_device && grub_pci_get_device (dev) != device)
+return 0;
+
+  if (check_function && grub_pci_get_function (dev) != device)
+return 0;
+
+  addr = grub_pci_make_address (dev, regaddr);
+
+  switch (regsize)
+{
+case 1:
+  regval = grub_pci_read_byte (addr);
+  break;
+
+case 2:
+  regval = grub_pci_read_word (addr);
+  break;
+
+case 4:
+  regval = grub_pci_read (addr);
+  break;
+}
+
+  if (varname)
+{
+  char buf[sizeof ("")];
+  grub_sprintf (buf, "%x", regval);
+  grub_env_set (varname, buf);
+  return 1;
+}
+
+  if (!write_mask)
+  

Re: Feature Request: 32-bit mem write and 'setpci -s' type command in menu.lst

2009-12-22 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Nando wrote:
> Hi Vlad,
>
> > able to do the equivalent of setpci by calculating the addresses
> > needing memory writes.
>
> Except pciconf space
>
>
> Are you saying that write_dword will not write to pciconf space? 
>  
>
> >
> > write_dump ADDRESS FILE
> > eg: write_dump 0xF800  dump_file
> >
> This has already been discussed and conclusion that it's too dangerous
> to write to FS from grub2. If it's one time operation you can just
> boot
> FreeDOS for it. IF it's not explain why do you need it on every boot
>
>
> I've like *read* a dump file into pciexbar memory space to overcome my
> wifi whitelisting. Currently doing this via a grub2 DOS Image entry
> explained at http://www.wimsbios.com/phpBB2/topic9388-135.html#53650 .
> To have such an ability would mean I could just add another menuitem
> "Ubunto [reverse whitelisting]" and bypass the need for the DOS
> bootimage. This ability would be further enhanced if a compressed dump
> file could be used to speed up the process.
>
> So I guess it should be a request for:
>
> - 'read_dump ADDRESS FILE' for mPCIe wifi whitelsting could be done
> within grub2. .
> - a 'setpci' type command  to do pci-e pci-port bridge window fixups,
> amongst other things.
>
MEM I/O isn't necessarily just a normal memory space. Most of the times
it isn't. So writing by dwords, words or bytes won't lead to the same
result. You could say: add an option to specify how to write to MM I/O
but it may happen that some registers need byte and other ones dword writes
> Nando
> 
>
> ___
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>   


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko




signature.asc
Description: OpenPGP digital signature
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Fix for grub_assert_fail undefined on NetBSD and other platforms

2009-12-22 Thread BVK Chaitanya
grub_fatal already calls grub_abort, so grub_abort line is removed.



-- 
bvk.chaitanya
=== modified file 'include/grub/handler.h'
--- include/grub/handler.h  2009-03-01 17:51:44 +
+++ include/grub/handler.h  2009-12-22 13:34:38 +
@@ -55,6 +55,6 @@
 GRUB_FIELD_MATCH (ptr, grub_handler_t, name) && \
 GRUB_FIELD_MATCH (ptr, grub_handler_t, init) && \
 GRUB_FIELD_MATCH (ptr, grub_handler_t, fini)) ? \
-   (grub_handler_t) ptr : grub_assert_fail ())
+   (grub_handler_t) ptr : grub_bad_type_cast ())
 
 #endif /* ! GRUB_HANDLER_HEADER */

=== modified file 'include/grub/list.h'
--- include/grub/list.h 2009-11-09 14:25:03 +
+++ include/grub/list.h 2009-12-22 16:25:10 +
@@ -22,6 +22,7 @@
 
 #include 
 #include 
+#include 
 
 struct grub_list
 {
@@ -39,31 +40,26 @@
 void EXPORT_FUNC(grub_list_insert) (grub_list_t *head, grub_list_t item,
grub_list_test_t test);
 
-/* This function doesn't exist, so if assertion is false for some reason, the
-   linker would fail.  */
-#ifdef APPLE_CC
-/* This approach fails with Apple's gcc. Use grub_abort.  */
-#include 
-static inline void *
-grub_assert_fail (void)
+static inline void *
+grub_bad_type_cast (void) __attribute__ ((error("bad type cast between 
incompatible grub types")));
+
+static inline void *
+grub_bad_type_cast (void)
 {
-   grub_abort ();
-   return 0;
+  grub_fatal ("bad type cast between incompatible grub types detected");
+  return 0;
 }
-#else
-extern void* grub_assert_fail (void);
-#endif
 
 #define GRUB_FIELD_MATCH(ptr, type, field) \
   ((char *) &(ptr)->field == (char *) &((type) (ptr))->field)
 
 #define GRUB_AS_LIST(ptr) \
   (GRUB_FIELD_MATCH (ptr, grub_list_t, next) ? \
-   (grub_list_t) ptr : grub_assert_fail ())
+   (grub_list_t) ptr : grub_bad_type_cast ())
 
 #define GRUB_AS_LIST_P(pptr) \
   (GRUB_FIELD_MATCH (*pptr, grub_list_t, next) ? \
-   (grub_list_t *) (void *) pptr : grub_assert_fail ())
+   (grub_list_t *) (void *) pptr : grub_bad_type_cast ())
 
 struct grub_named_list
 {
@@ -78,12 +74,12 @@
 #define GRUB_AS_NAMED_LIST(ptr) \
   ((GRUB_FIELD_MATCH (ptr, grub_named_list_t, next) && \
 GRUB_FIELD_MATCH (ptr, grub_named_list_t, name))? \
-   (grub_named_list_t) ptr : grub_assert_fail ())
+   (grub_named_list_t) ptr : grub_bad_type_cast ())
 
 #define GRUB_AS_NAMED_LIST_P(pptr) \
   ((GRUB_FIELD_MATCH (*pptr, grub_named_list_t, next) && \
 GRUB_FIELD_MATCH (*pptr, grub_named_list_t, name))? \
-   (grub_named_list_t *) (void *) pptr : grub_assert_fail ())
+   (grub_named_list_t *) (void *) pptr : grub_bad_type_cast ())
 
 #define GRUB_PRIO_LIST_PRIO_MASK   0xff
 #define GRUB_PRIO_LIST_FLAG_ACTIVE 0x100
@@ -111,12 +107,12 @@
   ((GRUB_FIELD_MATCH (ptr, grub_prio_list_t, next) && \
 GRUB_FIELD_MATCH (ptr, grub_prio_list_t, name) && \
 GRUB_FIELD_MATCH (ptr, grub_prio_list_t, prio))? \
-   (grub_prio_list_t) ptr : grub_assert_fail ())
+   (grub_prio_list_t) ptr : grub_bad_type_cast ())
 
 #define GRUB_AS_PRIO_LIST_P(pptr) \
   ((GRUB_FIELD_MATCH (*pptr, grub_prio_list_t, next) && \
 GRUB_FIELD_MATCH (*pptr, grub_prio_list_t, name) && \
 GRUB_FIELD_MATCH (*pptr, grub_prio_list_t, prio))? \
-   (grub_prio_list_t *) (void *) pptr : grub_assert_fail ())
+   (grub_prio_list_t *) (void *) pptr : grub_bad_type_cast ())
 
 #endif /* ! GRUB_LIST_HEADER */

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


Re: grub_error messages

2009-12-22 Thread Jordi Mallach
On Mon, Dec 21, 2009 at 10:19:16PM +, Carles Pina i Estany wrote:
> b) At beginning I thought that we would not gettext error messages, but
> I see that lot of these messages appears to the end user. Do we gettext
> using N_(" ") and then where it's printed I use _(" ") ? I would say
> yes.

No! Don't use any of N_() or _() if the message isn't meant to be translated.
If it's extracted into the pot file but then it's not used by GRUB (not
being marked with the necessary gettext call), it's a waste of time for
translators, of course.

-- 
Jordi Mallach Pérez  --  Debian developer http://www.debian.org/
jo...@sindominio.net jo...@debian.org http://www.sindominio.net/
GnuPG public key information available at http://oskuro.net/


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


Re: pci-e config register modification in grub

2009-12-22 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Nando wrote:
> Hi everyone,
>
> Wondering if grub2 can have an additional module added to do various
> pci-e Configuration Register fixups/modifications before launching
> into XP/Win7/Linux. 
Are PCI configuration registers enough? If not can you research the
specifications?
> Specifically I require:
>
> 1/ ability to modify PCI Bridge Configuration Registers for DIY ViDock
> project  to
> allow the video card to work [ current workaround is boot DOS, use
> pcitool to do the mod, then use grub4dos to chainload the OS ]
>
> 2/ ability to restore a mini pci-e port's Extended PCI Configuration
> registers config to reverse HP bios whitelisting of wifi cards (See
> bottom of HP Mini pci-e wifi bios thread
> . No current tool
> can do this that I've found, with the DOS pcitool extending only to
> the 00-FF pci-e configuration registers, not the extended registers.
>
> I'm running Ubuntu 9.04 with grub as the bootloader. Can these
> features be added to grub via say the menu.lst file as well as some
> config file that can store the dump for (2) above??
>
> Nando
> 
>
> ___
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>   


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko




signature.asc
Description: OpenPGP digital signature
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: grub_error messages

2009-12-22 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Jordi Mallach wrote:
> On Mon, Dec 21, 2009 at 10:19:16PM +, Carles Pina i Estany wrote:
>   
>> b) At beginning I thought that we would not gettext error messages, but
>> I see that lot of these messages appears to the end user. Do we gettext
>> using N_(" ") and then where it's printed I use _(" ") ? I would say
>> yes.
>> 
>
> No! Don't use any of N_() or _() if the message isn't meant to be translated.
> If it's extracted into the pot file but then it's not used by GRUB (not
> being marked with the necessary gettext call), it's a waste of time for
> translators, of course.
>
>   
Jordi, I think you misunderstand. What Carles propose is to do real
gettext call in grub_error and not before calling it. We already use N_
for this purpose.


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko




signature.asc
Description: OpenPGP digital signature
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


How to install grub on fakeraid (raid 0) which spans 2 TB?

2009-12-22 Thread André Heynatz
I have bought two 1 TB harddisks and one 2 TB harddisk (backup).
I want to use the 1 TB harddisks in a RAID 0 array (Intel ICH8R Fakeraid).

OS: Win XP SP3, Win 7, Ubuntu Linux 9.10 32 Bit

My partition plan 1:

P ntfs  300 GB Windows XP SP3 32 Bit
P ntfs  300 GB Windows 7 32 Bit
E
L swap2 GB Linux swap
L ext4  250 GB Ubuntu Linux 9.10 (Karmic) 32 Bit
L ntfs 1100 GB data (for data exchange and storage)
L ext4   48 GB spare space for testing of new OSes

I wanted to install Linux, then create the data partition with
Win XP SP3 Disk Management Tool. The Linux install failed
because Ubuntu wanted to install GRUB1 which is not part of
the install CD. I wonder that Ubuntu uses GRUB2 at all at the
moment because the FakeRaid support is still lacking which was
known before release (a severe regression).
However, I *managed* to install GRUB1 manually by following the
steps in:

Ubuntu FakeRaidHowto:
https://help.ubuntu.com/community/FakeRaidHowto

Ubuntu 9.10+fakeraid:
http://ubuntuforums.org/showthread.php?t=1360445

Unfortunately, the Extended Partition had no space, the Ubuntu
graphical installer just arrages so much space as required.
As I need two more partitions, I had to expand the Extended
partition somehow. I booted the Ubuntu Live System and could
extend this partition with gparted.
Then I tried to use the Win XP SP3 Disk Management Tool to create
the data partition. It destroyed the logical partitions so that
GRUB cannot boot anymore!!!
So I made another plan: First finish with NTFS partitions, then
start with Linux ones.

My partition plan 2:

P ntfs  300 GB Windows XP SP3 32 Bit
P ntfs  300 GB Windows 7 32 Bit
P ntfs 1100 GB data (for data exchange and storage)
E
L swap2 GB Linux swap
L ext4  250 GB Ubuntu Linux 9.10 (Karmic) 32 Bit
L ext4   48 GB spare space for testing of new OSes

The last partition I do not need, but in order to include it with
the Extended partition, I added it as a Linux ext4 partition for now.

I installed Ubuntu 9.10 32 Bit with the graphical installer. As
expected, GRUB install failed. But this time GRUB1 cannot be
installed. Maybe I crossed a capacity border. I heard that 2 TB is
a limit, but I have no more (ok, 2 * 1 TB, should work).

The first part describes my experience with GRUB1. The last part is
devoted to GRUB2.

===
GRUB1 (version 0.97-29ubuntu59 from Ubuntu 9.10 32 Bit)
===

r...@ubuntu:/# fdisk -l /dev/mapper/isw_bfacafefej_Volume0

Disk /dev/mapper/isw_bfacafefej_Volume0: 2000.4 GB, 2000404348928 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4d6d4d6c

  Device Boot  Start End  Blocks   
Id  System
/dev/mapper/isw_bfacafefej_Volume0p1   *   1   35695   286720056
7  HPFS/NTFS
/dev/mapper/isw_bfacafefej_Volume0p2   35696   71391   28672
7  HPFS/NTFS
/dev/mapper/isw_bfacafefej_Volume0p3   71391  204958  1072876544
7  HPFS/NTFS
/dev/mapper/isw_bfacafefej_Volume0p4  204959  243201   307186897+   
5  Extended
/dev/mapper/isw_bfacafefej_Volume0p5  204959  205230 2184808+  
82  Linux swap / Solaris
/dev/mapper/isw_bfacafefej_Volume0p6  205231  237122   256172458+  
83  Linux
/dev/mapper/isw_bfacafefej_Volume0p7  237123  24320148829536   
83  Linux

ubu...@ubuntu:~$ sudo mount --rbind /dev /target/dev
ubu...@ubuntu:~$ sudo cp /etc/resolv.conf /target/etc/
ubu...@ubuntu:~$ sudo chroot /target
r...@ubuntu:/# mount
/dev/mapper/isw_bfacafefej_Volume06 on / type ext4 (rw,errors=remount-ro)
r...@ubuntu:/# apt-get update
[...]
r...@ubuntu:/# apt-get install grub
[...]
Unpacking grub (from .../grub_0.97-29ubuntu59_i386.deb) ...
Processing triggers for man-db ...
Setting up grub (0.97-29ubuntu59) ...

r...@ubuntu:/# cp /usr/lib/grub/i386-pc/* /boot/grub/

Now create a device map so that GRUB knows how to access the RAID array, i.e. 
with the text editor vi.

r...@ubuntu:/# cat /boot/grub/device.map
(fd0) /dev/fd0
(hd0) /dev/mapper/isw_bfacafefej_Volume0

I have to add --device-map, otherwise GRUB1 mentions "Unknown partition table 
signature".
GPartEd has no problems with my partition table, so I think it is correct.

r...@ubuntu:/# grub --no-curses --device-map=/boot/grub/device.map

grub> find /boot/grub/stage1
find /boot/grub/stage1

Error 15: File not found
grub> device (hd0) /dev/mapper/isw_bfacafefej_Volume0
device (hd0) /dev/mapper/isw_bfacafefej_Volume0
grub> find /boot/grub/stage1
find /boot/grub/stage1

Error 15: File not found

grub> geometry (hd0) 
geometry (hd0)
drive 0x80: C/H/S = 243201/255/63, The number of sectors = -387927552, 
/dev/mapper/isw_bfacafefej_Volume0
   Partition num: 0,  Filesystem type unknown, partition type 0x7
   Partition num: 1,  Filesystem type unknown, partition type 0x7
   Partition num: 2,  Filesystem type un

Re: Fix for grub_assert_fail undefined on NetBSD and other platforms

2009-12-22 Thread Grégoire Sutre

Hi,

> Unfortunately, I couldn't test this on NetBSD, where old technique was
> reported failing as GCC optimizations didn't happen.  Can Grégoire
> Sutr or anybody else try this out on NetBSD and confirm?

Thanks for looking into this.

I tested the second version of the patch.  Linking now works without 
errors but I get new warnings:


./include/grub/list.h:44: warning: 'error' attribute directive ignored

I attach the log of (./autogen.sh && ./configure && gmake grub-fstest 
LDFLAGS=-lintl).  This is on NetBSD 5.0 with gcc 4.1.3 (the default). 
If I use gcc 4.4 instead, then I do not get any warning.


Grégoire
acinclude.m4:17: warning: underquoted definition of grub_PROG_TARGET_CC
acinclude.m4:17:   run info '(automake)Extending aclocal'
acinclude.m4:17:   or see 
http://sources.redhat.com/automake/automake.html#Extending-aclocal
configure.ac:42: warning: AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET
../../lib/autoconf/general.m4:1819: AC_CANONICAL_TARGET is expanded from...
configure.ac:42: the top level
configure.ac:42: warning: AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET
../../lib/autoconf/general.m4:1819: AC_CANONICAL_TARGET is expanded from...
configure.ac:42: the top level
configure.ac:42: warning: AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET
../../lib/autoconf/general.m4:1819: AC_CANONICAL_TARGET is expanded from...
configure.ac:42: the top level
configure.ac:42: warning: AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET
../../lib/autoconf/general.m4:1819: AC_CANONICAL_TARGET is expanded from...
configure.ac:42: the top level
configure.ac:41: installing `./config.guess'
configure.ac:176: required file `./config.rpath' not found
configure.ac:41: installing `./config.sub'
configure.ac:35: installing `./install-sh'
configure.ac:35: installing `./missing'
automake: no `Makefile.am' found for any configure output
WARNING: C file isn't a module: ac.c
WARNING: C file isn't a module: cipher.c
WARNING: C file isn't a module: dsa.c
WARNING: C file isn't a module: ecc.c
WARNING: C file isn't a module: elgamal.c
WARNING: C file isn't a module: hash-common.c
WARNING: C file isn't a module: hmac-tests.c
WARNING: C file isn't a module: md.c
WARNING: C file isn't a module: primegen.c
WARNING: C file isn't a module: pubkey.c
WARNING: C file isn't a module: rsa.c
checking for a BSD-compatible install... /usr/pkg/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/pkg/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... i386-unknown-netbsdelf5.0.
checking host system type... i386-unknown-netbsdelf5.0.
checking target system type... i386-unknown-netbsdelf5.0.
checking for cmp... cmp
checking for bison... bison
checking for gawk... (cached) gawk
checking whether make sets $(MAKE)... (cached) yes
checking for ruby... /usr/pkg/bin/ruby
checking for makeinfo... /usr/bin/makeinfo
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/pkg/bin/ggrep
checking for egrep... /usr/pkg/bin/ggrep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether NLS is requested... yes
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking whether we are using the GNU C Library 2 or newer... no
checking for ranlib... ranlib
checking for strerror in -lcposix... no
checking for an ANSI C-conforming const... yes
checking for signed... yes
checking for inline... inline
checking for off_t... yes
checking for size_t... yes
checking for long long... yes
checking for long double... yes
checking for wchar_t... yes
checking for wint_t... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for intmax_t... yes
checking whether printf() supports POSIX/XSI format strings... yes
checking for working alloca.h... no
checking for alloca... yes
checking for stdlib.h... (cached) yes
checking for unistd.h.

Re: How to install grub on fakeraid (raid 0) which spans 2 TB?

2009-12-22 Thread Felix Zielcke
Am Dienstag, den 22.12.2009, 18:02 +0100 schrieb "André Heynatz":
> I have bought two 1 TB harddisks and one 2 TB harddisk (backup).
> I want to use the 1 TB harddisks in a RAID 0 array (Intel ICH8R
> Fakeraid).
> 

> I wanted to install Linux, then create the data partition with
> Win XP SP3 Disk Management Tool. The Linux install failed
> because Ubuntu wanted to install GRUB1 which is not part of
> the install CD. 

There was a bug that GRUB Legacy wasn't included on the karmic DVD but
that should have been fixed already. So make sure you use a fresh image
file.

> I wonder that Ubuntu uses GRUB2 at all at the
> moment because the FakeRaid support is still lacking which was
> known before release (a severe regression).

That's why grub-installer uses still GRUB Legacy in case /boot is on a
dmraid.


GRUB Legacy is complete dead for us, so if you want to have help for
that you have to ask at some Ubuntu place or somewhere else.
With GRUB 2 you could try the lucid (10.04) package out.
At least grub-probe should work there.
But I never tested if grub-setup works and so not if it actually boots
correctly from a dmraid.

-- 
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer



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


Re: Fix for grub_assert_fail undefined on NetBSD and other platforms

2009-12-22 Thread Felix Zielcke
Am Dienstag, den 22.12.2009, 18:07 +0100 schrieb Grégoire Sutre:
> This is on NetBSD 5.0 with gcc 4.1.3 (the default). 
> If I use gcc 4.4 instead, then I do not get any warning. 

It looks like gcc 4.3 introduced the error attribute.
But this isn't documented at the gcc.gnu.org/gcc-4.X/changes.html pages.
Only the gcc-4.3 manual avaible there explains it but not the gcc-4.2
one.
-- 
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer



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


Re: Fix for grub_assert_fail undefined on NetBSD and other platforms

2009-12-22 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Grégoire Sutre wrote:
> Hi,
>
> > Unfortunately, I couldn't test this on NetBSD, where old technique was
> > reported failing as GCC optimizations didn't happen.  Can Grégoire
> > Sutr or anybody else try this out on NetBSD and confirm?
>
> Thanks for looking into this.
>
> I tested the second version of the patch.  Linking now works without
> errors but I get new warnings:
>
> ./include/grub/list.h:44: warning: 'error' attribute directive ignored
This situation is acceptable. In unlikely case that cast is indeed bad
you will get runtime error instead of compile error. But it would be a
benefit if abort message would de improved by defining intermidiate
macro while will pass __LINE__ and __FILE__ to bad_cast_real which will
use it to tell developper where there is a problem
>
> I attach the log of (./autogen.sh && ./configure && gmake grub-fstest
> LDFLAGS=-lintl).  This is on NetBSD 5.0 with gcc 4.1.3 (the default).
> If I use gcc 4.4 instead, then I do not get any warning.
>
> Grégoire
> 
>
> ___
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko




signature.asc
Description: OpenPGP digital signature
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: How to install grub on fakeraid (raid 0) which spans 2 TB?

2009-12-22 Thread André Heynatz

 Original-Nachricht 
> Datum: Tue, 22 Dec 2009 18:24:20 +0100
> Von: Felix Zielcke 
> An: The development of GNU GRUB 
> Betreff: Re: How to install grub on fakeraid (raid 0) which spans 2 TB?

> Am Dienstag, den 22.12.2009, 18:02 +0100 schrieb "André Heynatz":
> > I have bought two 1 TB harddisks and one 2 TB harddisk (backup).
> > I want to use the 1 TB harddisks in a RAID 0 array (Intel ICH8R
> > Fakeraid).
> > 
> 
> > I wanted to install Linux, then create the data partition with
> > Win XP SP3 Disk Management Tool. The Linux install failed
> > because Ubuntu wanted to install GRUB1 which is not part of
> > the install CD. 
> 
> There was a bug that GRUB Legacy wasn't included on the karmic DVD but
> that should have been fixed already. So make sure you use a fresh image
> file.
> 
> > I wonder that Ubuntu uses GRUB2 at all at the
> > moment because the FakeRaid support is still lacking which was
> > known before release (a severe regression).
> 
> That's why grub-installer uses still GRUB Legacy in case /boot is on a
> dmraid.
> 
> 
> GRUB Legacy is complete dead for us, so if you want to have help for
> that you have to ask at some Ubuntu place or somewhere else.
> With GRUB 2 you could try the lucid (10.04) package out.
> At least grub-probe should work there.
> But I never tested if grub-setup works and so not if it actually boots
> correctly from a dmraid.
> 
> -- 
> Felix Zielcke
> Proud Debian Maintainer and GNU GRUB developer

I know my initial mail is very long. Please read it completely. At first I have 
tried GRUB1, then I have tried GRUB2 with the Lucid package - no success yet. 
The autodetection of operating systems is better in GRUB2, so I would prefer to 
use the new version. But it does not work even though dmraid is recognized. The 
configuration seems to be ok, but I cannot boot.
With GRUB1 I had more success, but not with the partition order I chose because 
of a bug in the Windows XP SP3 Disk Management Tool. All details are in my post.

Thanks for your help,

André

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


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


Re: How to install grub on fakeraid (raid 0) which spans 2 TB?

2009-12-22 Thread Bruce Dubbs

André Heynatz wrote:

I have bought two 1 TB harddisks and one 2 TB harddisk (backup).
I want to use the 1 TB harddisks in a RAID 0 array (Intel ICH8R Fakeraid).

OS: Win XP SP3, Win 7, Ubuntu Linux 9.10 32 Bit

My partition plan 1:

P ntfs  300 GB Windows XP SP3 32 Bit
P ntfs  300 GB Windows 7 32 Bit
E
L swap2 GB Linux swap
L ext4  250 GB Ubuntu Linux 9.10 (Karmic) 32 Bit
L ntfs 1100 GB data (for data exchange and storage)
L ext4   48 GB spare space for testing of new OSes


I'd suggest:

P ext2  100 MB /boot
P ntfs  300 GB Windows XP SP3 32 Bit
P ntfs  300 GB Windows 7 32 Bit
E
L swap2 GB Linux swap
L ext4  250 GB Ubuntu Linux 9.10 (Karmic) 32 Bit
L ntfs 1100 GB data (for data exchange and storage)
L ext4   48 GB spare space for testing of new OSes

There is no need for /boot to be on a raid or other 'special' partition 
type.


  -- Bruce


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


New French PO file for 'grub' (version 1.97+20091122)

2009-12-22 Thread Translation Project Robot
Hello, gentle maintainer.

This is a message from the Translation Project robot.

A revised PO file for textual domain 'grub' has been submitted
by the French team of translators.  The file is available at:

http://translationproject.org/latest/grub/fr.po

(We can arrange things so that in the future such files are automatically
e-mailed to you when they arrive.  Ask at the address below if you want this.)

All other PO files for your package are available in:

http://translationproject.org/latest/grub/

Please consider including all of these in your next release, whether
official or a pretest.

Whenever you have a new distribution with a new version number ready,
containing a newer POT file, please send the URL of that distribution
tarball to the address below.  The tarball may be just a pretest or a
snapshot, it does not even have to compile.  It is just used by the
translators when they need some extra translation context.

The following HTML page has been updated:

http://translationproject.org/domain/grub.html

If any question arises, please contact the translation coordinator.

Thank you for all your work,

The Translation Project robot, in the
name of your translation coordinator.




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


New template for 'grub' made available

2009-12-22 Thread Translation Project Robot
Hello, gentle maintainer.

This is a message from the Translation Project robot.  (If you have
any questions, send them to .)

A new POT file for textual domain 'grub' has been made available
to the language teams for translation.  It is archived as:

http://translationproject.org/POT-files/grub-1.97+20091221.pot

Whenever you have a new distribution with a new version number ready,
containing a newer POT file, please send the URL of that distribution
tarball to the address below.  The tarball may be just a pretest or a
snapshot, it does not even have to compile.  It is just used by the
translators when they need some extra translation context.

Below is the URL which has been provided to the translators of your
package.  Please inform the translation coordinator, at the address
at the bottom, if this information is not current:


http://download.savannah.gnu.org/releases-noredirect/grub/cpina/grub-1.97+20091221.tar.gz

We can arrange things so that translated PO files are automatically e-mailed
to you when they arrive.  Ask at the address below if you want this.

Thank you for all your work,

The Translation Project robot, in the
name of your translation coordinator.




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


Re: grub_error messages

2009-12-22 Thread Carles Pina i Estany

Hi,

On Dec/22/2009, Vladimir '??-coder/phcoder' Serbinenko wrote:
> Jordi Mallach wrote:
> > On Mon, Dec 21, 2009 at 10:19:16PM +, Carles Pina i Estany wrote:
> >   
> >> b) At beginning I thought that we would not gettext error messages, but
> >> I see that lot of these messages appears to the end user. Do we gettext
> >> using N_(" ") and then where it's printed I use _(" ") ? I would say
> >> yes.
> >> 
> >
> > No! Don't use any of N_() or _() if the message isn't meant to be 
> > translated.
> > If it's extracted into the pot file but then it's not used by GRUB (not
> > being marked with the necessary gettext call), it's a waste of time for
> > translators, of course.
> >
> >   
> Jordi, I think you misunderstand. What Carles propose is to do real
> gettext call in grub_error and not before calling it. We already use N_
> for this purpose.

Vladimir: you got my point.

In my mail I mixed a bit two messages:
a) Asking confirmation that we will translate that messages (that my
first thought was "not needed" but then I see that appears more than I
was thinking)

b) Implementation.

Vladimir and everybody: I think that these strings are printed by
grub_print_error (void), (kern/err.c), in this way:
grub_err_printf ("error: %s\n", grub_errmsg);

so we should NOT capitalise the message strings (in English, after colon
is not capitalised). Plus I'm thinking to do:
grub_err_printf ("error: %s.\n", _(grub_errmsg));

So the "." is not part of each string and we save some bytes.

What do you think?

I haven't tested what I said above...

-- 
Carles Pina i Estany
http://pinux.info


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


New Indonesian PO file for 'grub' (version 1.97+20091221)

2009-12-22 Thread Translation Project Robot
Hello, gentle maintainer.

This is a message from the Translation Project robot.

A revised PO file for textual domain 'grub' has been submitted
by the Indonesian team of translators.  The file is available at:

http://translationproject.org/latest/grub/id.po

(We can arrange things so that in the future such files are automatically
e-mailed to you when they arrive.  Ask at the address below if you want this.)

All other PO files for your package are available in:

http://translationproject.org/latest/grub/

Please consider including all of these in your next release, whether
official or a pretest.

Whenever you have a new distribution with a new version number ready,
containing a newer POT file, please send the URL of that distribution
tarball to the address below.  The tarball may be just a pretest or a
snapshot, it does not even have to compile.  It is just used by the
translators when they need some extra translation context.

The following HTML page has been updated:

http://translationproject.org/domain/grub.html

If any question arises, please contact the translation coordinator.

Thank you for all your work,

The Translation Project robot, in the
name of your translation coordinator.




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


Re: Problems with grub-reboot/savedefault/default=saved

2009-12-22 Thread Colin Watson
On Wed, Dec 16, 2009 at 02:28:03PM -0800, Jordan Uggla wrote:
> There are multiple problems with grub-reboot/savedefault/default=saved.

Hi,

I do intend to follow up on this; however, due to Christmas holidays and
the like it won't be until the new year. I'm just sending this message
to let you know that I'm not ignoring this thread. I have a slightly
modified version of this patch queued up for testing.

Thanks,

-- 
Colin Watson   [cjwat...@ubuntu.com]


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


Re: Fix for grub_assert_fail undefined on NetBSD and other platforms

2009-12-22 Thread BVK Chaitanya
2009/12/22 Vladimir 'φ-coder/phcoder' Serbinenko :
>> ./include/grub/list.h:44: warning: 'error' attribute directive ignored
> This situation is acceptable. In unlikely case that cast is indeed bad
> you will get runtime error instead of compile error. But it would be a
> benefit if abort message would de improved by defining intermidiate
> macro while will pass __LINE__ and __FILE__ to bad_cast_real which will
> use it to tell developper where there is a problem


Attached patch has __LINE__ and __FILE__ tags added.

I ran indent on modified headers (list.h, handler.h) so patch has few
coding style changes extra.



-- 
bvk.chaitanya
=== modified file 'include/grub/handler.h'
--- include/grub/handler.h  2009-03-01 17:51:44 +
+++ include/grub/handler.h  2009-12-23 04:14:29 +
@@ -27,8 +27,8 @@
 {
   struct grub_handler *next;
   const char *name;
-  grub_err_t (*init) (void);
-  grub_err_t (*fini) (void);
+grub_err_t (*init) (void);
+grub_err_t (*fini) (void);
 };
 typedef struct grub_handler *grub_handler_t;
 
@@ -41,20 +41,20 @@
 };
 typedef struct grub_handler_class *grub_handler_class_t;
 
-extern grub_handler_class_t EXPORT_VAR(grub_handler_class_list);
+extern grub_handler_class_t EXPORT_VAR (grub_handler_class_list);
 
-void EXPORT_FUNC(grub_handler_register) (grub_handler_class_t class,
-grub_handler_t handler);
-void EXPORT_FUNC(grub_handler_unregister) (grub_handler_class_t class,
-  grub_handler_t handler);
-grub_err_t EXPORT_FUNC(grub_handler_set_current) (grub_handler_class_t class,
- grub_handler_t handler);
+void EXPORT_FUNC (grub_handler_register) (grub_handler_class_t class,
+ grub_handler_t handler);
+void EXPORT_FUNC (grub_handler_unregister) (grub_handler_class_t class,
+   grub_handler_t handler);
+grub_err_t EXPORT_FUNC (grub_handler_set_current) (grub_handler_class_t class,
+  grub_handler_t handler);
 
 #define GRUB_AS_HANDLER(ptr) \
   ((GRUB_FIELD_MATCH (ptr, grub_handler_t, next) && \
 GRUB_FIELD_MATCH (ptr, grub_handler_t, name) && \
 GRUB_FIELD_MATCH (ptr, grub_handler_t, init) && \
 GRUB_FIELD_MATCH (ptr, grub_handler_t, fini)) ? \
-   (grub_handler_t) ptr : grub_assert_fail ())
+   (grub_handler_t) ptr : grub_bad_type_cast (__LINE__, __FILE__))
 
 #endif /* ! GRUB_HANDLER_HEADER */

=== modified file 'include/grub/list.h'
--- include/grub/list.h 2009-11-09 14:25:03 +
+++ include/grub/list.h 2009-12-23 05:54:34 +
@@ -22,6 +22,7 @@
 
 #include 
 #include 
+#include 
 
 struct grub_list
 {
@@ -32,38 +33,34 @@
 typedef int (*grub_list_hook_t) (grub_list_t item);
 typedef int (*grub_list_test_t) (grub_list_t new_item, grub_list_t item);
 
-void EXPORT_FUNC(grub_list_push) (grub_list_t *head, grub_list_t item);
-void * EXPORT_FUNC(grub_list_pop) (grub_list_t *head);
-void EXPORT_FUNC(grub_list_remove) (grub_list_t *head, grub_list_t item);
-int EXPORT_FUNC(grub_list_iterate) (grub_list_t head, grub_list_hook_t hook);
-void EXPORT_FUNC(grub_list_insert) (grub_list_t *head, grub_list_t item,
-   grub_list_test_t test);
-
-/* This function doesn't exist, so if assertion is false for some reason, the
-   linker would fail.  */
-#ifdef APPLE_CC
-/* This approach fails with Apple's gcc. Use grub_abort.  */
-#include 
+void EXPORT_FUNC (grub_list_push) (grub_list_t * head, grub_list_t item);
+void *EXPORT_FUNC (grub_list_pop) (grub_list_t * head);
+void EXPORT_FUNC (grub_list_remove) (grub_list_t * head, grub_list_t item);
+int EXPORT_FUNC (grub_list_iterate) (grub_list_t head, grub_list_hook_t hook);
+void EXPORT_FUNC (grub_list_insert) (grub_list_t * head, grub_list_t item,
+grub_list_test_t test);
+
+static inline void *grub_bad_type_cast (int line, const char *file)
+  __attribute__ ((error ("bad type cast between incompatible grub types")));
+
 static inline void *
-grub_assert_fail (void)
+grub_bad_type_cast (int line, const char *file)
 {
-   grub_abort ();
-   return 0;
+  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
+ file, line);
+  return 0;
 }
-#else
-extern void* grub_assert_fail (void);
-#endif
 
 #define GRUB_FIELD_MATCH(ptr, type, field) \
   ((char *) &(ptr)->field == (char *) &((type) (ptr))->field)
 
 #define GRUB_AS_LIST(ptr) \
   (GRUB_FIELD_MATCH (ptr, grub_list_t, next) ? \
-   (grub_list_t) ptr : grub_assert_fail ())
+   (grub_list_t) ptr : grub_bad_type_cast (__LINE__, __FILE__))
 
 #define GRUB_AS_LIST_P(pptr) \
   (GRUB_FIELD_MATCH (*pptr, grub_list_t, next) ? \
-   (grub_list_t *) (void *) pptr : grub_assert_fail ())
+   (grub_list_t *) (void *) pptr : grub_bad_type_cast (__LINE__, __FILE__))
 
 struct grub_named_list
 {
@@ -72,18 +69,18 @@
 };
 typedef

Re: [solved] Re: USB device not seen by grub

2009-12-22 Thread Chris Jones
On Sat, Dec 05, 2009 at 04:16:45AM EST, Vladimir 'φ-coder/phcoder' Serbinenko 
wrote:
> Chris Jones wrote:

Hello Vladimir,

[..]

> > Also, is there any way I can run the grub command line on a system
> > that's already booted, so I can explore its possibities in a context
> > where I have internet access, browse documentation, etc..?
> >
> >   
> I'm working on it but the current problem is that I haven't found a
> syscall in linux to get physical address of a page. Does anyone has a
> suggestion?

Just curious as to whether anything came of this.

One thing further regarding booting a kernel that lives on a USB stick,
is that where it works fine when grub lives on the HDD, oddly enough, I
have not been able to boot that same kernel from a CD image created via
grub-mkrescue.

What I was trying to do is have some means of booting the USB stick in
the event the target machine has a bootable CD/DVD device and does not
let you boot off of a USB device.

When I leave the debug=uhci tracing on, I can see that it is generating
a few screenful of messages at:

  uhci.c:403 ..

They're all basically the same as previously, giving some details like
flags settings, addresses, completion codes, etc. for what appear to be
USB 'transactions'.

This is followed by exactly three identical sequences of entries at
lines:

  uhci.c:478 ..
  uhci.c:482 
  uhci.c:493 
  uhci.c:539 
  uhci.c:543

In turn this is followed by a branch back to uhci.c:403 where the same
messages as previously are displayed at the terminal.

I must have let this run for about a half hour and even without tracing,
the boot process never took off.

Again this does not occur when I used the copy of grub that lives on the
hard drive.

The CD images were created with each of the versions of grub that I have
on this machine, 1.96 that comes with debian 'lenny', 1.97 beta3, that
comes with debian 'squeeze' at least when I installed it about two
months ago, and 1.97 beta4 that calme with ubuntu 9.10.

Incidentally, I just checked the exact spelling of grub-mkrescue and
found that there is also a grub-mkimage, so maybe I'm using the wrong
script.

In any event, since I have pretty much abandoned this project of booting
off of a USB stick for the time being, I am not too concerned about this
being fixed or worked around, but I thought I might as well report that
I ran into this problem.

Thank you again for your help.

CJ


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