KVER(8)

NAME
kver - run a command with overriden system version

SYNOPSIS
kver [-m machine] [-p machine_arch] [-r osrelease] [-s ostype] command [argument ...]

DESCRIPTION
The kver utility provides a simple wrapper around the kver(3) library. It converts its options to environment variables understood by kver(3), sets the LD_PRELOAD environment variable to ensure that the kver(3) library (/usr/pkg/lib/libkver.so) is loaded, and executes the specified command with the specified arguments.

The following options are accepted:

-m machine
    The operating hardware platform, e.g. “amd64”. Sets the LIBKVER_MACHINE environment variable.

-p machine_arch
    The machine processor architecture, e.g. “x86_64”. Sets the LIBKVER_MACHINE_ARCH environment variable.

-r osrelease
    The operating system release, e.g. "6.0_STABLE". Sets the LIBKVER_OSRELEASE environment variable.

-s ostype
    The operating system type, e.g. "NetBSD". Sets the LIBKVER_OSTYPE environment variable.

If the -m machine option is specified and the -p machine_arch option is not specified, then kver checks that machine is valid, and attempts to set an appropriate value for machine_arch; for example, “-m macppc” implies “-p powerpc”. Some aliases for machine/machine_arch pairs are also supported; for example, “-m macppc64” is shorthand for “-m macppc -p powerpc64”. The way kver handles a machine name without a machine_arch name is intended to be identical to the way the build.sh script in the NetBSD source tree handles the same situation. To pass arbitrary values of -m machine without any validation, you must also specify -p machine_arch.

EXAMPLES

kver -r 1.5 uname -r
    Run the ‘uname -r’ command with osrelease set to ‘1.5’.

kver -m i386 chroot .
    Run the ‘chroot .’ command with machine set to ‘i386’ and with machine_arch set to ‘i386’ (which is the default machine_arch for that machine).

kver -m evbmips sysctl hw.machine_arch
    Error, because there is no default machine_arch corresponding to “-m evbmips”.

kver -m evbmips -p mipseb sysctl hw.machine_arch
    Run the ‘sysctl hw.machine_arch’ command with machine set to ‘evbmips’ and machine_arch set to ‘mipseb’.

SEE ALSO
kver(3)

AUTHORS
Alan Barrett <apb@NetBSD.org>