mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
bak
This commit is contained in:
38
README.adoc
38
README.adoc
@@ -1295,7 +1295,24 @@ In the background, it uses `BR2_TARGET_ROOTFS_INITRAMFS`, and this makes the ker
|
||||
|
||||
http://nairobi-embedded.org/initramfs_tutorial.html shows a full manual setup.
|
||||
|
||||
== ftrace
|
||||
== Linux kernel
|
||||
|
||||
=== Use your own .config
|
||||
|
||||
By default, we use a `.config` that is a mixture of:
|
||||
|
||||
* Buildroot's minimal per machine `.config`, which has the minimal options needed to boot
|
||||
* our link:kernel_config_fragment[] which enables options we want to play with
|
||||
|
||||
If you want to just use your own exact `.config` instead, do:
|
||||
|
||||
....
|
||||
./build -K myconfig
|
||||
....
|
||||
|
||||
Beware that Buildroot can `sed` override some of the configurations we make no matter what, e.g. it forces `CONFIG_BLK_DEV_INITRD=y` when `BR2_TARGET_ROOTFS_CPIO` is on.
|
||||
|
||||
=== ftrace
|
||||
|
||||
Trace a single function:
|
||||
|
||||
@@ -1390,7 +1407,11 @@ TODO: what do `+` and `!` mean?
|
||||
|
||||
Each `enable` under the `events/` tree enables a certain set of functions, the higher the `enable` more functions are enabled.
|
||||
|
||||
== Snapshot
|
||||
== QEMU
|
||||
|
||||
Some QEMU specific features to play with and limitations to cry over.
|
||||
|
||||
=== Snapshot
|
||||
|
||||
https://stackoverflow.com/questions/40227651/does-qemu-emulator-have-checkpoint-function/48724371#48724371
|
||||
|
||||
@@ -1467,10 +1488,6 @@ This is useful to learn:
|
||||
|
||||
To get started, have a look at the "Hardware device drivers" section under link:kernel_module/README.adoc[], and try to run those modules, and then grep the QEMU source code.
|
||||
|
||||
== QEMU
|
||||
|
||||
Some QEMU specific features to play with and limitations to cry over.
|
||||
|
||||
=== 9P
|
||||
|
||||
This protocol allows sharing a mountable filesystem between guest and host.
|
||||
@@ -1479,7 +1496,7 @@ With networking, it's boring, we can just use any of the old tools like sshfs an
|
||||
|
||||
https://superuser.com/questions/628169/how-to-share-a-directory-with-the-host-without-networking-in-qemu
|
||||
|
||||
One advantage of this method over NFS is that can run without `sudo` on host, or having to pass host cretendials on guest for sshfs.
|
||||
One advantage of this method over NFS is that can run without `sudo` on host, or having to pass host credentials on guest for sshfs.
|
||||
|
||||
TODO performance compared to NFS.
|
||||
|
||||
@@ -1541,8 +1558,15 @@ and on `aarch64`:
|
||||
mount: mounting host0 on /mnt/my9p failed: Invalid argument
|
||||
....
|
||||
|
||||
and dmesg gives:
|
||||
|
||||
....
|
||||
9pnet_virtio: no channels available for device
|
||||
....
|
||||
|
||||
A few hits:
|
||||
|
||||
* https://lists.gnu.org/archive/html/qemu-devel/2013-08/msg00044.html
|
||||
* https://superuser.com/questions/502205/libvirt-9p-kvm-mount-in-fstab-fails-to-mount-at-boot-time
|
||||
|
||||
==== 9P gem5
|
||||
|
||||
26
build
26
build
@@ -8,10 +8,11 @@ config_fragments='buildroot_config_fragment buildroot_config_fragment_cli'
|
||||
extra_make_args=''
|
||||
gem5=false
|
||||
j="$(($(nproc) - 2))"
|
||||
linux_kernel_custom_config_file=''
|
||||
post_script_args=''
|
||||
qemu_sdl='--enable-sdl --with-sdlabi=2.0'
|
||||
v=0
|
||||
while getopts 'a:c:Cgj:i:klp:qS:v' OPT; do
|
||||
while getopts 'a:c:Cgj:i:kK:lp:qS:v' OPT; do
|
||||
case "$OPT" in
|
||||
a)
|
||||
arch="$OPTARG"
|
||||
@@ -34,6 +35,9 @@ while getopts 'a:c:Cgj:i:klp:qS:v' OPT; do
|
||||
k)
|
||||
extra_make_args="$extra_make_args kernel_module-reconfigure"
|
||||
;;
|
||||
K)
|
||||
linux_kernel_custom_config_file="$OPTARG"
|
||||
;;
|
||||
l)
|
||||
extra_make_args="$extra_make_args linux-reconfigure"
|
||||
;;
|
||||
@@ -96,20 +100,26 @@ BR2_JLEVEL=$j
|
||||
BR2_ROOTFS_POST_SCRIPT_ARGS=\"$post_script_args\"
|
||||
" >> "${config_file}"
|
||||
if "$gem5"; then
|
||||
printf "\
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=\"../kernel_config_${arch_dir}\"
|
||||
BR2_PACKAGE_GEM5=y
|
||||
" >> "${config_file}"
|
||||
if [ -z "$linux_kernel_custom_config_file" ]; then
|
||||
printf "BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=\"../kernel_config_${arch_dir}\"" >> "${config_file}"
|
||||
fi
|
||||
printf "BR2_PACKAGE_GEM5=\"../kernel_config_${arch_dir}\"" >> "${config_file}"
|
||||
else
|
||||
printf "\
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES=\"../kernel_config_fragment\"
|
||||
" >> "${config_file}"
|
||||
if [ -z "$linux_kernel_custom_config_file" ]; then
|
||||
printf "BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES=\"../kernel_config_fragment\"" >> "${config_file}"
|
||||
fi
|
||||
fi
|
||||
if [ "$arch" = 'mips64' ]; then
|
||||
# Workaround for:
|
||||
# http://lists.busybox.net/pipermail/buildroot/2017-August/201053.html
|
||||
sed -Ei 's/^BR2_PACKAGE_LINUX_TOOLS_GPIO/BR2_PACKAGE_LINUX_TOOLS_GPIO=n/' "${config_file}"
|
||||
fi
|
||||
# TODO why is this needed. Otherwise kernel .config does not change, even though Buildroot
|
||||
# .config did due to -K. even if we are running linux-kernel-reconfigure!
|
||||
rm -f "${out_dir}/build/linux-custom/.config"
|
||||
if [ -n "$linux_kernel_custom_config_file" ]; then
|
||||
printf "BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=\"../${linux_kernel_custom_config_file}\"" >> "${config_file}"
|
||||
fi
|
||||
make O="$out_dir" olddefconfig
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
# Changes to this file are automatically trigger kernel reconfigures
|
||||
# even without using the linux-reconfigure target.
|
||||
#
|
||||
# Beware that buildroot can override some of the configurations we make, e.g.
|
||||
# it forces CONFIG_BLK_DEV_INITRD=y when BR2_TARGET_ROOTFS_CPIO is on.
|
||||
|
||||
CONFIG_MODULE_SRCVERSION_ALL=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
@@ -69,13 +66,16 @@ CONFIG_NET_9P=y
|
||||
CONFIG_NET_9P_DEBUG=y
|
||||
CONFIG_NET_9P_VIRTIO=y
|
||||
|
||||
## Virtio. TODO: aarch64 hangs before boot if I do all of these.
|
||||
## Virtio
|
||||
CONFIG_VIRTIO_PCI=y
|
||||
CONFIG_VFIO_PCI_INTX=y
|
||||
CONFIG_VFIO_PCI_MMAP=y
|
||||
# TODO: aarch64 hangs before boot if I do all of these.
|
||||
#CONFIG_RPMSG_VIRTIO=y
|
||||
#CONFIG_VIRTIO_BALLOON=y
|
||||
#CONFIG_VIRTIO_BLK=y
|
||||
#CONFIG_VIRTIO_BLK_SCSI=y
|
||||
#CONFIG_VIRTIO_INPUT=y
|
||||
#CONFIG_VIRTIO_PCI=y
|
||||
#CONFIG_VIRTIO_VSOCKETS=y
|
||||
|
||||
## Networking
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
echo "hello S98"
|
||||
if [ -n "$lkmc_eval" ]; then
|
||||
echo "$lkmc_eval"
|
||||
eval "$lkmc_eval"
|
||||
fi
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user