2

You can check how autocompletion does it: $ complete -p modprobe complete -F _modprobe modprobe declare -f _modprobe _modprobe () { ... In that function there's an internal _installed_modules $ declare -f _installed_modules _installed_modules () { COMPREPLY=($(compgen -W "$(PATH="$PATH:/sbin" lsmod | awk '{if (NR != 1) print $...


2

The vital clue is in the kernel version that failed to compile: 5.4.0-42-generic. Support for the SUBDIRS parameter was removed in that version in favor of the newer M parameter and KBUILD_EXTMOD environment variable. Previous versions (since 11/2018) printed a warning even while successfully compiling, so depending on how often you update your packages, ...


1

The stats file is named diskstats, instead of blkdevstats or similar. This is a clue. The statistics are output by diskstats_show() in block/genhd.c, and it uses the struct gendisk structures as its information source. You have created a block device, but for regular disks that is just the first step. After that there is usually alloc_disk() to allocate ...


Only top voted, non community-wiki answers of a minimum length are eligible