Discussion:
[lfs-support] Error with grub-install
David Sprayberry
2018-10-06 04:33:43 UTC
Permalink
To prepare to boot LFS in UEFI mode, followed the link to the UEFI hint in section 8.3.1. The hint said, "Booting LFS is no longer as simple as `grub-install  /dev/sda`, implying I should not follow this explicit instruction in the book concerning grub-install in section 8.4.3. By the way, I later realized that this hint is outdated by the updated 2018-04-09 hint. I followed the instructions in the hint, installing some dependencies and reinstalling GRUB, configuring the kernel, and then up to the command:

grub-install --bootloader-id=LFS --recheck --debug &> grub.log

I have attached a text file of grub.log. The error message at the end is:

...
grub-install: error: relocation 0x4 is not implemented yet
The beginning lines may be more informative, though:
grub-install: info: executing modprobe efivars 2>/dev/null.
grub-install: info: Looking for /sys/firmware/efi ...
grub-install: info: ...found.
Installing for x86_64-efi platform.
grub-install: info: cannot open `/boot/grub/device.map': No such file or directory.
grub-install: info: /dev/sda1 is not present.
grub-install: info: Looking for /dev/sda1.
grub-install: info: /dev/sda is a parent of /dev/sda1.
grub-install: info: /dev/sda1 starts from 2048.
grub-install: info: opening the device hostdisk//dev/sda....

I'm not sure why it thinks /dev/sda1 is not present. I did mount the SSD's efi partition (sda1) onto /boot/efi as instructed at the beginning of the hint.

Any pointers will be helpful. Thanks,
-David
Thomas Trepl
2018-10-06 13:03:54 UTC
Permalink
Am Samstag, den 06.10.2018, 04:33 +0000 schrieb David
Post by David Sprayberry
grub-install --bootloader-id=LFS --recheck --debug &> grub.log
...
grub-install: error: relocation 0x4 is not implemented yet
grub-install: info: executing modprobe efivars 2>/dev/null.
grub-install: info: Looking for /sys/firmware/efi ...
grub-install: info: ...found.
Installing for x86_64-efi platform.
grub-install: info: cannot open `/boot/grub/device.map': No such file or directory.
grub-install: info: /dev/sda1 is not present.
grub-install: info: Looking for /dev/sda1.
grub-install: info: /dev/sda is a parent of /dev/sda1.
grub-install: info: /dev/sda1 starts from 2048.
grub-install: info: opening the device hostdisk//dev/sda.
...
I'm not sure why it thinks /dev/sda1 is not present. I did mount the SSD's efi partition (sda1) onto /boot/efi as instructed at the beginning of the hint.
Any pointers will be helpful. Thanks,
-David
There is a similar report on the lfs-dev list today. It
seems that this can be fixed by a quite simple small patch.

diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
index a2bb054..39d7efb 100644
--- a/util/grub-mkimagexx.c
+++ b/util/grub-mkimagexx.c
@@ -841,6 +841,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr
*e, Elf_Shdr
*sections,
break;

case R_X86_64_PC32:
+ case R_X86_64_PLT32:
{
grub_uint32_t *t32 = (grub_uint32_t *) target;
*t32 = grub_host_to_target64
(grub_target_to_host32 (*t32)
diff --git a/util/grub-module-verifier.c b/util/grub-module-
verifier.c
index 9179285..a79271f 100644
--- a/util/grub-module-verifier.c
+++ b/util/grub-module-verifier.c
@@ -19,6 +19,7 @@ struct grub_module_verifier_arch archs[] =
{
-1
}, (int[]){
R_X86_64_PC32,
+ R_X86_64_PLT32,
-1
}
},


It would be cool if you could try to apply that patch to
grub's source (or add the two lines manually) and report if
that solves your problem, too.

--
Thomas
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing
David Sprayberry
2018-10-06 19:26:34 UTC
Permalink
Thanks, that worked. This time the installation finished successfully.
-David
On Saturday, October 6, 2018, 8:03:57 AM CDT, Thomas Trepl <***@linuxfromscratch.org> wrote:

Am Samstag, den 06.10.2018, 04:33 +0000 schrieb David
Post by David Sprayberry
grub-install --bootloader-id=LFS --recheck --debug &> grub.log
...
grub-install: error: relocation 0x4 is not implemented yet
grub-install: info: executing modprobe efivars 2>/dev/null.
grub-install: info: Looking for /sys/firmware/efi ...
grub-install: info: ...found.
Installing for x86_64-efi platform.
grub-install: info: cannot open `/boot/grub/device.map': No such file or directory.
grub-install: info: /dev/sda1 is not present.
grub-install: info: Looking for /dev/sda1.
grub-install: info: /dev/sda is a parent of /dev/sda1.
grub-install: info: /dev/sda1 starts from 2048.
grub-install: info: opening the device hostdisk//dev/sda.
...
I'm not sure why it thinks /dev/sda1 is not present. I did mount the SSD's efi partition (sda1) onto /boot/efi as instructed at the beginning of the hint.
Any pointers will be helpful. Thanks,
-David
There is a similar report on the lfs-dev list today. It
seems that this can be fixed by a quite simple small patch.

diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
index a2bb054..39d7efb 100644
--- a/util/grub-mkimagexx.c
+++ b/util/grub-mkimagexx.c
@@ -841,6 +841,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr
*e, Elf_Shdr
*sections,
          break;

        case R_X86_64_PC32:
+        case R_X86_64_PLT32:
          {
            grub_uint32_t *t32 = (grub_uint32_t *) target;
            *t32 = grub_host_to_target64
(grub_target_to_host32 (*t32)
diff --git a/util/grub-module-verifier.c b/util/grub-module-
verifier.c
index 9179285..a79271f 100644
--- a/util/grub-module-verifier.c
+++ b/util/grub-module-verifier.c
@@ -19,6 +19,7 @@ struct grub_module_verifier_arch archs[] =
{
      -1
    }, (int[]){
      R_X86_64_PC32,
+      R_X86_64_PLT32,
      -1
    }
  },


It would be cool if you could try to apply that patch to
grub's source (or add the two lines manually) and report if
that solves your problem, too.

--
Thomas

Loading...