Appunti di Programmazione

Lion: cambiare il Sistema Operativo di default in rEFIt

Possiedo un Mac Book Pro 13" con installati i tre principali sistemi operativi: Mac OS X Lion, Microsoft Windows 7 e Linux Debian.
Il boot loader che ho installato per gestire questa configurazione è rEFIt [SITO UFFICIALE]. Tale applicazione, per impostazione predefinita, rende Mac OS X il sistema operativo di default, in modo che all'accensione del computer il sistema di casa Apple venga avviato automaticamente senza effettuare alcuna scelta.
Qualora, come me, desideriate impostare un'opzione diversa, ad esempio per avviare Linux o Windows automaticamente, potete fare in questo modo:

- avviate Mac OS X.

- aprite con un normale text editor il file /efi/refit/refit.conf

#
# refit.conf
# Configuration file for the rEFIt boot menu
#

# Timeout in seconds for the main menu screen. Setting the timeout to 0
# disables automatic booting (i.e., no timeout).
#
timeout 20

# Disable menu options for increased security. These are intended for a lab
# environment where the administrator doesn't want users to mess with the
# operating system. List the names for the options you want to hide from
# the boot menu. Currently supported:
#  shell       - remove the EFI shell
#  tools       - remove all EFI tools (shell and gptsync)
#  optical     - no booting from optical drives
#  external    - no booting from external disks or USB flash drives
#  internal    - no booting from internal disks; this setting is not
#                 recommended because it locks you out of all operating
#                 systems installed on the internal hard disks.
#  singleuser  - remove the submenu options to boot Mac OS X in single-user
#                 or verbose modes
#  hwtest      - remove the submenu option to run Apple Hardware Test
#  all         - all of the above, except for 'internal'
#
#disable external optical shell singleuser
#disable all

# Note: The 'disableopticalboot' and 'disableexternalboot' options from
# Charles Ahn's patch are also supported for compatibility. They are
# equivalent to 'disable optical' and 'disable external', respectively.

# Use a custom title banner instead of the rEFIt icon and name. The file
# path is relative to the directory where refit.efi is located. The color
# in the top left corner of the image is used as the background color
# for the menu screens. Currently uncompressed BMP images with color
# depths of 24, 8, 4 or 1 bits are supported.
#
#banner hostname.bmp

# Custom images for the selection background. There is a big one (144 x 144)
# for the OS icons, and a small one (64 x 64) for the function icons in the
# second row. If only a small image is given, that one is also used for
# the big icons by stretching it in the middle. If only a big one is given,
# the built-in default will be used for the small icons.
#
# Like the banner option above, these options take a filename of
# an uncompressed BMP image file.
#
#selection_big   selection-big.bmp
#selection_small selection-small.bmp

# Hide the volume badge icons in the graphical main menu. There are three
# settings:
#  none      - show all volume badges (default)
#  internal  - hide badges on internal disk volumes only, allowing you to
#              distinguish CDs and occasionally connected external disks
#  all       - never show volume badges (not recommended)
#
#hidebadges internal

# Hide various user interface elements. Here you can list the names of
# interface elements to hide. Currently supported:
#  banner    - the rEFIt title banner
#  shell     - the EFI shell icon
#  tools     - all EFI tools (shell and gptsync)
#  funcs     - built-in functions (about, restart)
#    ('tools' and 'funcs' together hide the complete second row of icons.)
#  label     - text label in the menu
#  hdbadges  - volume badges for internal disk volumes (same as
#               'hidebadges internal')
#  badges    - all volume badges (same as 'hidebadges all'); this setting
#               is not recommended because it won't let you distinguish
#               installed OSes and bootable CDs/DVDs.
#  all       - all of the above, except for 'badges'
#
# Note: The 'shell' and 'tools' options are equivalent to the 'disable'
# options with the same names.
#
#hideui tools funcs hdbadges
#hideui all

# Use text mode only. When enabled, this option forces rEFIt into text mode.
#
#textonly

# List legacy options first. When enabled, legacy BIOS based boot options
# (e.g. Windows, Linux via LILO or GRUB) will be listed first. This is
# intended as a quick fix to change the default boot choice until full
# configurability arrives.
#
#legacyfirst

# Set the default menu selection.  The available arguments match the
# keyboard accelerators available within rEFIt.  You may select the default
# loader using a one-character abbreviation for the OS name ("M" = Mac OS X,
# "L" = Linux, "W" = Windows).  You may also specify a digit between 1 and
# 9, in which case the Nth loader in the menu will be the default.  You can
# also select a rEFIt tool entry ("S" = EFI Shell, "P" = Partitioning Tool,
# "U" = shutdown).  This is intended as a quick fix to change the default
# boot choice until full configurability arrives.
#
#default_selection L

# EOF

- modificate opportunamente il valore della variabile "default_selection"

Come si può facilmente constatare, nella parte finale del file, vi sono alcune righe esplicative sull'uso di questa variabile, (quelle in ROSSO qui sopra evidenziate).
Per cambiare il sistema di default seguire queste indicazioni:

default_selection M Avvia Mac OS X
default_selection W Avvia Windows
default_selection L Avvia Linux

Per rendere effettive le variazioni è necessario impostare la variabile come si desidera e togliere il simbolo di commento [#] dall'inizio della riga; quindi salvare e riavviare.