bootloader: added check for petitboot
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
parent
90cfb257a9
commit
e0c73cbbfa
2 changed files with 6 additions and 0 deletions
|
|
@ -34,6 +34,7 @@ INITRD_IMAGE_DIR = "/boot"
|
|||
BOOT_CMDLINE_TUNED_VAR = "TUNED_BOOT_CMDLINE"
|
||||
BOOT_CMDLINE_INITRD_ADD_VAR = "TUNED_BOOT_INITRD_ADD"
|
||||
BOOT_CMDLINE_FILE = "/etc/tuned/bootcmdline"
|
||||
PETITBOOT_DETECT_DIR = "/sys/firmware/opal"
|
||||
|
||||
# modules plugin configuration
|
||||
MODULES_FILE = "/etc/modprobe.d/tuned.conf"
|
||||
|
|
|
|||
|
|
@ -188,7 +188,12 @@ class BootloaderPlugin(base.Plugin):
|
|||
if self._initrd_dst_img_val is None:
|
||||
self._initrd_dst_img_val = os.path.join(consts.BOOT_DIR, os.path.basename(name))
|
||||
|
||||
def _check_petitboot(self):
|
||||
return os.path.isdir(consts.PETITBOOT_DETECT_DIR)
|
||||
|
||||
def _install_initrd(self, img):
|
||||
if self._check_petitboot():
|
||||
log.warn("Detected Petitboot which doesn't support initrd overlays. The initrd overlay will be ignored by bootloader.")
|
||||
log.info("installing initrd image as '%s'" % self._initrd_dst_img_val)
|
||||
img_name = os.path.basename(self._initrd_dst_img_val)
|
||||
if not self._cmd.copy(img, self._initrd_dst_img_val):
|
||||
|
|
|
|||
Loading…
Reference in a new issue