commit 4744ebcef48b2400d76ce5a2de735d8e74ebfe52
Author: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Date:   Thu Mar 15 00:14:35 2012 -0300

    modprobe: don't check if module builtin to decide if it's builtin
    
    More or less confusing message, but if module is builtin in the live
    system, it doesn't mean it's builtin in the target kernel.
    
    Instead we now check if module has a path. It don't have a path only if
    it's builtin in the target or if it doesn't exist at all. The latter
    should not be a problem since this code is being called from inside the
    library. Anyway, put an assert to make sure we get bug reports if any
    case slipped in here.

diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c
index 55f3795..3ab2a1c 100644
--- a/tools/kmod-modprobe.c
+++ b/tools/kmod-modprobe.c
@@ -17,6 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdbool.h>
@@ -538,13 +539,21 @@ static int handle_failed_lookup(struct kmod_ctx *ctx, const char *alias)
 static void print_action(struct kmod_module *m, bool install,
 							const char *options)
 {
-	if (install)
+	const char *path;
+
+	if (install) {
 		printf("install %s %s\n", kmod_module_get_install_commands(m),
 								options);
-	else
-		kmod_module_get_initstate(m) == KMOD_MODULE_BUILTIN
-			? printf("builtin %s\n", kmod_module_get_name(m))
-			: printf("insmod %s %s\n", kmod_module_get_path(m), options);
+		return;
+	}
+
+	path = kmod_module_get_path(m);
+
+	if (path == NULL) {
+		assert(kmod_module_get_initstate(m) == KMOD_MODULE_BUILTIN);
+		printf("builtin %s\n", kmod_module_get_name(m));
+	} else
+		printf("insmod %s %s\n", kmod_module_get_path(m), options);
 }
 
 static int insmod(struct kmod_ctx *ctx, const char *alias,
