Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Multilib grub2
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Tue May 06, 2014 1:40 am    Post subject: Multilib grub2 Reply with quote

I'm trying to setup gentoo on a x64 system with multilib (x86_64). So far, everything has gone well, except for having to deal with some UEFI issues. I think I've sorted most of them out, by now, but I'm sure other issues will come up. I've been following the Handbook, and some Wiki entries on dealing with UEFI, so I hope that I got things in order. I'm still in the chroot phase of the install trying to install grub2.

When I go to do the 'grub2-install' part, from the handbook, it complains that an x86_64 target doesn't exist. So this brings up a few questions:

  • Is there a way to make grub2 work for x86_64? Or do I need to use grub-legacy?
  • Will the i386-pc "profile" for grub2 boot the UEFI x86_64 kernel/OS?
  • If so, what configuration changes do I need to consider for it to work properly?
  • For either grub version, what changes do I need to anticipate for the UEFI CMOS?


If this question has been posted elsewhere or previously, please point me to it. A forum search didn't turn up much that was relevant to my specific issues.

Also, if more info is required, please let me know what additional information I need to post.

TIA

P.S. To add complexity to an already complex situation, this is a dual-boot system with Win8, so /boot isn't partition 1. It's also UEFI (in case you hadn't gathered), so MBR stuff goes out the window.
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13831

PostPosted: Tue May 06, 2014 2:04 am    Post subject: Reply with quote

Do you need grub2 or did you use that just because it is well known? In some cases, you can use efibootmgr to register your Linux kernel as a bootloader, build the EFI stub into the kernel, and avoid interacting with a separate bootloader entirely. If you need a bootloader, you could also look at elilo, an EFI-aware fork of LILO.
Back to top
View user's profile Send private message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Tue May 06, 2014 2:22 am    Post subject: Reply with quote

Hu wrote:
Do you need grub2 or did you use that just because it is well known? In some cases, you can use efibootmgr to register your Linux kernel as a bootloader, build the EFI stub into the kernel, and avoid interacting with a separate bootloader entirely. If you need a bootloader, you could also look at elilo, an EFI-aware fork of LILO.


I do have efibootmgr installed in the chroot environment, but I wasn't really sure what its purpose was, or how to use it. Definitely more research required there.

I haven't used lilo in, probably 10+ years. Would probably want to stay away from that, unless it's been heavily modernized.

EDIT: I only used grub2 because that's what the handbook guides you to do, and I've always used grub/grub2 in my gentoo installations. This is the first time I've had to deal with UEFI.
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Tue May 06, 2014 3:10 am    Post subject: Reply with quote

the easy way: https://wiki.gentoo.org/wiki/UEFI_Dual_boot_with_Windows_7/8
Particularly intended for the person who has just acquired a UEFI machine with Windows preinstalled.

IMHO: the best uefi boot loader is the efi stub kernel
the best uefi boot manager is rEFInd

Sticking with the question you asked, did you ( Plagiarizing the grub 2 quick start wiki ) Set GRUB_PLATFORMS in /etc/portage/make.conf? If unset, grub will guess which platform you want. It guesses "pc" for x86/amd64.. You need, for UEFI on amd64, GRUB_PLATFORMS="efi-64" or GRUB_PLATFORMS="efi-64 pc" before running emerge sys-boot/grub:2
_________________
Defund the FCC.
Back to top
View user's profile Send private message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Tue May 06, 2014 4:48 am    Post subject: Reply with quote

DONAHUE wrote:
the easy way: https://wiki.gentoo.org/wiki/UEFI_Dual_boot_with_Windows_7/8
Particularly intended for the person who has just acquired a UEFI machine with Windows preinstalled.

IMHO: the best uefi boot loader is the efi stub kernel
the best uefi boot manager is rEFInd

Sticking with the question you asked, did you ( Plagiarizing the grub 2 quick start wiki ) Set GRUB_PLATFORMS in /etc/portage/make.conf? If unset, grub will guess which platform you want. It guesses "pc" for x86/amd64.. You need, for UEFI on amd64, GRUB_PLATFORMS="efi-64" or GRUB_PLATFORMS="efi-64 pc" before running emerge sys-boot/grub:2


I have rEFInd installed, but not quite sure how to use it fully, quite yet. Should I uninstall grub2 and set those variables before re-installing?

I believe I've set all the UEFI required kernel modules/requirements. It's just a matter of will grub2 acknowledge those parameters. And if not, what command line parameters (if any) do I need to issue to make it see those arguments.

Then again, there's the x86 vs x86_64 issue.....
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Tue May 06, 2014 6:35 am    Post subject: Reply with quote

Quote:
should I uninstall grub2 and set those variables before re-installing?
that would be cleanest way, should not be required though since emerge is supposed to replace the existing files with a new recompile. (As mentioned before, I would just unmerge grub2 and use efi-stub and rEFInd.)

Quote:
x86 vs x86_64 issue
what's the issue? 32 bit UEFI is pretty much nonexistent.

Have you emerged and run os-prober? If so did it see the windows install?

What install media are you using? did you boot the install media in uefi mode?

boot the install media in uefi mode, mount the gentoo partitions, run
Code:
parted -l | wgetpaste
lspci -k | wgetpaste
wgetpaste /proc/cpuinfo
wgetpaste /mnt/gentoo/usr/src/linux/.config
post the url's returned

What is the motherboard/laptop manufacturer make and model?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Tue May 06, 2014 5:31 pm    Post subject: Reply with quote

DONAHUE wrote:
Quote:
should I uninstall grub2 and set those variables before re-installing?
that would be cleanest way, should not be required though since emerge is supposed to replace the existing files with a new recompile. (As mentioned before, I would just unmerge grub2 and use efi-stub and rEFInd.)

Unmerged grub. Now, will rEFInd automagically find the gentoo installation? Or will I have to point it to it?

DONAHUE wrote:

Quote:
x86 vs x86_64 issue
what's the issue? 32 bit UEFI is pretty much nonexistent.

Have you emerged and run os-prober? If so did it see the windows install?

No, os-prober doesn't find the Windows install, but it notes that if the Windows install in on NTFS volumes, then it needs fuse and ntfs3g, which I don't think the system rescue CD has (see below).

DONAHUE wrote:

What install media are you using? did you boot the install media in uefi mode?

I'm using the System Rescue CD. Normal install minimal CD wouldn't boot. It would spin up and then boot into Windows. So, I can only assume that it is in UEFI mode.
DONAHUE wrote:

boot the install media in uefi mode, mount the gentoo partitions, run
Code:
parted -l | wgetpaste
lspci -k | wgetpaste
wgetpaste /proc/cpuinfo
wgetpaste /mnt/gentoo/usr/src/linux/.config
post the url's returned

http://bpaste.net/show/260825/
http://bpaste.net/show/260826/
http://bpaste.net/show/260827/
http://bpaste.net/show/260828/

DONAHUE wrote:

What is the motherboard/laptop manufacturer make and model?

Not sure about the motherboard, but the laptop model is a Toshiba C55-A5105.
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Tue May 06, 2014 6:15 pm    Post subject: Reply with quote

The sysresccd uefi mode opens witth a black and white menu, the bios mode opens with a colorful menu.
Have you noticed whether the bios is intel, ami, or phoenix?

I'll be back.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Tue May 06, 2014 6:53 pm    Post subject: Reply with quote

DONAHUE wrote:
The sysresccd uefi mode opens witth a black and white menu, the bios mode opens with a colorful menu.
Have you noticed whether the bios is intel, ami, or phoenix?

I'll be back.


The sysresccd had the black and white menu.

I'm not sure about the branding on the BIOS. I just get the Toshiba branding on POST.
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Tue May 06, 2014 7:08 pm    Post subject: Reply with quote

Interestingly, upon reboot, rEFInd has a new entry, but it doesn't seem to point to the linux installation. It just flashes black and the caps lock light blinks.

That said, I am able to boot into the linux installation from the stysresccd.
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Tue May 06, 2014 7:23 pm    Post subject: Reply with quote

ok, uefi boot confirmed; hope toshiba bios is not strange

boot sysresccd, run
Code:
blkid
check that /dev/sda9 has ext4 file system and PARTUUID="cfb9aa33-c14f-4f92-aef0-e0be989a02e5"
In uefi/gpt a UUID is assigned to the file system and a PARTUUID is assigned to the partition The kernel can parse and use PARTUUID but not UUID.
The "Built-in kernel command line" must use the same format as any other kernel command line. cfb9aa33-c14f-4f92-aef0-e0be989a02e5 below shouild be replaced with the PARTUUID value from blkid for /dev/sda9 if different.
Kernel config changes:

Processor type and features --->
[*] Built-in kernel command line
(root=PARTUUID=cfb9aa33-c14f-4f92-aef0-e0be989a02e5 ro) Built-in kernel command string
[*] Built-in command line overrides boot loader arguments

File systems --->
[*] Miscellaneous filesystems --->
<*> EFI Variable filesystem

While in the chroot for the kernel rebuild suggest emerge wgetpaste ntfs3g efibootmgr gentoolkit pciutils usbutils.

I'll be back. lots to look at.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Tue May 06, 2014 7:53 pm    Post subject: Reply with quote

DONAHUE wrote:
ok, uefi boot confirmed; hope toshiba bios is not strange

boot sysresccd, run
Code:
blkid
check that /dev/sda9 has ext4 file system and PARTUUID="cfb9aa33-c14f-4f92-aef0-e0be989a02e5"
In uefi/gpt a UUID is assigned to the file system and a PARTUUID is assigned to the partition The kernel can parse and use PARTUUID but not UUID.
The "Built-in kernel command line" must use the same format as any other kernel command line. cfb9aa33-c14f-4f92-aef0-e0be989a02e5 below shouild be replaced with the PARTUUID value from blkid for /dev/sda9 if different.
Kernel config changes:

Processor type and features --->
[*] Built-in kernel command line
(root=PARTUUID=cfb9aa33-c14f-4f92-aef0-e0be989a02e5 ro) Built-in kernel command string
[*] Built-in command line overrides boot loader arguments

File systems --->
[*] Miscellaneous filesystems --->
<*> EFI Variable filesystem


cfb9aa33-c14f-4f92-aef0-e0be989a02e5 is the PARTUUID for the boot filesystem (/dev/sda7). So I need to put the PARTUUID for the rootfs (dev/sda9) in the kernel? Has the boot partition lost its usefulness?

DONAHUE wrote:

While in the chroot for the kernel rebuild suggest emerge wgetpaste ntfs3g efibootmgr gentoolkit pciutils usbutils.

I'll be back. lots to look at.

The only packages in the above list not installed were wgetpaste and usbutils, which now have been merged.
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Tue May 06, 2014 8:13 pm    Post subject: Reply with quote

So I need to put the PARTUUID for the rootfs (dev/sda9) in the kernel? Has the boot partition lost its usefulness?

your kernel config showed CONFIG_CMDLINE="cfb9aa33-c14f-4f92-aef0-e0be989a02e5" which would not be helpful as root=PARTUUID= is missing and, IIRC, quotation marks are not allowed; root=/dev/sda9 ro can be substituted for root=PARTUUID=cfb9aa33-c14f-4f92-aef0-e0be989a02e5 ro I prefer using the PARTUUID as plugging usb drives in or playing in BIOS occasionally changes kernel drive naming. PARTUUID can also be used in /etc/fstab. /boot is still useful as the place where kernels live.

/dev/sda9 's (rootfs) PARTUUID is the one that needs to be part of the kernel command line
_________________
Defund the FCC.


Last edited by DONAHUE on Tue May 06, 2014 8:44 pm; edited 3 times in total
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Tue May 06, 2014 8:36 pm    Post subject: Reply with quote

boot windows
download http://sourceforge.net/projects/refind/files/0.8.0/refind-bin-0.8.0.zip/download
Extract the downloaded refind-bin-{version}.zip to a handy location. Suggest C:\
browse to http://www.rodsbooks.com/refind/installing.html#windows and follow the directions in Installing rEFInd Manually Using Windows (moving the extracted files from C:\ to the Windows ESP and then editing them) Note the warning "Warning: Windows 8 implements a fast shutdown feature that helps speed up shutdown and startup operations on a single-boot computer. Unfortunately, this feature can cause filesystem corruption if it's used on a multi-boot computer. You can disable the feature by launching an Administrator Command Prompt window and typing powercfg /h off in it." Run powercfg /h off when in the Administrator Command Prompt window.
exit the terminal and reboot.
hopefully rEFInd boot screen will appear and will hopefully include windows and gentoo and sysresccd.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Tue May 06, 2014 9:09 pm    Post subject: Reply with quote

DONAHUE wrote:
boot windows
download http://sourceforge.net/projects/refind/files/0.8.0/refind-bin-0.8.0.zip/download
Extract the downloaded refind-bin-{version}.zip to a handy location. Suggest C:\
browse to http://www.rodsbooks.com/refind/installing.html#windows and follow the directions in Installing rEFInd Manually Using Windows (moving the extracted files from C:\ to the Windows ESP and then editing them) Note the warning "Warning: Windows 8 implements a fast shutdown feature that helps speed up shutdown and startup operations on a single-boot computer. Unfortunately, this feature can cause filesystem corruption if it's used on a multi-boot computer. You can disable the feature by launching an Administrator Command Prompt window and typing powercfg /h off in it." Run powercfg /h off when in the Administrator Command Prompt window.
exit the terminal and reboot.
hopefully rEFInd boot screen will appear and will hopefully include windows and gentoo and sysresccd.


This is done. However, the result is the same. One icon for normal Windows boot, and another that flashes what looks like a linux boot, then goes black and leaves the caps lock light flashing. Which leads me to the next thing:

DONAHUE wrote:

So I need to put the PARTUUID for the rootfs (dev/sda9) in the kernel? Has the boot partition lost its usefulness?

your kernel config showed CONFIG_CMDLINE="cfb9aa33-c14f-4f92-aef0-e0be989a02e5" which would not be helpful as root=PARTUUID= is missing and, IIRC, quotation marks are not allowed; root=/dev/sda9 ro can be substituted for root=PARTUUID=cfb9aa33-c14f-4f92-aef0-e0be989a02e5 ro I prefer using the PARTUUID as plugging usb drives in or playing in BIOS occasionally changes kernel drive naming. PARTUUID can also be used in /etc/fstab. /boot is still useful as the place where kernels live.

/dev/sda9 's (rootfs) PARTUUID is the one that needs to be part of the kernel command line

This was sort of confusing, but if you're saying what I think you're saying, the text entered into the field in the kernel needs the literal "root=PARTUUID=" in front of the actual PARTUUID. Correct?
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Tue May 06, 2014 10:32 pm    Post subject: Reply with quote

correct
_________________
Defund the FCC.
Back to top
View user's profile Send private message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Tue May 06, 2014 10:46 pm    Post subject: Reply with quote

DONAHUE wrote:
correct

OK. That's done, with the PARTUUID of /dev/sda9 (rootfs). Still the same thing. I'll try the PARTUUID of /dev/sda7 (boot -- where the kernel actually lives) and see if that makes a difference.
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Tue May 06, 2014 11:31 pm    Post subject: Reply with quote

from the chroot

Code:
mkdir /mnt/esp
mount -t vfat /dev/sda2 /mnt/esp
ls -lR /mnt/esp | wgetpaste
ls -l /boot | wgetpaste
post url's returned please
_________________
Defund the FCC.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Tue May 06, 2014 11:44 pm    Post subject: Reply with quote

Are you seeing anything like http://4.bp.blogspot.com/-DoXvJPSCQsM/UhMJT-PKGeI/AAAAAAAAACo/6BVCsKX2dys/s1600/refind-130818.jpg
The crash to black and flashing lock keys occurs when you click the maybe gentoo icon or the seconds count down?
Is secure boot disabled in bios?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Wed May 07, 2014 12:39 am    Post subject: Reply with quote

DONAHUE wrote:
Is secure boot disabled in bios?


Yes.

I'll post the rest when I get a sec to gather it. Compiling KDE atm.
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Wed May 07, 2014 12:58 am    Post subject: Reply with quote

DONAHUE wrote:
Are you seeing anything like http://4.bp.blogspot.com/-DoXvJPSCQsM/UhMJT-PKGeI/AAAAAAAAACo/6BVCsKX2dys/s1600/refind-130818.jpg
The crash to black and flashing lock keys occurs when you click the maybe gentoo icon or the seconds count down?


Nope, I don't get the gentoo icon. I get one that looks like the 3rd one from the left, and it says something about boot to fallback or failover, or something. I can get the exact verbiage for you when I have a chance to reboot.

Requested URLs:
http://bpaste.net/show/261251
http://bpaste.net/show/261252
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Wed May 07, 2014 2:40 am    Post subject: Reply with quote

Code:
ls -lR /mnt/gentoo/boot/efi | wgetpaste
and post url please
Is /boot/initramfs-genkernel-x86_64-3.12.13-gentoo currently used?

third from left is sysresccd icon
_________________
Defund the FCC.
Back to top
View user's profile Send private message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Wed May 07, 2014 2:58 am    Post subject: Reply with quote

dataking wrote:
I can get the exact verbiage for you when I have a chance to reboot.

The exact verbiage for the 3-cube icon is as follows:"Boot Fallback boot loader from boot". This is with the sysresccd not in the drive. Inserting the disk (re)boots to sysresccd, which allows me to boot to the gentoo install, although I think it's using the sysresccd kernel, and possibly the init scripts.
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
dataking
Apprentice
Apprentice


Joined: 20 Apr 2005
Posts: 251

PostPosted: Wed May 07, 2014 3:02 am    Post subject: Reply with quote

DONAHUE wrote:
Code:
ls -lR /mnt/gentoo/boot/efi | wgetpaste
and post url please

http://bpaste.net/show/261356
DONAHUE wrote:

Is /boot/initramfs-genkernel-x86_64-3.12.13-gentoo currently used?

It's there....I don't know if it's being used.

Like I said, I think the sysresccd is using it's own kernel and possibly init scripts to load the HDD gentoo install.
_________________
-= the D@7@k|n& =-
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Wed May 07, 2014 3:49 am    Post subject: Reply with quote

You are using a sysresccd option that reads something like: "boot a system already on the hard drive" that does use the cd kernel and the hard drive init.
Code:
mount -t vfat /dev/sda2 /mnt/esp
mv /boot/kernel-3.12.13-gentoo /boot/vmlinuz-3.12.13-gentoo
rm -rf /boot/efi
Bedtime here.

downloading http://sourceforge.net/projects/refind/files/0.8.0/refind-cd-0.8.0.zip/download and making and booting a refind cd may create a helpful tool.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum