running grub-install / grub-mkconfig from livecd/dvd/usb

2009-01-06 Thread Kenneth Andresen
I have finally installed grub2 on a SD memory stick from a persistent
LiveUSB, however I ran into several difficulties during the install; the
main ones where as follows:

1) Running grub-install and grub-mkconfig from within a persistent
liveUSB session cause grub not to find the root device. The "mount"
command returns "rootfs on / type rootfs (rw)".
For grub-install the work-around is to use the "--root-device" parameter
and point it to where the installation is desired, for grub-mkconfig I
found no immediate workaround but selected to create my own grub.cfg by
hand. It may be smart to add the --root-device parameter to all the
commands such as grub-mkconfig that requires figuring the root-device.

2) As from the above, the parameter "--root-device" may cause problems
later on(?) In my case I used some time to figure out that --root-device
in fact was not the device that was root on the system I was currently
running, but the root device I wanted to install to. I am imagining
several alternative problems later on where we are using separate root
and boot partitions which may be on entirely different devices from each
other. Due to the lack of GPT support under Grub legacy, I am frequently
having a boot partition on a disk with msdos label but with everything
else on the GPT device.

3) The "device.map" file creates links between (hd0) /dev/sda, (hd1)
/dev/sdb, (hd2) /dev/sdg and so on. Notice /dev/sdg - this is due to my
system having a built-in card reader, and firewire/usb disks are
detected after these card reader entries even though they contain no
memory sticks. I am experiencing instability in the use of /dev/sda and
so on - frequently I find my firewire external disk detected as /dev/sda
instead of my internal one. Would it be possible to use something more
specific as device.map entries?; such as:
(hd0) UUID=xxx--x or (hd1) label=...

I would like to use UUID and or label also inside the grub.cfg instead of
root (hd0)
such as
root (UUID=xxx--x)

4) When booting into my new shiny SD memory bootable stick and pressing
ctrl-c and typing help, I am presented with a long list of options - I
suspect a larger part of the help has scrolled beyond my screen. I tried
with "help | more", but that did not result in anything. Is there an
easy way to while in grub get the full help listing in a similar way to
the intended use of "help | less" pr "help | more"?

These where my initial findings from my first setup of grub2 so if there
are any tricks I may use such as force the order of /dev/sda ...
/dev/sdh to always be the same or something, I would greatly appreciate it!


-- 
Best regards,
Kenneth


smime.p7s
Description: S/MIME Cryptographic Signature
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH] Converter for the new font engine

2009-01-06 Thread Bean
Hi,

This patch converts existing font to pf2. It uses the freetype2
library, so it can support most common file format, like bdf, pcf.gz,
ttf, etc.

Usage: grub-mkfont [OPTIONS] FONT_FILES

Options:
  -o, --output=FILE_NAMEset output file name
  -i, --index=N set font index
  -n, --name=S  set font name
  -s, --size=N  set font size
  -d, --desc=N  set font descent
  -b, --boldconvert to bold font
  -a, --auto-hint   enable autohint
  --no-bitmap   don't use bitmap glyth
  -h, --helpdisplay this message and exit
  -V, --version print version information and exit
  -v, --verbose print verbose message

2008-01-06  Bean 

* Makefile.in (freetype_cflags): New macro.
(freetype_libs): New macro.

* common.rmk (bin_UTILITIES): Add grub-mkfont.
(grub_mkfont_SOURCES): New macro.
(grub_mkfont_CFLAGS): New macro.
(grub_mkfont_LDFLAGS): New macro.

* configure.ac (FREETYPE): New test for freetype.
(freetype_cflags): New macro.
(freetype_libs): New macro.

* util/grub-mkfont.c: New file.


-- 
Bean
diff --git a/DISTLIST b/DISTLIST
index 22be10b..521aec4 100644
--- a/DISTLIST
+++ b/DISTLIST
@@ -424,6 +424,7 @@ util/grub-fstest.c
 util/grub-mkconfig.in
 util/grub-mkconfig_lib.in
 util/grub-mkdevicemap.c
