build: add subcommands to kexttool

This commit is contained in:
2023-04-05 18:53:10 +01:00
parent 3ec25da693
commit eb22e72568
4 changed files with 82 additions and 20 deletions

19
tools/kexttool/select.py Normal file
View File

@@ -0,0 +1,19 @@
import inquirer
import os
from kexttool import kext
def select_kexts():
all_kexts = [ k.id() for k in kext.KextSource.scan(os.path.join(os.getcwd(), 'extensions')) ]
if len(all_kexts) == 0:
print('No kernel extensions available.')
return
questions = [
inquirer.Checkbox('kexts',
message="Select kexts to include in the kernel image",
choices=all_kexts,
)
]
answers = inquirer.prompt(questions)
print(answers["kexts"])