]> code.delx.au - refind/blob - docs/man/refind-install.8
More documentation of copyrights and licenses.
[refind] / docs / man / refind-install.8
1 .\" Copyright 2015 Roderick W. Smith (rodsmith@rodsbooks.com)
2 .\" May be distributed under the GNU Free Documentation License version 1.3 or
3 any later version
4 .TH "REFIND-INSTALL" "8" "0.10.0" "Roderick W. Smith" "rEFInd Manual"
5 .SH "NAME"
6 refind-install \- Install rEFInd to the ESP and create an NVRAM entry
7 .SH "SYNOPSIS"
8 .BI "refind-install "
9 [--notesp | --usedefault \fIdevice-file\fR | --root \fImount-point\fR |
10 --ownhfs \fIdevice-file\fR ] [--keepname ] [--nodrivers | --alldrivers]
11 [--shim \fIshim-filename\fR] [--localkeys] [--yes]
12
13
14 .SH "DESCRIPTION"
15
16 To be useful, the rEFInd boot manager must be installed to the computer's
17 EFI System Partition (ESP) or other EFI-accessible location. In most cases,
18 an NVRAM entry describing rEFInd's location must also be created. These
19 steps can be performed manually; however, the \fBrefind-install\fR command
20 provides an automated way to perform these tasks under both Linux and OS X.
21 The exact behavior and options vary depending on the OS, however.
22
23 Some details that can affect how the script runs include the following:
24
25 .TP
26 .B *
27 If you run the script as an ordinary user, it attempts to acquire
28 \fBroot\fR privileges by using the \fBsudo\fR command. This works on Mac OS
29 X and some Linux installations (such as under Ubuntu or if you've added
30 yourself to the \fBsudo\fR users list), but on some Linux installations
31 this will fail. On such systems, you should run \fBrefind\-install\fR as
32 root.
33
34 .TP
35 .B *
36 Under OS X, you can run the script with a mouse by opening a Terminal
37 session and then dragging\-and\-dropping the \fBrefind\-install\fR file to
38 the Terminal window. You'll need to press the Return or Enter key to run
39 the script.
40
41 .TP
42 .B *
43 If you're using OS X 10.7's Whole Disk Encryption (WDE) feature, or the
44 loogical volumes feature in OS X 10.10, you must install rEFInd to the ESP
45 or to a separate HFS+ partition. The default in rEFInd 0.8.4 and later is
46 to install to the ESP. If you prefer to use a separate HFS+ volume, the
47 \fB\-\-ownhfs \fIdevice-file\fR option to \fBrefind\-install\fR is required.
48
49 .TP
50 .B *
51 If you're not using WDE or logical volumes, you can install rEFInd to the
52 OS X root (/) partition by using the \-\-notesp option to
53 \fBrefind\-install\fR. Using this option is recommended when upgrading from
54 a working rEFInd installation in this location.
55
56 .TP
57 .B *
58 If you're replacing rEFIt with rEFInd on a Mac, there's a chance that
59 \fBrefind\-install\fR will warn you about the presence of a program called
60 \fB/Library/StartupItems/rEFItBlesser\fR and ask if you want to delete it.
61 This program is designed to keep rEFIt set as the boot manager by
62 automatically re\-blessing it if the default boot manager changes. This is
63 obviously undesirable if you install rEFInd as your primary boot manager,
64 so it's generally best to remove this program. If you prefer to keep your
65 options open, you can answer \fBN\fR when \fBrefind\-install\fR asks if you
66 want to delete rEFItBlesser, and instead manually copy it elsewhere. If you
67 subsequently decide to go back to using rEFIt as your primary boot manager,
68 you can restore rEFItBlesser to its place.
69
70 .TP
71 .B *
72 If you intend to boot BIOS-based OSes on a UEFI-based PC, you must edit the
73 \fBrefind.conf\fR file's \fBscanfor\fR line to enable the relevant
74 searches. This is not necessary on Macs, though; because of the popularity
75 of dual boots with Windows on Macs, the BIOS/legacy scans are enabled by
76 default on Macs.
77
78 .TP
79 .B *
80 On Linux, \fBrefind\-install\fR checks the filesystem type of the
81 \fB/boot\fR directory and, if a matching filesystem driver is available,
82 installs it. Note that the "\fB/boot\fR directory" may be on a separate
83 partition or it may be part of your root (\fB/\fR) filesystem, in which
84 case the driver for your root filesystem is installed. This feature is
85 unlikely to work properly from an emergency system, although it might if
86 you have a separate \fB/boot\fR partition and if you mount that partition
87 at \fB/boot\fR in your emergency system, and the ESP at \fB/boot/efi\fR.
88
89 .TP
90 .B *
91 On OS X, \fBrefind\-install\fR checks your partition tables for signs of a
92 Linux installation. If such a sign is found, the script installs the EFI
93 filesystem driver for the Linux ext4 filesystem. This will enable rEFInd to
94 read your Linux kernel if it's on an ext2, ext3, or ext4 filesystem. Note
95 that some configurations will require a \fB/boot/refind_linux.conf\fR file,
96 which can be reliably generated only under Linux. (The \fBmkrlconf\fR
97 script that comes with rEFInd will do this job once you've booted Linux.)
98 In the meantime, you can launch GRUB from rEFInd or press F2 or Insert
99 twice after highlighting the Linux option in rEFInd. This will enable you
100 to enter a \fBroot=\fI/dev/whatever\fR specification, where
101 \fI/dev/whatever\fR is the device identifier of your Linux root (\fB/\fR)
102 filesystem.
103
104 .TP
105 .B *
106 If you run \fBrefind\-install\fR on Linux and if
107 \fB/boot/refind_linux.conf\fR doesn't already exist, \fBrefind\-install\fR
108 creates this file and populates it with a few sample entries. If
109 \fB/boot\fR is on a FAT partition (or HFS+ on a Mac), or if it's on an
110 ext2fs, ext3fs, ext4fs, ReiserFS, Btrfs, or HFS+ partition and you install
111 an appropriate driver, the result is that rEFInd will detect your kernel
112 and will probably boot it correctly. Some systems will require manual
113 tweaking to \fBrefind_linux.conf\fR, though -- for instance, to add
114 \fBdolvm\fR to the boot options on Gentoo systems that use LVM.
115
116 .TP
117 .B *
118 If you pass the \fB\-\-shim\fR option to the script (along with a filename
119 for a Shim binary), the script sets up for a Secure Boot configuration via
120 Shim. By default, this causes the rEFInd binary to be renamed as
121 \fBgrubx64.efi\fR. Recent versions of Shim support passing the name of the
122 follow-on program to Shim via a parameter, though. If you want to use this
123 feature, you can pass the \fB\-\-keepname\fR option to
124 \fBrefind\-install\fR.
125
126 .PP
127
128 After you run \fBrefind\-install\fR, you should peruse the script's output
129 to ensure that everything looks OK. \fBrefind\-install\fR displays error
130 messages when it encounters errors, such as if the ESP is mounted read-only
131 or if you run out of disk space. You may need to correct such problems
132 manually and re\-run the script. In some cases you may need to fall back on
133 manual installation, which gives you better control over details such as
134 which partition to use for installation.
135
136 .SH "OPTIONS"
137
138 .TP
139 .B \-\-notesp
140 This option, which is valid only under OS X, tells \fBrefind-install\fR to
141 install rEFInd to the OS X root partition rather than to the ESP. This
142 behavior was the default in rEFInd 0.8.3 and earlier, so you may want to
143 use it when upgrading installations of that version, unless you used
144 \-\-esp (which is now the default behavior, although the \-\-esp option no
145 longer exists) or \-\-ownhfs. You may also want to use \-\-notesp on new
146 installations if you're sure you're not using whole\-disk encryption or
147 logical volumes.
148
149 .TP
150 .B \-\-usedefault \fIdevice-file\fR
151 You can install rEFInd to a disk using the default/fallback filename of
152 \fBEFI/BOOT/bootx64.efi\fR (as well as \fBEFI/BOOT/bootia32.efi\fR and
153 \fBEFI/BOOT/bootaa64.efi\fR, if the IA\-32 and ARM64
154 builds are available) using this option. The device\-file should be an
155 unmounted ESP, or at least a FAT partition, as in \fB\-\-usedefault
156 /dev/sdc1\fR. Your computer's NVRAM entries will not be modified when
157 installing in this way. The intent is that you can create a bootable USB
158 flash drive or install rEFInd on a computer that tends to "forget" its
159 NVRAM settings with this option. This option is mutually exclusive with
160 \-\-notesp and \-\-root.
161
162 .TP
163 .B \-\-ownhfs \fIdevice-file\fR
164 This option should be used only under OS X. It's used to install rEFInd to
165 an HFS+ volume other than a standard Mac boot volume. The result should be
166 that rEFInd will show up in the Mac's own boot manager. More importantly,
167 suspend\-to\-RAM operations may work correctly. Note that this option
168 requires an HFS+ volume that is not currently an OS X boot volume. This can
169 be a data volume or a dedicated rEFInd partition. The ESP might also work,
170 if it's converted to use HFS+; however, HFS+ is a non\-standard filesystem
171 for an ESP, and so is not recommended.
172
173 .TP
174 .B \-\-root \fImount-point\fR
175 This option is intended to help install rEFInd from a "live CD" or other
176 emergency system. To use it, you should mount your regular installation at
177 \fI/mount\-point\fR, including your /boot directory (if it's separate) at
178 \fI/mount\-point\fR/boot and (on Linux) your ESP at that location or at
179 \fI/mount\-point\fR/boot/efi. The \fBrefind\-install\fR script then
180 installs rEFInd to the appropriate location -- on Linux,
181 \fI/mount\-point\fR/boot/EFI/refind or
182 \fI/mount\-point\fR/boot/efi/EFI/refind, depending on where you've mounted
183 your ESP. Under OS X, this option is useful only in conjunction with
184 \-\-notesp, in which case rEFInd will install to
185 \fI/mount\-point\fR/EFI/refind. The script also adds an entry to your NVRAM
186 for rEFInd at this location. You cannot use this option with
187 \-\-usedefault. Note that this option is not needed when doing a dual-boot
188 Linux/OS X installation; just install normally in OS X.
189
190 .TP
191 .B \-\-nodrivers
192 Ordinarily \fBrefind\-install\fR attempts to install the driver required to
193 read /boot on Linux. This attempt works only if you're using ext2fs,
194 ext3fs, ext4fs, ReiserFS, or Btrfs on the relevant partition. If you want
195 to forego this driver installation, pass the \-\-nodrivers option. This
196 option is implicit when you use \-\-usedefault.
197
198 .TP
199 .B \-\-alldrivers
200 When you specify this option, \fBrefind\-install\fR copies all the driver
201 files for your architecture. You may want to remove unused driver files
202 after you use this option. Note that some computers hang or fail to work
203 with any drivers if you use this option, so use it with caution.
204
205 .TP
206 .B \-\-shim \fIshim\-filename\fR or \fB\-\-preloader \fIpreloader\-filename\fR\fB
207 If you pass this option to \fBrefind\-install\fR, the script will copy the
208 specified shim program file to the target directory, copy the
209 MokManager.efi file from the shim program file's directory to the target
210 directory, copy the 64-bit version of rEFInd as grubx64.efi, and register
211 shim with the firmware. (If you also specify \-\-usedefault, the NVRAM
212 registration is skipped. If you also use \-\-keepname, the renaming to
213 grubx64.efi is skipped.) When the target file is identified as PreLoader,
214 much the same thing happens, but \fBrefind\-install\fR copies HashTool.efi
215 instead of MokManager.efi and copies rEFInd as loader.efi rather than as
216 grubx64.efi. The intent is to simplify rEFInd installation on a computer
217 that uses Secure Boot; when so set up, rEFInd will boot in Secure Boot
218 mode, with one caveat: The first time you boot, MokManager/HashTool will
219 launch, and you must use it to locate and install a public key or register
220 rEFInd as a trusted application. The rEFInd public key file will be located
221 in the rEFInd directory's keys subdirectory under the name refind.cer.
222
223 .TP
224 .B \-\-localkeys
225 This option tells \fBrefind\-install\fR to generate a new Machine Owner Key
226 (MOK), store it in /etc/refind.d/keys as refind_local.*, and re-sign all
227 the 64-bit rEFInd binaries with this key before installing them. This is
228 the preferable way to install rEFInd in Secure Boot mode, since it means
229 your binaries will be signed locally rather than with my own key, which is
230 used to sign many other users' binaries; however, this method requires that
231 both the \fBopenssl\fR and \fBsbsign\fR binaries be installed. The former
232 is readily available in most distributions' repositories, but the latter is
233 not, so this option is not the default.
234
235 .TP
236 .B \-\-keepname
237 This option is useful only in conjunction with \-\-shim. It tells
238 \fBrefind\-install\fR to keep rEFInd's regular filename (typically
239 refind_x64.efi) when used with shim, rather than rename the binary to
240 grubx64.efi. This change cuts down on the chance of confusion because of
241 filename issues; however, this feature requires that shim be launched with
242 a command-line parameter that points to the rEFInd binary under its real
243 name. versions of shim prior to 0.7 do not properly support this feature.
244 (Version 0.4 supports it but with a buggy interpretation of the follow-on
245 loader specification.) If your NVRAM variables become corrupted or are
246 forgotten, this feature may make rEFInd harder to launch. This option is
247 incompatible with \-\-usedefault and is unavailable when run under OS X or
248 without the \-\-shim option. If the script discovers an existing rEFInd
249 installation under EFI/BOOT or EFI/Microsoft/Boot and no other rEFInd
250 installation when this option is used, it will abort.
251
252 .TP
253 .B \-\-yes
254 This option causes the script to assume a \fBY\fR input to every yes/no
255 prompt that can be generated under certain conditions, such as if you
256 specify \-\-shim but \fBrefind\-install\fR detects no evidence of a Secure
257 Boot installation. This option is intended mainly for use by scripts such
258 as those that might be used as part of an installation via an RPM or Debian
259 package.
260
261 .SH "AUTHORS"
262 Primary author: Roderick W. Smith (rodsmith@rodsbooks.com)
263
264 .SH "SEE ALSO"
265 \fBmkrlconf (8)\fR,
266 \fBmvrefind (8)\fR
267
268 \fIhttp://www.rodsbooks.com/refind/\fR
269
270 .SH "AVAILABILITY"
271 The \fBrefind\-install\fR command is part of the \fIrEFInd\fR package and is
272 available from Roderick W. Smith.