You are not logged in.

#1 2021-03-04 15:06:30

archron
Member
Registered: 2021-03-02
Posts: 4

[SOLVED] Custom Arch Icons for rEFInd & Manual Stanza

Bit the bullet and installed Arch on my work laptop yesterday, the install went smooth. But post-install, I heard about the theming possibilities of rEFInd and wanted to try it out, all my bootloaders so far have been GRUB. I don't know if this is because the ESP is mounted at /boot instead of the suggested /boot/efi but my rEFInd works, and I am able to boot the system normally through the autodetected "vmlinuz-linux" option.

Now, for the love of all things nix, I cannot get my custom boot stanza to work even though it shows up on the rEFInd menu. I am a total noob at rEFInd, so any help at fixing this problem would be appreciated, or rather- how would a custom rEFInd stanza for my case look? I have affixed relevant details below.

Here is the output of my lsblk

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 931.5G  0 disk 
├─sda1        8:1    0   500G  0 part /media/Data_A1
├─sda2        8:2    0   400G  0 part 
└─sda3        8:3    0   4.5G  0 part [SWAP]
nvme0n1     259:0    0 119.2G  0 disk 
├─nvme0n1p1 259:1    0   320M  0 part /boot
├─nvme0n1p2 259:2    0   128M  0 part 
├─nvme0n1p3 259:3    0    84G  0 part 
├─nvme0n1p4 259:4    0     1G  0 part 
└─nvme0n1p5 259:5    0  33.8G  0 part /

Here is the output of my blkid

/dev/nvme0n1p1: LABEL_FATBOOT="EFI" LABEL="EFI" UUID="6816-673A" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="b8fb393f-6f34-4e18-9db7-e3bb24050f83"
/dev/nvme0n1p3: LABEL="Windows" BLOCK_SIZE="512" UUID="1EAADD8DAADD6237" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="6f9c22a5-dc73-4a10-8020-adc909b449c3"
/dev/nvme0n1p4: LABEL="Recovery" BLOCK_SIZE="512" UUID="4868026168024DDE" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="43312182-1d38-4ac7-ac2f-6fa3072ba87c"
/dev/nvme0n1p5: LABEL="Arch-Local" UUID="e3e42f07-05e3-4c1f-9360-252895112f7d" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="47160c91-1784-c84e-9368-6e497622c254"
/dev/sda1: BLOCK_SIZE="512" UUID="90C017D9C017C3FE" TYPE="ntfs" PARTUUID="a3b5b8cc-6d72-11eb-9256-82dea00d2dc8"
/dev/sda2: BLOCK_SIZE="512" UUID="D6A4D46CA4D4511B" TYPE="ntfs" PARTUUID="309a5b2b-6de7-11eb-9258-806e6f6e6963"
/dev/sda3: UUID="6a9ed6cd-5970-4fb9-900e-588a5b9b11ae" TYPE="swap" PARTUUID="44aad921-56d1-7d4b-8005-a2f53bfe28ac"
/dev/nvme0n1p2: PARTLABEL="Microsoft reserved partition" PARTUUID="89c73b4d-bbfe-48a3-a79a-237ccc2038d0"

Here is my refind_linux.conf

"Boot with standard options"  "root=UUID=e3e42f07-05e3-4c1f-9360-252895112f7d rw loglevel=3 quiet"
"Boot to single-user mode"    "root=UUID=e3e42f07-05e3-4c1f-9360-252895112f7d rw loglevel=3 quiet single"
"Boot with minimal options"   "ro root=/dev/nvme0n1p5"

And here is my custom stanza that I am trying to append to refind.conf

include refind-theme-regular/theme.conf
scanfor internal,external,manual
extra_kernel_version_strings linux-lts,linux

menuentry "Arch Linux" {
    icon     /EFI/refind/icons/os_arch.png
    volume    BOOT
    loader   vmlinuz-linux
    initrd   initramfs-linux.img
    options  "root=UUID=e3e42f07-05e3-4c1f-9360-252895112f7d rw add_efi_memmap initrd=intel-ucode.img"
    submenuentry "Boot using fallback initramfs" {
        initrd initramfs-linux-fallback.img
    }
    submenuentry "Boot to terminal" {
        add_options "systemd.unit=multi-user.target"
    }
}

Last edited by archron (2021-03-07 08:34:08)

Offline

#2 2021-03-04 16:36:14

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,568

