Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Issue configuring rEFInd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Dwosky
Tux's lil' helper
Tux's lil' helper


Joined: 07 Nov 2018
Posts: 87

PostPosted: Wed Nov 28, 2018 9:26 am    Post subject: [Solved] Issue configuring rEFInd Reply with quote

I'm trying to configure rEFInd to dual boot my laptop (Windows + Gentoo), but I've found some issues on the steps described in the Wiki and I'm somehow lost right now.

I followed https://wiki.gentoo.org/wiki/Refind for the installing process, but refind-install return an issue that it was not able to register itself as EFI bootmanager, this paste its when I launched again reifind-install, since I didn't copied the first time it failed, so you have some messages regarding upgrade as well:
Code:
ShimSource is none
Installing rEFInd on Linux....
ESP was found at /boot using vfat
Found rEFInd installation in /boot/EFI/refind; upgrading it.
Copied rEFInd binary files

Notice: Backed up existing icons directory as icons-backup.
Existing refind.conf file found; copying sample file as refind.conf-sample
to avoid overwriting your customizations.

Installing it!

ALERT: There were problems running the efibootmgr program! You may need to
rename the refind_x64.efi binary to the default name (EFI/BOOT/bootx64.efi
on x86-64 systems, EFI/BOOT/bootia32.efi on x86 systems, or
EFI/BOOT/bootaa64.efi on ARM64 systems) to have it run!

Existing //boot/refind_linux.conf found; not overwriting.

ALERT:
Installation has completed, but problems were detected. Review the output for
error messages and take corrective measures as necessary. You may need to
re-run this script or install manually before rEFInd will work.



From my side the efivars partition its on RW and I can manually insert the entry via efibootmgr without issues with the following command: efibootmgr -c -d /dev/nvme0n1 -p 2 -L "rEFInd" -l "\EFI\refind\refind_x64.efi". The problem is that upon restarting the laptop, it hangs in the manufacturer splash screen (the one you usually have prior to loading the bootloader). If I restart it and change the order to load the windows EFI bootloader, it works without issues. This is my current EFI layout and configuration:
Code:
sysresccd / # tree -L 3 /boot
/boot
├── EFI
│   ├── Boot
│   │   └── bootx64.efi
│   ├── Microsoft
│   │   ├── Boot
│   │   └── Recovery
│   ├── refind
│   │   ├── icons
│   │   ├── icons-backup
│   │   ├── keys
│   │   ├── refind.conf
│   │   ├── refind.conf.example
│   │   ├── refind.conf-sample
│   │   └── refind_x64.efi
│   └── tools
└── refind_linux.conf


Code:
sysresccd / # cat /boot/EFI/refind/refind.conf
menuentry "Gentoo Linux" {
    icon     /EFI/refind/icons/os_gentoo.png
    volume   b2db872d-9575-4c04-8898-47f5f35db531
    loader   /boot/vmlinuz
    options  "root=PARTUUID=b2db872d-9575-4c04-8898-47f5f35db531"
    submenuentry "Boot using old kernel image" {
        volume   b2db872d-9575-4c04-8898-47f5f35db531
        loader /boot/vmlinuz.old
    }
}

menuentry "Windows 10" {
    loader \EFI\Microsoft\Boot\bootmgfw.efi
    disabled
}


BTW, I have used the trick described in the Wiki https://wiki.gentoo.org/wiki/Refind#Kernel_image_outside_ESP_partition, so the kernel files are not in the boot efi partition, but in the root partition below the EFI mounted one.
Code:
sysresccd / # ls -l /boot
total 2
drwxr-xr-x 6 root root 1024 Nov 27 22:58 EFI
-rwxr-xr-x 1 root root  213 Nov 27 22:58 refind_linux.conf
sysresccd / # umount /boot
sysresccd / # ls -l /boot
total 10268
lrwxrwxrwx 1 root root      21 Nov 27 21:47 config -> config-4.14.83-gentoo
-rw-r--r-- 1 root root  103088 Nov 27 21:47 config-4.14.83-gentoo
lrwxrwxrwx 1 root root      31 Nov 27 21:48 config.old -> config-4.14.80-std532-amd64.old
drwx------ 2 root root    4096 Nov 27 19:08 lost+found
lrwxrwxrwx 1 root root      25 Nov 27 21:47 System.map -> System.map-4.14.83-gentoo
-rw-r--r-- 1 root root 3520977 Nov 27 21:47 System.map-4.14.83-gentoo
lrwxrwxrwx 1 root root      35 Nov 27 21:48 System.map.old -> System.map-4.14.80-std532-amd64.old
lrwxrwxrwx 1 root root      22 Nov 27 21:47 vmlinuz -> vmlinuz-4.14.83-gentoo
-rw-r--r-- 1 root root 6881232 Nov 27 21:47 vmlinuz-4.14.83-gentoo
lrwxrwxrwx 1 root root      32 Nov 27 21:48 vmlinuz.old -> vmlinuz-4.14.80-std532-amd64.old


Any idea why refind can't be installed successfully or where I have messed it up?


Last edited by Dwosky on Fri Nov 30, 2018 11:48 am; edited 1 time 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: Wed Nov 28, 2018 1:54 pm    Post subject: Reply with quote

