lib/Kernel/utils.pm

is_debugfs_mounted

is_debugfs_mounted();

Checks whether debugfs is mounted at /sys/kernel/debug, same check as blktests' _have_debugfs(). Returns true/false.

get_mount_info

my $mount = get_mount_info($path);

Returns a hash reference with target, source, fstype and options of the file system that $path is on, from findmnt -T. For example, target /var, source /dev/sda2[/@/var], fstype btrfs. Dies if $path is on no mounted file system.

enable_debugfs

enable_debugfs();

Mounts debugfs at /sys/kernel/debug (e.g. on SLE 16.1+, where it is disabled by default per PED-8812).

get_kernel_config

get_kernel_config();

Locates the running kernel's config file (/boot/config-$(uname -r), falling back to /usr/lib/modules/$(uname -r)/config and then /proc/config.gz) and records its full contents via record_info(), prefixed with a comment naming the source file (as done in LTP::utils::log_versions).

get_verified_shallow_tar

get_verified_shallow_tar(tree => 'stable', branch => 'linux-6.12.y', commit => '...');

Downloads the kernel.org shallow-clone tarball for the given tree and branch, verifies it via the signed checksums, and checks out commit into ./linux. commit should always be supplied in CI; omitting it checks out the current tip (the bundle is published nightly).

See https://people.kernel.org/monsieuricon/using-shallow-git-tarballs-for-ci.