Re: [SOLVED] Custom Arch Icons for rEFInd & Manual Stanza

rEFInd should work out of the box work with refind_linux.conf alone without the need for a stanza if you only have one default OS. I propose copying what you have in the 'options' part of your stanza to refind_linux.conf and just disable the stanza. You can also add another boot parameter to refind_linux.conf:

"Boot to terminal" "root=UUID=e3e42f07-05e3-4c1f-9360-252895112f7d systemd.unit=multi-user.target"

Please note that it is best to transpose your "Boot with minimal options" to a more permanent naming device like UUID.

Last edited by d_fajardo (2021-03-04 16:37:08)

Offline

#3 2021-03-04 18:46:17

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,869
Website

Re: [SOLVED] Custom Arch Icons for rEFInd & Manual Stanza

Please remove the superfluous cry for help from your topic title.

https://gitlab.archlinux.org/archlinux/ … ow-to-post


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2021-03-04 19:34:11

archron
Member
Registered: 2021-03-02
Posts: 4

Re: [SOLVED] Custom Arch Icons for rEFInd & Manual Stanza

d_fajardo wrote:

rEFInd should work out of the box work with refind_linux.conf alone without the need for a stanza if you only have one default OS. I propose copying what you have in the 'options' part of your stanza to refind_linux.conf and just disable the stanza. You can also add another boot parameter to refind_linux.conf:

"Boot to terminal" "root=UUID=e3e42f07-05e3-4c1f-9360-252895112f7d systemd.unit=multi-user.target"

Please note that it is best to transpose your "Boot with minimal options" to a more permanent naming device like UUID.

Getting refind to work is not the problem, but that it is showing up a generic logo which I do not want to see, and should be easily done with this manual stanza. What bugs me is that it does not, so I am looking for a way to make it work so that the next time I can use it as a template.

Offline

#5 2021-03-04 19:50:47

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,568

Re: [SOLVED] Custom Arch Icons for rEFInd & Manual Stanza

The custom logos/icons are defined in refind.conf in /esp/EFI/refind and not in the stanza. This link will give a good picture of how rEFInd works.
Have you created a directory for your custom logos/icons? Could you post your complete refind.conf?

EDIT: Read the Note on this page.

Last edited by d_fajardo (2021-03-04 19:58:57)

Offline

#6 2021-03-04 20:04:09

archron
Member
Registered: 2021-03-02
Posts: 4

Re: [SOLVED] Custom Arch Icons for rEFInd & Manual Stanza

d_fajardo wrote:

The custom logos/icons are defined in refind.conf in /esp/EFI/refind and not in the stanza. This link will give a good picture of how rEFInd works.
Have you created a directory for your custom logos/icons? Could you post your complete refind.conf?

I am using the default icons folder from within refind, and the icon shows up just fine. But there is something wrong with the stanza, and hence this option does not boot, and returns back to refind. My main concern, which I suspect is the problem here is whether all the paths within the stanza point to the right locations, and the refind website is unclear regarding this.

I did some trial and error, and have made the option to work but I have skipped the "volume" option


The previous one that did not boot goes like this

include refind-theme-regular/theme.conf
scanfor internal,external,manual
extra_kernel_version_strings linux-lts,linux

menuentry "Arch Linux" {
    icon     /EFI/refind/icons/os_arch.png
    volume    BOOT
    loader   vmlinuz-linux
    initrd   initramfs-linux.img
    options  "root=UUID=e3e42f07-05e3-4c1f-9360-252895112f7d rw add_efi_memmap initrd=intel-ucode.img"
    submenuentry "Boot using fallback initramfs" {
        initrd initramfs-linux-fallback.img
    }
    submenuentry "Boot to terminal" {
        add_options "systemd.unit=multi-user.target"
    }
}

The current one that is working is as follows

include refind-theme-regular/theme.conf
scanfor internal,external,manual
extra_kernel_version_strings linux-lts,linux

menuentry "Arch Linux" {
    icon     /EFI/refind/icons/os_arch.png
    loader   /vmlinuz-linux
    initrd   /initramfs-linux.img
    options  "root=UUID=e3e42f07-05e3-4c1f-9360-252895112f7d rw quiet add_efi_memmap initrd=/intel-ucode.img"
    submenuentry "Boot using fallback initramfs" {
        initrd /initramfs-linux-fallback.img
    }
    submenuentry "Boot to terminal" {
        add_options "systemd.unit=multi-user.target"
    }
}

