Contribute
Register

[Solved] Choose which OS to boot to before restarting?

Status
Not open for further replies.
Joined
Feb 16, 2013
Messages
54
Motherboard
Z77-DS3H
CPU
Intel Core i7-3770
Graphics
GeForce GTX 650
(apologies for any incorrect terminology; it's been a while since I messed with my installation)
tl;dr - is it idiotic to use a script to alter the .plist file on my "Boot OS X" volume so I can restart into any OS, bypassing the need to manually select one at the bootloader?

I dual-boot Yosemite and Windows 7, with Windows on its own drive just for games. Often, I want to switch to Windows, requiring me to reboot and wait for the bootloader screen so I can select the Windows drive. (I don't have it set to auto-boot into any OS after a timeout). Sometimes, though, I want to hit "Restart" and walk away for a few minutes as Windows takes a bit longer to spin up.

Could I, using a script, alter the .plist file for the bootloader (Chameleon) so that it selects a certain drive automatically? Or is that just asking to brick my Hackintosh?

Edit 1: I use Chameleon, not Chimera. Ancient, but if it ain't broke...
Edit 2: This probably belongs in the "Bootloaders" forum
 
Last edited:
I've got an alternative to constantly editing the org.chameleon.boot.plist file: If I just make a copy, alter it, then change the name of the original, Chameleon should read the "altered" copy because it uses the correct filename. So, I could just write a script to change the filenames. Easy enough.
 
Figured it out, it's actually fairly simple. Cursory explanation below:
  • Since Chameleon's settings are based on the contents of the org.chameleon.boot.plist file, I needed a way to change them easily before restarting. Rather than trying to edit the file each time I reboot, I made a couple different copies in different locations with the same name and altered settings. To reboot, I run a script that copies the desired file into the "Extras" folder on the "Boot OS X" drive, replacing whichever was there before. This changes the default partition that Chameleon chooses, without me interacting with the computer after I give the command.
  • Written with an Automator app, so I can trigger it via Alfred and Alfred Remote.
Steps, outlined in brief:
  1. Mount your "Boot OS X" partition. Make a backup copy of your current org.chameleon.boot.plist file in a folder somewhere else on your computer. Make a copy of that and alter the lines shown in the image attached.
    1. The line "hd(0,3)" is the disk identifier of your "Boot OS X" partition or your Windows NTFS partition.
  2. Locate the UUID of your "Boot OS X" partition
    1. Terminal command - diskutil info /dev/disk1s3 | grep UUID where disk1s3 is whichever volume you need (likely disk0s3 instead). Copy the Disk/Partition UUID.
  3. Open Automator and start a new Application
  4. Copy the steps in the image, excluding duplicates if you don't have a Fusion Drive
    1. Before adding the last step, test the Automator app by changing something in the file to be copied, running the app, and checking the file on the "Boot OS X" partition
  • I have two .plist files that I've altered - one boots automatically into my Yosemite install and the other boots automatically into Windows 7. I keep them in separate folders since they have the same name, and use two Automator apps to copy them into the boot partition: one named "Reboot Into Mac" and the other: "Reboot Into Windows".
  • The only difference: the Mac file has hd(0,3); the Windows uses hd(2,1). The Mac Automator app copies the Mac .plist file (obviously) and the Windows Automator app copies the Windows .plist.
 

Attachments

  • Altered boot.plist file.png
    Altered boot.plist file.png
    100.2 KB · Views: 185
  • Automator Instructions.png
    Automator Instructions.png
    117.6 KB · Views: 158
Status
Not open for further replies.
Back
Top