Custom Bootloader Icons

2013-01-27
2015-02-27
  • Jordan Fern

    Jordan Fern - 2013-01-27

    OCD is getting the better of me, but im trying to accomplish a custom icon for each of my bootloaders (Mac, windows 7 and windows 8).

    Here is what it currently looks like:
    Here

    I want it to look like this:
    Here

    Any idea's?

    (Also on a side note, i cannot get the 'vol_internal.icns' to change without changing in the default icon folder + The text "Boot Mac OSX from Machintosh HD" wont disappear)

     
    Last edit: Jordan Fern 2013-01-27
  • Roderick W. Smith

    I'm afraid there isn't currently a way to assign unique icons to BIOS/legacy boot loaders of the same type -- that is, all BIOS-booted Windows versions must have the same icon. Your best bet to get this to work is to install one or both of the Windows systems using EFI mode; you could then assign a custom icon using any of several methods. Using an EFI-mode boot for Windows is tricky at best with Windows 7, but I've seen reports that it's much easier with Windows 8. I don't have Windows 8, though, so I can't really offer much guidance on how to do this.

    I'm afraid I just couldn't parse your last parenthetical paragraph. Could you please re-phrase it?

     
  • Jordan Fern

    Jordan Fern - 2013-01-27

    Sorry Roderick, I'm having trouble understanding what you mean when you say use EFI mode for windows?

    Is there no way to make rEFInd use the partitions own icons instead of those from the EFI folder? For example i have changed the partition logo's on my desktop - could it not use these icons instead? http://img18.imageshack.us/img18/6100/screenshot20130127at182.png

    With regards to the side note;

    1. If i change the icon 'vol_internal.icns' in the standard icon folder, when i reboot it has changed to what i wanted it too.

    If i have my own icon setup in my custom icon dir (as per other icons), this icon is the only one that doesnt change

    1. The text "Boot Mac OSX from Machintosh HD" (as shown in the screenshot) does not disappear (unable to hide the text)
     
  • Roderick W. Smith

    By "install... Windows... using EFI mode," I mean to use an EFI-mode boot loader (on a FAT32 ESP) to boot Windows, rather than rely on a Boot Camp-style BIOS-mode boot loader. Upon second thought, though, this will be harder than I was initially thinking because of the way Windows ties its boot mode to the partition table type, so you'd need to convert both of your Windows installations to EFI mode -- otherwise one of them would be unable to boot at all. (A BIOS-mode boot of Windows requires a hybrid MBR, whereas an EFI-mode boot of Windows requires a legal protective MBR and not a hybrid MBR.) Booting Windows 7 in EFI mode theoretically possible, but getting it to actually boot that way on a Mac is very tricky at best. It would be easier to do if you had two hard disks and put one Windows on each disk.

    As to icons, first know that rEFInd is reliant on the EFI to load icon files. The icons in the screen shot you posted are presumably stored on an NTFS volume and read in OS X via an NTFS driver. EFI can't read an NTFS volume by itself, and so can't read an icon file from an NTFS volume. That said, I have run across an NTFS driver for EFI that might do the job; but the driver I found is binary-only and of unknown (by me) provenance and legality. Therefore, I can't recommend its use. Beyond that, loading an icon requires support in the rEFInd code, and the current code simply doesn't support giving users partition-by-partition support for loading custom icons for BIOS-mode boot loaders -- the code attempts to identify the OS type and then loads an OS-specific icon. Thus, even if you used an NTFS driver, it wouldn't help without code changes. Such changes could be made, of course, or the code could be changed to enable loading custom icons in some other way, but any such change would require more than tweaking a line or two.

    Concerning vol_internal.icns, I made some changes yesterday (after releasing 0.6.6) that might help. Try the version that's in git as source code, or available as a test binary here:

    http://www.rodsbooks.com/refind-bin-0.6.6.4.zip

    Concerning hiding the "Boot Mac OS X from Macintosh HD" and similar messages for other OSes, look at the hideui token in refind.conf. Specifically, setting hideui label or adding label to an existing hideui line should do the trick.

     
  • Jordan Fern

    Jordan Fern - 2013-01-27

    Re: the label comment, i already have it hidden, but everything is blocked apart from that comment

    Here is the line

    'hideui singleuser,hwtest,arrows,hints,editor,label'

    Ill try the updated version tomorrow for icon fix.

    Re: Custom icons - is there maybe even a way to trick rEFInd to think an individual partition is a different format and that format has its own icon? i know im not explaining it well - but i was hoping to even go along the lines of hdbios2 which would be assigned to partition 4 (windows 8)

    any idea's welcome :P

     
  • Roderick W. Smith

    OK; I found the bug that was causing label to be ignored as an option to hideui, and I've fixed it. It's up in git, and a binary as:

    http://www.rodsbooks.com/refind-bin-0.6.6.6.zip

    The only way to trick rEFInd into using another icon for a BIOS-mode OS is to alter its boot loader signature. Perhaps there's a third-party boot loader you could install that would do the trick, but I really don't know much about third-party Windows boot loaders.

    Perhaps you could copy the first sector of both of your Windows partitions to binary files (as in sudo dd if=/dev/disk0s4 of=windows7.br bs=512 count=1, changing the device filename and output filename as appropriate). If they're different, send them both to me; I may be able to find a way to differentiate them and put in a relatively simple coding change that you could latch onto for creating separate icons.

     
  • Jordan Fern

    Jordan Fern - 2013-01-29

    Thanks Roderick,

    I have uploaded each partition : http://www.sendspace.com/file/exz5n3

    Let me know how i can help :)

     
  • Roderick W. Smith

    Sorry, there's nothing there I can use. Although the sectors you've provided do differ, the differences all relate to variable data such as volume serial numbers. There are no differences that uniquely identify one version of Windows vs. another one.

     
  • Jordan Fern

    Jordan Fern - 2013-01-29

    I have an IDEA!

    Could i...Make the 'os_win' icon transparent, then with a background, make the icons differ and set this as my refind's background?

    Only question now...how do i get a screen grab of refind at boot for icon placement?

    When i press F10, i get "Error egsavefile: E"?

     
    Last edit: Jordan Fern 2013-01-29
  • Roderick W. Smith

    Yes, that ought to work, albeit with some caveats. A similar option would be to make the icon only partially transparent, and include an identifier in the background (say, a "7" or "8"). The biggest caveat is that this will only work if the icon positions are guaranteed to be invariant. If you add or remove options, or if you have enough that the icons scroll left and right, then it won't work. Also, I don't guarantee that I won't change icon positioning in the future. (I did so recently when improving banner and icon support, and may find cause to do so in the future.) Incidentally, there's already a fully-transparent icon in the icon set, called transparent.icns.

    The error you get when taking a screen shot might denote a read-only ESP. This can happen if you use HFS+ on the ESP, as happens with some Macs. If this is the case, I've got a few suggestions:

    • You can convert your ESP to use FAT32 rather than HFS+. If your default boot program isn't on the ESP, this should be pretty straightforward to do, although you should be sure to back up and restore any files that are on it.
    • If you're using the standard banner and background, you can mock it up by loading the refind_banner.bmp file from the banners subdirectory of the rEFInd distribution into a graphics file and expanding it to whatever your screen resolution is. If you're not using the standard banner, you could work from whatever you're using in a similar way. Of course, you'd then have to locate your icons pretty precisely, which might take some trial-and-error work. The icons are positioned so that they're exactly centered vertically, and the set of them should be centered horizontally, with 8 pixels between icons -- but each icon is actually 144x144 pixels, to account for the selection image. Thus, it should be 152 pixels from one icon's edge to the next one's edge.
    • You could set up another computer or a virtual machine with the same resolution you've got and set up an identical number of boot loader entries. You can then take the screen shot with it and modify the banner image from that screen shot.
     
  • Joe van Tunen

    Joe van Tunen - 2013-04-19

    Would it be possible to change rEFInd so the user can specify the scratch disk for screen shots or tell rEFInd to use the EFI partition that is on the same disk as the rEFInd partition?

     
  • Roderick W. Smith

    Yes, but this is a change I'm not likely to make. I'm reluctant to do the first because it means another configuration file option, and I think there are enough of those already that it can be confusing to new users. Specifying the ESP on the same physical disk as rEFInd would not require a configuration file change, but I'm not sure it really has any significant advantage over using whatever comes up first in the list. If somebody submits a patch to do this, I'll consider using it, but unless I'm convinced of a significant advantage to this, I'm not going to put any effort ito it myself.

     
  • Joe van Tunen

    Joe van Tunen - 2013-04-19

    I don't think the number of configuration options is a deterrent. I say the more the merrier. If there's a problem that can be solved by adding an option then why not add the option? Options are optional after all.

    The advantage is being able to use the screen shot feature while avoiding the 30 second delay of booting rEFInd from a FAT partition. I don't know if that's significant enough since screen shots aren't necessary for rEFInd's primary use and not every Mac has the 30 second delay. If I really want a screen shot, then I suppose I could boot from the FAT partition and keep my HFS partition for regular booting.

    Does rEFInd have any other code besides screen shots (such as logging or debug output) that writes to the EFI partition? I use the EFI partition when using the EFI Shell to redirect output of EFI Shell commands because all other partitions are read only at the time.

     
  • Roderick W. Smith

    Adding configuration options without cause is a Bad Idea for several reasons:

    • It's unnecessary work for me (or whoever does the coding).
    • It creates more opportunity for bugs to creep into the code.
    • It intimidates new users, who often find the default refind.conf-sample file intimidating enough already. Your "more the merrier" comment is definitely not the sentiment of a significant number of users.

    In the case under discussion, an option to set the partition used for screen shots is unnecessary because rEFInd will store screen shots to the ESP -- it locates a partition with a partition type code for the ESP. Such partitions must be FAT partitions, and therefore writeable, according to the EFI spec. (I realize some Macs have HFS+ partitions flagged as ESPs, but those are misconfigured. Note that this is not IMHO or even IMO; the EFI spec is quite explicit about this.) Thus, if you install rEFInd on the OS X boot partition, you can still use F10 -- the screen shot will be saved on the ESP.

    That said, this code could be improved with better support for failure conditions (such as those misconfigured systems with HFS+ "ESPs" but some other FAT partition somewhere else). Such improvements wouldn't necessarily require new configuration file options, though. In the meantime, adjusting partition type codes so that only FAT partitions (and ideally just one of them) have the ESP type code is the way to go.

    Currently, the only code in rEFInd that writes files is the screen shot code. I may eventually add some logging features, but I haven't done so yet.

     
  • Joe van Tunen

    Joe van Tunen - 2013-04-21

    Right, I should have looked at the code. It does find an ESP partition. Is it always going to be the same EFI partition? My computer has 5 disks with EFI partitions.

    There's varying degrees of unnecessary. Sure, the feature works as is. But if you want to make accessing the screenshot easier without having the user manually mount the EFI partition then it would be necessary to add the option. Every code change, whether it's a new option or not, has the potential to introduce a bug, but code changes are how improvements are made. As for intimidating new users, I'm confident that you won't find one ever saying "I used to use rEFInd but then they added another option".

    Is it possible to take a screenshot of the text screen either as a BMP or as a text file (maybe with HTML markup for the text colors)? I think it might be useful to be able to see the text for all the options at once - as apposed to the graphics mode that shows the text only for the currently selected item.

    Currently, the screenshot file name is fixed so you can only create one screen shot at a time. Can you append the time to the screen shot like how Mac OS X's Command-Shift-3 does or append a number that counts upward? Otherwise the user needs to manually rename the file using the EFI Shell or boot into OS X to do it.

    A screenshot takes 5% of the space in an EFI partition. So the number of screen shots that can be taken is limited. That's another reason to allow a different partition to be selected.

     
  • Jim Hoyle

    Jim Hoyle - 2015-02-27

    I am wondering, is there a solution to this nowadays? Is it possible to assign different icons for automatically detected different versions of the same operating system?

     
  • Roderick W. Smith

    I've recently made changes that enable rEFInd to differentiate between older (Windows XP and earlier) and later (Windows Vista and later) versions of Windows, and presents different icons for each. (Older versions get the old icon and new ones get a Windows 8 icon.) That's as fine-grained as it currently gets on the boot loader detection.

    You might try loading the new NTFS driver and seeing if you can set an OS icon via a .VolumeIcon.png file. I can't promise this will work, but it might. (I've not tested it.) If you try it and it doesn't work, I can look into it and see what might be done. (Of course, this assumes you're booting Windows. If it's some other OS, you'd need support for whatever filesystem holds the boot loader that rEFInd is detecting.)

     
  • Jim Hoyle

    Jim Hoyle - 2015-02-27

    Actually I have two OSX Yosemites on two different hard drives, so I would like to differentiate the icons between those (I have also Windows there, but that's ok as is).

    I just have refind_x64.efi in my /EFI/refind folder, I am not sure how to proceed? Thank you!

     
  • Roderick W. Smith

    Well, that's long been supported -- see the part of the documentation to which I pointed in my previous reply:

    http://www.rodsbooks.com/refind/configfile.html#icons

    Fine-tuning configurations for BIOS-mode OSes is harder, but for EFI-mode OSes, you've got lots of options.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks