From: Dave Reisner Date: Mon, 27 Feb 2012 20:59:09 +0000 (-0500) Subject: modprobe: show builtin label on --show-depends X-Git-Tag: v6~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa5da52c3ba4bb770c2a96067ef9c2f90472d615;p=thirdparty%2Fkmod.git modprobe: show builtin label on --show-depends Previously, we didn't handle builtins very well, displaying things like: $ modprobe -D btrfs insmod /lib/modules/3.2.6-foo/kernel/crypto/crc32c.ko.gz insmod (null) insmod /lib/modules/3.2.6-foo/kernel/lib/libcrc32c.ko.gz insmod /lib/modules/3.2.6-foo/kernel/lib/zlib_deflate/zlib_deflate.ko.gz insmod /lib/modules/3.2.6-foo/kernel/fs/btrfs/btrfs.ko.gz Follow module-init-tools and show builtins with the label 'builtin' and their name: $ modprobe -D btrfs insmod /lib/modules/3.2.6-foo/kernel/crypto/crc32c.ko.gz builtin intel_crc32c insmod /lib/modules/3.2.6-foo/kernel/lib/libcrc32c.ko.gz insmod /lib/modules/3.2.6-foo/kernel/lib/zlib_deflate/zlib_deflate.ko.gz insmod /lib/modules/3.2.6-foo/kernel/fs/btrfs/btrfs.ko.gz --- diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c index b94bdf36..55f37956 100644 --- a/tools/kmod-modprobe.c +++ b/tools/kmod-modprobe.c @@ -542,7 +542,9 @@ static void print_action(struct kmod_module *m, bool install, printf("install %s %s\n", kmod_module_get_install_commands(m), options); else - printf("insmod %s %s\n", kmod_module_get_path(m), options); + 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); } static int insmod(struct kmod_ctx *ctx, const char *alias,