Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Icons for custom boot entries #1042

Closed
tkashkin opened this issue Jul 12, 2020 · 5 comments
Closed

[Feature Request] Icons for custom boot entries #1042

tkashkin opened this issue Jul 12, 2020 · 5 comments

Comments

@tkashkin
Copy link

If I understand documentation and code correctly there's currently no way to set icons for custom boot entries except using .VolumeIcon.icns.
I'd like to be able to set icons for entries like it's currently possible for tools.

I have a slightly unusual multiboot setup (macOS, Windows and multiple Linux distros).
All EFI bootloaders are located on one ESP so .VolumeIcon.icns won't work for a case like this.

The easiest solution would probably be to try to append .icns to entry's Path and load that.
It should be consistent with how tools icons currently work.

ESP file structure
  • EFI
    • BOOT
      • BOOTx64.efi - OpenCore
    • Microsoft
      • Boot
        • bootmgfw.efi - Windows bootloader
        • bootmgfw.efi.icns - custom icon should probably be loaded from here if that's how it currently works for tools
    • OC - OpenCore
    • linux - Linux efistubs and initrds are here
      • fedora
        • initrd.img - ramdisk
        • vmlinuz.efi - kernel
        • vmlinuz.efi.icns - custom icon should probably be loaded from here
      • ... (more subdirs like fedora for other distros)

That's how it is setup in config.plist:

<plist version="1.0">
<dict>
	<key>Misc</key>
	<dict>
		<key>Entries</key>
		<array>
			<dict>
				<key>Name</key>
				<string>Windows</string>
				<key>Enabled</key>
				<true/>
				<key>Path</key>
				<string>PciRoot(0x0)/[Full path to ESP]/\EFI\Microsoft\Boot\bootmgfw.efi</string>
				<key>Arguments</key>
				<string></string>
			</dict>
			<dict>
				<key>Name</key>
				<string>Fedora</string>
				<key>Enabled</key>
				<true/>
				<key>Path</key>
				<string>PciRoot(0x0)/[Full path to ESP]/\EFI\linux\fedora\vmlinuz.efi</string>
				<key>Arguments</key>
				<string>root=UUID=baacb13a-a97a-4bfc-a83c-a47eb5ade9f5 ro rootflags=subvol=@fedora initrd=\EFI\linux\fedora\initrd.img mitigations=off quiet splash nouveau.modeset=0</string>
			</dict>
			<!-- Other distros are also here -->
		</array>
	</dict>
</dict>
</plist>

I tried to setup entries as tools, OpenCore loads icons for tools but fails to boot them.

How it was setup in Clover previously

Entries have Image property which should accept builtin icon name or path relative to current theme.

<dict>
	<key>Arguments</key>
	<string>root=UUID=baacb13a-a97a-4bfc-a83c-a47eb5ade9f5 ro rootflags=subvol=@fedora initrd=\EFI\linux\fedora\initrd.img mitigations=off quiet splash nouveau.modeset=0</string>
	<key>FullTitle</key>
	<string>Fedora</string>
	<key>Hotkey</key>
	<string>F</string>
	<key>Image</key>
	<string>icons\os_fedora.icns</string>
	<key>Path</key>
	<string>\EFI\linux\fedora\vmlinuz.efi</string>
	<key>Type</key>
	<string>Linux</string>
	<key>Volume</key>
	<string>ESP</string>
</dict>
@Andrey1970AppleLife
Copy link
Contributor

In yours ESP file structure, different bootloaders in different folders, I don't see a problem.

@kommtzeitkonrad
Copy link

kommtzeitkonrad commented Jul 12, 2020

If I understand documentation and code correctly there's currently no way to set icons for custom boot entries except using .VolumeIcon.icns.

Don't think about how to set this in OpenCore. Instead look up how to solve this on a real Mac.

To achieve what you want to have, you can follow the instructions in this link (ignore naming convention for grub.efi). Bonus: You can select all your multiple Linux distros in Startup Disk.

@tkashkin
Copy link
Author

tkashkin commented Jul 12, 2020

So should I:

  • Create a separate APFS volume or HFS+ partition (or FAT32 partition if it works) for each bootloader (Windows + 4 Linux distros in my case)
  • Put .VolumeIcon.icns, mach_kernel, SystemVersion.plist and boot.efi on it
  • bless each bootloader

I'm not sure if I can use Linux partitions for this since I have 4 distros on a single btrfs partition with subvolumes. Maybe btrfs EFI driver could work, but does it support subvolumes?

Also I don't think it's possible to pass arguments to the kernel this way.
I'd like to avoid having to chainload GRUB or something else just to pass arguments.
I'd also like to avoid having another bootloader and chainload REFInd/Clover/... -> OpenCore -> macOS.

All I care about here are the icons in OpenCore's GUI, everything else already works (except Startup Disk, but I don't really care about that).
I don't think custom entries shouldn't support icons while tools support them already.

@vit9696
Copy link
Contributor

vit9696 commented Jul 12, 2020

Well, ok. I can reopen this. I think both Tools and Custom entries can support manually specified icons from OpenCore ESP partition, but I will not work on this. If anybody is interest, he can discuss the design here, and then submit a PR.

@vit9696 vit9696 reopened this Jul 12, 2020
@kommtzeitkonrad
Copy link

kommtzeitkonrad commented Jul 13, 2020

So should I:

  • Create a separate APFS volume or HFS+ partition (or FAT32 partition if it works) for each bootloader (Windows + 4 Linux distros in my case)

Create /boot partitions (real GPT partitions, no Btrfs subvolumes) for each Linux distro in HFS+.

Make sure journaling is disabled, when creating them in macOS. When creating partitions from Linux, journaling is not enabled using mkfs.hfsplus from hfsprogs package. Don't forget to edit your /etc/fstab and do whatever you always do with your /boot partition.

  • Put .VolumeIcon.icns, mach_kernel, SystemVersion.plist and boot.efi on it

Yes! To have your command line parameters passed, the kernel and the parameters can be combined into a unified kernel image. Just put this to /boot/System/Library/CoreServices/boot.efi.

A more easier approach would be to link .../boot.efi to /boot/grub/x86-64-efi/core.efi and set GRUB_TIMEOUT=0.1 in /etc/default/grub, which also immediately boots your kernel (if that is your only problem regarding GRUB).

  • bless each bootloader

You do not need to bless the file since /System/Library/CoreServices/boot.efi is a predefined path in Open Core.

I'm not sure if I can use Linux partitions for this since I have 4 distros on a single btrfs partition with subvolumes. Maybe btrfs EFI driver could work, but does it support subvolumes?

I don't know, but every time I'm using filesystem drivers from elsewhere I'm running into trouble in OpenCore

Regarding Windows: /EFI/OC/Resources/Image/Windows.icns should be automatically selected for the default MS path.

13010405

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants