diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index 215c823d..566734a6 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -51,6 +51,7 @@ RELEASE_FILE=/etc/os-release DEBUG=0 SKIPCLEANUP=0 SKIPCOMPILERCHECK=0 +SKIPDISTROCHECK=0 ARCH_KCFLAGS="" DEBUG_KCFLAGS="" declare -a PATCH_LIST @@ -733,13 +734,15 @@ usage() { echo " --skip-cleanup Skip post-build cleanup" >&2 echo " --skip-compiler-check Skip compiler version matching check" >&2 echo " (not recommended)" >&2 + echo " --skip-distro-check Skip checking for a compatible distribution" >&2 + echo " (not recommended)" >&2 } if ! command -v gawk &> /dev/null; then die "gawk not installed" fi -options="$(getopt -o ha:r:s:c:v:j:t:n:o:dR -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,oot-module:,oot-module-src:,debug,skip-gcc-check,skip-compiler-check,skip-cleanup,non-replace" -- "$@")" || die "getopt failed" +options="$(getopt -o ha:r:s:c:v:j:t:n:o:dR -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,oot-module:,oot-module-src:,debug,skip-gcc-check,skip-compiler-check,skip-cleanup,non-replace,skip-distro-check" -- "$@")" || die "getopt failed" eval set -- "$options" @@ -821,6 +824,10 @@ while [[ $# -gt 0 ]]; do echo "WARNING: Skipping compiler version matching check (not recommended)" SKIPCOMPILERCHECK=1 ;; + --skip-distro-check) + echo "WARNING: Skipping distribution check (not recommended)" + SKIPDISTROCHECK=1 + ;; *) [[ "$1" = "--" ]] && shift && continue [[ ! -f "$1" ]] && die "patch file '$1' not found" @@ -1106,7 +1113,7 @@ else sed -i "s/^SUBLEVEL.*/${sublevel}/" "$KERNEL_SRCDIR/Makefile" || die echo "$ARCHVERSION" > "$VERSIONFILE" || die else - die "Unsupported distribution" + [[ "$SKIPDISTROCHECK" -eq 0 ]] && die "Unsupported distribution" fi fi