support for kernel configs without modules support

This commit is contained in:
Jörg Deckert 2021-02-05 17:00:19 +01:00
parent 8bacd765d0
commit 5cc933830b
1 changed files with 15 additions and 10 deletions

View File

@ -76,17 +76,22 @@ def remove_old_kernels():
def install_kernel():
makeopts = os.environ.get("MAKEOPTS", "")
modules_install = False
subprocess.check_call(
[
"make",
"-C",
"/usr/src/linux",
"MAKEOPTS=" + makeopts,
"install",
"modules_install",
]
)
for line in open("/usr/src/linux/.config"):
if "CONFIG_MODULES=y" in line:
modules_install = True
break
if modules_install:
subprocess.check_call([
'make', '-C', '/usr/src/linux', 'MAKEOPTS=' + makeopts, 'install',
'modules_install'
])
else:
subprocess.check_call([
'make', '-C', '/usr/src/linux', 'MAKEOPTS=' + makeopts, 'install'
])
# create the symlink. /sbin/installkernel claims this is not used on
# "modern" distributions and doesn't create it (unless it already