You are not logged in.

#1 2012-12-11 03:15:09

donniezazen
Member
From: Salt Lake City
Registered: 2011-06-24
Posts: 671
Website

[SOLVED] How to use different kernel with rEFInd?

Hello,

I am completely new to EFI and just did a clean install. How do I use custom kernel with rEFInd? I have efistub-update.path systemd file to copy /boot files to /boot/efi/EFI/arch but I suppose it only copies stock linux kernel files and not custom kernel files like linux-mainline. I have read wiki but couldn't find information about using multiple kernels, it only says a boot manager should be used to handle multiple kernels. I copied linux-mainline vmlinuz and initramfs files to /boot/efi/EFI/arch but booting using these file took me to rootfs prompt.

Thanks.

Last edited by donniezazen (2012-12-11 07:48:15)

Offline

#2 2012-12-11 04:02:16

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] How to use different kernel with rEFInd?

Have you even looked at the service file you created, and what it does?  I think it is pretty self expanitory.  In my head, if efistub-update.{path,service} updates the kernel, then another one modfied slightly could do the same for another kernel!!!

Offline

#3 2012-12-11 04:20:38

donniezazen
Member
From: Salt Lake City
Registered: 2011-06-24
Posts: 671
Website

Re: [SOLVED] How to use different kernel with rEFInd?

Yes, I have looked into the efistub-update.{path,service}. It copies /boot/vmlinuz-linux to /boot/efi/EFI/arch/vmlinuz-arch.efi. During this copying names are being changed from linux to arch (vmlinuz-linux to vmlinuz-arch). I have tired copying linux-mainline files as they are which took me to rootfs prompt. So, I might need to change some names with linux-mainline too, so I gather. I am not sure about what to change name to and will i have to make changes to other files too. And I don't want to make changes without any logic and create more incompatibility and end up with a system that won't boot at all.

Offline

#4 2012-12-11 04:29:26

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] How to use different kernel with rEFInd?

I am not sure why you think you need to rename the files.  rEFInd's autodetect function should detect anything with .efi at the end of it.  You should read rod smith's page on configuring rEFInd.  But basically it will scan for kernels and matching initramfs names in EFI\* (except EFI\refind) as well as the \ of the ESP.  I don't actually use rEFInd, so I am not sure what kind of logic it specifically uses to match kernels and initrds.  Again, you should read this for more info.

Personally I use gummiboot, as I find its fully namual configuration and stoopid simple menu to be simply amazing.

Offline

#5 2012-12-11 04:38:35

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [SOLVED] How to use different kernel with rEFInd?

These are the files I use (I use testing/linux and miffe/linux-mainline pkgs in my system) :

/etc/systemd/system/efistub_copy.path

[Unit]
Description=Copy EFISTUB Kernel and Initramfs to UEFISYS Partition

[Path]
PathChanged=/boot/initramfs-linux-fallback.img
PathChanged=/boot/initramfs-linux-mainline-fallback.img
Unit=efistub_copy.service

[Install]
WantedBy=multi-user.target

/etc/systemd/system/efistub_copy.service

[Unit]
Description=Copy EFISTUB Kernel and Initramfs to UEFISYS Partition
# Requires=boot-efi.mount

[Service]
Type=oneshot

ExecStart=/bin/cp -f /boot/vmlinuz-linux /boot/efi/EFI/arch/arch_linux_core/vmlinuz-ARCH-core.efi
ExecStart=/bin/cp -f /boot/initramfs-linux.img /boot/efi/EFI/arch/arch_linux_core/initramfs-ARCH-core.img
ExecStart=/bin/cp -f /boot/initramfs-linux-fallback.img /boot/efi/EFI/arch/arch_linux_core/initramfs-ARCH-core-fallback.img

ExecStart=/bin/cp -f /boot/vmlinuz-linux-mainline /boot/efi/EFI/arch/arch_linux_mainline/vmlinuz-arch-mainline.efi
ExecStart=/bin/cp -f /boot/initramfs-linux-mainline.img /boot/efi/EFI/arch/arch_linux_mainline/initramfs-arch-mainline.img
ExecStart=/bin/cp -f /boot/initramfs-linux-mainline-fallback.img /boot/efi/EFI/arch/arch_linux_mainline/initramfs-arch-mainline-fallback.img

/boot/efi/EFI/refind/refind.conf (only part of the file)

scanfor manual,internal,external,optical

menuentry "Arch Linux Core Kernel" {
    icon /EFI/refind/icons/os_arch.icns
    loader /EFI/arch/arch_linux_core/vmlinuz-ARCH-core.efi
    initrd /EFI/arch/arch_linux_core/initramfs-ARCH-core.img
    options "root=PARTUUID=6f44c56d-d5c2-41ca-8c54-873d8dc5e5e3 rootfstype=ext4 pcie_aspm=force add_efi_memmap systemd.unit=graphical.target"
    ostype Linux
    graphics off
}

menuentry "Arch Linux Core Kernel Fallback" {
    icon /EFI/refind/icons/os_arch.icns
    loader /EFI/arch/arch_linux_core/vmlinuz-ARCH-core.efi
    initrd /EFI/arch/arch_linux_core/initramfs-ARCH-core-fallback.img
    options "root=PARTUUID=6f44c56d-d5c2-41ca-8c54-873d8dc5e5e3 rootfstype=ext4 pcie_aspm=force add_efi_memmap systemd.unit=graphical.target"
    ostype Linux
    graphics off
}

menuentry "Arch Linux Mainline Kernel" {
    icon /EFI/refind/icons/os_arch.icns
    loader /EFI/arch/arch_linux_mainline/vmlinuz-arch-mainline.efi
    initrd /EFI/arch/arch_linux_mainline/initramfs-arch-mainline.img
    options "root=PARTUUID=6f44c56d-d5c2-41ca-8c54-873d8dc5e5e3 rootfstype=ext4 pcie_aspm=force add_efi_memmap systemd.unit=graphical.target"
    ostype Linux
    graphics off
}

menuentry "Arch Linux Mainline Kernel Fallback" {
    icon /EFI/refind/icons/os_arch.icns
    loader /EFI/arch/arch_linux_mainline/vmlinuz-arch-mainline.efi
    initrd /EFI/arch/arch_linux_mainline/initramfs-arch-mainline-fallback.img
    options "root=PARTUUID=6f44c56d-d5c2-41ca-8c54-873d8dc5e5e3 rootfstype=ext4 pcie_aspm=force add_efi_memmap systemd.unit=graphical.target"
    ostype Linux
    graphics off
}

Offline

#6 2012-12-11 07:47:52

donniezazen
Member
From: Salt Lake City
Registered: 2011-06-24
Posts: 671
Website

Re: [SOLVED] How to use different kernel with rEFInd?

@ the.ridikulus.rat

Thanks, your files did the trick.

Offline

Board footer

Powered by FluxBB