diff --git a/tools/packaging/kernel/README.md b/tools/packaging/kernel/README.md index 4f89121e0..cb4840260 100644 --- a/tools/packaging/kernel/README.md +++ b/tools/packaging/kernel/README.md @@ -47,7 +47,7 @@ Options: -g : GPU vendor, intel or nvidia. -h : Display this help. -k : Path to kernel to build. - -p : Path to a directory with patches to apply to kernel. + -p : Path to a directory with patches to apply to kernel, only patches in top-level directory are applied. -t : Hypervisor_target. -v : Kernel version to use if kernel path not provided. ``` @@ -76,7 +76,7 @@ $ ./build-kernel.sh setup The script `./build-kernel.sh` tries to apply the patches from `${GOPATH}/src/github.com/kata-containers/kata-containers/tools/packaging/kernel/patches/` when it sets up a kernel. If you want to add a source modification, add a patch on this -directory. +directory. Patches present in the top-level directory are applied, with subdirectories being ignored. The script also adds a kernel config file from `${GOPATH}/src/github.com/kata-containers/kata-containers/tools/packaging/kernel/configs/` to `.config` diff --git a/tools/packaging/scripts/apply_patches.sh b/tools/packaging/scripts/apply_patches.sh index e5092779f..c5b8c748d 100755 --- a/tools/packaging/scripts/apply_patches.sh +++ b/tools/packaging/scripts/apply_patches.sh @@ -36,7 +36,7 @@ fi echo "INFO: Apply patches from $patches_dir" if [ -d "$patches_dir" ]; then - patches=($(find "$patches_dir" -name '*.patch'|sort -t- -k1,1n)) + patches=($(find "$patches_dir" -maxdepth 1 -name '*.patch'|sort -t- -k1,1n)) echo "INFO: Found ${#patches[@]} patches" for patch in ${patches[@]}; do echo "INFO: Apply $patch"