diff --git a/tuned/consts.py b/tuned/consts.py index 58da3dd..ec75eba 100644 --- a/tuned/consts.py +++ b/tuned/consts.py @@ -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" diff --git a/tuned/plugins/plugin_bootloader.py b/tuned/plugins/plugin_bootloader.py index dd514cf..0258acc 100644 --- a/tuned/plugins/plugin_bootloader.py +++ b/tuned/plugins/plugin_bootloader.py @@ -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):