View Single Post
Old 2021-02-16, 00:24   #8
Dylan14
 
Dylan14's Avatar
 
"Dylan"
Mar 2017

24116 Posts
Default

Okay, I have figured out a way to determine when to patch within the PKGBUILD, as seen here in the prepare function:

Code:
prepare() { 
cd "${srcdir}"/"${pkgname}"_v"${pkgver}" 
#Only patch if the kernel version is at least 5.5.0 
kermajver=`uname -r | cut -d. -f1` 
kerminver=`uname -r | cut -d. -f2` 
if [ $kermajver -gt 5 ]; then    
   patch -p1 < "../../sysctl-missing.patch" 
elif [ $kermajver -eq 5 ] && [ $kerminver -ge 5 ]; then    
   patch -p1 < "../../sysctl-missing.patch" 
fi 
}
Basically, if the kernel major version is greater then 5 then run the patch, or if the kernel major version is 5 and the minor version is at least 5 then also run the patch. Otherwise do nothing.

Last fiddled with by Dylan14 on 2021-02-16 at 00:25
Dylan14 is offline   Reply With Quote