Skip to content

Commit

Permalink
Allow skipping the distribution check
Browse files Browse the repository at this point in the history
This is useful for development on new distributions.

Signed-off-by: Julian Stecklina <julian.stecklina@cyberus-technology.de>
  • Loading branch information
blitz committed Jul 29, 2024
1 parent 828b557 commit 32a1dbf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions kpatch-build/kpatch-build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 32a1dbf

Please sign in to comment.