Now, can any of you veterans tell me the difference in the config if I were to mount the ESP to "/boot/efi" instead of "/efi" as I have here?

Offline

#7 2021-03-04 20:12:05

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,568

Re: [SOLVED] Custom Arch Icons for rEFInd & Manual Stanza

But there is something wrong with the stanza, and hence this option does not boot.

In my first post I proposed disabling the stanza completely and just relying on refind_linux.conf to generate rEFInd boot but you haven't really followed it. Will you give it a try?

Offline

#8 2021-03-04 21:54:17

archron
Member
Registered: 2021-03-02
Posts: 4

Re: [SOLVED] Custom Arch Icons for rEFInd & Manual Stanza

d_fajardo wrote:

But there is something wrong with the stanza, and hence this option does not boot.

In my first post I proposed disabling the stanza completely and just relying on refind_linux.conf to generate rEFInd boot but you haven't really followed it. Will you give it a try?


Yes, I did. The system works fine without my manual stanza, and I am able to boot into it BUT the problem is I don't understand the manual stanza part of rEFInd and would like to learn where I messed up in creating it that's all. Hence all this time into fixing the problem of having no icon in my custom entry.

Offline

#9 2021-03-04 22:06:27

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,568

Re: [SOLVED] Custom Arch Icons for rEFInd & Manual Stanza

Have a good read of the Rod Smith link I posted. He is the author of rEFInd and there's a wealth of info in there. In addition of course is the Arch wiki on rEFInd.

Last edited by d_fajardo (2021-03-05 05:08:07)

Offline

#10 2021-03-05 08:57:07

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 596

Re: [SOLVED] Custom Arch Icons for rEFInd & Manual Stanza

archron wrote:
/dev/nvme0n1p1: LABEL_FATBOOT="EFI" LABEL="EFI" UUID="6816-673A" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="b8fb393f-6f34-4e18-9db7-e3bb24050f83"
archron wrote:
menuentry "Arch Linux" {
...
    volume    BOOT
...
}

Your EFI system partition's LABEL, PARTLABEL, or PARTUUID is not "BOOT". And you don't even need to set the "volume" option since you're referencing files on the EFI system partition. Read https://wiki.archlinux.org/index.php/RE … ot_stanzas (the text after the example).

If you want your autodetected boot entry (configured from refind_linux.conf) to have a Arch Linux icon, a simple way to do that is to change the ESP's file system label to include the word "arch", e.g.:

# fatlabel /dev/nvme0n1p1 "Arch boot"

Also, I'm curious about:

archron wrote:

instead of the suggested /boot/efi

Where did you find the suggestion to use /boot/efi? I'm quite sure I removed most references to that mountpoint from the wiki. The current recommendation is to use either /boot or /efi.

Last edited by nl6720 (2021-03-05 09:05:46)

Offline

#11 2021-03-05 09:42:06

Terence64w
Member
Registered: 2020-12-17
Posts: 29

Re: [SOLVED] Custom Arch Icons for rEFInd & Manual Stanza

archron wrote:

rEFInd

1. rEFInd works better with start option `ro`, GRUB works best with start option `rw`

2. rEFInd works better without "Stanza" that expressly mentioned in Manual, I suggest to delete it.

3. Archlinux have different starter as other OS e.g. Ubuntu

4. If you have installed another Theme... you got another 'icons'-theme-folder

Solutions:
1. Right icon for Archlinux:

- Open/Edit `boot/efi/EFI/BOOT/refind.conf` or `boot/EFI/BOOT/refind.conf` and search for `icons_dir` around line 80 and add one line as shown:

icons_dir icons

Here my conf:

#icons_dir myicons
#icons_dir icons/snowy
icons_dir icons

Without this you get "just" the penguin, change to other dir if you have installed another theme.

2. Set right boot-eviroment-variables:
In the same file of above point 1., search this time for 'arch linux`, this is around line 600, here my menuentry...:

menuentry "Arch Linux" {
    icon     /EFI/BOOT/icons/os_arch.png
    volume   "Arch Linux"
    loader   /boot/vmlinuz-linux
    initrd   /boot/initramfs-linux.img
    options  "root=/dev/disk/by-id/nvme-eui.<+16-digits>-part1 ro add_efi_memmap initrd=boot\amd-ucode.img initrd=boot\initramfs-%v.img"
    submenuentry "Boot using fallback initramfs" {
        initrd /boot/initramfs-linux-fallback.img
    }
    submenuentry "Boot to terminal" {
        add_options "systemd.unit=multi-user.target"
    }
    disabled
}

