From 147941657f7892089d8b7b4bcf61de3dad9ef8bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 14 Jul 2016 04:15:50 +0200 Subject: [PATCH] anaconda: don't force non-encrypted /boot on coreboot systems With grub payload it is possible to have all the partitions encrypted. Based on patch by @tlaurion Fixes QubesOS/qubes-issues#2118 --- anaconda/anaconda.spec | 1 + anaconda/pyanaconda/bootloader.py | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/anaconda/anaconda.spec b/anaconda/anaconda.spec index 2ec781d..9626658 100644 --- a/anaconda/anaconda.spec +++ b/anaconda/anaconda.spec @@ -130,6 +130,7 @@ Requires: hfsplus-tools %endif %endif Requires: python3-pid +Requires: dmidecode Requires: python3-coverage diff --git a/anaconda/pyanaconda/bootloader.py b/anaconda/pyanaconda/bootloader.py index 2f8fc74..0a53940 100644 --- a/anaconda/pyanaconda/bootloader.py +++ b/anaconda/pyanaconda/bootloader.py @@ -46,6 +46,8 @@ from pyanaconda.i18n import _, N_ from pyanaconda.orderedset import OrderedSet import logging +import subprocess + log = logging.getLogger("anaconda") class serial_opts(object): @@ -1412,16 +1414,19 @@ class GRUB2(GRUB): raid.RAID5, raid.RAID6, raid.RAID10] stage2_raid_metadata = ["0", "0.90", "1.0", "1.2"] - @property - def stage2_format_types(self): - if productName.startswith("Red Hat "): - return ["xfs", "ext4", "ext3", "ext2", "btrfs"] - else: - return ["ext4", "ext3", "ext2", "btrfs", "xfs"] + stage2_format_types = ["ext4", "ext3", "ext2", "btrfs", "xfs"] def __init__(self): super(GRUB2, self).__init__() + if subprocess.check_output( + ['dmidecode', '-s', 'bios-vendor'], + universal_newlines=True) == "coreboot\n": + log.info("dmidecode -s bios-vendor returns coreboot") + self.encryption_support = True + self.skip_bootloader = True + self.stage2_format_types += ["lvmlv"] + # XXX we probably need special handling for raid stage1 w/ gpt disklabel # since it's unlikely there'll be a bios boot partition on each disk