]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2005-11-22 Mike Small <smallm@panix.com>
authorhollisb <hollisb@localhost>
Wed, 23 Nov 2005 04:25:16 +0000 (04:25 +0000)
committerhollisb <hollisb@localhost>
Wed, 23 Nov 2005 04:25:16 +0000 (04:25 +0000)
* util/powerpc/ieee1275/grub-install.in (grubdir): Fixed partition
number regex so multidigit numbers are recognized correctly.

* loader/powerpc/ieee1275/linux.c (grub_rescue_cmd_linux): Add a
debugging message before attempting to claim memory.
(grub_rescue_cmd_initrd): Add a claim debugging message and try
multiple addresses in case of failure.

ChangeLog
conf/common.mk
conf/powerpc-ieee1275.mk
loader/powerpc/ieee1275/linux.c
util/powerpc/ieee1275/grub-install.in

index 173480ccbf8837dd5180b4cb67767737e446bc37..1918abf651f82b69cbb7d339d15d88d7289a6617 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2005-11-22  Mike Small  <smallm@panix.com>
+
+       * util/powerpc/ieee1275/grub-install.in (grubdir): Fixed partition
+       number regex so multidigit numbers are recognized correctly.
+
+2005-11-22  Mike Small  <smallm@panix.com>
+
+       * loader/powerpc/ieee1275/linux.c (grub_rescue_cmd_linux): Add a
+       debugging message before attempting to claim memory.
+       (grub_rescue_cmd_initrd): Add a claim debugging message and try
+       multiple addresses in case of failure.
+
 2005-11-22  Hollis Blanchard  <hollis@penguinppc.org>
 
        * term/tparm.c (get_space): Remove empty `if' statement.
index 38c38ac95ec8a161009fbdd36e79399fd416561c..9422456b5a56ff01e5cb46859f3c0fe5ab78a717 100644 (file)
@@ -1309,6 +1309,52 @@ search_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # For test.mod.
 test_mod_SOURCES = commands/test.c
+CLEANFILES += test.mod mod-test.o mod-test.c pre-test.o test_mod-commands_test.o def-test.lst und-test.lst
+MOSTLYCLEANFILES += test_mod-commands_test.d
+DEFSYMFILES += def-test.lst
+UNDSYMFILES += und-test.lst
+
+test.mod: pre-test.o mod-test.o
+       -rm -f $@
+       $(LD) $(test_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
+       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
+
+pre-test.o: test_mod-commands_test.o
+       -rm -f $@
+       $(LD) $(test_mod_LDFLAGS) -r -d -o $@ $^
+
+mod-test.o: mod-test.c
+       $(CC) $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -c -o $@ $<
+
+mod-test.c: moddep.lst genmodsrc.sh
+       sh $(srcdir)/genmodsrc.sh 'test' $< > $@ || (rm -f $@; exit 1)
+
+def-test.lst: pre-test.o
+       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 test/' > $@
+
+und-test.lst: pre-test.o
+       echo 'test' > $@
+       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
+
+test_mod-commands_test.o: commands/test.c
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -c -o $@ $<
+
+test_mod-commands_test.d: commands/test.c
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -M $<    | sed 's,test\.o[ :]*,test_mod-commands_test.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+
+-include test_mod-commands_test.d
+
+CLEANFILES += cmd-test_mod-commands_test.lst fs-test_mod-commands_test.lst
+COMMANDFILES += cmd-test_mod-commands_test.lst
+FSFILES += fs-test_mod-commands_test.lst
+
+cmd-test_mod-commands_test.lst: commands/test.c gencmdlist.sh
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh test > $@ || (rm -f $@; exit 1)
+
+fs-test_mod-commands_test.lst: commands/test.c genfslist.sh
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh test > $@ || (rm -f $@; exit 1)
+
+
 test_mod_CFLAGS = $(COMMON_CFLAGS)
 test_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
index d658d8ebfc2d0f70106ca1252fe9c8ae7e572498..900a75d1537cc2f44060c95405bf714b73fb17a9 100644 (file)
@@ -876,8 +876,7 @@ pkgdata_MODULES = halt.mod \
        linux.mod \
        normal.mod \
        reboot.mod \
-       suspend.mod \
-       test.mod
+       suspend.mod
 
 # For _linux.mod.
 _linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c
index dd4cf3af5398c4ef81e320af48b19c21d64fb467..b69ba5c379633d8dc264928dd84a0837ae2ce6c7 100644 (file)
@@ -173,6 +173,8 @@ grub_rescue_cmd_linux (int argc, char *argv[])
      try some other addresses just like yaboot does.  */
   for (linux_addr = entry; linux_addr < entry + 200 * 0x100000; linux_addr += 0x100000)
     {
+      grub_dprintf ("loader", "Attempting to claim at 0x%x, size 0x%x.\n", 
+                   linux_addr, linux_size);
       found_addr = grub_claimmap (linux_addr, linux_size);
       if (found_addr != -1)
        break;
@@ -261,7 +263,9 @@ grub_rescue_cmd_initrd (int argc, char *argv[])
 {
   grub_file_t file = 0;
   grub_ssize_t size;
+  grub_addr_t first_addr;
   grub_addr_t addr;
+  int found_addr = 0;
 
   if (argc == 0)
     {
@@ -279,10 +283,21 @@ grub_rescue_cmd_initrd (int argc, char *argv[])
   if (! file)
     goto fail;
 
-  addr = linux_addr + linux_size;
+  first_addr = linux_addr + linux_size;
   size = grub_file_size (file);
 
-  if (grub_claimmap (addr, size) == -1)
+  /* Attempt to claim at a series of addresses until successful in
+     the same way that grub_rescue_cmd_linux does.  */
+  for (addr = first_addr; addr < first_addr + 200 * 0x100000; addr += 0x100000) 
+    {
+      grub_dprintf ("loader", "Attempting to claim at 0x%x, size 0x%x.\n", 
+                   addr, size);
+      found_addr = grub_claimmap (addr, size);
+      if (found_addr != -1)
+       break;
+    }
+
+  if (found_addr == -1)
     {
       grub_error (GRUB_ERR_OUT_OF_MEMORY, "Can not claim memory");
       goto fail;
index 5e66123e34bd8cf366e2b4f132cc39e6748b377c..4405894fdcdbdbf58cdf661923b62175b956e0cf 100644 (file)
@@ -171,7 +171,7 @@ if test $update_nvram = yes; then
 
     # Get the Open Firmware device tree path translation.
     dev=`echo $install_device | sed -e 's/\/dev\///' -e 's/[0-9]\+//'`
-    partno=`echo $install_device | sed -e 's/.*\([0-9]\+\)$/\1/'`
+    partno=`echo $install_device | sed -e 's/.*[^0-9]\([0-9]\+\)$/\1/'`
     ofpath=`$ofpathname $dev` || {
        echo "Couldn't find Open Firmware device tree path for $dev."
        echo "You will have to set boot-device manually."