userland: fix kernel version to work on older ubuntu

Expose --kernel-version to allow customization.

Update LTP info.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-05 00:00:00 +00:00
parent bbdf6cdc06
commit 44ab6b7c6c
2 changed files with 41 additions and 15 deletions

20
run
View File

@@ -68,8 +68,6 @@ https://github.com/cirosantilli/linux-kernel-module-cheat#lkmc_home
Pass a base64 encoded command line parameter that gets evalled at the end of
the normal init.
See: https://github.com/cirosantilli/linux-kernel-module-cheat#init-busybox
chdir into lkmc_home before running the command:
https://github.com/cirosantilli/linux-kernel-module-cheat#lkmc_home
'''
)
self.add_argument(
@@ -120,6 +118,21 @@ separator, and place the options after the dash. Intended for custom
options understood by our `init` scripts, most of which are prefixed
by `lkmc_`.
Example: `./run --kernel-cli-after-dash 'lkmc_eval="wget google.com" lkmc_lala=y'`
'''
)
self.add_argument(
'--kernel-version',
default='5.0',
help='''\
Pass a base64 encoded command line parameter that gets evalled at the end of
the normal init.
See: https://github.com/cirosantilli/linux-kernel-module-cheat#init-busybox
chdir into lkmc_home before running the command:
https://github.com/cirosantilli/linux-kernel-module-cheat#lkmc_home
Specify the Linux kernel version to be reported by syscall emulation.
Defaults to the same kernel version as our default Buildroot build.
Currently only works for QEMU.
See: http://github.com/cirosantilli/linux-kernel-module-cheat#fatal-kernel-too-old
'''
)
self.add_argument(
@@ -440,7 +453,8 @@ Run QEMU with VNC instead of the default SDL. Connect to it with:
cmd.extend(
[
os.path.join(self.env['qemu_build_dir'], '{}-linux-user'.format(self.env['arch']), 'qemu-{}'.format(self.env['arch'])), LF,
'-L', self.env['userland_library_dir'], LF
'-L', self.env['userland_library_dir'], LF,
'-r', self.env['kernel_version'], LF,
] +
qemu_user_and_system_options +
debug_args