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.

	* 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.
This commit is contained in:
hollisb 2005-11-23 04:25:16 +00:00
parent 9c12956b84
commit 44b83271e6
5 changed files with 77 additions and 5 deletions

View file

@ -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.

View 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)

View 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

View 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;

View 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."