# # Patch managed by http://www.holgerschurig.de/patcher.html # --- grub2/ChangeLog~initrdclaim +++ grub2/ChangeLog @@ -1,3 +1,15 @@ +2005-11-21 Mike Small + + * util/powerpc/ieee1275/grub-install.in (grubdir): Fixed partition + number regex so multidigit numbers are recognized correctly. + +2005-11-20 Mike Small + + * loader/powerpc/ieee1275/linux.c (grub_rescue_cmd_linux): Add a + debugging message before attempting to claim memory. + (grub_rescue_cmd_initrd): A new claim debugging message and try + multiple addresses in case of failure. + 2005-11-18 Timothy Baldwin * genmk.rb: Fixed list rules moved to Makefile.in. Recognise --- grub2/loader/powerpc/ieee1275/linux.c~initrdclaim +++ grub2/loader/powerpc/ieee1275/linux.c @@ -173,6 +173,8 @@ 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_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 @@ 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; --- grub2/util/powerpc/ieee1275/grub-install.in~initrdclaim +++ grub2/util/powerpc/ieee1275/grub-install.in @@ -171,7 +171,7 @@ # 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."