kiwi-el8/kiwi/bootloader/install/systemd_boot.py
Marcus Schäfer fe478de901
Added API for BLS and systemd-boot support
Bootloaders implementing the Boot Loader Spec (BLS) are not
directly compatible with the original Bootloader Class design
in kiwi. Because of that an interface class which translates
the original API into calls following BLS was added. This allows
us to keep the implementations in the Builder classes and the
public BootLoader interface untouched. In addition to the BLS
API an implementation to support the systemd-boot loader is
part of this commit too.

An example type definition to use systemd-boot with an EFI
disk image type looks like the following:

    <type image="oem" filesystem="xfs" firmware="efi" bootloader="systemd_boot" efipartsize="200"/>

The implementation uses bootctl and kernel-install tools
provided from systemd and expects a proper integration
of systemd-boot by the distribution maintainers

This Fixes #1935
2022-11-12 17:39:22 +01:00

62 lines
1.8 KiB
Python

# Copyright (c) 2022 Marcus Schäfer. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# kiwi is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with kiwi. If not, see <http://www.gnu.org/licenses/>
#
import logging
from typing import Dict
# project
from kiwi.bootloader.install.base import BootLoaderInstallBase
log = logging.getLogger('kiwi')
class BootLoaderInstallSystemdBoot(BootLoaderInstallBase):
"""
**systemd-boot bootloader installation**
"""
def post_init(self, custom_args: Dict):
"""
systemd-boot post initialization method
:param dict custom_args:
Contains custom systemd-boot bootloader arguments
"""
self.custom_args = custom_args
def install_required(self):
"""
Check if systemd-boot needs to install boot code
systemd-boot supports EFI boot only and does not need to
install boot code since it's expected that the firmware
can read from the EFI partition
:return: True or False
:rtype: bool
"""
return False
def secure_boot_install(self):
"""
Run shim installation for secure boot setup
For systemd-boot this is currently skipped since details for
secure boot are not yet clear
"""
pass