How to compile and install rEFInd on Linux

rEFInd is an EFI boot manager on macOS systems with a beautiful graphical interface and automatic OS recognition. Of course, it can also be installed and run on Linux systems.

 

Ready to work:

1. A computer or virtual machine with Ubuntu 64-bit system (must be installed in UEFI mode, this article uses version 16.04.3)

2. The build-essential package must be installed

3. Download software (source code): UDK 2017 / gnu-efi 3.0.6 / rEFInd 0.11.2

rEFInd has two compilation methods, one is UDK+rEFInd, and the other is gnu-efi+rEFInd.

 

Compile and install gnu-efi+rEFInd (start with the easiest):

1. Compile gnu-efi. The file decompression process will not be discussed. Open a terminal and enter the following command:

cd ~/Downloads/gnu-efi-3.0.6
make all
sudo make install

In this way, gnu-efi is compiled and installed.

2. Prepare to compile rEFInd.

You need to change a file here to compile normally, otherwise an error will be reported.

We open the Make.common file in the rEFInd directory and we can see the following:

EFIINC          = /usr/include/efi
GNUEFILIB       = /usr/lib
EFILIB          = /usr/lib
EFICRT0         = /usr/lib

# Comment out above and uncomment below if using locally-compiled GNU-EFI....
#EFIINC          = /usr/local/include/efi
#GNUEFILIB       = /usr/local/lib
#EFILIB          = /usr/local/lib
#EFICRT0         = /usr/local/lib

We comment out the top four lines, then uncomment the bottom four lines and save the file.

3. Compile and install rEFInd.

Finally, we enter the following command to compile and install rEFInd:

cd ~/Downloads/refind-0.11.2
make all
sudo make install

rEFInd is installed in the /boot/efi/EFI/refind directory, and we can customize some boot options by modifying the refind.conf configuration file.

At this point, gnu-efi+rEFInd has been compiled and installed. Restart the computer or virtual machine to see the effect.

 

Compile and install UDK+rEFInd:

1. Compile UDK 2017. Unzip UDK 2017 to the /usr/local directory. Not to mention the decompression process. Enter the following command:

cd /usr/local/edk2-vUDK2017
source edksetup.sh BaseTools

Then we need to modify the Conf/target.txt file. Change some parameters in the file to the following:

ACTIVE_PLATFORM = MdePkg/MdePkg.dsc
TARGET = RELEASE
TARGET_ARCH = X64
TOOL_CHAIN_TAG = GCC5
MAX_CONCURRENT_THREAD_NUMBER = 4

The last parameter is MAX_CONCURRENT_THREAD_NUMBER = 4. This 4 refers to the number of parallel threads. If there are several logical CPUs, change them to several, so that the compilation will be faster.

Then enter the command (here we first install the necessary python and uuid-dev packages):

sudo apt-get install python uuid-dev
make -C BaseTools/Source/C
build

It compiles after a while.

2. Compile rEFInd. Enter the following command:

cd ~/Downloads/refind-0.11.2
make all
sudo make install

At this point, UDK+rEFInd is compiled and installed.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325585472&siteId=291194637