fix .sh typo on kernel module test that accept the module as first argument

This commit is contained in:
Ciro Santilli
2025-05-09 16:27:29 +01:00
parent dd8cef4d24
commit 6513e99438
7 changed files with 18 additions and 10 deletions

View File

@@ -364,15 +364,15 @@ The safe way is to fist <<rebuild-buildroot-while-running,quit QEMU>>, rebuild t
./run --eval-after 'insmod hello.ko'
....
or for a slightly faster turnaround just leave it on 9p and use it from there:
where `./build-buildroot` is required after `./build-modules` because it re-generates the root filesystem with the modules that we compiled at `./build-modules`.
Alternatively, for a slightly faster turnaround just leave it on 9p and use it from there:
....
./build-modules
./run --eval-after 'insmod /mnt/9p/out_rootfs_overlay/lkmc/hello.ko'
....
`./build-buildroot` is required after `./build-modules` because it re-generates the root filesystem with the modules that we compiled at `./build-modules`.
You can see that `./build` does that as well, by running:
....
@@ -7733,6 +7733,14 @@ This example behaves the same as <<fops>>, except that the in-memory virtual fil
* link:kernel_modules/memfile.c[]
* link:rootfs_overlay/lkmc/memfile.sh[]
TODO: this example builds but oopses with out of memory on our currently default kernel v5.9.2 when doing the big allocation at:
....
dd if=/dev/zero of="$f" bs=1k count=1M
....
It works however on kernel 6.8.12, we're not sure why. We do have a potential krealloc vs kvrealloc on version check which is a very likely reason for the issue, but it has not been investigated.
[[seq-file]]
==== seq_file

View File

@@ -1,4 +1,4 @@
/* https://cirosantilli.com/linux-kernel-module-cheat#fops */
/* https://cirosantilli.com/linux-kernel-module-cheat#memfile */
#include <linux/debugfs.h>
#include <linux/errno.h> /* EFAULT */

View File

@@ -1,5 +1,5 @@
#!/bin/sh
set -e
set -eux
# Helpers
odraw() (