[PATCH] [rhel6-branch]add multiboot support for tboot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Gang Wei <gang.wei@xxxxxxxxx>

If tboot package installed, create multiboot entries in GRUB config for kernels.

Signed-off-by: Gang Wei <gang.wei@xxxxxxxxx>
---
 booty/bootloaderInfo.py |    9 +++++++++
 booty/x86.py            |   22 ++++++++++++++++------
 yuminstall.py           |    2 ++
 3 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py
index 8cdc83d..1df682d 100644
--- a/booty/bootloaderInfo.py
+++ b/booty/bootloaderInfo.py
@@ -516,6 +516,14 @@ class bootloaderInfo(object):
         self._drivelist = val
     drivelist = property(_getDriveList, _setDriveList)
 
+    def _getTrustedBoot(self):
+        if self._trusted_boot is not None:
+            return self._trusted_boot
+        return 0
+    def _setTrustedBoot(self, val):
+        self._trusted_boot = val
+    trusted_boot = property(_getTrustedBoot, _setTrustedBoot)
+
     def __init__(self, instData):
         self.args = KernelArguments(instData)
         self.images = BootImages()
@@ -533,6 +541,7 @@ class bootloaderInfo(object):
         self.serial = 0
         self.serialDevice = None
         self.serialOptions = None
+        self._trusted_boot = 0
 
         # this has somewhat strange semantics.  if 0, act like a normal
         # "install" case.  if 1, update lilo.conf (since grubby won't do that)
diff --git a/booty/x86.py b/booty/x86.py
index 1d23a84..ab255f8 100644
--- a/booty/x86.py
+++ b/booty/x86.py
@@ -365,13 +365,23 @@ class x86BootloaderInfo(efiBootloaderInfo):
                 if initrd:
                     f.write('\tmodule %s%s\n' % (cfPath, initrd))
             else: # normal kernel
-                f.write('\tkernel %s ro%s' % (kernelFile, realroot))
-                if self.args.get():
-                    f.write(' %s' % self.args.get())
-                f.write('\n')
+                if self.trusted_boot:
+                    f.write('\tkernel %stboot.gz logging=vga.serial,memory\n' % (cfPath))
+                    f.write('\tmodule %s ro%s intel_iommu=on' % (kernelFile, realroot))
+                    if self.args.get():
+                        f.write(' %s' % self.args.get())
+                    f.write('\n')
+
+                    if initrd:
+                        f.write('\tmodule %s%s\n' % (cfPath, initrd))
+                else:
+                    f.write('\tkernel %s ro%s' % (kernelFile, realroot))
+                    if self.args.get():
+                        f.write(' %s' % self.args.get())
+                    f.write('\n')
 
-                if initrd:
-                    f.write('\tinitrd %s%s\n' % (cfPath, initrd))
+                    if initrd:
+                        f.write('\tinitrd %s%s\n' % (cfPath, initrd))
 
         for (label, longlabel, device) in chainList:
             if ((not longlabel) or (longlabel == "")):
diff --git a/yuminstall.py b/yuminstall.py
index b3b7561..6f8a8a4 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1854,6 +1854,8 @@ debuglevel=6
 
         anaconda.id.instProgress = None
 
+        anaconda.id.bootloader.trusted_boot = self.ayum.isPackageInstalled(name="tboot")
+
         if rc == DISPATCH_BACK:
             return DISPATCH_BACK
 
-- 
1.7.6


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux