Bootctl is a command-line utility used to control EFI (Extensible Firmware Interface) firmware boot settings and manage the boot loader. It is primarily designed for systems that use UEFI (Unified Extensible Firmware Interface) firmware, which is the modern replacement for the traditional BIOS (Basic Input/Output System) firmware.
Here are the key features and aspects of bootctl:
- EFI Firmware Boot Settings: Bootctl allows you to configure various boot settings provided by the EFI firmware. These settings include the default boot entry, boot timeout duration, boot order, and other parameters that control the boot process. By using bootctl, you can view and modify these settings from the command line, providing a convenient way to customize the boot behavior of your system.
- Boot Loader Management: Bootctl also helps in managing the boot loader installed on the EFI system partition (ESP). The ESP is a specially formatted partition that contains the boot loader and related boot configuration files. With bootctl, you can install, configure, and update the boot loader on the ESP. This includes managing multiple boot entries, specifying the kernel or operating system to boot, and setting boot options or command-line parameters.
- Boot Entry Configuration: Bootctl allows you to manage multiple boot entries on your system. A boot entry represents a specific operating system or kernel configuration that can be booted from the EFI firmware. Using bootctl, you can create, modify, and remove boot entries. This is particularly useful in dual-boot or multi-boot scenarios where you have multiple operating systems or kernel versions installed on your system.
- Boot Loader Discovery: Bootctl provides a mechanism to automatically discover and configure the installed boot loader on the EFI system partition. It can detect the presence of supported boot loaders and populate the boot entry list accordingly. This simplifies the boot configuration process, as you don’t need to manually specify the boot loader location or configuration files. Bootctl automatically handles these details for you.
- Secure Boot Support: Secure Boot is a feature provided by UEFI firmware to ensure that only trusted and properly signed boot loaders and operating system kernels are executed during the boot process. Bootctl supports managing boot entries and boot loader configurations in a Secure Boot environment. It allows you to enroll and manage the keys used for secure boot, ensuring that your system boots securely and only executes trusted code.
bootctl Command Examples
1. Show information about the system firmware and the bootloaders:
# bootctl status
2. Set a flag to boot into the system firmware on the next boot (similar to sudo systemctl reboot –firmware-setup):
# bootctl reboot-to-firmware true
3. Specify the path to the EFI system partition (defaults to /efi/, /boot/ or /boot/efi):
# bootctl --esp-path=/path/to/efi_system_partition/
4. Show all available bootloader entries:
# bootctl list
5. Install systemd-boot into the EFI system partition:
# bootctl install
6. Remove all installed versions of systemd-boot from the EFI system partition:
# bootctl remove
In summary, bootctl is a command-line utility that helps control EFI firmware boot settings and manage the boot loader on UEFI-based systems. It provides functionality to configure boot settings, manage boot entries, install and update the boot loader, and support Secure Boot. By using bootctl, you can customize and manage the boot process of your system, allowing you to control which operating systems or kernels are booted and specify boot options as needed.