aboutsummaryrefslogtreecommitdiffstats
path: root/contrail-keystone-auth/hooks/charmhelpers/core/kernel_factory/ubuntu.py
diff options
context:
space:
mode:
Diffstat (limited to 'contrail-keystone-auth/hooks/charmhelpers/core/kernel_factory/ubuntu.py')
-rw-r--r--contrail-keystone-auth/hooks/charmhelpers/core/kernel_factory/ubuntu.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/contrail-keystone-auth/hooks/charmhelpers/core/kernel_factory/ubuntu.py b/contrail-keystone-auth/hooks/charmhelpers/core/kernel_factory/ubuntu.py
new file mode 100644
index 0000000..3de372f
--- /dev/null
+++ b/contrail-keystone-auth/hooks/charmhelpers/core/kernel_factory/ubuntu.py
@@ -0,0 +1,13 @@
+import subprocess
+
+
+def persistent_modprobe(module):
+ """Load a kernel module and configure for auto-load on reboot."""
+ with open('/etc/modules', 'r+') as modules:
+ if module not in modules.read():
+ modules.write(module + "\n")
+
+
+def update_initramfs(version='all'):
+ """Updates an initramfs image."""
+ return subprocess.check_call(["update-initramfs", "-k", version, "-u"])