[Lunar-commits] <moonbase-core> kmod: Added a depmod post build plugin

Stefan Wold ratler at lunar-linux.org
Mon Sep 16 01:24:38 CEST 2013


commit 6a682dc9bb7270f66585c35b521387b35eee4bfa
Author: Stefan Wold <ratler at lunar-linux.org>
Date: Sun, 15 Sep 2013 02:11:43 -0700
URL: https://github.com/lunar-linux/moonbase-core/commit/6a682dc9bb7270f66585c35b521387b35eee4bfa

kmod: Added a depmod post build plugin
---
  kernel/kmod/plugin.d/postbuild-depmod.plugin | +30/-0    
  1 file changed, 30 insertions(+)

--- /dev/null
+++ b/kernel/kmod/plugin.d/postbuild-depmod.plugin
@@ -0,0 +1,30 @@
+#!/bin/bash
+######################################################################
+#                                                                    #
+# postbuild-depmod.plugin - postbuild update kernel module           #
+#                           dependency files                         #
+#                                                                    #
+######################################################################
+#                                                                    #
+# Copyright 2013 by Stefan Wold <ratler at lunar-linux.org> under GPLv2 #
+#                                                                    #
+######################################################################
+
+
+plugin_depmod_post_build()
+{
+  debug_msg "plugin_depmod_post_build ($@)"
+
+  # Find installed kernel modules and then run depmod
+  if parse_iw | grep -q "^/lib/modules/.*/"; then
+    while read kversion; do
+      debug_msg "Running depmod for kernel $kversion"
+      depmod -a $kversion
+    done < <(parse_iw | grep "^/lib/modules/.*/" | awk -F/ '{ print $4 }' | sort | uniq)
+  fi
+  
+  # We always return 2, fail or success
+  return 2
+}
+
+plugin_register BUILD_POST_BUILD plugin_depmod_post_build




More information about the Lunar-commits mailing list