Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: kernel_handler.py

Issue 3781016: Introduce SAFT TPM testing support. (Closed) Base URL: http://git.chromium.org/git/saft.git
Patch Set: Addressed review comments. Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtests.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: kernel_handler.py
diff --git a/kernel_handler.py b/kernel_handler.py
index 6168c906ea56b9a7af201eb65d81bce6fab93874..d1356622d6d46dc3ea23b09f0322d807041961b5 100644
--- a/kernel_handler.py
+++ b/kernel_handler.py
@@ -14,6 +14,11 @@ MAIN_STORAGE_DEVICE = '/dev/sda'
KERNEL_BODY_MOD = 1
KERNEL_VERSION_MOD = 2
+
+class KernelHandlerError(Exception):
+ pass
+
+
class KernelHandler(object):
'''An object to provide ChromeOS kernel related actions.
@@ -106,6 +111,8 @@ class KernelHandler(object):
def set_version(self, section, version):
'''Set version of this kernel blob and re-sign it.'''
+ if version < 0:
+ raise KernelHandlerError('Bad version value %d' % version)
self._modify_kernel(section.upper(), version, KERNEL_VERSION_MOD)
def init (self, chros_if):
« no previous file with comments | « no previous file | runtests.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698