+util/grub-mkfont.c
 util/grub-pe2elf.c
 util/grub-probe.c
 util/hostdisk.c
diff --git a/Makefile.in b/Makefile.in
index 8cc0f1a..d411b64 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -95,6 +95,8 @@ enable_grub_emu = @enable_grub_emu@
 enable_grub_fstest = @enable_grub_fstest@
 enable_grub_pe2elf = @enable_grub_pe2elf@
 enable_lzo = @enable_lzo@
+freetype_cflags = @freetype_cflags@
+freetype_libs = @freetype_libs@
 
 ### General variables.
 
diff --git a/conf/common.rmk b/conf/common.rmk
index 78a7dc5..45bf7a5 100644
--- a/conf/common.rmk
+++ b/conf/common.rmk
@@ -45,6 +45,12 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c 
util/misc.c   \
disk/mdraid_linux.c disk/dmraid_nvidia.c\
grub_fstest_init.c
 
+# For grub-mkfont.
+bin_UTILITIES += grub-mkfont
+grub_mkfont_SOURCES = util/grub-mkfont.c util/misc.c
+grub_mkfont_CFLAGS = $(freetype_cflags)
+grub_mkfont_LDFLAGS = $(freetype_libs)
+
 # For the parser.
 grub_script.tab.c grub_script.tab.h: normal/parser.y
