1
0
Fork 0

bootloader: added check for petitboot

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
Jaroslav Škarvada 2018-05-16 15:57:47 +02:00
parent 90cfb257a9
commit e0c73cbbfa
No known key found for this signature in database
GPG key ID: D8E1C00E076E840B
2 changed files with 6 additions and 0 deletions

View file

@ -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"

View file

@ -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):