Bug#597538: grub-ieee1275: grub-install needs to pass a --prefix option to grub-mkimage

Daniel Kahn Gillmor dkg at fifthhorseman.net
Tue Oct 5 17:47:00 UTC 2010


Hi Colin--

On 10/04/2010 01:21 PM, Colin Watson wrote:
> On Sun, Oct 03, 2010 at 07:42:10PM -0400, Daniel Kahn Gillmor wrote:
>> On 09/21/2010 06:51 AM, Colin Watson wrote:
>>> Does the attached patch work?  It's a partial resync with the main
>>> version of grub-install, anticipating the next snapshot/release where
>>> all the different grub-installs are merged into a single version.
>>
>> hrm, no, this doesn't work.  i get:
>>
>>>> 0 attica:/usr/sbin# grub-install /dev/hda
>>>> /usr/sbin/grub-install: 229: make_system_path_relative_to_its_root: not found
>>>> 1 attica:/usr/sbin# 
> 
> Whoops, I forgot a piece.  Try this one.

hrm.  trying this one lets grub-install complete properly, but it leaves
me unable to boot smoothly (i get dropped into the grub rescue prompt,
and have to use this workaround):

  set prefix=(hd,apple3)/
  insmod normal
  normal


I it looks to me like the prefix is stored very early in the created
grub image.  So i took different variants of grub-install, generated the
grub image, and then looked at the strings in /boot/grub/grub.

the three versions are:

 grub-install
  (as shipped in grub-ieee1275 version 1.98+20100804-4)

 grub-install.patched
  (shipped version + this latest patch applied)

 grub-install.dkg
  (shipped version + --prefix='(hd,apple3)/' hard-coded on the
   "$grub_mkimage" invocation line)


of these, only grub-install.dkg works for me to get all the way through
the boot process without manual intervention (obviously, my hard-coded
change won't work for every system, though).

So here's what strings reports about the prefix string in
/boot/grub/grub after running each variant:

root at bigpuff:/usr/sbin# grub-install /dev/hda
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0)	/dev/disk/by-id/ata-ST940110A_3KW5HWVC
root at bigpuff:/usr/sbin# strings /boot/grub/grub | head -2
D/boot/grub
|cH8N
root at bigpuff:/usr/sbin# grub-install.dkg /dev/hda
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install.dkg'.

(hd0)	/dev/disk/by-id/ata-ST940110A_3KW5HWVC
root at bigpuff:/usr/sbin# strings /boot/grub/grub | head -2
D(hd,apple3)/
|cH8N
root at bigpuff:/usr/sbin# grub-install.patched /dev/hda
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install.patched'.

(hd0)	/dev/disk/by-id/ata-ST940110A_3KW5HWVC
root at bigpuff:/usr/sbin# strings /boot/grub/grub | head -2
|cH8N
[9|~
root at bigpuff:/usr/sbin#


I can give you shell access to a comparable machine if you'd like to
experiment.  all these tests are done on up-to-date squeeze
installations, fwiw.  I'm dkg on irc.oftc.net, if you want to chat
realtime about it.

thanks for looking into this,

	--dkg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20101005/3652df12/attachment.pgp>


More information about the Pkg-grub-devel mailing list