nbalonso.com

Fixing BootPicker for Yosemite

| Comments

At work we’ve been using Apple BootPicker for years. It is specially useful for computers sitting in public areas where there are many visitors coming in and out. It allows us for example to make the whole library dual-boot.

The problem is that the application has not been updated since 2009, so as one would expect it doesn’t play nice with the most recent version of OS X.

The log from the application reads

BootPicker: BootPicker: Exiting, BootPicker is only supported on Leopard or later.

So yeah… it doesn’t know that 10.10 is > 10.5. The reason is that it is picking up only the first digit after the dot and comparing it against five.

When I saw the error I thought to myself “that it’s a silly comparison error” (which is also the reason Microsoft had to jump to Windows 10) and it could be fixed by simply making the comparison against 10.0.

So I downloaded Hex Fiend, opened the binary, looked for the hex value of 10.5 and replaced it with 10.0; went to test it and works!

Put it all together in a pkg with new images, renamed the LaunchAgent and made the logs go the more reasonable location /var/log/bootpicker.log. You can download my package here.

Note that this package does deploy a sample preference file to /Library/Preferences/bootpicker.plist. It looks like

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>bgPath</key>
  <string>/Library/Desktop Pictures/Milky Way.jpg</string>
  <key>defaultBootOS</key>
  <string></string>
  <key>linJustification</key>
  <string></string>
  <key>linuxPartition</key>
  <string></string>
  <key>mosxJustification</key>
  <string></string>
  <key>timeLimit</key>
  <integer>0</integer>
  <key>title</key>
  <string>Welcome to Macintosh</string>
  <key>userChoosesBootOS</key>
  <true/>
  <key>winJustification</key>
  <string></string>
  <key>windowsPartition</key>
  <string>/dev/disk0s4</string>
</dict>
</plist>

So the computer will end up looking like

You will probably want to replace or edit this file to accommodate your needs.

During my testing, the panel in System Preferences did not seem to work as expected but modifying the plist did.

Bonus: When I was playing with this on a VM I noticed that the log read

1
2
3
4
5
6
7
8
9
10
11
23:38:20 BootPicker: Configuring interface for Windows volume/device: /dev/disk0s4
23:39:00  BootPicker: User chose Windows.
23:39:00  BootPicker: Bless args: (
    "--device",
    "/dev/disk0s4",
    "--setBoot",
    "--legacy",
    "--nextonly"
).
Legacy mode not supported on this system
23:39:00  BootPicker: Failed to set /dev/disk0s4 as the boot device!

So if you ever want to get rid of that --legacy part and make OS X still trust the binary you could replace it with zeros and the log will end up with something like

1
2
3
4
5
6
7
8
9
23:44:45 BootPicker: User chose Windows.
23:44:45  BootPicker: Bless args: (
    "--device",
    "/dev/disk0s4",
    "--setBoot",
    "",
    "--nextonly"
).
23:44:45  BootPicker: Flagging slice 4

A VM can’t be blessed so this doesn’t make it work, but this trick might be useful in the future if you need UEFI boots (eg. black Mac Pro)

Did you end up with a cold feeling about how non-secure OS X really can be?

Comments