02b406b6f3
Change-Id: Ib7cc06b3b42f26f725a9ea79f09189cc72952d29
18 lines
538 B
Python
18 lines
538 B
Python
import subprocess
|
|
import os
|
|
|
|
|
|
def persistent_modprobe(module):
|
|
"""Load a kernel module and configure for auto-load on reboot."""
|
|
if not os.path.exists('/etc/rc.modules'):
|
|
open('/etc/rc.modules', 'a')
|
|
os.chmod('/etc/rc.modules', 111)
|
|
with open('/etc/rc.modules', 'r+') as modules:
|
|
if module not in modules.read():
|
|
modules.write('modprobe %s\n' % module)
|
|
|
|
|
|
def update_initramfs(version='all'):
|
|
"""Updates an initramfs image."""
|
|
return subprocess.check_call(["dracut", "-f", version])
|