From: srs5694
Date: Sun, 22 Nov 2015 21:47:57 +0000 (-0500)
Subject: Move details of refind-install documentation from installing.html to a
X-Git-Url: https://code.delx.au/refind/commitdiff_plain/8e538ff3eedf77a2c16e830529eb6c99a9c61eee
Move details of refind-install documentation from installing.html to a
man page and create HTML versions of the man pages (auto-generated via
man2html in the mkdistrib script).
---
diff --git a/NEWS.txt b/NEWS.txt
index d1a373a..661acec 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,11 @@
0.10.1 (??/??/201?):
--------------------
+- Moved detailed descriptions of refind-install from installing.html to
+ a refind-install man page. To keep this information Web-accessible, I've
+ also created HTML versions of the three man pages and linked them into
+ the HTML documentation.
+
- Updated LodePNG to latest version (20151024).
- Fixed bugs in mkrlconf and in refind-install that could cause some kernel
diff --git a/docs/man/refind-install.8 b/docs/man/refind-install.8
index ac84672..5034051 100644
--- a/docs/man/refind-install.8
+++ b/docs/man/refind-install.8
@@ -20,6 +20,119 @@ steps can be performed manually; however, the \fBrefind-install\fR command
provides an automated way to perform these tasks under both Linux and OS X.
The exact behavior and options vary depending on the OS, however.
+Some details that can affect how the script runs include the following:
+
+.TP
+.B *
+If you run the script as an ordinary user, it attempts to acquire
+\fBroot\fR privileges by using the \fBsudo\fR command. This works on Mac OS
+X and some Linux installations (such as under Ubuntu or if you've added
+yourself to the \fBsudo\fR users list), but on some Linux installations
+this will fail. On such systems, you should run \fBrefind\-install\fR as
+root.
+
+.TP
+.B *
+Under OS X, you can run the script with a mouse by opening a Terminal
+session and then dragging\-and\-dropping the \fBrefind\-install\fR file to
+the Terminal window. You'll need to press the Return or Enter key to run
+the script.
+
+.TP
+.B *
+If you're using OS X 10.7's Whole Disk Encryption (WDE) feature, or the
+loogical volumes feature in OS X 10.10, you must install rEFInd to the ESP
+or to a separate HFS+ partition. The default in rEFInd 0.8.4 and later is
+to install to the ESP. If you prefer to use a separate HFS+ volume, the
+\fB\-\-ownhfs \fIdevice-file\fR option to \fBrefind\-install\fR is required.
+
+.TP
+.B *
+If you're not using WDE or logical volumes, you can install rEFInd to the
+OS X root (/) partition by using the \-\-notesp option to
+\fBrefind\-install\fR. Using this option is recommended when upgrading from
+a working rEFInd installation in this location.
+
+.TP
+.B *
+If you're replacing rEFIt with rEFInd on a Mac, there's a chance that
+\fBrefind\-install\fR will warn you about the presence of a program called
+\fB/Library/StartupItems/rEFItBlesser\fR and ask if you want to delete it.
+This program is designed to keep rEFIt set as the boot manager by
+automatically re\-blessing it if the default boot manager changes. This is
+obviously undesirable if you install rEFInd as your primary boot manager,
+so it's generally best to remove this program. If you prefer to keep your
+options open, you can answer \fBN\fR when \fBrefind\-install\fR asks if you
+want to delete rEFItBlesser, and instead manually copy it elsewhere. If you
+subsequently decide to go back to using rEFIt as your primary boot manager,
+you can restore rEFItBlesser to its place.
+
+.TP
+.B *
+If you intend to boot BIOS-based OSes on a UEFI-based PC, you must edit the
+\fBrefind.conf\fR file's \fBscanfor\fR line to enable the relevant
+searches. This is not necessary on Macs, though; because of the popularity
+of dual boots with Windows on Macs, the BIOS/legacy scans are enabled by
+default on Macs.
+
+.TP
+.B *
+On Linux, \fBrefind\-install\fR checks the filesystem type of the
+\fB/boot\fR directory and, if a matching filesystem driver is available,
+installs it. Note that the "\fB/boot\fR directory" may be on a separate
+partition or it may be part of your root (\fB/\fR) filesystem, in which
+case the driver for your root filesystem is installed. This feature is
+unlikely to work properly from an emergency system, although it might if
+you have a separate \fB/boot\fR partition and if you mount that partition
+at \fB/boot\fR in your emergency system, and the ESP at \fB/boot/efi\fR.
+
+.TP
+.B *
+On OS X, \fBrefind\-install\fR checks your partition tables for signs of a
+Linux installation. If such a sign is found, the script installs the EFI
+filesystem driver for the Linux ext4 filesystem. This will enable rEFInd to
+read your Linux kernel if it's on an ext2, ext3, or ext4 filesystem. Note
+that some configurations will require a \fB/boot/refind_linux.conf\fR file,
+which can be reliably generated only under Linux. (The \fBmkrlconf\fR
+script that comes with rEFInd will do this job once you've booted Linux.)
+In the meantime, you can launch GRUB from rEFInd or press F2 or Insert
+twice after highlighting the Linux option in rEFInd. This will enable you
+to enter a \fBroot=\fI/dev/whatever\fR specification, where
+\fI/dev/whatever\fR is the device identifier of your Linux root (\fB/\fR)
+filesystem.
+
+.TP
+.B *
+If you run \fBrefind\-install\fR on Linux and if
+\fB/boot/refind_linux.conf\fR doesn't already exist, \fBrefind\-install\fR
+creates this file and populates it with a few sample entries. If
+\fB/boot\fR is on a FAT partition (or HFS+ on a Mac), or if it's on an
+ext2fs, ext3fs, ext4fs, ReiserFS, Btrfs, or HFS+ partition and you install
+an appropriate driver, the result is that rEFInd will detect your kernel
+and will probably boot it correctly. Some systems will require manual
+tweaking to \fBrefind_linux.conf\fR, though -- for instance, to add
+\fBdolvm\fR to the boot options on Gentoo systems that use LVM.
+
+.TP
+.B *
+If you pass the \fB\-\-shim\fR option to the script (along with a filename
+for a Shim binary), the script sets up for a Secure Boot configuration via
+Shim. By default, this causes the rEFInd binary to be renamed as
+\fBgrubx64.efi\fR. Recent versions of Shim support passing the name of the
+follow-on program to Shim via a parameter, though. If you want to use this
+feature, you can pass the \fB\-\-keepname\fR option to
+\fBrefind\-install\fR.
+
+.PP
+
+After you run \fBrefind\-install\fR, you should peruse the script's output
+to ensure that everything looks OK. \fBrefind\-install\fR displays error
+messages when it encounters errors, such as if the ESP is mounted read-only
+or if you run out of disk space. You may need to correct such problems
+manually and re\-run the script. In some cases you may need to fall back on
+manual installation, which gives you better control over details such as
+which partition to use for installation.
+
.SH "OPTIONS"
.TP
diff --git a/docs/refind/index.html b/docs/refind/index.html
index f8fa136..d26bdd4 100644
--- a/docs/refind/index.html
+++ b/docs/refind/index.html
@@ -182,6 +182,18 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
The Future of rEFInd—Current bugs that need squashing and features that I hope to one day add
+Manual (man) pages for rEFInd support scripts:
+
+
+
+ - mkrlconf—This Linux-only tool creates a /boot/refind_linux.conf file to hold Linux kernel options.
+
+ - mvrefind—This Linux-only script moves a rEFInd installation from one location to another on the EFI System Partition (ESP).
+
+ - refind-install—This Linux and OS X script installs rEFInd with minimal fuss.
+
+
+
diff --git a/docs/refind/installing.html b/docs/refind/installing.html
index af16a43..2a725cb 100644
--- a/docs/refind/installing.html
+++ b/docs/refind/installing.html
@@ -150,14 +150,6 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
Installing rEFInd Using refind-install under Linux or Mac OS X
-
-
Installing rEFInd Manually
@@ -254,10 +246,6 @@ $ sudo apt-get install refind
If you're using Linux or Mac OS X, the easiest way to install rEFInd is to use the refind-install script. This script automatically copies rEFInd's files to your ESP or other target location and makes changes to your firmware's NVRAM settings so that rEFInd will start the next time you boot. If you've booted to OS X or in non-Secure-Boot EFI mode to Linux on a UEFI-based PC, refind-install will probably do the right thing, so you can get by with the quick instructions. If your setup is unusual, if your computer uses Secure Boot, or if you want to create a USB flash drive with rEFInd on it, you should read the extra instructions for this utility.
-
-Quick refind-install Instructions
-
-
By default, the refind-install script installs rEFInd to your disk's ESP. Under Mac OS X, you can instead install rEFInd to your current OS X boot partition by passing the script the --notesp option, or to a non-boot HFS+ partition by using the --ownhfs devicefile option. Under either OS, you can install to something other than the currently-running OS by using the --root /mountpoint option. (See Table 1 for details.)
@@ -310,167 +298,7 @@ Unmounting install dir
Note that the change to an ESP location for rEFInd with version 0.8.4 means that, if you upgrade rEFInd from an earlier version, you may notice a rEFInd boot option in the rEFInd menu. This option will boot the old version of rEFInd (or the new one, if something went wrong and the old version continues to boot). You can rid yourself of the unwanted boot menu by deleting the old files or by using dont_scan_dirs or dont_scan_files in refind.conf. Before you do this, you should use rEFInd to identify the unwanted files—the filename and volume identifier appear under the icons when you highlight the option. You can then locate and delete them from within OS X. Before you delete the old files, though, you may want to copy over any changes you've made to the rEFInd configuration, icons, and other support files.
-
-Extra refind-install Instructions
-
-
-Some details that can affect how the script runs include the following:
-
-
-
-- If you run the script as an ordinary user, it attempts to acquire
- root privileges by using the sudo command. This works
- on Mac OS X and some Linux installations (such as under Ubuntu or if
- you've added yourself to the sudo users list), but on some
- Linux installations this will fail. On such systems, you should run
- refind-install as root.
-
-- Under OS X, you can run the script with a mouse by opening a Terminal
- session and then dragging-and-dropping the refind-install file to
- the Terminal window. You'll need to press the Return or Enter key to
- run the script.
-
-- If you're using OS X 10.7's Whole Disk Encryption (WDE) feature, or the
- loogical volumes feature in OS X 10.10, you must install rEFInd
- to the ESP or to a separate HFS+ partition. The default in rEFInd 0.8.4
- and later is to install to the ESP. If you prefer to use a separate
- HFS+ volume, the --ownhfs device-file option to refind-install is
- required.
-
-- If you're not using WDE or logical volumes, you can install
- rEFInd to the OS X root (/) partition by using the
- --notesp option to refind-install. Using this option is
- recommended when upgrading from a working rEFInd installation in this
- location.
-
-- If you're replacing rEFIt with rEFInd on a Mac, there's a chance that
- refind-install will warn you about the presence of a program
- called /Library/StartupItems/rEFItBlesser and ask if you want
- to delete it. This program is designed to keep rEFIt set as the boot
- manager by automatically re-blessing it if the default boot manager
- changes. This is obviously undesirable if you install rEFInd as your
- primary boot manager, so it's generally best to remove this program. If
- you prefer to keep your options open, you can answer N when refind-install asks if you want to
- delete rEFItBlesser, and instead manually copy it elsewhere. If you
- subsequently decide to go back to using rEFIt as your primary boot
- manager, you can restore rEFItBlesser to its place.
-
-- If you're using OS X and an Advanced Format disk, heed the warning that
- refind-install displays and do not use bless
- --info to check your installation status; this combination has
- been reported to cause disk corruption on some Macs!
-
-- If you intend to boot BIOS-based OSes on a UEFI-based PC, you
- must edit the refind.conf file's scanfor line
- to enable the relevant searches. This is not necessary on Macs,
- though; because of the popularity of dual boots with Windows on Macs,
- the BIOS/legacy scans are enabled by default on Macs.
-
-- On Linux, refind-install checks the filesystem type of the
- /boot directory and, if a matching filesystem driver is
- available, installs it. Note that the "/boot directory" may be
- on a separate partition or it may be part of your root (/)
- filesystem, in which case the driver for your root filesystem is
- installed. This feature is unlikely to work properly from an emergency
- system, although it might if you have a separate /boot
- partition and if you mount that partition at /boot in your
- emergency system, and the ESP at /boot/efi.
-
-- On OS X, refind-install checks your partition tables for signs of
- a Linux installation. If such a sign is found, the script installs the
- EFI filesystem driver for the Linux ext4 filesystem. This will enable
- rEFInd to read your Linux kernel if it's on an ext2, ext3, or
- ext4 filesystem. Note that some configurations will require a
- /boot/refind_linux.conf file, which can be reliably generated
- only under Linux. (The mkrlconf script that comes with
- rEFInd will do this job once you've booted Linux.) In the meantime, you
- can launch GRUB from rEFInd or press F2 or Insert twice after
- highlighting the Linux option in rEFInd. This will enable you to enter
- a root=/dev/whatever specification,
- where /dev/whatever is the device
- identifier of your Linux root (/) filesystem.
-
-
- If you run refind-install on Linux and if
- /boot/refind_linux.conf doesn't already exist,
- refind-install creates this file and populates it with a few
- sample entries. If /boot is on a FAT partition (or HFS+ on a
- Mac), or if it's on an ext2fs, ext3fs, ext4fs, ReiserFS, or HFS+
- partition and you install an appropriate driver, the
- result is that rEFInd will detect your kernel and will probably boot it
- correctly. Some systems will require manual tweaking to
- refind_linux.conf, though—for instance, to add
- dolvm to the boot options on Gentoo systems that use LVM.
-
-- If you pass the --shim option to the script (along with a
- filename for a shim binary), the script sets up for a Secure Boot
- configuration via shim. By default, this causes the rEFInd binary to be
- renamed as grubx64.efi. Recent versions of shim support
- passing the name of the follow-on program to shim via a parameter,
- though. If you want to use this feature, you can pass the
- --keepname option to refind-install.
-
-
-
-In addition to these quirks, you should be aware of some options that refind-install supports to enable you to customize your installation in various ways. The syntax for refind-install is as follows:
-
-
-refind-install [--notesp | --usedefault device-file | --root mount-point | \
- --ownhfs device-file ] [--keepname ] \
- [--nodrivers | --alldrivers] [--shim shim-filename] [--localkeys] [--yes]
-
-
-The details of the options are summarized in Table 1. Broadly speaking, they come in four classes: installation location options (--notesp, --usedefault, and --root), driver options (--nodrivers and --alldrivers), Secure Boot options (--shim and --localkeys), and a user input option (--yes). Using some of these options in unusual conditions can generate warnings and prompts to confirm your actions. In particular, using --shim or --localkeys when you're not booted in Secure Boot mode, or failing to use --shim when you are booted in Secure Boot mode, will generate a query and a request to confirm your installation. Consult the Managing Secure Boot page for more on this topic.
-
-Table 1: Options to refind-install
-
- Option |
- Explanation |
-
-
- --notesp |
- This option, which is valid only under OS X, tells refind-install to install rEFInd to the OS X root partition rather than to the ESP. This behavior was the default in rEFInd 0.8.3 and earlier, so you may want to use it when upgrading installations of that version, unless you used --esp (which is now the default behavior, although the --esp option no longer exists) or --ownhfs. You may also want to use --notesp on new installations if you're sure you're not using whole-disk encryption or logical volumes. |
-
-
- --usedefault device-file |
- You can install rEFInd to a disk using the default/fallback filename of EFI/BOOT/bootx64.efi (and EFI/BOOT/bootia32.efi, if the 32-bit build is available) using this option. The device-file should be an unmounted ESP, or at least a FAT partition, as in --usedefault /dev/sdc1. Your computer's NVRAM entries will not be modified when installing in this way. The intent is that you can create a bootable USB flash drive or install rEFInd on a computer that tends to "forget" its NVRAM settings with this option. This option is mutually exclusive with --notesp and --root. |
-
-
- --ownhfs device-file |
- This option should be used only under OS X. It's used to install rEFInd to an HFS+ volume other than a standard Mac boot volume. The result should be that rEFInd will show up in the Mac's own boot manager. More importantly, suspend-to-RAM operations may work correctly. Note that this option requires an HFS+ volume that is not currently an OS X boot volume. This can be a data volume or a dedicated rEFInd partition. The ESP might also work, if it's converted to use HFS+. |
-
-
- --root /mount-point |
- This option is intended to help install rEFInd from a "live CD" or other emergency system. To use it, you should mount your regular installation at /mount-point, including your /boot directory (if it's separate) at /mount-point/boot and (on Linux) your ESP at that location or at /mount-point/boot/efi. The refind-install script then installs rEFInd to the appropriate location—on Linux, /mount-point/boot/EFI/refind or /mount-point/boot/efi/EFI/refind, depending on where you've mounted your ESP. Under OS X, this option is only useful in conjunction with --notesp, in which case rEFInd will install to /mount-point/EFI/refind. The script also adds an entry to your NVRAM for rEFInd at this location. You cannot use this option with --usedefault. Note that this option is not needed when doing a dual-boot Linux/OS X installation; just install normally in OS X. |
-
-
- --nodrivers |
- Ordinarily refind-install attempts to install the driver required to read /boot on Linux. This attempt works only if you're using ext2fs, ext3fs, ext4fs, ReiserFS, or Btrfs on the relevant partition. If you want to forego this driver installation, pass the --nodrivers option. This option is implicit when you use --usedefault. |
-
-
- --alldrivers |
- When you specify this option, refind-install copies all the driver files for your architecture. You may want to remove unused driver files after you use this option. Note that some computers hang or fail to work with any drivers if you use this option, so use it with caution. |
-
-
- --shim shim-filename or --preloader preloader-filename |
- If you pass this option to refind-install, the script will copy the specified shim program file to the target directory, copy the MokManager.efi file from the shim program file's directory to the target directory, copy the 64-bit version of rEFInd as grubx64.efi, and register shim with the firmware. (If you also specify --usedefault, the NVRAM registration is skipped. If you also use --keepname, the renaming to grubx64.efi is skipped.) When the target file is identified as PreLoader, much the same thing happens, but refind-install copies HashTool.efi instead of MokManager.efi and copies rEFInd as loader.efi rather than as grubx64.efi. The intent is to simplify rEFInd installation on a computer that uses Secure Boot; when so set up, rEFInd will boot in Secure Boot mode, with one caveat: The first time you boot, MokManager/HashTool will launch, and you must use it to locate and install a public key or register rEFInd as a trusted application. The rEFInd public key file will be located in the rEFInd directory's keys subdirectory under the name refind.cer. Note that I'm not providing a shim binary myself, but you can download one from here. Some distributions also provide their own shim programs, so can point to them—for instance, in /boot/efi/EFI/fedora/shim.efi. |
-
-
- --localkeys |
- This option tells refind-install to generate a new Machine Owner Key (MOK), store it in /etc/refind.d/keys as refind_local.*, and re-sign all the 64-bit rEFInd binaries with this key before installing them. This is the preferable way to install rEFInd in Secure Boot mode, since it means your binaries will be signed locally rather than with my own key, which is used to sign many other users' binaries; however, this method requires that both the openssl and sbsign binaries be installed. The former is readily available in most distributions' repositories, but the latter is not, so this option is not the default. |
-
-
- --keepname |
- This option is useful only in conjunction with --shim. It tells refind-install to keep rEFInd's regular filename (typically refind_x64.efi) when used with shim, rather than rename the binary to grubx64.efi. This change cuts down on the chance of confusion because of filename issues; however, this feature requires that shim be launched with a command-line parameter that points to the rEFInd binary under its real name. versions of shim prior to 0.7 do not properly support this feature. (Version 0.4 supports it but with a buggy interpretation of the follow-on loader specification.) If your NVRAM variables become corrupted or are forgotten, this feature may make rEFInd harder to launch. This option is incompatible with --usedefault and is unavailable when run under OS X or without the --shim option. If the script discovers an existing rEFInd installation under EFI/BOOT or EFI/Microsoft/Boot and no other rEFInd installation when this option is used, it will abort. |
-
-
- --yes |
- This option causes the script to assume a Y input to every yes/no prompt that can be generated under certain conditions, such as if you specify --shim but refind-install detects no evidence of a Secure Boot installation. This option is intended mainly for use by scripts such as those that might be used as part of an installation via an RPM or Debian package. |
-
-
-
-After you run refind-install, you should peruse the script's output to ensure that everything looks OK. refind-install displays error messages when it encounters errors, such as if the ESP is mounted read-only or if you run out of disk space. You may need to correct such problems manually and re-run the script. In some cases you may need to fall back on manual installation, which gives you better control over details such as which partition to use for installation.
+The refind-install script supports a number of options that can affect how it operates. For information on these options, consult the script's man page: Type man refind-install if you installed rEFInd via an RPM or Debian package; or read it in HTML form.
Installing rEFInd Manually
diff --git a/libeg/lodepng.h b/libeg/lodepng.h
index bd3b714..5fae53d 100644
--- a/libeg/lodepng.h
+++ b/libeg/lodepng.h
@@ -24,7 +24,7 @@ freely, subject to the following restrictions:
*/
/*
* This version of lodepng.h is modified for use with rEFInd. Some options
- * are commented out and two definitions (commented on shortly) are added
+ * are commented out and several definitions (commented on shortly) are added
* for GNU-EFI compatibility. The associated lodepng.c file is unmodified
* from the original.
*/
@@ -34,7 +34,7 @@ freely, subject to the following restrictions:
#include /*for size_t*/
-// Below two lines required for GNU-EFI (program hangs when run without them,
+// Below block of lines required for GNU-EFI (program hangs when run without them,
// and associated function in lodepng_xtra.c)
int MyStrlen(const char *InString);
#define strlen(c) MyStrlen(c)
diff --git a/mkdistrib b/mkdistrib
index 78ee30a..18b3395 100755
--- a/mkdistrib
+++ b/mkdistrib
@@ -47,6 +47,11 @@ make clean
# Remove temporary files from the "debian" subdirectory
rm -rf debian/refind debian/*.log
+# Convert man pages to HTML form
+man2html docs/man/mkrlconf.8 > docs/refind/mkrlconf.html
+man2html docs/man/mvrefind.8 > docs/refind/mvrefind.html
+man2html docs/man/refind-install.8 > docs/refind/refind-install.html
+
# Prepare a place and copy files there....
mkdir -p ../snapshots/$1/refind-$1/icons/licenses ../snapshots/$1/refind-$1/icons/svg
cp --preserve=timestamps icons/*png icons/README ../snapshots/$1/refind-$1/icons/
diff --git a/mkrlconf b/mkrlconf
index 9855dec..543ce0a 100755
--- a/mkrlconf
+++ b/mkrlconf
@@ -18,11 +18,12 @@
# Revision history:
#
-# 0.10.0 -- Renamed from mkrlconf.sh to mkrlconf; changed to get $DefaultOptions
+# 0.10.1 -- Improve extraction of kernel options from /proc/cmdline
+# 0.10.0 -- Renamed from mkrlconf.sh to mkrlconf; changed to get $DefaultOptions
# from /proc/cmdline rather than from GRUB
-# 0.9.0 -- Added check for OS type, to keep from running pointlessly on OS X
-# 0.7.7 -- Fixed bug that caused stray PARTUUID= and line breaks in generated file
-# 0.5.1 -- Initial release
+# 0.9.0 -- Added check for OS type, to keep from running pointlessly on OS X
+# 0.7.7 -- Fixed bug that caused stray PARTUUID= and line breaks in generated file
+# 0.5.1 -- Initial release
#
# Note: mkrlconf version numbers match those of the rEFInd package
# with which they first appeared.
diff --git a/refind-install b/refind-install
index f0fc2b2..b1510d7 100755
--- a/refind-install
+++ b/refind-install
@@ -36,6 +36,7 @@
#
# Revision history:
#
+# 0.10.1 -- Improve extraction of default kernel options from /proc/cmdline.
# 0.10.0 -- Enable running under OS X's recovery system & add warning about
# SIP & brief instructions on how to deal with it if SIP is
# detected to be enabled. Also change way refind_linux.conf default