For dual boot with windows 7,8,10 in UEFI mode I recommend using https://www.rodsbooks.com/refind/installing.html#windows . Suspect the rEFInd package in portage was developed without considering windows quirks.
Step 10 of the reference wrote:
If you like, type bcdedit /set "{bootmgr}" description "rEFInd description" to set a description (change rEFInd description as you see fit).
If I don't run that step, selecting Windows Boot Manager in the UEFI Boot Menu passes execution to rEFInd. If I run Step 10 I have a rEFInd entry in the UEFI boot menu. Rod mentions that some motherboard adaptations of UEFI may not allow step 10.
Been doing dual boot with windows this way for past 6 years.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Dwosky
Tux's lil' helper
Tux's lil' helper


Joined: 07 Nov 2018
Posts: 87

PostPosted: Wed Nov 28, 2018 2:58 pm    Post subject: Reply with quote

Nice, I was able to install an launch rEFInd without issues doing it from Windows... lol :lol:

Thanks.
Back to top
View user's profile Send private message
Dwosky
Tux's lil' helper
Tux's lil' helper


Joined: 07 Nov 2018
Posts: 87

PostPosted: Wed Nov 28, 2018 6:57 pm    Post subject: Reply with quote

So I have a running rEFInd that works with my Linux Live USB and Windows, but gets stuck on loading Gentoo not really sure why... It displays the following:
Code:
Starting vmlinuz
Using load options 'ro root=UUID=...'

And stays that way forever. Not sure why my laptop caps lock key keeps blinking from that on.

I've tried removing the UUID and setting root=/dev/sda3 in that case it still gets stuck, but for whatever reason the caps lock key doesn't blink.

This issue happens with both my manual menuentry and the kernel discovered by rEFInd automatically. Any idea why it gets stuck?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Thu Nov 29, 2018 2:54 am    Post subject: Reply with quote

How did you build your kernel?
It looks like it may not be a valid EFI stub kernel.
Could you place your kernel config in a pastebin and post the url here?
Is there any lvm, raid, encryption involved?
Do you have more than one EFI Systems Partition? Best to only have one, if dual booting windows best to use the windows ESP.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Dwosky
Tux's lil' helper
Tux's lil' helper


Joined: 07 Nov 2018
Posts: 87

PostPosted: Thu Nov 29, 2018 7:05 am    Post subject: Reply with quote

I did double check that I had the CONFIG_EFI_STUB enabled, because when I didn't have it that way the kernel was not even shown on rEFInd.

I don't have any complex filesystem or configuration (no lvm, raid or encryption) and I'm using the same EFI partition that Windows created on the first place. I've seent its vfat and 100M, so I suppose it should work since rEFInd seems to be working from it without issues.

Here's my current kernel configuration: http://ix.io/1uNI
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Thu Nov 29, 2018 10:16 pm    Post subject: Reply with quote

I emerged gentoo-sources-4.14.83 ran eselect kernel set linux-4.14.83-gentoo, added your config to /usr/src/linux as .config, ran cd /usr/src/linux, make menuconfig, edited your menuconfig to add or change:
Code:
General setup  --->
 <*> Kernel .config support                                                                                 
 [*]   Enable access to .config through /proc/config.gz
Processor type and features  --->
 [*] Built-in kernel command line
 (root=PARTUUID=<value for root partition from running blkid> ro rootfs=ext4) Built-in kernel command string
 [*] Built-in command line overrides boot loader arguments
Device Drivers  --->
 <*> NVM Express block device                                                                               
 <*> NVM Express over Fabrics FC host driver
 [*] Multiple devices driver support (RAID and LVM)  --->
  <*>   Device mapper support
Graphics support  --->
 <*> /dev/agpgart (AGP Support)  --->
  --- /dev/agpgart (AGP Support)                                                                             
   < >   AMD Opteron/Athlon64 on-CPU GART support                                                             
   <*>   Intel 440LX/BX/GX, I8xx and E7x05 chipset support                                                     
   < >   SiS chipset support                                                                                   
   < >   VIA chipset support
Frame buffer Devices  --->
 [*] EFI-based Framebuffer Support
saved the new menuconfig, ran make && make modules_install && make install, rebooted, selected the new kernel in rEFInd, it worked. Maybe the same changes will work for you.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Dwosky
Tux's lil' helper
Tux's lil' helper


Joined: 07 Nov 2018
Posts: 87

PostPosted: Fri Nov 30, 2018 8:09 am    Post subject: Reply with quote

That seemed to do the trick, now the issue is that I get a kernel panic => VFS: Unable to mount roof fs on unknown-block(0,0). Shouldn't it be able to mount it from the CMDLINE config?

EDIT: Do I need an initramfs with this kernel? I believe I was able to boot on other systems with Grub and no issues without initramfs.

EDIT 2: Ok, I compiled with a typo on the root=... Now it works as expected. Thanks for the help!
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Fri Nov 30, 2018 4:30 pm    Post subject: Reply with quote

If/when a windows update wrecks rEFInd (in an attempt to return you to a single operating system), rerunning steps 9 and 10 restores it.
NB: If you are going to use a GUI/Desktop you will need a little more work in Graphics Support section of menuconfig.
_________________
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
Page 1 of 1

 
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