$(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y
diff --git a/configure.ac b/configure.ac
index ad6429f..3248ece 100644
--- a/configure.ac
+++ b/configure.ac
@@ -127,6 +127,16 @@ if test "x$YACC" = x; then
   AC_MSG_ERROR([bison is not found])
 fi
 
+AC_CHECK_PROGS([FREETYPE], [freetype-config])
+if test "x$FREETYPE" = x; then
+  AC_MSG_ERROR([freetype-config is not found])
+fi
+
+freetype_cflags=`freetype-config --cflags`
+freetype_libs=`freetype-config --libs`
+AC_SUBST([freetype_cflags])
+AC_SUBST([freetype_libs])
+
 for file in /usr/src/unifont.bdf ; do
   if test -e $file ; then
 AC_SUBST([UNIFONT_BDF], [$file])
diff --git a/util/grub-mkfont.c b/util/grub-mkfont.c
new file mode 100644
index 000..10734cf
--- /dev/null
+++ b/util/grub-mkfont.c
@@ -0,0 +1,450 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2008 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 
+#include 
+
+#include 
+#include FT_FREETYPE_H
+#include 
+
+#define GRUB_FONT_DEFAULT_SIZE 16
+#define GRUB_FONT_DEFAULT_DESC 2
+
+struct grub_glyph_info
+{
+  struct grub_glyph_info *next;
+  grub_uint32_t char_code;
+  int width;
+  int height;
+  int x_ofs;
+  int y_ofs;
+  int device_width;
+  int bitmap_size;
+  grub_uint8_t bitmap[0];
+};
+
+#define GRUB_FONT_FLAG_BOLD1
+#define GRUB_FONT_FLAG_AUTOHINT2
+#define GRUB_FONT_FLAG_NOBITMAP4
+
+struct grub_font_info
+{
+  char* name;
+  int style;
+  int desc;
+  int size;
+  int max_width;
+  int max_height;
+  int flags;
+  struct grub_glyph_info *glyph;
+};
+
+static struct option options[] =
+{
+  {"output", required_argument, 0, 'o'},
+  {"name", required_argument, 0, 'n'},
+  {"index", required_argument, 0, 'i'},
+  {"size", required_argument, 0, 's'},
+  {"desc", required_argument, 0, 'd'},
+  {"bold", no_argum

Re: [PATCH] Converter for the new font engine

2009-01-06 Thread Vesa Jääskeläinen
Bean wrote:
> Hi,
> 
> This patch converts existing font to pf2. It uses the freetype2
> library, so it can support most common file format, like bdf, pcf.gz,
> ttf, etc.
> 
> Usage: grub-mkfont [OPTIONS] FONT_FILES
> 
> Options:
>   -o, --output=FILE_NAMEset output file name
>   -i, --index=N set font index
>   -n, --name=S  set font name
>   -s, --size=N  set font size
>   -d, --desc=N  set font descent
>   -b, --boldconvert to bold font
>   -a, --auto-hint   enable autohint
>   --no-bitmap   don't use bitmap glyth
>   -h, --helpdisplay this message and exit
>   -V, --version print version information and exit
>   -v, --verbose print verbose message

Whoa... that was fast. I hope Colin didn't start yet with his
implementation.

Anyway. I think there needs to be support to specify ranges to font
files do not bloat unneededly.

Perhaps --range=0x1234-0x2345 ? (and allowing multiple of those)

Btw. what does --no-bitmap do here?



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


Re: [PATCH] Converter for the new font engine

2009-01-06 Thread Bean
On Tue, Jan 6, 2009 at 10:18 PM, Vesa Jääskeläinen  wrote:
> Perhaps --range=0x1234-0x2345 ? (and allowing multiple of those)

Yeah, looks good.

> Btw. what does --no-bitmap do here?

Some outline font contain bitmap strike as well, this option tell
freetype to ignore bitmap font when outline font exists.

-- 
Bean


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


Re: [PATCH] Converter for the new font engine

2009-01-06 Thread Bean
On Tue, Jan 6, 2009 at 10:21 PM, Bean  wrote:
> On Tue, Jan 6, 2009 at 10:18 PM, Vesa Jääskeläinen  wrote:
>> Perhaps --range=0x1234-0x2345 ? (and allowing multiple of those)
>
> Yeah, looks good.
>
>> Btw. what does --no-bitmap do here?
>
> Some outline font contain bitmap strike as well, this option tell
> freetype to ignore bitmap font when outline font exists.

Hi,

This new patch add --range parameter, for example:

grub-mkfont -r 0x20-0x7f  -o aa.pf2  h16.bdf


-- 
Bean
diff --git a/DISTLIST b/DISTLIST
index 22be10b..521aec4 100644
--- a/DISTLIST
+++ b/DISTLIST
@@ -424,6 +424,7 @@ util/grub-fstest.c
 util/grub-mkconfig.in
 util/grub-mkconfig_lib.in
 util/grub-mkdevicemap.c
+util/grub-mkfont.c
 util/grub-pe2elf.c
 util/grub-probe.c
 util/hostdisk.c
diff --git a/Makefile.in b/Makefile.in
index 8cc0f1a..d411b64 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -95,6 +95,8 @@ enable_grub_emu = @enable_grub_emu@
 enable_grub_fstest = @enable_grub_fstest@
 enable_grub_pe2elf = @enable_grub_pe2elf@
 enable_lzo = @enable_lzo@
+freetype_cflags = @freetype_cflags@
+freetype_libs = @freetype_libs@
 
 ### General variables.
 
diff --git a/conf/common.rmk b/conf/common.rmk
index 78a7dc5..45bf7a5 100644
--- a/conf/common.rmk
+++ b/conf/common.rmk
@@ -45,6 +45,12 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c 
util/misc.c   \
disk/mdraid_linux.c disk/dmraid_nvidia.c\
grub_fstest_init.c
 
+# For grub-mkfont.
+bin_UTILITIES += grub-mkfont
+grub_mkfont_SOURCES = util/grub-mkfont.c util/misc.c
+grub_mkfont_CFLAGS = $(freetype_cflags)
+grub_mkfont_LDFLAGS = $(freetype_libs)
+
 # For the parser.
 grub_script.tab.c grub_script.tab.h: normal/parser.y
$(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y
diff --git a/configure.ac b/configure.ac
index ad6429f..3248ece 100644
--- a/configure.ac
+++ b/configure.ac
@@ -127,6 +127,16 @@ if test "x$YACC" = x; then
   AC_MSG_ERROR([bison is not found])
 fi
 
+AC_CHECK_PROGS([FREETYPE], [freetype-config])
+if test "x$FREETYPE" = x; then
+  AC_MSG_ERROR([freetype-config is not found])
+fi
+
+freetype_cflags=`freetype-config --cflags`
+freetype_libs=`freetype-config --libs`
+AC_SUBST([freetype_cflags])
+AC_SUBST([freetype_libs])
+
 for file in /usr/src/unifont.bdf ; do
   if test -e $file ; then
 AC_SUBST([UNIFONT_BDF], [$file])
diff --git a/util/grub-mkfont.c b/util/grub-mkfont.c
new file mode 100644
index 000..814cb37
--- /dev/null
+++ b/util/grub-mkfont.c
@@ -0,0 +1,496 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2008 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 
+#include 
+
+#include 
+#include FT_FREETYPE_H
+#include 
+
+#define GRUB_FONT_DEFAULT_SIZE 16
+#define GRUB_FONT_DEFAULT_DESC 2
+#define GRUB_FONT_RANGE_BLOCK  1024
+
+struct grub_glyph_info
+{
+  struct grub_glyph_info *next;
+  grub_uint32_t char_code;
+  int width;
+  int height;
+  int x_ofs;
+  int y_ofs;
+  int device_width;
+  int bitmap_size;
+  grub_uint8_t bitmap[0];
+};
+
+#define GRUB_FONT_FLAG_BOLD1
+#define GRUB_FONT_FLAG_AUTOHINT2
+#define GRUB_FONT_FLAG_NOBITMAP4
+
+struct grub_font_info
+{
+  char* name;
+  int style;
+  int desc;
+  int size;
+  int max_width;
+  int max_height;
+  int flags;
+  int num_range;
+  grub_uint32_t *ranges;
+  struct grub_glyph_info *glyph;
+};
+
+static struct option options[] =
+{
+  {"output", required_argument, 0, 'o'},
+  {"name", required_argument, 0, 'n'},
+  {"index", required_argument, 0, 'i'},
+  {"range", required_argument, 0, 'r'},
+  {"size", required_argument, 0, 's'},
+  {"desc", required_argument, 0, 'd'},
+  {"bold", no_argument, 0, 'b'},
+  {"no-bitmap", no_argument, 0, 0x100},
+  {"auto-hint", no_argument, 0, 'a'},
+  {"help", no_argument, 0, 'h'},
+  {"version", no_argument, 0, 'V'},
+  {"verbose", no_argument, 0, 'v'},
+  {0, 0, 0, 0}
+};
+
+static void
+usage (int status)
+{
+  if (status)
+fprintf (stderr, "Try ``grub-mkfont --help'' for more information.\n");
+  else
+printf ("\
+Usage: grub-mkfont [OPTIONS] FONT_FILES\n\
+\nOptions:\n\
+  -o, --output=FILE_NAMEset output file name\n\
+  -i, --index=N set font index\n\
+  -r, --range=A-B   set font range\n\
+  -n, --name=S  

Re: [PATCH] Converter for the new font engine

2009-01-06 Thread Colin D Bennett
On Tue, 06 Jan 2009 16:18:15 +0200
Vesa Jääskeläinen  wrote:

> Bean wrote:
> > Hi,
> > 
> > This patch converts existing font to pf2. It uses the freetype2
> > library, so it can support most common file format, like bdf,
> > pcf.gz, ttf, etc.

Wow!  Thanks, Bean.  That is great!

> > Usage: grub-mkfont [OPTIONS] FONT_FILES
> > 
> > Options:
> >   -o, --output=FILE_NAMEset output file name
> >   -i, --index=N set font index
> >   -n, --name=S  set font name
> >   -s, --size=N  set font size
> >   -d, --desc=N  set font descent
> >   -b, --boldconvert to bold font
> >   -a, --auto-hint   enable autohint
> >   --no-bitmap   don't use bitmap glyth
> >   -h, --helpdisplay this message and exit
> >   -V, --version print version information and exit
> >   -v, --verbose print verbose message
> 
> Whoa... that was fast. I hope Colin didn't start yet with his
> implementation.

Nope, I didn't.  And I guess I won't bother making the Java converter
build with gcj in the GRUB makefile.

Regards,
Colin


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


Re: [PATCH] Converter for the new font engine

2009-01-06 Thread Bean
On Wed, Jan 7, 2009 at 1:04 AM, Colin D Bennett  wrote:
> On Tue, 06 Jan 2009 16:18:15 +0200
> Vesa Jääskeläinen  wrote:
>
>> Bean wrote:
>> > Hi,
>> >
>> > This patch converts existing font to pf2. It uses the freetype2
>> > library, so it can support most common file format, like bdf,
>> > pcf.gz, ttf, etc.
>
> Wow!  Thanks, Bean.  That is great!
>
>> > Usage: grub-mkfont [OPTIONS] FONT_FILES
>> >
>> > Options:
>> >   -o, --output=FILE_NAMEset output file name
>> >   -i, --index=N set font index
>> >   -n, --name=S  set font name
>> >   -s, --size=N  set font size
>> >   -d, --desc=N  set font descent
>> >   -b, --boldconvert to bold font
>> >   -a, --auto-hint   enable autohint
>> >   --no-bitmap   don't use bitmap glyth
>> >   -h, --helpdisplay this message and exit
>> >   -V, --version print version information and exit
>> >   -v, --verbose print verbose message
>>
>> Whoa... that was fast. I hope Colin didn't start yet with his
>> implementation.
>
> Nope, I didn't.  And I guess I won't bother making the Java converter
> build with gcj in the GRUB makefile.

Hi Colin,

BTW, there seems to be some new tags in the pf2 file created by java
converter, perhaps you can update the wiki page sometime ?

The new patch contains small bug fix for the device_width variable.

-- 
Bean
diff --git a/DISTLIST b/DISTLIST
index 22be10b..521aec4 100644
--- a/DISTLIST
+++ b/DISTLIST
@@ -424,6 +424,7 @@ util/grub-fstest.c
 util/grub-mkconfig.in
 util/grub-mkconfig_lib.in
 util/grub-mkdevicemap.c
+util/grub-mkfont.c
 util/grub-pe2elf.c
 util/grub-probe.c
 util/hostdisk.c
diff --git a/Makefile.in b/Makefile.in
index 8cc0f1a..d411b64 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -95,6 +95,8 @@ enable_grub_emu = @enable_grub_emu@
 enable_grub_fstest = @enable_grub_fstest@
 enable_grub_pe2elf = @enable_grub_pe2elf@
 enable_lzo = @enable_lzo@
+freetype_cflags = @freetype_cflags@
+freetype_libs = @freetype_libs@
 
 ### General variables.
 
diff --git a/conf/common.rmk b/conf/common.rmk
index 78a7dc5..45bf7a5 100644
--- a/conf/common.rmk
+++ b/conf/common.rmk
@@ -45,6 +45,12 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c 
util/misc.c   \
disk/mdraid_linux.c disk/dmraid_nvidia.c\
grub_fstest_init.c
 
+# For grub-mkfont.
+bin_UTILITIES += grub-mkfont
+grub_mkfont_SOURCES = util/grub-mkfont.c util/misc.c
+grub_mkfont_CFLAGS = $(freetype_cflags)
+grub_mkfont_LDFLAGS = $(freetype_libs)
+
 # For the parser.
 grub_script.tab.c grub_script.tab.h: normal/parser.y
$(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y
diff --git a/configure.ac b/configure.ac
index ad6429f..3248ece 100644
--- a/configure.ac
+++ b/configure.ac
@@ -127,6 +127,16 @@ if test "x$YACC" = x; then
   AC_MSG_ERROR([bison is not found])
 fi
 
+AC_CHECK_PROGS([FREETYPE], [freetype-config])
+if test "x$FREETYPE" = x; then
+  AC_MSG_ERROR([freetype-config is not found])
+fi
+
+freetype_cflags=`freetype-config --cflags`
+freetype_libs=`freetype-config --libs`
+AC_SUBST([freetype_cflags])
+AC_SUBST([freetype_libs])
+
 for file in /usr/src/unifont.bdf ; do
   if test -e $file ; then
 AC_SUBST([UNIFONT_BDF], [$file])
diff --git a/util/grub-mkfont.c b/util/grub-mkfont.c
new file mode 100644
index 000..9dffeef
--- /dev/null
+++ b/util/grub-mkfont.c
@@ -0,0 +1,497 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2008 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 
+#include 
+
+#include 
+#include FT_FREETYPE_H
+#include 
+
+#define GRUB_FONT_DEFAULT_SIZE 16
+#define GRUB_FONT_DEFAULT_DESC 2
+
+#define GRUB_FONT_RANGE_BLOCK  1024
+
+struct grub_glyph_info
+{
+  struct grub_glyph_info *next;
+  grub_uint32_t char_code;
+  int width;
+  int height;
+  int x_ofs;
+  int y_ofs;
+  int device_width;
+  int bitmap_size;
+  grub_uint8_t bitmap[0];
+};
+
+#define GRUB_FONT_FLAG_BOLD1
+#define GRUB_FONT_FLAG_AUTOHINT2
+#define GRUB_FONT_FLAG_NOBITMAP4
+
+struct grub_font_info
+{
+  char* name;
+  int style;
+  int desc;
+  int size;
+  int max_width;
+  int max_height;
+  int flags;
+  int num_range;
+ 

Re: [PATCH] Corrections to affs and sfs

2009-01-06 Thread Krzysztof Smiechowicz

Robert Millan pisze:


Index: fs/sfs.c
===
--- fs/sfs.c(revision 1919)
+++ fs/sfs.c(working copy)
@@ -172,7 +172,8 @@
  return grub_errno;
}
 
-  for (i = 0; i < grub_be_to_cpu16 (tree->nodes); i++)

+  grub_uint16_t nodescount = grub_be_to_cpu16(tree->nodes);
+  for (i = nodescount - 1; i >= 0; i--)


nodescount is only used once; why adding a variable?


  /* Follow the tree down to the leaf level.  */
- if ((grub_be_to_cpu32 (EXTNODE(tree, i)->key) >= block)
+ if ((grub_be_to_cpu32 (EXTNODE(tree, i)->key) <= block)
  && !tree->leaf)
{
- next = grub_be_to_cpu32 (EXTNODE (tree, i - 1)->data);
- break;
-   }
-
- /* In case the last node is reached just use that one, it is
-the right match.  */
- if (i + 1 == grub_be_to_cpu16 (tree->nodes) && !tree->leaf)
-   {
  next = grub_be_to_cpu32 (EXTNODE (tree, i)->data);
  break;
}


I'm not familiar with our SFS code.  Marco, if you have a minute could you
review this part?



Hello,

Any news about applying this patch? :)

Best regards,
Krzysztof
AROS Development Team


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


EFI Boot on MacPro

2009-01-06 Thread Ziling Zhao
I'm trying to get grub2 working on a Mac Pro using pure EFI.

So, I've mucked around a bit and grub is loading. I can have it load the
linux image as well, but it freezes soon after.

Output is:

  Booting 'Gentoo'

 [Linux-bzImage, setup=0x2c00, size=0x2ff4701]
Video mode: 180x1050...@0
Video frame buffer: f000

-- Then it freezes --

I seeded a bunch of grub_printf statements to see where it dies, and it
seems like it calls grub_machine_fini() (grub_loader_noreturn) is set to 1.
However, it doesn't seem to get back to grub_cmd_boot, which is calling
grub_loader_boot.

Anybody know what this is doing?

I've heard that people have successfully gotten non rEFItted makes to boot
Linux, can anybody confirm this?


I compiled the grub2 stuff with "./configure --with-platform=efi
--target=i386", this is grub trunk.



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


Re: EFI Boot on MacPro

2009-01-06 Thread peter cros
Hi,

The kernel vesion may be the bug there, I have found grub.efi needs 2.6.26
or later, configured with EFI enabled, else the result is similar to yours.

I have had a grub.efi test package built from vesion 1913, running  in
ubuntuforums.com (apple intel) for a while, a number of people tried it.

grub.efi it would load and run for Apple MacBook2,1, Apple mini2,1
MacBook pro 2,2 or earlier , i.e. none of the current Apple MacBooks, but no
reports   for Apple xserver, Imac or Mac Pro.

It is therefore very interesting that grub.efi loads and runs on the Mac
Pro, I would like to know what your the Model version is.

peter cros


On Wed, Jan 7, 2009 at 8:42 AM, Ziling Zhao  wrote:

> I'm trying to get grub2 working on a Mac Pro using pure EFI.
>
> So, I've mucked around a bit and grub is loading. I can have it load the
> linux image as well, but it freezes soon after.
>
> Output is:
>
>   Booting 'Gentoo'
>
>  [Linux-bzImage, setup=0x2c00, size=0x2ff4701]
> Video mode: 180x1050...@0
> Video frame buffer: f000
>
> -- Then it freezes --
>
> I seeded a bunch of grub_printf statements to see where it dies, and it
> seems like it calls grub_machine_fini() (grub_loader_noreturn) is set to 1.
> However, it doesn't seem to get back to grub_cmd_boot, which is calling
> grub_loader_boot.
>
> Anybody know what this is doing?
>
> I've heard that people have successfully gotten non rEFItted makes to boot
> Linux, can anybody confirm this?
>
>
> I compiled the grub2 stuff with "./configure --with-platform=efi
> --target=i386", this is grub trunk.
>
>
>
> --
> ~Ziling Zhao
>
>
>
> ___
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: EFI Boot on MacPro

2009-01-06 Thread Bean
On Wed, Jan 7, 2009 at 12:54 PM, peter cros  wrote:
> Hi,
>
> The kernel vesion may be the bug there, I have found grub.efi needs 2.6.26
> or later, configured with EFI enabled, else the result is similar to yours.
>
> I have had a grub.efi test package built from vesion 1913, running  in
> ubuntuforums.com (apple intel) for a while, a number of people tried it.
>
> grub.efi it would load and run for Apple MacBook2,1, Apple mini2,1
> MacBook pro 2,2 or earlier , i.e. none of the current Apple MacBooks, but no
> reports   for Apple xserver, Imac or Mac Pro.
>

Later models have switched to 64-bit firmware, you need to use
x86_64-efi version of grub2.

-- 
Bean


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


Re: EFI Boot on MacPro

2009-01-06 Thread Ziling Zhao
On Tuesday 06 January 2009 21:14:48 Bean wrote:
> On Wed, Jan 7, 2009 at 12:54 PM, peter cros  wrote:
> > Hi,
> >
> > The kernel vesion may be the bug there, I have found grub.efi needs
> > 2.6.26 or later, configured with EFI enabled, else the result is similar
> > to yours.
> >
> > I have had a grub.efi test package built from vesion 1913, running  in
> > ubuntuforums.com (apple intel) for a while, a number of people tried it.
> >
> > grub.efi it would load and run for Apple MacBook2,1, Apple mini2,1
> > MacBook pro 2,2 or earlier , i.e. none of the current Apple MacBooks, but
> > no reports   for Apple xserver, Imac or Mac Pro.
>
> Later models have switched to 64-bit firmware, you need to use
> x86_64-efi version of grub2.

Which models switched to 64bit firmware? Form the looks of it, all of them are 
still using EFI 1.x, does Grub2 support EFI 1.x with x86_64?

I believe the kernel version that I am running is 2.6.27. 

I'll try again with the x86_64 version of Grub2 tomorrow.

~Ziling Zhao


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


Re: EFI Boot on MacPro

2009-01-06 Thread peter cros
On Wed, Jan 7, 2009 at 4:14 PM, Bean  wrote:

> On Wed, Jan 7, 2009 at 12:54 PM, peter cros  wrote:
> > Hi,
> >
> > The kernel vesion may be the bug there, I have found grub.efi needs
> 2.6.26
> > or later, configured with EFI enabled, else the result is similar to
> yours.
> >
> > I have had a grub.efi test package built from vesion 1913, running  in
> > ubuntuforums.com (apple intel) for a while, a number of people tried it.
> >
> > grub.efi it would load and run for Apple MacBook2,1, Apple mini2,1
> > MacBook pro 2,2 or earlier , i.e. none of the current Apple MacBooks, but
> no
> > reports   for Apple xserver, Imac or Mac Pro.
> >
>
> Later models have switched to 64-bit firmware, you need to use
> x86_64-efi version of grub2.
>
> --
> Bean
>
> Thanks, I tried a --target =x86_64, using multilib, compiled on the
> MacBook2,1 in i386, built OK, but could not run it on the macbook2,1. (I
> dont have a later model )
>
> So does that mean I need to build another package for x86_64 and put that
> up for test  on later version Mac, quite a few people interested, especially
> for external drive booting.
>
> peter cros
>
>
> ___
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: EFI Boot on MacPro

2009-01-06 Thread Bean
On Wed, Jan 7, 2009 at 2:43 PM, Ziling Zhao  wrote:
> On Tuesday 06 January 2009 21:14:48 Bean wrote:
>> On Wed, Jan 7, 2009 at 12:54 PM, peter cros  wrote:
>> > Hi,
>> >
>> > The kernel vesion may be the bug there, I have found grub.efi needs
>> > 2.6.26 or later, configured with EFI enabled, else the result is similar
>> > to yours.
>> >
>> > I have had a grub.efi test package built from vesion 1913, running  in
>> > ubuntuforums.com (apple intel) for a while, a number of people tried it.
>> >
>> > grub.efi it would load and run for Apple MacBook2,1, Apple mini2,1
>> > MacBook pro 2,2 or earlier , i.e. none of the current Apple MacBooks, but
>> > no reports   for Apple xserver, Imac or Mac Pro.
>>
>> Later models have switched to 64-bit firmware, you need to use
>> x86_64-efi version of grub2.
>
> Which models switched to 64bit firmware? Form the looks of it, all of them are
> still using EFI 1.x, does Grub2 support EFI 1.x with x86_64?
>
> I believe the kernel version that I am running is 2.6.27.
>
> I'll try again with the x86_64 version of Grub2 tomorrow.

Hi,

The new ""Santa Rosa" generation of macbook is 64-bit. Although I
double that it's the problem. If the firmware doesn't match, you can't
load grub2 at all.

Oh btw, you shouldn't load 64-bit linux kernel in 32-bit firmware, and
vice verse.

Your problem could be caused by 2.6.27. I only test 2.6.26, perhaps
you can try that and see how it goes.

-- 
Bean


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


Re: EFI Boot on MacPro

2009-01-06 Thread peter cros
I am using ubuntu 810, kernel 2.6.27 no problem with grub.efi i386
MacBook2,1.

On Wed, Jan 7, 2009 at 5:43 PM, Ziling Zhao  wrote:

> On Tuesday 06 January 2009 21:14:48 Bean wrote:
> > On Wed, Jan 7, 2009 at 12:54 PM, peter cros  wrote:
> > > Hi,
> > >
> > > The kernel vesion may be the bug there, I have found grub.efi needs
> > > 2.6.26 or later, configured with EFI enabled, else the result is
> similar
> > > to yours.
> > >
> > > I have had a grub.efi test package built from vesion 1913, running  in
> > > ubuntuforums.com (apple intel) for a while, a number of people tried
> it.
> > >
> > > grub.efi it would load and run for Apple MacBook2,1, Apple mini2,1
> > > MacBook pro 2,2 or earlier , i.e. none of the current Apple MacBooks,
> but
> > > no reports   for Apple xserver, Imac or Mac Pro.
> >
> > Later models have switched to 64-bit firmware, you need to use
> > x86_64-efi version of grub2.
>
> Which models switched to 64bit firmware? Form the looks of it, all of them
> are
> still using EFI 1.x, does Grub2 support EFI 1.x with x86_64?
>
> I believe the kernel version that I am running is 2.6.27.
>
> I'll try again with the x86_64 version of Grub2 tomorrow.
>
> ~Ziling Zhao
>
>
> ___
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel