Menu

Custom Menu Entries

aleksgeo
2012-10-21
2012-11-10
  • aleksgeo

    aleksgeo - 2012-10-21

    Hey all,

    I'd appreciate a little help with a relatively minor issue I'm having. I use a MacBook Pro with Mountain Lion, and Windows 7 installed in a BootCamp partition. My refind.conf file has the following:

    scanfor internal,hdbios,external,optical,cd,manual

    This allows me to choose between Mac and Windows every time, which is exactly what I want. However, there's no way for me to get to the Recovery HD partition that was introduced with Mac OS X 10.7 Lion, since it doesn't appear in the submenu for Mac OS X. So I added this to refind.conf:

    also_scan_dirs com.apple.recovery.boot

    Now, the Recovery HD appears as a third option every time I boot - no different than if I were using the standard BootCamp OS picker.

    What I'd like to do is create a custom menu entry for Mac OS X and Windows, and include a submenu for Mac OS X to boot the Recovery HD. Unfortunately, I don't know how :P I'm not sure where the actual loaders are for each of these and therefore can't properly write the custom stanzas myself. I'd really appreciate it if someone could help me out with this.

    Cheers!

     
  • Roderick W. Smith

    In checking the details for this, I discovered that I never implemented the "volume" option within submenu entries. It was an easy enough change, though, so I've put it up to the rEFInd git repository (for source code), and I've made a binary available here:

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

    With that version, you should be able to do something like this:

    menuentry "OS X" {
    icon EFI/refind/icons/os_mac.icns
    volume "Mac OS X"
    loader /System/Library/CoreServices/boot.efi
        submenuentry "Recovery boot" {
            volume "Recovery HD"
            loader /com.apple.recovery.boot/boot.efi
        }
    }
    

    You'll probably need to change the values of one or both of the "volume" items for your system, of course. For the recovery volume, you may need to figure it out via Disk Utility. (OTOH, I used "Recovery HD" because that's the name that turned up on a Web page that described it, so perhaps that's the standard name.)

    Just doing this, though, will create duplicate Apple boot options. To remove the duplicate, you'll need to add /System/Library/CoreServices to the "dont_scan_dirs" option line in refind.conf (and uncomment it, if it's currently commented out).

    By default, rEFInd should generate a number of other submenu entries. These add boot options on a line called "options". If you want to preserve these boot options, you'll need to create one new submenuentry for each of the boot options you want to create. Each should include a "volume" and "loader" token, just as in the example above, but also an "options" line, as in:

    options "-v -s"
    

    This example sets the verbose (-v) and single-user (-s) flags.

    I hope this helps!

     

Log in to post a comment.