# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/l7-filter/patch_o_matic.in # Copyright (C) 2004 - 2022 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- if l7patch="`match_source_file netfilter l7-filter`"; then l7ver=${l7patch%.tar.*} l7ver=${l7ver#*layer7-} echo_status "Including l7-filter ($l7ver) patch" hook_add prepatch 5 "tar -C /tmp -v $taropt $base/download/mirror/n/$l7patch" hook_add prepatch 6 "l7_fix_and_inject_patch $l7patch" # removed on postinstall to be able to copy it to /usr/src/linux-patches hook_add postinstall 5 "rm -rf /tmp/${l7patch%.tar*}/" l7_fix_and_inject_patch() { local patchfile if [ "$pkg" = "iptables" ]; then patchfile=$( echo /tmp/${1%.tar*}/iptables-${ver}*.patch ) elif [[ $ver = 2.6.24* ]]; then patchfile=$( echo /tmp/${1%.tar*}/for_older_kernels/kernel-2.6.22-2.6.24*.patch ) elif [[ $ver = 2.6* ]]; then patchfile=$( echo /tmp/${1%.tar*}/kernel-2.6*.patch ) else patchfile=$( echo /tmp/${1%.tar*}/for_older_kernels/kernel-2.4*.patch ) fi var_append patchfiles ' ' $patchfile } else abort "what? l7-filter patch not found!" fi