Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

(solved) grub-install fails: modinfo.sh does not exist

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
11 posts • Page 1 of 1
Author
Message
Spanik
Veteran
Veteran
Posts: 1170
Joined: Fri Dec 12, 2003 9:10 pm
Location: Belgium

(solved) grub-install fails: modinfo.sh does not exist

  • Quote

Post by Spanik » Tue May 18, 2021 9:52 am

Reinstalling the laptop and I'm now at installing Grub. But this fails. Disk setup is as follows:

Code: Select all

/dev/sda (gtp) (spinning HD)

/dev/sda1 swap
/dev/sda2 xfs /root
/dev/sda3 xfs /home
/dev/sda4 xfs /var
/dev/sda5 xfs/mnt/data

/dev/sdb (dos) (ssd)

/dev/sdb1 ext2 /boot (boot flag set)
/dev/sdb2 xfs /
As the laptop is from the changeover to efi I used "echo 'GRUB_PLATFORMS="efi-64"' >> /etc/portage/make.conf" "to add the functionality.

The emerge was ok. But the install does not work.

Code: Select all

(chroot) livecd / # grub-install /dev/sdb
grub-install: error /usr/lib/grub/i386-pc/modinfo.sh doesn't exist. Please specify --target or --directory
Adding "--target=x86_64-efi --efi-directory=/boot" does not help.

Do I need to start again and not add the efi option?
Last edited by Spanik on Tue May 18, 2021 1:32 pm, edited 2 times in total.
Expert in non-working solutions
Top
alamahant
Advocate
Advocate
Posts: 4032
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Tue May 18, 2021 10:03 am

You said it all
Adding "--target=x86_64-efi --efi-directory=/boot" does help.
Plz do that
:)
Top
Spanik
Veteran
Veteran
Posts: 1170
Joined: Fri Dec 12, 2003 9:10 pm
Location: Belgium

  • Quote

Post by Spanik » Tue May 18, 2021 10:04 am

This is an Intel I7.
Expert in non-working solutions
Top
Spanik
Veteran
Veteran
Posts: 1170
Joined: Fri Dec 12, 2003 9:10 pm
Location: Belgium

  • Quote

Post by Spanik » Tue May 18, 2021 10:10 am

alamahant wrote:You said it all
Adding "--target=x86_64-efi --efi-directory=/boot" does help.
Plz do that
Sorry, this was a typo from me, it should read "does NOT help". I corrected the original.
Expert in non-working solutions
Top
alamahant
Advocate
Advocate
Posts: 4032
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Tue May 18, 2021 10:13 am

Code: Select all

This is an Intel I7.
ok no problem.
Actually there is a problem the

Code: Select all

mkfs.vfat /dev/sdb1
mkdir /boot/efi
mount /dev/sdb1 /boot/efi
grub-install --target=x86_64-efi --efi-directory=/boot/efi
is the correct form.

If you dont do that then all kernel initrd and grub related stuff will be inside the <esp>.
This is not very standard,unless you are doing it for a specific reason.

Please see UEFI with GPT section in
https://wiki.gentoo.org/wiki/GRUB2

I think it is high time that the handbook stop telling people to mount the esp on /boot.
It is WRONG.
UNORTHODOX
CONFUSES PEOPLE
https://wiki.gentoo.org/wiki/Handbook:A ... Bootloader
Last edited by alamahant on Tue May 18, 2021 10:45 am, edited 7 times in total.
:)
Top
pietinger
Moderator
Moderator
Posts: 6617
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Tue May 18, 2021 10:14 am

You wrote you have tried to install grub from the liveCD. What happens if you mount your /root to /mnt/gentoo, chroot into it (like described in the AMD64-handbook) and then try to install grub2 again ?


P.S.: And check before, if it was really an UEFI-boot => check if /sys/firmware/efi exists -> yes -> ok, it was really an uefi boot

Code: Select all

# ls /sys/firmware
Top
Spanik
Veteran
Veteran
Posts: 1170
Joined: Fri Dec 12, 2003 9:10 pm
Location: Belgium

  • Quote

Post by Spanik » Tue May 18, 2021 10:21 am

pietinger wrote:You wrote you have tried to install grub from the liveCD. What happens if you mount your /root to /mnt/gentoo, chroot into it (like described in the AMD64-handbook) and then try to install grub2 again ?
I do install from the chroot.
Actually there is a problem the
Code:

mkdir /boot/efi
mount <esp> /boot/efi
grub-install --target=x86_64-efi --efi-directory=/boot/efi

is the correct form.
Furthermore the /boot/efi partition should be "vfat"

mkfs.vfat /dev/sdb1

If you dont do that then all kernel initrd and grub related stuf will be inside the <esp>.
Ok, so you now got me thinking that in the previous install I also used ext2 for the /boot.At least that is what I wrote down before I wiped the partitions (and from the fstab that I saved). This makes me think I do not used efi before and I should remove that option from the make.conf and rebuild grub.
Expert in non-working solutions
Top
pietinger
Moderator
Moderator
Posts: 6617
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Tue May 18, 2021 10:22 am

alamahant wrote:Furthermore the /boot/efi partition should be "vfat"
... and MUST reside on a disk which is partitioned with GPT (and not MBR) !
Top
pietinger
Moderator
Moderator
Posts: 6617
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Tue May 18, 2021 10:24 am

Spanik wrote:This makes me think I do not used efi before and I should remove that option from the make.conf and rebuild grub.
Yes. This is the other option: You do an old MBR-boot (but then you can never use SecureBoot because for this you need UEFI).
Top
Spanik
Veteran
Veteran
Posts: 1170
Joined: Fri Dec 12, 2003 9:10 pm
Location: Belgium

  • Quote

Post by Spanik » Tue May 18, 2021 10:55 am

pietinger wrote:
alamahant wrote:Furthermore the /boot/efi partition should be "vfat"
... and MUST reside on a disk which is partitioned with GPT (and not MBR) !
I did wipe the partitions but I did not changed anything to the type of disk. So this also points in the direction that I used an MBR. I also saw that I saved the old make.conf and there is no "GRUB_PLATFORMS="efi-64"" there.
pietinger wrote:
Spanik wrote:This makes me think I do not used efi before and I should remove that option from the make.conf and rebuild grub.
Yes. This is the other option: You do an old MBR-boot (but then you can never use SecureBoot because for this you need UEFI).
Ok, but I never use that.

So, emerge -C grub:2, remove the "GRUB_PLATFORMS" from make.conf, add "CHOST" and emerge grub:2 again and see where/how that ends.
Expert in non-working solutions
Top
Spanik
Veteran
Veteran
Posts: 1170
Joined: Fri Dec 12, 2003 9:10 pm
Location: Belgium

  • Quote

Post by Spanik » Tue May 18, 2021 1:31 pm

Ok, "emerge -C grub:2, remove the "GRUB_PLATFORMS" from make.conf, add "CHOST" and emerge grub:2 again and see where/how that ends" did the trick.

Thanks.
Expert in non-working solutions
Top
Post Reply

11 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic