Skip to content

Commit e5df965

Browse files
committed
Remove super evil debug line left in by accident
1 parent 2903982 commit e5df965

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

module-signing-script.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def getModuleEntries (modulesPath: str) -> dict:
227227

228228
return modules
229229

230-
def signKernel (kernel: str, modules: dict, privateKeyPath: str, publicKeyPath: str):
230+
def signKernel (kernel: str, moduleEntries: list, privateKeyPath: str, publicKeyPath: str):
231231
'''
232232
Signs the nvidia kernel modules for a kernel (void).
233233
@@ -240,15 +240,15 @@ def signKernel (kernel: str, modules: dict, privateKeyPath: str, publicKeyPath:
240240
'''Path to the sign-file binary used to sign the kernel modules'''
241241

242242
BASE_MODULES_PATH = '/usr/lib/modules/' + kernel + '/'
243-
'''Path to modules before the directory provided by the JSON file is appended'''
243+
'''Path to modules before the directory provided by each module entry is appended'''
244244

245245
#Print if the user is not root (uid 0)
246246
if os.getuid () != 0:
247247
print ('%s: Signing kernel modules must be done as root. You may be prompted for your password:' %__title__)
248248
print ()
249249

250250
#Sign the modules for each entry in the JSON file
251-
for moduleEntry in modules ['moduleEntries']:
251+
for moduleEntry in moduleEntries:
252252
modulesPath = BASE_MODULES_PATH + moduleEntry ['directory']
253253

254254
moduleFiles = moduleEntry ['moduleFiles']
@@ -359,7 +359,7 @@ def getNewKernels (currentKernel: str, installedKernels: list) -> list:
359359

360360
return newKernels
361361

362-
def signNewKernels (newKernels: list, moduleEntries: dict, privateKeyPath: str, publicKeyPath: str):
362+
def signNewKernels (newKernels: list, moduleEntries: list, privateKeyPath: str, publicKeyPath: str):
363363
'''
364364
Signs the nvidia kernel modules for every new kernel by calling signKernel () on each (void).
365365
@@ -397,8 +397,8 @@ def main ():
397397
print ('%s: Found package manager: %s' %(__title__, packageManager))
398398
print ()
399399

400-
#currentKernel = getCurrentKernel ()
401-
currentKernel = '4.7.2-200.fc24.x86_64'
400+
currentKernel = getCurrentKernel ()
401+
402402
print ('%s: Found current kernel: %s' %(__title__, currentKernel))
403403
print ()
404404

@@ -413,10 +413,11 @@ def main ():
413413
print ('%s: Found new kernels: %s' %(__title__, newKernels))
414414
print ()
415415

416-
moduleEntries = getModuleEntries (args.modulesFile)
417-
416+
modulesFile = getModuleEntries (args.modulesFile)
417+
moduleEntries = modulesFile ['moduleEntries']
418+
418419
print ('%s: Signing modules for: ' %__title__, end = '')
419-
for moduleEntry in moduleEntries ['moduleEntries']:
420+
for moduleEntry in moduleEntries:
420421
print (moduleEntry ['name'], end = ', ')
421422
print ('\n')
422423

0 commit comments

Comments
 (0)