- Necessary mods:
2.1. `icon` # like it is by me, change it if you have another theme.

2.2 . `options` # Remove here UUID and use `/dev/disk/by-id/nvme-eui.<+16-digits>-part1` or `/dev/disk/by-id/wwn-0x<+16-digits>-part1` or `/dev/nvme0n1p1` or `/dev/sda1`

Here an example from Wikipedia: `/dev/disk/by-id/wwn-0x500277a4100c4e21`

Read dev-disk-by-id with command:

ls -la /dev/disk/by-id/

2.3. Just after partition-entry is the `ro` or `rw` option. If here stay `rw` change to `ro`.
2.4. `initrd=boot\amd-ucode.img` If you have a Intel-CPU you find here `initrd=boot\intel-ucode.img`, here check only the presence.

Now save the file and close.

3. Check and (in case) modify `/boot/refind_linux.conf`.
If you have only archlinux on your computer you should have following entries:

"Boot with standard options"  "ro root=/dev/disk/by-id/nvme-eui.<+16-digits>-part2"
"Boot to single-user mode"    "ro root=/dev/disk/by-id/nvme-eui.<+16-digits>-part2 single"
"Boot with minimal options"   "ro root=/dev/disk/by-id/nvme-eui.<+16-digits>-part2"

Notes:
- Here is `root` on second partition, modify according to your system.
- Other entries like `lo` = loop = installation-usb or cd can be deleted.

That works on any PC or notebook and with any kernel

Offline

#12 2021-03-05 09:52:33

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 596

Re: [SOLVED] Custom Arch Icons for rEFInd & Manual Stanza

The "ro" and "rw" kernel parameters have nothing to do with rEFInd or GRUB. mkinitcpio requires "rw" to be able to fsck the root volume, read the fsck hook description in https://wiki.archlinux.org/index.php/Mk … mmon_hooks.

There's also nothing wrong with using UUIDs in root=.

Last edited by nl6720 (2021-03-05 09:55:34)

Offline

#13 2021-03-05 23:13:52

Terence64w
Member
Registered: 2020-12-17
Posts: 29

Re: [SOLVED] Custom Arch Icons for rEFInd & Manual Stanza

nl6720 wrote:

The "ro" and "rw" kernel parameters have nothing to do with rEFInd or GRUB. mkinitcpio requires "rw" to be able to fsck the root volume, read the fsck hook description in https://wiki.archlinux.org/index.php/Mk … mmon_hooks.

There's also nothing wrong with using UUIDs in root=.

Thanks for the link, I put back to `rw` even if `mkinitcpio` made me a lot of problems in last installation not inserting module (amdgpu) and some hooks, one, maybe the most important  `sd-vconsole`, but this is a completely different story. That's not simple for newbies.

Anyway, installing arch with plasma (at least on notebook a couple of days ago) without GRUB, rEFInd set the kernel option directly to `ro` like in own wiki stay.

It's pity that rEFInd documentation and basic entries/configuration have to be reworked over different wikis to get just the arch-logo at start.

Worse is... if searching for the right logo of/for OS the people lands to "Stanza" or different "themes" (me too) but not on "how to set the `icon_dir`" in `/boot/EFI/BOOT/refind.conf`, that it's all other than "Keep It Simple".

A Wiki-page or `bbs`-corner should not be limited to external or internal links but to direct solution.

For me is UUID a big problem as well GRUB requiring special ZFS-configuration to works, with `/dev/disk/by-id/` (with WWN (World Wide Number) see Wikipedia) and "rEFInd" are all problem gone. Theoretically (with `/dev/disk/by-id/` and "rEFInd") I can reinstall the (ARCH) system without modify ESP/EFI-partition and this is perfect for all dual- and multi-booters.

I'm very sorry for my criticism but, it took one month for me to discover how to get Arch-Logo appearing in my rEFInd, during the solution is very simple for everybody even for the package-maintainer-s.

Please add to Arch-Motto "Keep It Simple" also "Evrybody's Time Is Precious" e.g. KISSETIP.

Offline

Board footer

Powered by FluxBB